diff options
-rw-r--r-- | drivers/mfd/max77663-core.c | 12 | ||||
-rw-r--r-- | include/linux/mfd/max77663-core.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mfd/max77663-core.c b/drivers/mfd/max77663-core.c index 137c04b01e0d..2ecb84d543df 100644 --- a/drivers/mfd/max77663-core.c +++ b/drivers/mfd/max77663-core.c @@ -1358,8 +1358,13 @@ static int max77663_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct max77663_chip *chip = i2c_get_clientdata(client); + struct max77663_platform_data *pdata = chip->pdata; int ret; + /* PMU_STAT_LED */ + if (pdata->has_stat_led) + max77663_gpio_dir_input(&chip->gpio, pdata->stat_led_gpio); + if (client->irq) disable_irq(client->irq); @@ -1374,6 +1379,7 @@ static int max77663_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct max77663_chip *chip = i2c_get_clientdata(client); + struct max77663_platform_data *pdata = chip->pdata; int ret; ret = max77663_sleep(chip, false); @@ -1385,6 +1391,12 @@ static int max77663_resume(struct device *dev) if (client->irq) enable_irq(client->irq); + /* PMU_STAT_LED */ + if (pdata->has_stat_led) { + max77663_gpio_dir_output(&chip->gpio, MAX77663_GPIO7, + pdata->stat_led_active_low ? 0 : 1); + } + return 0; } #else diff --git a/include/linux/mfd/max77663-core.h b/include/linux/mfd/max77663-core.h index acfe22aac535..896b6565f84c 100644 --- a/include/linux/mfd/max77663-core.h +++ b/include/linux/mfd/max77663-core.h @@ -140,6 +140,9 @@ struct max77663_platform_data { unsigned char rtc_i2c_addr; bool use_power_off; + int has_stat_led; + int stat_led_gpio; + int stat_led_active_low; }; #if defined(CONFIG_MFD_MAX77663) |