From patchwork Tue Sep 19 16:11:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9959581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A5D9260208 for ; Tue, 19 Sep 2017 16:28:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9123E28CCB for ; Tue, 19 Sep 2017 16:28:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E7428DE4; Tue, 19 Sep 2017 16:28:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 04C0528CCB for ; Tue, 19 Sep 2017 16:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: References:List-Owner; bh=YX2braEq59p7caWdEBH52hJCQdJnossSI/TAJUTTKAY=; b=CiN y4p6WSvk4yUY4cg23etKq+f9dkQEffFcuIXk88++XEmR3HcFv+fqKc3GtYDKKdhAg2wcBLPN3eDpb sfNz1DPnc3Gk5QBfrTL5GuKQCx1VD1eYtvy2xW/uiKFCmVNfDNAoC0sTBClHlCgKd0DqDg3zNSuGB KezKI0Q/A1xiyyDYmhVtkIfNQuljysPVFpN5uYLWLOPK0zO1wRr37jOX0IimzuxFGisl4cH+OqPhp lZvUc3wWyrRyIvYlbf793wHphmKF2sQCIZFXX7GY8HR00I99AJTmWtFeYq+WLG8lQVoH3Hhbk7Z5A OAuSYyJGXIOJE7eRITAc5uvYPdfaZGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1duLNu-0004q2-BG; Tue, 19 Sep 2017 16:28:30 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duLMg-0003Yd-1h for linux-arm-kernel@bombadil.infradead.org; Tue, 19 Sep 2017 16:27:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Date:Message-Id:In-Reply-To:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A9hxCNsic89onA2QWHoMlHYyV2Oo3d5WKx5MciprYaU=; b=Dzsp72aNo56Icj2MFr5g5LIAnH WvskgkV5fSdmDAGzaRtEGDopkZ7pvDmzksh2ZveErqQcyUV/RPFX6P8/UOS0hXnjzTT5E+0Lwnibh mLdfPzz8JER7Zi2vDazOlntlO++EWyEFClhHpEMOhonv4v3oK/QZ+/85ywabyW+WjC+E9ltltlCKg eQkv4Stoe197T/V+izWlhO1DPcG0qkGQBIqKNKBmy8LocHvZsJ8jmt6HcTyXa2WW0qi/1tR05utYL dMQKnuh+NtyHN0cX4f5RLAhiIBBLCHCEiAhyzxfacLA0YfgZD65RBar+bMjv2eZQDnTIlEH9J8DB2 3mgJscig==; Received: from heliosphere.sirena.org.uk ([2a01:7e01::f03c:91ff:fed4:a3b6]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duL8E-000599-Da for linux-arm-kernel@lists.infradead.org; Tue, 19 Sep 2017 16:12:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=A9hxCNsic89onA2QWHoMlHYyV2Oo3d5WKx5MciprYaU=; b=S7sn1ZiZfs9p 9GErsDBQlNCEvHoKWxDs3tYxwPG0lfFAnSEXggu++q5ROkTAmp9dd6j1gPSKy6sLRNooqC9e4sCRm QzNSGH7NOqR0wzQy5Pr8x5E2AtJkz+KzLc4f2dohKWkLglJ/+JiETvAkIMmd3Dayg1diPCeFmUaRz W2xq0=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1duL7E-0001fN-37; Tue, 19 Sep 2017 16:11:16 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1duL7D-0004kS-M6; Tue, 19 Sep 2017 17:11:15 +0100 From: Mark Brown To: Robert Jarzmik Subject: Applied "Input: wm97xx: add new AC97 bus support" to the asoc tree In-Reply-To: <1477510907-23495-10-git-send-email-robert.jarzmik@free.fr> Message-Id: Date: Tue, 19 Sep 2017 17:11:15 +0100 X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170919_171218_486218_F5D4B0F7 X-CRM114-Status: GOOD ( 30.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-input@vger.kernel.org, alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Liam Girdwood , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Dmitry Torokhov , Sebastian Reichel , Haojian Zhuang , Jaroslav Kysela , Mark Brown , linux-arm-kernel@lists.infradead.org, Takashi Iwai , Charles Keepax , Lee Jones , Daniel Mack MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The patch Input: wm97xx: add new AC97 bus support has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From ae9d1b5fbd7b7ee1c2d2f62a7cee3c0455e06f94 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Wed, 13 Sep 2017 21:37:18 +0200 Subject: [PATCH] Input: wm97xx: add new AC97 bus support This adds support for the new AC97 bus code, which discovers the devices rather than uses platform data. As part of this discovery, it enables a multi-function device wm97xx, which supports touchscreen, battery, ADC and an audio codec. This patch adds the code to bind the touchscreen "cell" as the touchscreen driver. This was tested on the pxa architecture with a pxa270 + wm9713 + the mioa701 touchscreen. Signed-off-by: Robert Jarzmik Acked-by: Charles Keepax Acked-by: Dmitry Torokhov Signed-off-by: Mark Brown --- drivers/input/touchscreen/Kconfig | 2 +- drivers/input/touchscreen/wm97xx-core.c | 56 ++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 64b30fe273fd..176b1a74b2b7 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -727,7 +727,7 @@ config TOUCHSCREEN_WM831X config TOUCHSCREEN_WM97XX tristate "Support for WM97xx AC97 touchscreen controllers" - depends on AC97_BUS + depends on AC97_BUS || AC97_BUS_NEW help Say Y here if you have a Wolfson Microelectronics WM97xx touchscreen connected to your system. Note that this option diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 39869ffdc4fa..fd714ee881f7 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -766,6 +767,39 @@ static int wm97xx_remove(struct device *dev) return 0; } +static int wm97xx_mfd_probe(struct platform_device *pdev) +{ + struct wm97xx *wm; + struct wm97xx_platform_data *mfd_pdata = dev_get_platdata(&pdev->dev); + int ret; + + wm = devm_kzalloc(&pdev->dev, sizeof(struct wm97xx), GFP_KERNEL); + if (!wm) + return -ENOMEM; + + wm->dev = &pdev->dev; + wm->ac97 = mfd_pdata->ac97; + + ret = _wm97xx_probe(wm); + if (ret) + return ret; + + ret = wm97xx_add_battery(wm, mfd_pdata->batt_pdata); + if (ret < 0) + goto batt_err; + + return ret; + +batt_err: + wm97xx_unregister_touch(wm); + return ret; +} + +static int wm97xx_mfd_remove(struct platform_device *pdev) +{ + return wm97xx_remove(&pdev->dev); +} + static int __maybe_unused wm97xx_suspend(struct device *dev) { struct wm97xx *wm = dev_get_drvdata(dev); @@ -862,21 +896,41 @@ EXPORT_SYMBOL_GPL(wm97xx_unregister_mach_ops); static struct device_driver wm97xx_driver = { .name = "wm97xx-ts", +#ifdef CONFIG_AC97_BUS .bus = &ac97_bus_type, +#endif .owner = THIS_MODULE, .probe = wm97xx_probe, .remove = wm97xx_remove, .pm = &wm97xx_pm_ops, }; +static struct platform_driver wm97xx_mfd_driver = { + .driver = { + .name = "wm97xx-ts", + .pm = &wm97xx_pm_ops, + }, + .probe = wm97xx_mfd_probe, + .remove = wm97xx_mfd_remove, +}; + static int __init wm97xx_init(void) { - return driver_register(&wm97xx_driver); + int ret; + + ret = platform_driver_register(&wm97xx_mfd_driver); + if (ret) + return ret; + + if (IS_BUILTIN(CONFIG_AC97_BUS)) + ret = driver_register(&wm97xx_driver); + return ret; } static void __exit wm97xx_exit(void) { driver_unregister(&wm97xx_driver); + platform_driver_unregister(&wm97xx_mfd_driver); } module_init(wm97xx_init);