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: 9860511 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 6F1C660349 for ; Mon, 24 Jul 2017 20:52:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62F54285C6 for ; Mon, 24 Jul 2017 20:52:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57CA5285D1; Mon, 24 Jul 2017 20:52:52 +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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E65DD285C6 for ; Mon, 24 Jul 2017 20:52:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755808AbdGXUuE (ORCPT ); Mon, 24 Jul 2017 16:50:04 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:33784 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755734AbdGXUuD (ORCPT ); Mon, 24 Jul 2017 16:50:03 -0400 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 Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org 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 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 ");