From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Liam Girdwood <lgirdwood@gmail.com>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-input@vger.kernel.org,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
Lee Jones <lee.jones@linaro.org>, Daniel Mack <daniel@zonque.org>
Subject: Re: [PATCH v2 06/12] Input: wm97xx: add new AC97 bus support
Date: Mon, 19 Jun 2017 19:44:37 -0700 [thread overview]
Message-ID: <20170620024437.GB21379@dtor-ws> (raw)
In-Reply-To: <1497857229-12049-7-git-send-email-robert.jarzmik@free.fr>
On Mon, Jun 19, 2017 at 09:27:03AM +0200, Robert Jarzmik wrote:
> 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 <robert.jarzmik@free.fr>
> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> 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 033599777651..22257f3e1059 100644
> --- a/drivers/input/touchscreen/Kconfig
> +++ b/drivers/input/touchscreen/Kconfig
> @@ -725,7 +725,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 <linux/pm.h>
> #include <linux/interrupt.h>
> #include <linux/bitops.h>
> +#include <linux/mfd/wm97xx.h>
> #include <linux/workqueue.h>
> #include <linux/wm97xx.h>
> #include <linux/uaccess.h>
> @@ -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);
> --
> 2.1.4
>
--
Dmitry
next prev parent reply other threads:[~2017-06-20 2:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 7:26 [PATCH v2 00/12] AC97 device/driver model revamp Robert Jarzmik
2017-06-19 7:26 ` [PATCH v2 01/12] ALSA: ac97: add an ac97 bus Robert Jarzmik
2017-06-19 7:26 ` [PATCH v2 02/12] ASoC: add new ac97 bus support Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 03/12] ASoC: arm: make pxa2xx-ac97-lib ac97 codec agnostic Robert Jarzmik
2017-09-04 17:25 ` Applied "ASoC: arm: make pxa2xx-ac97-lib ac97 codec agnostic" to the asoc tree Mark Brown
2017-06-19 7:27 ` [PATCH v2 04/12] Input: wm97xx: split out touchscreen registering Robert Jarzmik
2017-06-20 2:43 ` Dmitry Torokhov
2017-09-19 16:11 ` Applied "Input: wm97xx: split out touchscreen registering" to the asoc tree Mark Brown
2017-06-19 7:27 ` [PATCH v2 05/12] mfd: wm97xx-core: core support for wm97xx Codec Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 06/12] Input: wm97xx: add new AC97 bus support Robert Jarzmik
2017-06-20 2:44 ` Dmitry Torokhov [this message]
2017-06-19 7:27 ` [PATCH v2 07/12] ASoC: wm9713: add ac97 new " Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 08/12] ASoC: wm9712: " Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 09/12] ASoC: wm9705: add private structure Robert Jarzmik
2017-09-19 16:11 ` Applied "ASoC: wm9705: add private structure" to the asoc tree Mark Brown
2017-06-19 7:27 ` [PATCH v2 10/12] ASoC: wm9705: add ac97 new bus support Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 11/12] ASoC: pxa: switch to new ac97 " Robert Jarzmik
2017-06-19 7:27 ` [PATCH v2 12/12] ASoC: Fix use-after-free at card unregistration Robert Jarzmik
2017-06-19 9:25 ` Takashi Iwai
2017-06-19 11:57 ` Robert Jarzmik
2017-06-28 19:53 ` Mark Brown
2017-06-28 22:03 ` Robert Jarzmik
2017-06-30 11:56 ` Mark Brown
2017-06-30 15:06 ` [alsa-devel] " Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170620024437.GB21379@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=robert.jarzmik@free.fr \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).