提交 266a5e02 编写于 作者: M Mark Brown 提交者: Samuel Ortiz

mfd: Allow touchscreen to be disabled on wm831x devices

Allow platform data to flag the touchscreen as disabled so that if the
touch driver is built in we don't end up causing lots of work by spuriously
detecting touchscreen activity on systems where it isn't in use.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 eb503dc1
...@@ -1124,11 +1124,6 @@ static struct mfd_cell wm8311_devs[] = { ...@@ -1124,11 +1124,6 @@ static struct mfd_cell wm8311_devs[] = {
.num_resources = ARRAY_SIZE(wm831x_status2_resources), .num_resources = ARRAY_SIZE(wm831x_status2_resources),
.resources = wm831x_status2_resources, .resources = wm831x_status2_resources,
}, },
{
.name = "wm831x-touch",
.num_resources = ARRAY_SIZE(wm831x_touch_resources),
.resources = wm831x_touch_resources,
},
{ {
.name = "wm831x-watchdog", .name = "wm831x-watchdog",
.num_resources = ARRAY_SIZE(wm831x_wdt_resources), .num_resources = ARRAY_SIZE(wm831x_wdt_resources),
...@@ -1285,11 +1280,6 @@ static struct mfd_cell wm8312_devs[] = { ...@@ -1285,11 +1280,6 @@ static struct mfd_cell wm8312_devs[] = {
.num_resources = ARRAY_SIZE(wm831x_status2_resources), .num_resources = ARRAY_SIZE(wm831x_status2_resources),
.resources = wm831x_status2_resources, .resources = wm831x_status2_resources,
}, },
{
.name = "wm831x-touch",
.num_resources = ARRAY_SIZE(wm831x_touch_resources),
.resources = wm831x_touch_resources,
},
{ {
.name = "wm831x-watchdog", .name = "wm831x-watchdog",
.num_resources = ARRAY_SIZE(wm831x_wdt_resources), .num_resources = ARRAY_SIZE(wm831x_wdt_resources),
...@@ -1428,6 +1418,15 @@ static struct mfd_cell wm8320_devs[] = { ...@@ -1428,6 +1418,15 @@ static struct mfd_cell wm8320_devs[] = {
}, },
}; };
static struct mfd_cell touch_devs[] = {
{
.name = "wm831x-touch",
.num_resources = ARRAY_SIZE(wm831x_touch_resources),
.resources = wm831x_touch_resources,
},
};
static struct mfd_cell backlight_devs[] = { static struct mfd_cell backlight_devs[] = {
{ {
.name = "wm831x-backlight", .name = "wm831x-backlight",
...@@ -1624,12 +1623,20 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) ...@@ -1624,12 +1623,20 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
ret = mfd_add_devices(wm831x->dev, wm831x_num, ret = mfd_add_devices(wm831x->dev, wm831x_num,
wm8311_devs, ARRAY_SIZE(wm8311_devs), wm8311_devs, ARRAY_SIZE(wm8311_devs),
NULL, wm831x->irq_base); NULL, wm831x->irq_base);
if (!pdata || !pdata->disable_touch)
mfd_add_devices(wm831x->dev, wm831x_num,
touch_devs, ARRAY_SIZE(touch_devs),
NULL, wm831x->irq_base);
break; break;
case WM8312: case WM8312:
ret = mfd_add_devices(wm831x->dev, wm831x_num, ret = mfd_add_devices(wm831x->dev, wm831x_num,
wm8312_devs, ARRAY_SIZE(wm8312_devs), wm8312_devs, ARRAY_SIZE(wm8312_devs),
NULL, wm831x->irq_base); NULL, wm831x->irq_base);
if (!pdata || !pdata->disable_touch)
mfd_add_devices(wm831x->dev, wm831x_num,
touch_devs, ARRAY_SIZE(touch_devs),
NULL, wm831x->irq_base);
break; break;
case WM8320: case WM8320:
......
...@@ -120,6 +120,9 @@ struct wm831x_pdata { ...@@ -120,6 +120,9 @@ struct wm831x_pdata {
/** Put the /IRQ line into CMOS mode */ /** Put the /IRQ line into CMOS mode */
bool irq_cmos; bool irq_cmos;
/** Disable the touchscreen */
bool disable_touch;
int irq_base; int irq_base;
int gpio_base; int gpio_base;
int gpio_defaults[WM831X_GPIO_NUM]; int gpio_defaults[WM831X_GPIO_NUM];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册