mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
i2c: mux: ltc4306: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Acked-by: Peter Rosin <peda@axentia.se> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
This commit is contained in:
parent
1e5c9b1efa
commit
04668774f6
|
|
@ -85,13 +85,13 @@ static int ltc4306_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
|||
return !!(val & BIT(1 - offset));
|
||||
}
|
||||
|
||||
static void ltc4306_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
static int ltc4306_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct ltc4306 *data = gpiochip_get_data(chip);
|
||||
|
||||
regmap_update_bits(data->regmap, LTC_REG_CONFIG, BIT(5 - offset),
|
||||
value ? BIT(5 - offset) : 0);
|
||||
return regmap_update_bits(data->regmap, LTC_REG_CONFIG,
|
||||
BIT(5 - offset), value ? BIT(5 - offset) : 0);
|
||||
}
|
||||
|
||||
static int ltc4306_gpio_get_direction(struct gpio_chip *chip,
|
||||
|
|
@ -164,7 +164,7 @@ static int ltc4306_gpio_init(struct ltc4306 *data)
|
|||
data->gpiochip.direction_input = ltc4306_gpio_direction_input;
|
||||
data->gpiochip.direction_output = ltc4306_gpio_direction_output;
|
||||
data->gpiochip.get = ltc4306_gpio_get;
|
||||
data->gpiochip.set = ltc4306_gpio_set;
|
||||
data->gpiochip.set_rv = ltc4306_gpio_set;
|
||||
data->gpiochip.set_config = ltc4306_gpio_set_config;
|
||||
data->gpiochip.owner = THIS_MODULE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user