summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2019-10-23 21:41:00 -0600
committerMartin Roth <martinroth@google.com>2019-10-27 21:08:39 +0000
commit38ddbfb325866716c9c65a460e388f33d1a773dd (patch)
treeffc7469c60e0a94321cf96de2bd0c4928067849f /src/drivers/i2c
parente74ca4ffc2008a93e38909a4d583408affbaf28a (diff)
src/[arch-lib]: change "unsigned" to "unsigned int"
Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: Ibb7b48a7a144421aff29acbb7ac30968ae5fe5ab Reviewed-on: https://review.coreboot.org/c/coreboot/+/36329 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/at24rf08c/lenovo_serials.c2
-rw-r--r--src/drivers/i2c/da7219/chip.h28
-rw-r--r--src/drivers/i2c/generic/chip.h8
-rw-r--r--src/drivers/i2c/nau8825/chip.h30
-rw-r--r--src/drivers/i2c/ww_ring/ww_ring.c16
-rw-r--r--src/drivers/i2c/ww_ring/ww_ring.h2
6 files changed, 43 insertions, 43 deletions
diff --git a/src/drivers/i2c/at24rf08c/lenovo_serials.c b/src/drivers/i2c/at24rf08c/lenovo_serials.c
index 1be9e4e431..aacdb724c6 100644
--- a/src/drivers/i2c/at24rf08c/lenovo_serials.c
+++ b/src/drivers/i2c/at24rf08c/lenovo_serials.c
@@ -116,7 +116,7 @@ const char *smbios_mainboard_product_name(void)
void smbios_system_set_uuid(u8 *uuid)
{
static char result[16];
- unsigned i;
+ unsigned int i;
static int already_read;
struct device *dev;
const int remap[16] = {
diff --git a/src/drivers/i2c/da7219/chip.h b/src/drivers/i2c/da7219/chip.h
index f50362588c..89ee21e217 100644
--- a/src/drivers/i2c/da7219/chip.h
+++ b/src/drivers/i2c/da7219/chip.h
@@ -25,13 +25,13 @@ struct drivers_i2c_da7219_config {
struct acpi_gpio irq_gpio;
/* I2C Bus Frequency in Hertz (default 400kHz) */
- unsigned bus_speed;
+ unsigned int bus_speed;
/*
* micbias-lvl : Voltage (mV) for Mic Bias
* [<1600>, <1800>, <2000>, <2200>, <2400>, <2600>]
*/
- unsigned micbias_lvl;
+ unsigned int micbias_lvl;
/*
* mic-amp-in-sel : Mic input source type
@@ -47,30 +47,30 @@ struct drivers_i2c_da7219_config {
* micbias-pulse-lvl : Mic bias higher voltage pulse level (mV)
* [<2800>, <2900>]
*/
- unsigned micbias_pulse_lvl;
+ unsigned int micbias_pulse_lvl;
/*
* micbias-pulse-time : Mic bias higher voltage pulse duration (ms)
*/
- unsigned micbias_pulse_time;
+ unsigned int micbias_pulse_time;
/*
* btn-cfg : Periodic button press measurements for 4-pole jack (ms)
* [<2>, <5>, <10>, <50>, <100>, <200>, <500>]
*/
- unsigned btn_cfg;
+ unsigned int btn_cfg;
/*
* mic-det-thr : Impedance threshold for mic detection measurement (Ohms)
* [<200>, <500>, <750>, <1000>]
*/
- unsigned mic_det_thr;
+ unsigned int mic_det_thr;
/*
* jack-ins-deb : Debounce time for jack insertion (ms)
* [<5>, <10>, <20>, <50>, <100>, <200>, <500>, <1000>]
*/
- unsigned jack_ins_deb;
+ unsigned int jack_ins_deb;
/*
* jack-det-rate : Jack type detection latency (3/4 pole)
@@ -82,43 +82,43 @@ struct drivers_i2c_da7219_config {
* jack-rem-deb : Debounce time for jack removal (ms)
* [<1>, <5>, <10>, <20>]
*/
- unsigned jack_rem_deb;
+ unsigned int jack_rem_deb;
/*
* a-d-btn-thr : Impedance threshold between buttons A and D
* [0x0 - 0xFF]
*/
- unsigned a_d_btn_thr;
+ unsigned int a_d_btn_thr;
/*
* d-b-btn-thr : Impedance threshold between buttons D and B
* [0x0 - 0xFF]
*/
- unsigned d_b_btn_thr;
+ unsigned int d_b_btn_thr;
/*
* b-c-btn-thr : Impedance threshold between buttons B and C
* [0x0 - 0xFF]
*/
- unsigned b_c_btn_thr;
+ unsigned int b_c_btn_thr;
/*
* c-mic-btn-thr : Impedance threshold between button C and Mic
* [0x0 - 0xFF]
*/
- unsigned c_mic_btn_thr;
+ unsigned int c_mic_btn_thr;
/*
* btn-avg : Number of 8-bit readings for averaged button measurement
* [<1>, <2>, <4>, <8>]
*/
- unsigned btn_avg;
+ unsigned int btn_avg;
/*
* adc-1bit-rpt : Repeat count for 1-bit button measurement
* [<1>, <2>, <4>, <8>]
*/
- unsigned adc_1bit_rpt;
+ unsigned int adc_1bit_rpt;
/*
* mclk-name : Pass the system clk to da7219
diff --git a/src/drivers/i2c/generic/chip.h b/src/drivers/i2c/generic/chip.h
index 59224ec972..ffaf7e14e5 100644
--- a/src/drivers/i2c/generic/chip.h
+++ b/src/drivers/i2c/generic/chip.h
@@ -24,10 +24,10 @@ struct drivers_i2c_generic_config {
const char *cid; /* ACPI _CID */
const char *name; /* ACPI Device Name */
const char *desc; /* Device Description */
- unsigned uid; /* ACPI _UID */
+ unsigned int uid; /* ACPI _UID */
enum i2c_speed speed; /* Bus speed in Hz, default is I2C_SPEED_FAST */
const char *compat_string; /* Compatible string for _HID=PRP0001 */
- unsigned wake; /* Wake GPE */
+ unsigned int wake; /* Wake GPE */
struct acpi_irq irq; /* Interrupt */
/* Use GPIO based interrupt instead of PIRQ */
@@ -43,8 +43,8 @@ struct drivers_i2c_generic_config {
int probed;
/* GPIO used to indicate if this device is present */
- unsigned device_present_gpio;
- unsigned device_present_gpio_invert;
+ unsigned int device_present_gpio;
+ unsigned int device_present_gpio_invert;
/* Disable reset and enable GPIO export in _CRS */
bool disable_gpio_export_in_crs;
diff --git a/src/drivers/i2c/nau8825/chip.h b/src/drivers/i2c/nau8825/chip.h
index 72704e5c9d..9fc8e96ac4 100644
--- a/src/drivers/i2c/nau8825/chip.h
+++ b/src/drivers/i2c/nau8825/chip.h
@@ -24,19 +24,19 @@ struct drivers_i2c_nau8825_config {
struct acpi_irq irq;
/* I2C Bus Frequency in Hertz (default 400kHz) */
- unsigned bus_speed;
+ unsigned int bus_speed;
/* Enable jack detection via JKDET pin */
- unsigned jkdet_enable;
+ unsigned int jkdet_enable;
/* Enable JKDET pin pull if set, otherwise high impedance state */
- unsigned jkdet_pull_enable;
+ unsigned int jkdet_pull_enable;
/* Pull-up JKDET pin if set, otherwise pull down */
- unsigned jkdet_pull_up;
+ unsigned int jkdet_pull_up;
/* JKDET pin polarity, 0 => active high, 1 => active low */
- unsigned jkdet_polarity;
+ unsigned int jkdet_polarity;
/*
* VREF Impedance selection
@@ -45,10 +45,10 @@ struct drivers_i2c_nau8825_config {
* 2 - 125 kOhm
* 3 - 2.5 kOhm
*/
- unsigned vref_impedance;
+ unsigned int vref_impedance;
/* Button impedance measurement hysteresis */
- unsigned sar_hysteresis;
+ unsigned int sar_hysteresis;
/*
* Reference voltage for button impedance measurement and micbias
@@ -61,8 +61,8 @@ struct drivers_i2c_nau8825_config {
* 6 - VDDA * 1.53
* 7 - VDDA * 1.53
*/
- unsigned micbias_voltage;
- unsigned sar_voltage;
+ unsigned int micbias_voltage;
+ unsigned int sar_voltage;
/*
* SAR compare time
@@ -71,7 +71,7 @@ struct drivers_i2c_nau8825_config {
* 2 - 2 us
* 3 - 4 us
*/
- unsigned sar_compare_time;
+ unsigned int sar_compare_time;
/*
* SAR sampling time
@@ -80,7 +80,7 @@ struct drivers_i2c_nau8825_config {
* 2 - 8 us
* 3 - 16 us
*/
- unsigned sar_sampling_time;
+ unsigned int sar_sampling_time;
/*
* Button short key press debounce time
@@ -89,16 +89,16 @@ struct drivers_i2c_nau8825_config {
* 2 - 100 ms
* 3 - 30 ms
*/
- unsigned short_key_debounce;
+ unsigned int short_key_debounce;
/* Debounce time 2^(n+2) ms (0-7) for jack insert */
- unsigned jack_insert_debounce;
+ unsigned int jack_insert_debounce;
/* Debounce time 2^(n+2) ms (0-7) for jack eject */
- unsigned jack_eject_debounce;
+ unsigned int jack_eject_debounce;
/* Number of buttons supported, up to 8 */
- unsigned sar_threshold_num;
+ unsigned int sar_threshold_num;
/*
* Impedance threshold for each button, up to 8
diff --git a/src/drivers/i2c/ww_ring/ww_ring.c b/src/drivers/i2c/ww_ring/ww_ring.c
index 16f6bd7a77..9957584d28 100644
--- a/src/drivers/i2c/ww_ring/ww_ring.c
+++ b/src/drivers/i2c/ww_ring/ww_ring.c
@@ -88,12 +88,12 @@
* the program page size.
*/
typedef struct {
- unsigned i2c_bus;
+ unsigned int i2c_bus;
uint8_t dev_addr;
uint8_t data_buffer[LP55231_PROG_PAGE_SIZE + 1];
} TiLp55231;
-static void ww_ring_init(unsigned i2c_bus);
+static void ww_ring_init(unsigned int i2c_bus);
/* Controller descriptors. */
static TiLp55231 lp55231s[WW_RING_NUM_LED_CONTROLLERS];
@@ -142,7 +142,7 @@ static int ledc_transfer(TiLp55231 *ledc, struct i2c_msg *segs,
* bytes can be transmitted in one write transaction.
*/
static int ledc_write(TiLp55231 *ledc, uint8_t start_addr,
- const uint8_t *data, unsigned count)
+ const uint8_t *data, unsigned int count)
{
struct i2c_msg seg;
@@ -220,10 +220,10 @@ static int ledc_reset(TiLp55231 *ledc)
* into sections fitting into memory pages.
*/
static void ledc_write_program(TiLp55231 *ledc, uint8_t load_addr,
- const uint8_t *program, unsigned count)
+ const uint8_t *program, unsigned int count)
{
uint8_t page_num = load_addr / LP55231_PROG_PAGE_SIZE;
- unsigned page_offs = load_addr % LP55231_PROG_PAGE_SIZE;
+ unsigned int page_offs = load_addr % LP55231_PROG_PAGE_SIZE;
if ((load_addr + count) > LP55231_MAX_PROG_SIZE) {
printk(BIOS_WARNING,
@@ -233,7 +233,7 @@ static void ledc_write_program(TiLp55231 *ledc, uint8_t load_addr,
}
while (count) {
- unsigned segment_size = LP55231_PROG_PAGE_SIZE - page_offs;
+ unsigned int segment_size = LP55231_PROG_PAGE_SIZE - page_offs;
if (segment_size > count)
segment_size = count;
@@ -334,7 +334,7 @@ static int ledc_init_validate(TiLp55231 *ledc)
* Find a program matching screen type, and run it on both controllers, if
* found.
*/
-int ww_ring_display_pattern(unsigned i2c_bus, enum display_pattern pattern)
+int ww_ring_display_pattern(unsigned int i2c_bus, enum display_pattern pattern)
{
static int initted;
const WwRingStateProg *wwr_prog;
@@ -379,7 +379,7 @@ int ww_ring_display_pattern(unsigned i2c_bus, enum display_pattern pattern)
#define LP55231_I2C_BASE_ADDR 0x32
-static void ww_ring_init(unsigned i2c_bus)
+static void ww_ring_init(unsigned int i2c_bus)
{
TiLp55231 *ledc;
int i, count = 0;
diff --git a/src/drivers/i2c/ww_ring/ww_ring.h b/src/drivers/i2c/ww_ring/ww_ring.h
index 911a85a1e4..a3c3372c1c 100644
--- a/src/drivers/i2c/ww_ring/ww_ring.h
+++ b/src/drivers/i2c/ww_ring/ww_ring.h
@@ -30,6 +30,6 @@ enum display_pattern {
*
* Display pattern on the ring LEDs.
*/
-int ww_ring_display_pattern(unsigned i2c_bus, enum display_pattern pattern);
+int ww_ring_display_pattern(unsigned int i2c_bus, enum display_pattern pattern);
#endif