forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/x86/platform/intel-mid/device_libs/platform_tc35876x.c
....@@ -1,30 +1,36 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * platform_tc35876x.c: tc35876x platform data initialization file
34 *
45 * (C) Copyright 2013 Intel Corporation
56 * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; version 2
10
- * of the License.
117 */
128
13
-#include <linux/gpio.h>
14
-#include <linux/platform_data/tc35876x.h>
9
+#include <linux/gpio/machine.h>
1510 #include <asm/intel-mid.h>
11
+
12
+static struct gpiod_lookup_table tc35876x_gpio_table = {
13
+ .dev_id = "i2c_disp_brig",
14
+ .table = {
15
+ GPIO_LOOKUP("0000:00:0c.0", -1, "bridge-reset", GPIO_ACTIVE_HIGH),
16
+ GPIO_LOOKUP("0000:00:0c.0", -1, "bl-en", GPIO_ACTIVE_HIGH),
17
+ GPIO_LOOKUP("0000:00:0c.0", -1, "vadd", GPIO_ACTIVE_HIGH),
18
+ { },
19
+ },
20
+};
1621
1722 /*tc35876x DSI_LVDS bridge chip and panel platform data*/
1823 static void *tc35876x_platform_data(void *data)
1924 {
20
- static struct tc35876x_platform_data pdata;
25
+ struct gpiod_lookup_table *table = &tc35876x_gpio_table;
26
+ struct gpiod_lookup *lookup = table->table;
2127
22
- /* gpio pins set to -1 will not be used by the driver */
23
- pdata.gpio_bridge_reset = get_gpio_by_name("LCMB_RXEN");
24
- pdata.gpio_panel_bl_en = get_gpio_by_name("6S6P_BL_EN");
25
- pdata.gpio_panel_vadd = get_gpio_by_name("EN_VREG_LCD_V3P3");
28
+ lookup[0].chip_hwnum = get_gpio_by_name("LCMB_RXEN");
29
+ lookup[1].chip_hwnum = get_gpio_by_name("6S6P_BL_EN");
30
+ lookup[2].chip_hwnum = get_gpio_by_name("EN_VREG_LCD_V3P3");
31
+ gpiod_add_lookup_table(table);
2632
27
- return &pdata;
33
+ return NULL;
2834 }
2935
3036 static const struct devs_id tc35876x_dev_id __initconst = {