Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296903
b: refs/heads/master
c: 9467d29
h: refs/heads/master
i:
  296901: 7559cb6
  296899: 1e3c1dc
  296895: ddf26a4
v: v3
  • Loading branch information
Laxman Dewangan authored and Grant Likely committed Feb 6, 2012
1 parent b3e9f10 commit 9caf460
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b43ab901d671e3e3cad425ea5e9a3c74e266dcdd
refs/heads/master: 9467d298e92455e6fd411d7ef1f367ced940587c
20 changes: 18 additions & 2 deletions trunk/drivers/gpio/gpio-tps65910.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static int tps65910_gpio_input(struct gpio_chip *gc, unsigned offset)
void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base)
{
int ret;
struct tps65910_board *board_data;

if (!gpio_base)
return;
Expand All @@ -80,10 +81,10 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base)

switch(tps65910_chip_id(tps65910)) {
case TPS65910:
tps65910->gpio.ngpio = 6;
tps65910->gpio.ngpio = TPS65910_NUM_GPIO;
break;
case TPS65911:
tps65910->gpio.ngpio = 9;
tps65910->gpio.ngpio = TPS65911_NUM_GPIO;
break;
default:
return;
Expand All @@ -95,6 +96,21 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base)
tps65910->gpio.set = tps65910_gpio_set;
tps65910->gpio.get = tps65910_gpio_get;

/* Configure sleep control for gpios */
board_data = dev_get_platdata(tps65910->dev);
if (board_data) {
int i;
for (i = 0; i < tps65910->gpio.ngpio; ++i) {
if (board_data->en_gpio_sleep[i]) {
ret = tps65910_set_bits(tps65910,
TPS65910_GPIO0 + i, GPIO_SLEEP_MASK);
if (ret < 0)
dev_warn(tps65910->dev,
"GPIO Sleep setting failed\n");
}
}
}

ret = gpiochip_add(&tps65910->gpio);

if (ret)
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/linux/mfd/tps65910.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@


/*Register GPIO (0x80) register.RegisterDescription */
#define GPIO_SLEEP_MASK 0x80
#define GPIO_SLEEP_SHIFT 7
#define GPIO_DEB_MASK 0x10
#define GPIO_DEB_SHIFT 4
#define GPIO_PUEN_MASK 0x08
Expand Down Expand Up @@ -740,6 +742,11 @@
#define TPS65910_GPIO_STS BIT(1)
#define TPS65910_GPIO_SET BIT(0)

/* Max number of TPS65910/11 GPIOs */
#define TPS65910_NUM_GPIO 6
#define TPS65911_NUM_GPIO 9
#define TPS6591X_MAX_NUM_GPIO 9

/* Regulator Index Definitions */
#define TPS65910_REG_VRTC 0
#define TPS65910_REG_VIO 1
Expand Down Expand Up @@ -779,6 +786,7 @@ struct tps65910_board {
int irq_base;
int vmbch_threshold;
int vmbch2_threshold;
bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
};

Expand Down

0 comments on commit 9caf460

Please sign in to comment.