1
0
Fork 0

touch: Fix getting of GPIO in cyttsp5 from device tree

steinar/wifi_calib_4_9_kernel
Martin T. H. Sandsmark 2016-08-22 18:22:54 +02:00 committed by Lars Ivar Miljeteig
parent 9bdd8f4c45
commit 87340ba572
1 changed files with 7 additions and 6 deletions

View File

@ -29,6 +29,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/slab.h>
/* cyttsp */
@ -554,10 +555,12 @@ static struct cyttsp5_core_platform_data *create_and_get_core_pdata(
}
/* Required fields */
rc = of_property_read_u32(core_node, "cy,irq_gpio", &value);
if (rc)
pdata->irq_gpio = of_get_named_gpio(core_node, "cy,irq_gpio", 0);
if (!gpio_is_valid(pdata->irq_gpio)) {
rc = -ENODEV;
pr_err("Invalid irq_gpio");
goto fail_free;
pdata->irq_gpio = value;
}
rc = of_property_read_u32(core_node, "cy,hid_desc_register", &value);
if (rc)
@ -568,9 +571,7 @@ static struct cyttsp5_core_platform_data *create_and_get_core_pdata(
/* rst_gpio is optional since a platform may use
* power cycling instead of using the XRES pin
*/
rc = of_property_read_u32(core_node, "cy,rst_gpio", &value);
if (!rc)
pdata->rst_gpio = value;
pdata->rst_gpio = of_get_named_gpio(core_node, "cy,rst_gpio", 0);
rc = of_property_read_u32(core_node, "cy,level_irq_udelay", &value);
if (!rc)