Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb141597 authored by Marek Vasut's avatar Marek Vasut Committed by Dmitry Torokhov
Browse files

Input: ucb1400_ts - allow passing IRQ through platfrom_data



This patch allows UCB1400 to get IRQ GPIO from platform data. In case
platform_data are not supplied or the IRQ supplied in the platform_data
is negative, fall back to the old IRQ detection algorithm.

Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 765af10d
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -355,11 +355,14 @@ static int ucb1400_ts_probe(struct platform_device *dev)
		goto err;
		goto err;
	}
	}


	/* Only in case the IRQ line wasn't supplied, try detecting it */
	if (ucb->irq < 0) {
		error = ucb1400_ts_detect_irq(ucb);
		error = ucb1400_ts_detect_irq(ucb);
		if (error) {
		if (error) {
			printk(KERN_ERR "UCB1400: IRQ probe failed\n");
			printk(KERN_ERR "UCB1400: IRQ probe failed\n");
			goto err_free_devs;
			goto err_free_devs;
		}
		}
	}


	init_waitqueue_head(&ucb->ts_wait);
	init_waitqueue_head(&ucb->ts_wait);


+7 −0
Original line number Original line Diff line number Diff line
@@ -51,6 +51,7 @@ static int ucb1400_core_probe(struct device *dev)
	struct ucb1400_ts ucb_ts;
	struct ucb1400_ts ucb_ts;
	struct ucb1400_gpio ucb_gpio;
	struct ucb1400_gpio ucb_gpio;
	struct snd_ac97 *ac97;
	struct snd_ac97 *ac97;
	struct ucb1400_pdata *pdata = dev->platform_data;


	memset(&ucb_ts, 0, sizeof(ucb_ts));
	memset(&ucb_ts, 0, sizeof(ucb_ts));
	memset(&ucb_gpio, 0, sizeof(ucb_gpio));
	memset(&ucb_gpio, 0, sizeof(ucb_gpio));
@@ -88,6 +89,12 @@ static int ucb1400_core_probe(struct device *dev)


	/* TOUCHSCREEN */
	/* TOUCHSCREEN */
	ucb_ts.ac97 = ac97;
	ucb_ts.ac97 = ac97;

	if (pdata != NULL && pdata->irq >= 0)
		ucb_ts.irq = pdata->irq;
	else
		ucb_ts.irq = -1;

	ucb->ucb1400_ts = platform_device_alloc("ucb1400_ts", -1);
	ucb->ucb1400_ts = platform_device_alloc("ucb1400_ts", -1);
	if (!ucb->ucb1400_ts) {
	if (!ucb->ucb1400_ts) {
		err = -ENOMEM;
		err = -ENOMEM;
+4 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,10 @@ struct ucb1400 {
	struct platform_device	*ucb1400_gpio;
	struct platform_device	*ucb1400_gpio;
};
};


struct ucb1400_pdata {
	int	irq;
};

static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
{
{
	return ac97->bus->ops->read(ac97, reg);
	return ac97->bus->ops->read(ac97, reg);