mfd: Commonize tps65910 regmap access through header
This change removes the read/write callback functions in favor of common regmap accessors inside the header file. This change also makes use of regmap_read/write for single register access which maps better onto what this driver actually needs. Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:

committed by
Samuel Ortiz

parent
7ccfe9b1d5
commit
3f7e82759c
@@ -23,9 +23,9 @@
|
||||
static int tps65910_gpio_get(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
struct tps65910 *tps65910 = container_of(gc, struct tps65910, gpio);
|
||||
uint8_t val;
|
||||
unsigned int val;
|
||||
|
||||
tps65910->read(tps65910, TPS65910_GPIO0 + offset, 1, &val);
|
||||
tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val);
|
||||
|
||||
if (val & GPIO_STS_MASK)
|
||||
return 1;
|
||||
@@ -39,10 +39,10 @@ static void tps65910_gpio_set(struct gpio_chip *gc, unsigned offset,
|
||||
struct tps65910 *tps65910 = container_of(gc, struct tps65910, gpio);
|
||||
|
||||
if (value)
|
||||
tps65910_set_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
GPIO_SET_MASK);
|
||||
else
|
||||
tps65910_clear_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
GPIO_SET_MASK);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ static int tps65910_gpio_output(struct gpio_chip *gc, unsigned offset,
|
||||
/* Set the initial value */
|
||||
tps65910_gpio_set(gc, offset, value);
|
||||
|
||||
return tps65910_set_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
return tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
GPIO_CFG_MASK);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
|
||||
{
|
||||
struct tps65910 *tps65910 = container_of(gc, struct tps65910, gpio);
|
||||
|
||||
return tps65910_clear_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
return tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
|
||||
GPIO_CFG_MASK);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base)
|
||||
int i;
|
||||
for (i = 0; i < tps65910->gpio.ngpio; ++i) {
|
||||
if (board_data->en_gpio_sleep[i]) {
|
||||
ret = tps65910_set_bits(tps65910,
|
||||
ret = tps65910_reg_set_bits(tps65910,
|
||||
TPS65910_GPIO0 + i, GPIO_SLEEP_MASK);
|
||||
if (ret < 0)
|
||||
dev_warn(tps65910->dev,
|
||||
|
Reference in New Issue
Block a user