15 #include <linux/kernel.h>
19 #include <asm/machdep.h>
24 #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
25 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
31 static void *pdm360ng_gpio_base;
33 static int pdm360ng_get_pendown_state(
void)
39 setbits32(pdm360ng_gpio_base + 0
xc, 0x40);
41 reg =
in_be32(pdm360ng_gpio_base + 0x8);
44 return (reg & 0x40) == 0;
49 .get_pendown_state = pdm360ng_get_pendown_state,
53 static int __init pdm360ng_penirq_init(
void)
59 pr_err(
"%s: Can't find 'mpc5121-gpio' node\n", __func__);
63 pdm360ng_gpio_base =
of_iomap(np, 0);
65 if (!pdm360ng_gpio_base) {
66 pr_err(
"%s: Can't map gpio regs.\n", __func__);
69 out_be32(pdm360ng_gpio_base + 0
xc, 0xffffffff);
70 setbits32(pdm360ng_gpio_base + 0x18, 0x2000);
71 setbits32(pdm360ng_gpio_base + 0x10, 0x40);
76 static int pdm360ng_touchscreen_notifier_call(
struct notifier_block *nb,
77 unsigned long event,
void *__dev)
93 static void __init pdm360ng_touchscreen_init(
void)
95 if (pdm360ng_penirq_init())
101 static inline void __init pdm360ng_touchscreen_init(
void)
109 pdm360ng_touchscreen_init();
112 static int __init pdm360ng_probe(
void)
114 unsigned long root = of_get_flat_dt_root();
116 return of_flat_dt_is_compatible(root,
"ifm,pdm360ng");
121 .probe = pdm360ng_probe,