All the tps6501{0,1,2,3,4} chips have a signal for hooking up with
a vibrator (for non-auditory cell phone "ring") ... expose that as
one more (output-only) GPIO.
[ dbrownell@users.sourceforge.net: comments; list tps65014 too ]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
/* offsets 0..3 == GPIO1..GPIO4
* offsets 4..5 == LED1/nPG, LED2 (we set one of the non-BLINK modes)
/* offsets 0..3 == GPIO1..GPIO4
* offsets 4..5 == LED1/nPG, LED2 (we set one of the non-BLINK modes)
+ * offset 6 == vibrator motor driver
*/
static void
tps65010_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
{
if (offset < 4)
tps65010_set_gpio_out_value(offset + 1, value);
*/
static void
tps65010_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
{
if (offset < 4)
tps65010_set_gpio_out_value(offset + 1, value);
tps65010_set_led(offset - 3, value ? ON : OFF);
tps65010_set_led(offset - 3, value ? ON : OFF);
+ else
+ tps65010_set_vib(value);
if (!(tps->outmask & (1 << offset)))
return -EINVAL;
tps65010_set_gpio_out_value(offset + 1, value);
if (!(tps->outmask & (1 << offset)))
return -EINVAL;
tps65010_set_gpio_out_value(offset + 1, value);
tps65010_set_led(offset - 3, value ? ON : OFF);
tps65010_set_led(offset - 3, value ? ON : OFF);
+ else
+ tps65010_set_vib(value);
tps->chip.get = tps65010_gpio_get;
tps->chip.base = board->base;
tps->chip.get = tps65010_gpio_get;
tps->chip.base = board->base;
tps->chip.can_sleep = 1;
status = gpiochip_add(&tps->chip);
tps->chip.can_sleep = 1;
status = gpiochip_add(&tps->chip);
{ "tps65011", TPS65011 },
{ "tps65012", TPS65012 },
{ "tps65013", TPS65013 },
{ "tps65011", TPS65011 },
{ "tps65012", TPS65012 },
{ "tps65013", TPS65013 },
+ { "tps65014", TPS65011 }, /* tps65011 charging at 6.5V max */
{ }
};
MODULE_DEVICE_TABLE(i2c, tps65010_id);
{ }
};
MODULE_DEVICE_TABLE(i2c, tps65010_id);