This pull request has a patch to switch DA850 EVM GPIO LED support to use
GPIO lookup table -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJdC02UAAoJEGFBu2jqvgRN0egP/0Yb3kZ+9Yg/ulJraJgrp5zL QyPocXaOIuBAFyVX+PHHexCbpGrZg/7RfbOInbhCZvo5n2wTywaOpYNSY9zjdh0w NTzt+IGyqWaAnsll9GrgntD7o20EdZrcx9IrD2C9juK+EgF02nQOI7QPXswQJX63 eC4f6XO3fuS0givF9HHtlsjp+wNgU2T5u/6iI+An+8O0dvPdc7+IuPt9MbNcvupe xJg4NR5hWLiRySUBdIZUCgtqlSOd1w2b+MysHjLsBPBssuhTsd2H5G96w3c8p0vk MKnLVw7oOerQNSuSIyNWHAr3FipE6smtGTDJbYBh5t8ukya68bv5RifZMMgTP+un g6keORxR0MD04c5BGt8X9jTVv0uYsnICX9VG8erZ3Gqreh7zNmZi9sz1PPxvX1O8 7me4Ayiq+MhjtTS56wGVWjlCc58oE1fiRJ+5HeDhDq/FcScZYqbJMJWvpepLoptu NQJFDgerYtV3fOVj3/bRK+QSmVr5+63SsIGB95BP9oQT61lJ5TdrsUWNAgnOO+fX kxwvitnWNeZyHUdVSvmaoxcgKNE7X2sRFSm3F1C7o+yJYtCNjJ/H9Fqi7anWms1C dSQrHjYFQzKTcx16ZyLYkMx3WkV/M/Gl/+ouImK2gUWfFKb1kJ9IgxBMIy8gWT1L U4IcPQPk6OFpaINjUCCZ =BF48 -----END PGP SIGNATURE----- Merge tag 'davinci-for-v5.3/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into arm/soc This pull request has a patch to switch DA850 EVM GPIO LED support to use GPIO lookup table * tag 'davinci-for-v5.3/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: Use GPIO lookup table for DA850 LEDs Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
9060463be5
|
@ -631,13 +631,12 @@ static void da850_evm_bb_keys_init(unsigned gpio)
|
|||
}
|
||||
}
|
||||
|
||||
#define DA850_N_BB_USER_LED 2
|
||||
|
||||
static struct gpio_led da850_evm_bb_leds[] = {
|
||||
[0 ... DA850_N_BB_USER_LED - 1] = {
|
||||
.active_low = 1,
|
||||
.gpio = -1, /* assigned at runtime */
|
||||
.name = NULL, /* assigned at runtime */
|
||||
{
|
||||
.name = "user_led2",
|
||||
},
|
||||
{
|
||||
.name = "user_led1",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -646,6 +645,20 @@ static struct gpio_led_platform_data da850_evm_bb_leds_pdata = {
|
|||
.num_leds = ARRAY_SIZE(da850_evm_bb_leds),
|
||||
};
|
||||
|
||||
static struct gpiod_lookup_table da850_evm_bb_leds_gpio_table = {
|
||||
.dev_id = "leds-gpio",
|
||||
.table = {
|
||||
GPIO_LOOKUP_IDX("i2c-bb-expander",
|
||||
DA850_EVM_BB_EXP_USER_LED2, NULL,
|
||||
0, GPIO_ACTIVE_LOW),
|
||||
GPIO_LOOKUP_IDX("i2c-bb-expander",
|
||||
DA850_EVM_BB_EXP_USER_LED2 + 1, NULL,
|
||||
1, GPIO_ACTIVE_LOW),
|
||||
|
||||
{ },
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device da850_evm_bb_leds_device = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
|
@ -654,20 +667,6 @@ static struct platform_device da850_evm_bb_leds_device = {
|
|||
}
|
||||
};
|
||||
|
||||
static void da850_evm_bb_leds_init(unsigned gpio)
|
||||
{
|
||||
int i;
|
||||
struct gpio_led *led;
|
||||
|
||||
for (i = 0; i < DA850_N_BB_USER_LED; i++) {
|
||||
led = &da850_evm_bb_leds[i];
|
||||
|
||||
led->gpio = gpio + DA850_EVM_BB_EXP_USER_LED2 + i;
|
||||
led->name =
|
||||
da850_evm_bb_exp[DA850_EVM_BB_EXP_USER_LED2 + i];
|
||||
}
|
||||
}
|
||||
|
||||
static int da850_evm_bb_expander_setup(struct i2c_client *client,
|
||||
unsigned gpio, unsigned ngpio,
|
||||
void *c)
|
||||
|
@ -685,7 +684,7 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client,
|
|||
goto io_exp_setup_sw_fail;
|
||||
}
|
||||
|
||||
da850_evm_bb_leds_init(gpio);
|
||||
gpiod_add_lookup_table(&da850_evm_bb_leds_gpio_table);
|
||||
ret = platform_device_register(&da850_evm_bb_leds_device);
|
||||
if (ret) {
|
||||
pr_warn("Could not register baseboard GPIO expander LEDs");
|
||||
|
@ -729,10 +728,12 @@ static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
|
|||
},
|
||||
{
|
||||
I2C_BOARD_INFO("tca6416", 0x20),
|
||||
.dev_name = "ui-expander",
|
||||
.platform_data = &da850_evm_ui_expander_info,
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("tca6416", 0x21),
|
||||
.dev_name = "bb-expander",
|
||||
.platform_data = &da850_evm_bb_expander_info,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue