From patchwork Sun Nov 8 02:10:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 58444 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA8243vp032009 for ; Sun, 8 Nov 2009 02:11:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751917AbZKHCLL (ORCPT ); Sat, 7 Nov 2009 21:11:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752654AbZKHCLL (ORCPT ); Sat, 7 Nov 2009 21:11:11 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:33563 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751917AbZKHCLK convert rfc822-to-8bit (ORCPT ); Sat, 7 Nov 2009 21:11:10 -0500 Received: by bwz27 with SMTP id 27so2388530bwz.21 for ; Sat, 07 Nov 2009 18:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:mime-version:content-type:content-transfer-encoding :message-id; bh=+fuPVKDKZpcyifS77TliohV5RF3O4PYWi36tpxXTO9o=; b=bxnRrOkiPulmNeyRu88rgCOmaJ3SA9RHJTDn2I5LtWfHF8u0m92LhcyDw9l69ROArv VEW2j8IkE1B3jl8at7CPV1r56qxxry6nXO1pjy8x6ozpr3vxZEAPq7EOnxzAS00uNNXu RXyj5FyejMwDIsyWRadP5aeDWxbuOtC+wdamE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; b=ppolOzXESlDfE9HcX6ROoaN3/UxXvjSKMXJFlIfEF1YnhCzIih3J1PwQLxJymKmW4L 8WCO5P6czLyizmrVPvrx6fgApovXAoTCyxvLQ/E4es8hf51FS146GZhGSvAJ5TDGD2gt JPPmCkJB8lgRbgowIDGhLrgjjkd03CPBAKxhU= Received: by 10.204.32.76 with SMTP id b12mr125211bkd.165.1257646275250; Sat, 07 Nov 2009 18:11:15 -0800 (PST) Received: from rin.localnet (85-132-216-250-eth3-gwfm10-user.802.cz [85.132.216.250]) by mx.google.com with ESMTPS id 21sm2989646fkx.27.2009.11.07.18.11.14 (version=SSLv3 cipher=RC4-MD5); Sat, 07 Nov 2009 18:11:14 -0800 (PST) From: Marek Vasut Organization: Hack&Dev To: Dmitry Torokhov , "linux-input@vger.kernel.org" Subject: [PATCH] UCB1400: Allow passing IRQ through platfrom_data Date: Sun, 8 Nov 2009 03:10:03 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.30-2-amd64; KDE/4.3.2; x86_64; ; ) MIME-Version: 1.0 Message-Id: <200911080310.04121.marek.vasut@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 095f84b..89dcbe7 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -355,10 +355,13 @@ static int ucb1400_ts_probe(struct platform_device *dev) goto err; } - error = ucb1400_ts_detect_irq(ucb); - if (error) { - printk(KERN_ERR "UCB1400: IRQ probe failed\n"); - goto err_free_devs; + /* Only in case the IRQ line wasn't supplied, try detecting it */ + if (ucb->irq < 0) { + error = ucb1400_ts_detect_irq(ucb); + if (error) { + printk(KERN_ERR "UCB1400: IRQ probe failed\n"); + goto err_free_devs; + } } init_waitqueue_head(&ucb->ts_wait); diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c index fa294b6..85fd942 100644 --- a/drivers/mfd/ucb1400_core.c +++ b/drivers/mfd/ucb1400_core.c @@ -51,6 +51,7 @@ static int ucb1400_core_probe(struct device *dev) struct ucb1400_ts ucb_ts; struct ucb1400_gpio ucb_gpio; struct snd_ac97 *ac97; + struct ucb1400_pdata *pdata = dev->platform_data; memset(&ucb_ts, 0, sizeof(ucb_ts)); memset(&ucb_gpio, 0, sizeof(ucb_gpio)); @@ -88,6 +89,12 @@ static int ucb1400_core_probe(struct device *dev) /* TOUCHSCREEN */ 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); if (!ucb->ucb1400_ts) { err = -ENOMEM; diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index adb4406..1b47909 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h @@ -110,6 +110,10 @@ struct ucb1400 { struct platform_device *ucb1400_gpio; }; +struct ucb1400_pdata { + int irq; +}; + static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) { return ac97->bus->ops->read(ac97, reg);