From patchwork Mon Jul 24 20:49:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 9860459 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 B148460349 for ; Mon, 24 Jul 2017 20:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4AA3285C6 for ; Mon, 24 Jul 2017 20:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9979E285C9; Mon, 24 Jul 2017 20:50:50 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE 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 11636285D2 for ; Mon, 24 Jul 2017 20:50:49 +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:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=eeSvkXuegPfxpDh0h/8M6z5odeq/2lMMnHSHE2ZWq10=; b=XtE +vTHSql8BnSsHPVRz6YD3FH0iUwjwAvqx9MZ71Ss3Iryqd+cC939iTFTxywtwS9qDI/zTBsTb8P9s sW16I4w6fLWepFQbR/bG66E1UVtwFbN+2AezBKDYJkQbMCIBNuM1rEh4JSCQxOnZj9AIDYer8AEoc rL9Cx6kbLxbw/Hjhmi/zMIGor2ehZ1exmoeEJq37o5bB5oJreS7K/AQf5Vykm1xnxWZPZjMEn5CPf KniYZ2fV47B1EHLuc9GpZi3ltfnOgMeOv1aGh9KHu/RzkdqA8h+1hPBvQD30JvKE1iMjEX3OKCri5 9ka/93lHmZ2x6MfMtlZsIdH1vIK3afg==; 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 1dZkJR-0001fc-Pk; Mon, 24 Jul 2017 20:50:45 +0000 Received: from smtp01.smtpout.orange.fr ([80.12.242.123] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dZkJ6-0000Bx-Ur for linux-arm-kernel@lists.infradead.org; Mon, 24 Jul 2017 20:50:27 +0000 Received: from belgarion.home ([90.16.81.74]) by mwinf5d48 with ME id okpu1v00K1cCLj603kpupB; Mon, 24 Jul 2017 22:50:00 +0200 X-ME-Helo: belgarion.home X-ME-Date: Mon, 24 Jul 2017 22:50:00 +0200 X-ME-IP: 90.16.81.74 From: Robert Jarzmik To: Dmitry Torokhov , Lee Jones , Jaroslav Kysela , Takashi Iwai , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Liam Girdwood , Mark Brown , Lars-Peter Clausen , Charles Keepax Subject: [PATCH v4 00/12] AC97 device/driver model revamp Date: Mon, 24 Jul 2017 22:49:16 +0200 Message-Id: <20170724204928.29505-1-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170724_135025_520459_2C4E9C53 X-CRM114-Status: GOOD ( 15.45 ) 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: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org 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 Hi Lars, Mark, Charles, Lee, This is a minor revision after v3, mainly reviews from Takashi, Charles. I did more extensive testing of load/unload of the whole serie, and apart from a bug in wm97xx-core in touchscreen tree (for a which a patch will be sent apart), it seems to work properly. I extracted the diff from the v3 of sound/ac97 which is in [1] for easier spotting of what has globally changed. I would still need a review from you, Lee, for the mfd patch (patch 6/12). Happy review. --- Robert Robert Jarzmik (12): ALSA: ac97: split out the generic ac97 registers ALSA: ac97: add an ac97 bus ASoC: add new ac97 bus support ASoC: arm: make pxa2xx-ac97-lib ac97 codec agnostic Input: wm97xx: split out touchscreen registering mfd: wm97xx-core: core support for wm97xx Codec Input: wm97xx: add new AC97 bus support ASoC: wm9713: add ac97 new bus support ASoC: wm9712: add ac97 new bus support ASoC: wm9705: add private structure ASoC: wm9705: add ac97 new bus support ASoC: pxa: switch to new ac97 bus support drivers/input/touchscreen/Kconfig | 2 +- drivers/input/touchscreen/wm97xx-core.c | 252 ++++++++++----- drivers/mfd/Kconfig | 15 + drivers/mfd/Makefile | 1 + drivers/mfd/wm97xx-core.c | 405 ++++++++++++++++++++++++ include/linux/mfd/wm97xx.h | 31 ++ include/sound/ac97/codec.h | 118 +++++++ include/sound/ac97/compat.h | 21 ++ include/sound/ac97/controller.h | 84 +++++ include/sound/ac97/regs.h | 262 +++++++++++++++ include/sound/ac97_codec.h | 239 +------------- include/sound/pxa2xx-lib.h | 15 +- sound/Kconfig | 2 + sound/Makefile | 1 + sound/ac97/Kconfig | 19 ++ sound/ac97/Makefile | 8 + sound/ac97/ac97_core.h | 10 + sound/ac97/bus.c | 542 ++++++++++++++++++++++++++++++++ sound/ac97/codec.c | 15 + sound/ac97/snd_ac97_compat.c | 105 +++++++ sound/arm/Kconfig | 1 - sound/arm/pxa2xx-ac97-lib.c | 37 ++- sound/arm/pxa2xx-ac97.c | 35 ++- sound/soc/codecs/Kconfig | 9 +- sound/soc/codecs/wm9705.c | 59 ++-- sound/soc/codecs/wm9712.c | 37 ++- sound/soc/codecs/wm9713.c | 39 ++- sound/soc/pxa/Kconfig | 5 +- sound/soc/pxa/pxa2xx-ac97.c | 46 ++- 29 files changed, 2001 insertions(+), 414 deletions(-) create mode 100644 drivers/mfd/wm97xx-core.c create mode 100644 include/linux/mfd/wm97xx.h create mode 100644 include/sound/ac97/codec.h create mode 100644 include/sound/ac97/compat.h create mode 100644 include/sound/ac97/controller.h create mode 100644 include/sound/ac97/regs.h create mode 100644 sound/ac97/Kconfig create mode 100644 sound/ac97/Makefile create mode 100644 sound/ac97/ac97_core.h create mode 100644 sound/ac97/bus.c create mode 100644 sound/ac97/codec.c create mode 100644 sound/ac97/snd_ac97_compat.c diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 7cda8175341e..af618a0e89cb 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -76,7 +76,6 @@ static void ac97_codec_release(struct device *dev) adev = to_ac97_device(dev); ac97_ctrl = adev->ac97_ctrl; ac97_ctrl->codecs[adev->num] = NULL; - sysfs_remove_link(&dev->kobj, "ac97_controller"); kfree(adev); } @@ -269,8 +268,29 @@ static const struct attribute_group *ac97_adapter_groups[] = { NULL, }; +static void ac97_del_adapter(struct ac97_controller *ac97_ctrl) +{ + mutex_lock(&ac97_controllers_mutex); + ac97_ctrl_codecs_unregister(ac97_ctrl); + list_del(&ac97_ctrl->controllers); + mutex_unlock(&ac97_controllers_mutex); + + device_unregister(&ac97_ctrl->adap); +} + +static void ac97_adapter_release(struct device *dev) +{ + struct ac97_controller *ac97_ctrl; + + ac97_ctrl = to_ac97_controller(dev); + idr_remove(&ac97_adapter_idr, ac97_ctrl->nr); + dev_dbg(&ac97_ctrl->adap, "adapter unregistered by %s\n", + dev_name(ac97_ctrl->parent)); +} + static const struct device_type ac97_adapter_type = { .groups = ac97_adapter_groups, + .release = ac97_adapter_release, }; static int ac97_add_adapter(struct ac97_controller *ac97_ctrl) @@ -298,16 +318,6 @@ static int ac97_add_adapter(struct ac97_controller *ac97_ctrl) return ret; } -static void ac97_del_adapter(struct ac97_controller *ac97_ctrl) -{ - mutex_lock(&ac97_controllers_mutex); - ac97_ctrl_codecs_unregister(ac97_ctrl); - list_del(&ac97_ctrl->controllers); - idr_remove(&ac97_adapter_idr, ac97_ctrl->nr); - mutex_unlock(&ac97_controllers_mutex); - put_device(&ac97_ctrl->adap); -} - /** * snd_ac97_controller_register - register an ac97 controller * @ops: the ac97 bus operations @@ -508,7 +518,7 @@ static int ac97_bus_remove(struct device *dev) } static struct bus_type ac97_bus_type = { - .name = "ac97", + .name = "ac97bus", .dev_groups = ac97_dev_groups, .match = ac97_bus_match, .pm = &ac97_pm, @@ -522,5 +532,11 @@ static int __init ac97_bus_init(void) } subsys_initcall(ac97_bus_init); +static void __exit ac97_bus_exit(void) +{ + bus_unregister(&ac97_bus_type); +} +module_exit(ac97_bus_exit); + MODULE_LICENSE("GPL"); MODULE_AUTHOR("Robert Jarzmik ");