@@ -206,6 +206,10 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client)
for (i = 0; i < board_data->n_gpiod_lookups; i++)
gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]);
+ if (board_data->led_lookups)
+ for (i = 0; i < board_data->led_lookups->n_lookups; i++)
+ led_add_lookup(&board_data->led_lookups->lookup_table[i]);
+
ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,
cells, TPS68470_WIN_MFD_CELL_COUNT,
NULL, 0, NULL);
@@ -214,6 +218,10 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client)
if (ret) {
for (i = 0; i < board_data->n_gpiod_lookups; i++)
gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_tables[i]);
+
+ if (board_data->led_lookups)
+ for (i = 0; i < board_data->led_lookups->n_lookups; i++)
+ led_remove_lookup(&board_data->led_lookups->lookup_table[i]);
}
break;
@@ -11,14 +11,22 @@
#ifndef _INTEL_SKL_INT3472_TPS68470_H
#define _INTEL_SKL_INT3472_TPS68470_H
+#include <linux/leds.h>
+
struct gpiod_lookup_table;
struct tps68470_regulator_platform_data;
struct tps68470_led_platform_data;
+struct tps68470_led_lookups {
+ unsigned int n_lookups;
+ struct led_lookup_data lookup_table[];
+};
+
struct int3472_tps68470_board_data {
const char *dev_name;
const struct tps68470_regulator_platform_data *tps68470_regulator_pdata;
const struct tps68470_led_platform_data *tps68470_led_pdata;
+ struct tps68470_led_lookups *led_lookups;
unsigned int n_gpiod_lookups;
struct gpiod_lookup_table *tps68470_gpio_lookup_tables[];
};
On platforms with the TPS68470 PMIC, we need to be able to define which of the LEDs powered by the PMIC should be used by each of the sensors that consume its resources. Add the ability to define tables of LED lookup data to the board data file. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> --- drivers/platform/x86/intel/int3472/tps68470.c | 8 ++++++++ drivers/platform/x86/intel/int3472/tps68470.h | 8 ++++++++ 2 files changed, 16 insertions(+)