Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ads7846 - Convert to use software nodes

The Nokia 770 is using GPIOs from the global numberspace on the
CBUS node to pass down to the LCD controller. This regresses when we
let the OMAP GPIO driver use dynamic GPIO base.

The Nokia 770 now has dynamic allocation of IRQ numbers, so this
needs to be fixed for it to work.

As this is the only user of LCD MIPID we can easily augment the
driver to use a GPIO descriptor instead and resolve the issue.

The platform data .shutdown() callback wasn't even used in the
code, but we encode a shutdown asserting RESET in the remove()
callback for completeness sake.

The CBUS also has the ADS7846 touchscreen attached.

Populate the devices on the Nokia 770 CBUS I2C using software
nodes instead of platform data quirks. This includes the LCD
and the ADS7846 touchscreen so the conversion just brings the LCD
along with it as software nodes is an all-or-nothing design
pattern.

The ADS7846 has some limited support for using GPIO descriptors,
let's convert it over completely to using device properties and then
fix all remaining boardfile users to provide all platform data using
software nodes.

Dump the of includes and of_match_ptr() in the ADS7846 driver as part
of the job.

Since we have to move ADS7846 over to obtaining the GPIOs it is
using exclusively from descriptors, we provide descriptor tables
for the two remaining in-kernel boardfiles using ADS7846:

- PXA Spitz
- MIPS Alchemy DB1000 development board

It was too hard for me to include software node conversion of
these two remaining users at this time: the spitz is using a
hscync callback in the platform data that would require further
GPIO descriptor conversion of the Spitz, and moving the hsync
callback down into the driver: it will just become too big of
a job, but it can be done separately.

The MIPS Alchemy DB1000 is simply something I cannot test, so take
the easier approach of just providing some GPIO descriptors in
this case as I don't want the patch to grow too intrusive.

As we see that several device trees have incorrect polarity flags
and just expect to bypass the gpiolib polarity handling, fix up
all device trees too, in a separate patch.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base")
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+138 -114
+65 -34
arch/arm/mach-omap1/board-nokia770.c
··· 8 8 #include <linux/irq.h> 9 9 #include <linux/gpio.h> 10 10 #include <linux/gpio/machine.h> 11 + #include <linux/gpio/property.h> 11 12 #include <linux/kernel.h> 12 13 #include <linux/init.h> 13 14 #include <linux/mutex.h> 14 15 #include <linux/platform_device.h> 16 + #include <linux/property.h> 15 17 #include <linux/input.h> 16 18 #include <linux/omapfb.h> 17 19 18 20 #include <linux/spi/spi.h> 19 - #include <linux/spi/ads7846.h> 20 21 #include <linux/workqueue.h> 21 22 #include <linux/delay.h> 22 23 ··· 35 34 #include "common.h" 36 35 #include "clock.h" 37 36 #include "mmc.h" 37 + 38 + static const struct software_node nokia770_mpuio_gpiochip_node = { 39 + .name = "mpuio", 40 + }; 41 + 42 + static const struct software_node nokia770_gpiochip1_node = { 43 + .name = "gpio-0-15", 44 + }; 45 + 46 + static const struct software_node nokia770_gpiochip2_node = { 47 + .name = "gpio-16-31", 48 + }; 49 + 50 + static const struct software_node *nokia770_gpiochip_nodes[] = { 51 + &nokia770_mpuio_gpiochip_node, 52 + &nokia770_gpiochip1_node, 53 + &nokia770_gpiochip2_node, 54 + NULL 55 + }; 38 56 39 57 #define ADS7846_PENDOWN_GPIO 15 40 58 ··· 105 85 &nokia770_kp_device, 106 86 }; 107 87 108 - static void mipid_shutdown(struct mipid_platform_data *pdata) 109 - { 110 - if (pdata->nreset_gpio != -1) { 111 - printk(KERN_INFO "shutdown LCD\n"); 112 - gpio_set_value(pdata->nreset_gpio, 0); 113 - msleep(120); 114 - } 115 - } 116 - 117 - static struct mipid_platform_data nokia770_mipid_platform_data = { 118 - .shutdown = mipid_shutdown, 119 - }; 88 + static struct mipid_platform_data nokia770_mipid_platform_data = { }; 120 89 121 90 static const struct omap_lcd_config nokia770_lcd_config __initconst = { 122 91 .ctrl_name = "hwa742", 123 92 }; 124 93 94 + static const struct property_entry nokia770_mipid_props[] = { 95 + PROPERTY_ENTRY_GPIO("reset-gpios", &nokia770_gpiochip1_node, 96 + 13, GPIO_ACTIVE_LOW), 97 + { } 98 + }; 99 + 100 + static const struct software_node nokia770_mipid_swnode = { 101 + .name = "lcd_mipid", 102 + .properties = nokia770_mipid_props, 103 + }; 104 + 125 105 static void __init mipid_dev_init(void) 126 106 { 127 - nokia770_mipid_platform_data.nreset_gpio = 13; 128 107 nokia770_mipid_platform_data.data_lines = 16; 129 108 130 109 omapfb_set_lcd_config(&nokia770_lcd_config); 131 110 } 132 111 133 - static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 134 - .x_max = 0x0fff, 135 - .y_max = 0x0fff, 136 - .x_plate_ohms = 180, 137 - .pressure_max = 255, 138 - .debounce_max = 10, 139 - .debounce_tol = 3, 140 - .debounce_rep = 1, 141 - .gpio_pendown = ADS7846_PENDOWN_GPIO, 112 + static const struct property_entry nokia770_ads7846_props[] = { 113 + PROPERTY_ENTRY_STRING("compatible", "ti,ads7846"), 114 + PROPERTY_ENTRY_U32("touchscreen-size-x", 4096), 115 + PROPERTY_ENTRY_U32("touchscreen-size-y", 4096), 116 + PROPERTY_ENTRY_U32("touchscreen-max-pressure", 256), 117 + PROPERTY_ENTRY_U32("touchscreen-average-samples", 10), 118 + PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180), 119 + PROPERTY_ENTRY_U16("ti,debounce-tol", 3), 120 + PROPERTY_ENTRY_U16("ti,debounce-rep", 1), 121 + PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node, 122 + ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW), 123 + { } 124 + }; 125 + 126 + static const struct software_node nokia770_ads7846_swnode = { 127 + .name = "ads7846", 128 + .properties = nokia770_ads7846_props, 142 129 }; 143 130 144 131 static struct spi_board_info nokia770_spi_board_info[] __initdata = { ··· 155 128 .chip_select = 3, 156 129 .max_speed_hz = 12000000, 157 130 .platform_data = &nokia770_mipid_platform_data, 131 + .swnode = &nokia770_mipid_swnode, 158 132 }, 159 133 [1] = { 160 134 .modalias = "ads7846", 161 135 .bus_num = 2, 162 136 .chip_select = 0, 163 137 .max_speed_hz = 2500000, 164 - .platform_data = &nokia770_ads7846_platform_data, 138 + .swnode = &nokia770_ads7846_swnode, 165 139 }, 166 140 }; 167 141 ··· 240 212 #endif 241 213 242 214 #if IS_ENABLED(CONFIG_I2C_CBUS_GPIO) 243 - static struct gpiod_lookup_table nokia770_cbus_gpio_table = { 244 - .dev_id = "i2c-cbus-gpio.2", 245 - .table = { 246 - GPIO_LOOKUP_IDX("mpuio", 9, NULL, 0, 0), /* clk */ 247 - GPIO_LOOKUP_IDX("mpuio", 10, NULL, 1, 0), /* dat */ 248 - GPIO_LOOKUP_IDX("mpuio", 11, NULL, 2, 0), /* sel */ 249 - { }, 250 - }, 215 + 216 + static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = { 217 + SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 9, 0), 218 + SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 10, 0), 219 + SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 11, 0), 220 + }; 221 + 222 + static const struct property_entry nokia770_cbus_props[] = { 223 + PROPERTY_ENTRY_REF_ARRAY("gpios", nokia770_cbus_gpio_refs), 224 + { } 251 225 }; 252 226 253 227 static struct platform_device nokia770_cbus_device = { ··· 283 253 nokia770_i2c_board_info_2[1].irq = gpio_to_irq(tahvo_irq_gpio); 284 254 i2c_register_board_info(2, nokia770_i2c_board_info_2, 285 255 ARRAY_SIZE(nokia770_i2c_board_info_2)); 286 - gpiod_add_lookup_table(&nokia770_cbus_gpio_table); 256 + device_create_managed_software_node(&nokia770_cbus_device.dev, 257 + nokia770_cbus_props, NULL); 287 258 platform_device_register(&nokia770_cbus_device); 288 259 } 289 260 #else /* CONFIG_I2C_CBUS_GPIO */ ··· 304 273 /* Unmask SleepX signal */ 305 274 omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004); 306 275 276 + software_node_register_node_group(nokia770_gpiochip_nodes); 307 277 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); 308 - nokia770_spi_board_info[1].irq = gpio_to_irq(15); 309 278 spi_register_board_info(nokia770_spi_board_info, 310 279 ARRAY_SIZE(nokia770_spi_board_info)); 311 280 omap_serial_init();
+10 -1
arch/arm/mach-pxa/spitz.c
··· 506 506 .x_plate_ohms = 419, 507 507 .y_plate_ohms = 486, 508 508 .pressure_max = 1024, 509 - .gpio_pendown = SPITZ_GPIO_TP_INT, 510 509 .wait_for_sync = spitz_ads7846_wait_for_hsync, 510 + }; 511 + 512 + static struct gpiod_lookup_table spitz_ads7846_gpio_table = { 513 + .dev_id = "spi2.0", 514 + .table = { 515 + GPIO_LOOKUP("gpio-pxa", SPITZ_GPIO_TP_INT, 516 + "pendown", GPIO_ACTIVE_LOW), 517 + { } 518 + }, 511 519 }; 512 520 513 521 static void spitz_bl_kick_battery(void) ··· 602 594 else 603 595 gpiod_add_lookup_table(&spitz_lcdcon_gpio_table); 604 596 597 + gpiod_add_lookup_table(&spitz_ads7846_gpio_table); 605 598 gpiod_add_lookup_table(&spitz_spi_gpio_table); 606 599 pxa2xx_set_spi_info(2, &spitz_spi_info); 607 600 spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices));
+10 -1
arch/mips/alchemy/devboards/db1000.c
··· 381 381 static struct ads7846_platform_data db1100_touch_pd = { 382 382 .model = 7846, 383 383 .vref_mv = 3300, 384 - .gpio_pendown = 21, 385 384 }; 386 385 387 386 static struct spi_gpio_platform_data db1100_spictl_pd = { 388 387 .num_chipselect = 1, 388 + }; 389 + 390 + static struct gpiod_lookup_table db1100_touch_gpio_table = { 391 + .dev_id = "spi0.0", 392 + .table = { 393 + GPIO_LOOKUP("alchemy-gpio2", 21, 394 + "pendown", GPIO_ACTIVE_LOW), 395 + { } 396 + }, 389 397 }; 390 398 391 399 static struct spi_board_info db1100_spi_info[] __initdata = { ··· 482 474 pfc |= (1 << 0); /* SSI0 pins as GPIOs */ 483 475 alchemy_wrsys(pfc, AU1000_SYS_PINFUNC); 484 476 477 + gpiod_add_lookup_table(&db1100_touch_gpio_table); 485 478 spi_register_board_info(db1100_spi_info, 486 479 ARRAY_SIZE(db1100_spi_info)); 487 480
+43 -74
drivers/input/touchscreen/ads7846.c
··· 24 24 #include <linux/interrupt.h> 25 25 #include <linux/slab.h> 26 26 #include <linux/pm.h> 27 - #include <linux/of.h> 28 - #include <linux/of_gpio.h> 29 - #include <linux/of_device.h> 27 + #include <linux/property.h> 30 28 #include <linux/gpio/consumer.h> 31 - #include <linux/gpio.h> 32 29 #include <linux/spi/spi.h> 33 30 #include <linux/spi/ads7846.h> 34 31 #include <linux/regulator/consumer.h> ··· 137 140 int (*filter)(void *data, int data_idx, int *val); 138 141 void *filter_data; 139 142 int (*get_pendown_state)(void); 140 - int gpio_pendown; 143 + struct gpio_desc *gpio_pendown; 141 144 142 145 void (*wait_for_sync)(void); 143 146 }; ··· 220 223 if (ts->get_pendown_state) 221 224 return ts->get_pendown_state(); 222 225 223 - return !gpio_get_value(ts->gpio_pendown); 226 + return gpiod_get_value(ts->gpio_pendown); 224 227 } 225 228 226 229 static void ads7846_report_pen_up(struct ads7846 *ts) ··· 986 989 struct ads7846 *ts, 987 990 const struct ads7846_platform_data *pdata) 988 991 { 989 - int err; 990 - 991 992 /* 992 993 * REVISIT when the irq can be triggered active-low, or if for some 993 994 * reason the touchscreen isn't hooked up, we don't need to access ··· 994 999 995 1000 if (pdata->get_pendown_state) { 996 1001 ts->get_pendown_state = pdata->get_pendown_state; 997 - } else if (gpio_is_valid(pdata->gpio_pendown)) { 998 - 999 - err = devm_gpio_request_one(&spi->dev, pdata->gpio_pendown, 1000 - GPIOF_IN, "ads7846_pendown"); 1001 - if (err) { 1002 - dev_err(&spi->dev, 1003 - "failed to request/setup pendown GPIO%d: %d\n", 1004 - pdata->gpio_pendown, err); 1005 - return err; 1006 - } 1007 - 1008 - ts->gpio_pendown = pdata->gpio_pendown; 1009 - 1010 - if (pdata->gpio_pendown_debounce) 1011 - gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown), 1012 - pdata->gpio_pendown_debounce); 1013 1002 } else { 1014 - dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); 1015 - return -EINVAL; 1003 + ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN); 1004 + if (IS_ERR(ts->gpio_pendown)) { 1005 + dev_err(&spi->dev, "failed to request pendown GPIO\n"); 1006 + return PTR_ERR(ts->gpio_pendown); 1007 + } 1008 + if (pdata->gpio_pendown_debounce) 1009 + gpiod_set_debounce(ts->gpio_pendown, 1010 + pdata->gpio_pendown_debounce); 1016 1011 } 1017 1012 1018 1013 return 0; ··· 1104 1119 return 0; 1105 1120 } 1106 1121 1107 - #ifdef CONFIG_OF 1108 1122 static const struct of_device_id ads7846_dt_ids[] = { 1109 1123 { .compatible = "ti,tsc2046", .data = (void *) 7846 }, 1110 1124 { .compatible = "ti,ads7843", .data = (void *) 7843 }, ··· 1114 1130 }; 1115 1131 MODULE_DEVICE_TABLE(of, ads7846_dt_ids); 1116 1132 1117 - static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev) 1133 + static const struct ads7846_platform_data *ads7846_get_props(struct device *dev) 1118 1134 { 1119 1135 struct ads7846_platform_data *pdata; 1120 - struct device_node *node = dev->of_node; 1121 - const struct of_device_id *match; 1136 + const struct platform_device_id *pdev_id; 1122 1137 u32 value; 1123 1138 1124 - if (!node) { 1125 - dev_err(dev, "Device does not have associated DT data\n"); 1126 - return ERR_PTR(-EINVAL); 1127 - } 1128 - 1129 - match = of_match_device(ads7846_dt_ids, dev); 1130 - if (!match) { 1139 + pdev_id = device_get_match_data(dev); 1140 + if (!pdev_id) { 1131 1141 dev_err(dev, "Unknown device model\n"); 1132 1142 return ERR_PTR(-EINVAL); 1133 1143 } ··· 1130 1152 if (!pdata) 1131 1153 return ERR_PTR(-ENOMEM); 1132 1154 1133 - pdata->model = (unsigned long)match->data; 1155 + pdata->model = (unsigned long)pdev_id->driver_data; 1134 1156 1135 - of_property_read_u16(node, "ti,vref-delay-usecs", 1136 - &pdata->vref_delay_usecs); 1137 - of_property_read_u16(node, "ti,vref-mv", &pdata->vref_mv); 1138 - pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on"); 1157 + device_property_read_u16(dev, "ti,vref-delay-usecs", 1158 + &pdata->vref_delay_usecs); 1159 + device_property_read_u16(dev, "ti,vref-mv", &pdata->vref_mv); 1160 + pdata->keep_vref_on = device_property_read_bool(dev, "ti,keep-vref-on"); 1139 1161 1140 - pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy"); 1162 + pdata->swap_xy = device_property_read_bool(dev, "ti,swap-xy"); 1141 1163 1142 - of_property_read_u16(node, "ti,settle-delay-usec", 1143 - &pdata->settle_delay_usecs); 1144 - of_property_read_u16(node, "ti,penirq-recheck-delay-usecs", 1145 - &pdata->penirq_recheck_delay_usecs); 1164 + device_property_read_u16(dev, "ti,settle-delay-usec", 1165 + &pdata->settle_delay_usecs); 1166 + device_property_read_u16(dev, "ti,penirq-recheck-delay-usecs", 1167 + &pdata->penirq_recheck_delay_usecs); 1146 1168 1147 - of_property_read_u16(node, "ti,x-plate-ohms", &pdata->x_plate_ohms); 1148 - of_property_read_u16(node, "ti,y-plate-ohms", &pdata->y_plate_ohms); 1169 + device_property_read_u16(dev, "ti,x-plate-ohms", &pdata->x_plate_ohms); 1170 + device_property_read_u16(dev, "ti,y-plate-ohms", &pdata->y_plate_ohms); 1149 1171 1150 - of_property_read_u16(node, "ti,x-min", &pdata->x_min); 1151 - of_property_read_u16(node, "ti,y-min", &pdata->y_min); 1152 - of_property_read_u16(node, "ti,x-max", &pdata->x_max); 1153 - of_property_read_u16(node, "ti,y-max", &pdata->y_max); 1172 + device_property_read_u16(dev, "ti,x-min", &pdata->x_min); 1173 + device_property_read_u16(dev, "ti,y-min", &pdata->y_min); 1174 + device_property_read_u16(dev, "ti,x-max", &pdata->x_max); 1175 + device_property_read_u16(dev, "ti,y-max", &pdata->y_max); 1154 1176 1155 1177 /* 1156 1178 * touchscreen-max-pressure gets parsed during 1157 1179 * touchscreen_parse_properties() 1158 1180 */ 1159 - of_property_read_u16(node, "ti,pressure-min", &pdata->pressure_min); 1160 - if (!of_property_read_u32(node, "touchscreen-min-pressure", &value)) 1181 + device_property_read_u16(dev, "ti,pressure-min", &pdata->pressure_min); 1182 + if (!device_property_read_u32(dev, "touchscreen-min-pressure", &value)) 1161 1183 pdata->pressure_min = (u16) value; 1162 - of_property_read_u16(node, "ti,pressure-max", &pdata->pressure_max); 1184 + device_property_read_u16(dev, "ti,pressure-max", &pdata->pressure_max); 1163 1185 1164 - of_property_read_u16(node, "ti,debounce-max", &pdata->debounce_max); 1165 - if (!of_property_read_u32(node, "touchscreen-average-samples", &value)) 1186 + device_property_read_u16(dev, "ti,debounce-max", &pdata->debounce_max); 1187 + if (!device_property_read_u32(dev, "touchscreen-average-samples", &value)) 1166 1188 pdata->debounce_max = (u16) value; 1167 - of_property_read_u16(node, "ti,debounce-tol", &pdata->debounce_tol); 1168 - of_property_read_u16(node, "ti,debounce-rep", &pdata->debounce_rep); 1189 + device_property_read_u16(dev, "ti,debounce-tol", &pdata->debounce_tol); 1190 + device_property_read_u16(dev, "ti,debounce-rep", &pdata->debounce_rep); 1169 1191 1170 - of_property_read_u32(node, "ti,pendown-gpio-debounce", 1192 + device_property_read_u32(dev, "ti,pendown-gpio-debounce", 1171 1193 &pdata->gpio_pendown_debounce); 1172 1194 1173 - pdata->wakeup = of_property_read_bool(node, "wakeup-source") || 1174 - of_property_read_bool(node, "linux,wakeup"); 1175 - 1176 - pdata->gpio_pendown = of_get_named_gpio(dev->of_node, "pendown-gpio", 0); 1195 + pdata->wakeup = device_property_read_bool(dev, "wakeup-source") || 1196 + device_property_read_bool(dev, "linux,wakeup"); 1177 1197 1178 1198 return pdata; 1179 1199 } 1180 - #else 1181 - static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev) 1182 - { 1183 - dev_err(dev, "no platform data defined\n"); 1184 - return ERR_PTR(-EINVAL); 1185 - } 1186 - #endif 1187 1200 1188 1201 static void ads7846_regulator_disable(void *regulator) 1189 1202 { ··· 1238 1269 1239 1270 pdata = dev_get_platdata(dev); 1240 1271 if (!pdata) { 1241 - pdata = ads7846_probe_dt(dev); 1272 + pdata = ads7846_get_props(dev); 1242 1273 if (IS_ERR(pdata)) 1243 1274 return PTR_ERR(pdata); 1244 1275 } ··· 1395 1426 .driver = { 1396 1427 .name = "ads7846", 1397 1428 .pm = pm_sleep_ptr(&ads7846_pm), 1398 - .of_match_table = of_match_ptr(ads7846_dt_ids), 1429 + .of_match_table = ads7846_dt_ids, 1399 1430 }, 1400 1431 .probe = ads7846_probe, 1401 1432 .remove = ads7846_remove,
+10
drivers/video/fbdev/omap/lcd_mipid.c
··· 7 7 */ 8 8 #include <linux/device.h> 9 9 #include <linux/delay.h> 10 + #include <linux/gpio/consumer.h> 10 11 #include <linux/slab.h> 11 12 #include <linux/workqueue.h> 12 13 #include <linux/spi/spi.h> ··· 42 41 when we can issue the 43 42 next sleep in/out command */ 44 43 unsigned long hw_guard_wait; /* max guard time in jiffies */ 44 + struct gpio_desc *reset; 45 45 46 46 struct omapfb_device *fbdev; 47 47 struct spi_device *spi; ··· 558 556 return -ENOMEM; 559 557 } 560 558 559 + /* This will de-assert RESET if active */ 560 + md->reset = gpiod_get(&spi->dev, "reset", GPIOD_OUT_LOW); 561 + if (IS_ERR(md->reset)) 562 + return dev_err_probe(&spi->dev, PTR_ERR(md->reset), 563 + "no reset GPIO line\n"); 564 + 561 565 spi->mode = SPI_MODE_0; 562 566 md->spi = spi; 563 567 dev_set_drvdata(&spi->dev, md); ··· 582 574 { 583 575 struct mipid_device *md = dev_get_drvdata(&spi->dev); 584 576 577 + /* Asserts RESET */ 578 + gpiod_set_value(md->reset, 1); 585 579 mipid_disable(&md->panel); 586 580 kfree(md); 587 581 }
-2
include/linux/platform_data/lcd-mipid.h
··· 15 15 #ifdef __KERNEL__ 16 16 17 17 struct mipid_platform_data { 18 - int nreset_gpio; 19 18 int data_lines; 20 19 21 - void (*shutdown)(struct mipid_platform_data *pdata); 22 20 void (*set_bklight_level)(struct mipid_platform_data *pdata, 23 21 int level); 24 22 int (*get_bklight_level)(struct mipid_platform_data *pdata);
-2
include/linux/spi/ads7846.h
··· 35 35 u16 debounce_tol; /* tolerance used for filtering */ 36 36 u16 debounce_rep; /* additional consecutive good readings 37 37 * required after the first two */ 38 - int gpio_pendown; /* the GPIO used to decide the pendown 39 - * state if get_pendown_state == NULL */ 40 38 int gpio_pendown_debounce; /* platform specific debounce time for 41 39 * the gpio_pendown */ 42 40 int (*get_pendown_state)(void);