From patchwork Tue Sep 18 19:12:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10604829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3460A13AD for ; Tue, 18 Sep 2018 19:50:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 247232BD0B for ; Tue, 18 Sep 2018 19:50:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 188592BD19; Tue, 18 Sep 2018 19:50:49 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EA7B2BD17 for ; Tue, 18 Sep 2018 19:50:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CF49126789F; Tue, 18 Sep 2018 21:12:35 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 775222678A5; Tue, 18 Sep 2018 21:12:34 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by alsa0.perex.cz (Postfix) with ESMTP id 2D5D726789F for ; Tue, 18 Sep 2018 21:12:31 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id u24-v6so1453518pfn.13 for ; Tue, 18 Sep 2018 12:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fTZQCD0J81eQK4+Q7VYr6hsVNeRL6N/98n/VoVXi2Xo=; b=UUcc+RVoHovm8oASLlmtgVPoirsWCdov3d9wGVCHXlShBDI1S9qrJP8A7QyK5FRAJa 6LifFRnMfmkbQhA8XWa/8epM2M/SRiXiZFylVTUGmFMN8iuhpecq+TvsdOq341gXdjS4 /c9xijtmB/Ioi/wsXbzW2BT1nyDhGatbVTIIg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fTZQCD0J81eQK4+Q7VYr6hsVNeRL6N/98n/VoVXi2Xo=; b=j5aSDpUfQK/lBfGoNRtpT9PWI48v9W8o80mQIauypkfsFEONSiMDP1GuiJr8tev3ei uD9HyrvmfZmVJDNswhv7WeacgZgNGMkzVVBZo9spimf4Hr/gI0/Mt/SRtgz7aoIs5M/R TDhGMaX538OetkQJ9mx4O7yZqSeE0ELDejBoceSxwuNSP4gekFoNibwTL1bbn4zqrKiu 7+mgVEu+7DmJ1cX1L9JuUdTbqVgeLKEsXyuLz9LD3c06dzGtZRD9TniCdmDn2E6kEZxP WcOxhbmLzj42XE/A2/XWWriehFso+oTs5TZquwVpsiTCe5AxboGYm8OecTZcUfMhvUX3 pjEg== X-Gm-Message-State: APzg51DNkDLyZQrkZhN7jO718NRZPan4shF/pxjgw+tsJhXPx25+7VGW lJ1C9Mc9Ndw7IPffT4G93a/ZXg== X-Google-Smtp-Source: ANB0VdaGy5c+VCKrTULFb8AfBl3bsd1xaaS1yYCDN7pcGzRy1Bn+tpuQb2HajJSxH4Wr6v28CXtSyA== X-Received: by 2002:a62:cdcf:: with SMTP id o198-v6mr32425274pfg.12.1537297950901; Tue, 18 Sep 2018 12:12:30 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id l9-v6sm24381865pgg.79.2018.09.18.12.12.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Sep 2018 12:12:29 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Date: Tue, 18 Sep 2018 12:12:26 -0700 Message-Id: <20180918191226.17104-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Cc: alsa-devel@alsa-project.org, Linus Walleij Subject: [alsa-devel] [PATCH 1/2] sound: soc: wm8903: Pull in platform data X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP No platform in the kernel is using platform data to populate the WM8903 so pull it into the source file. This is done to handle further simplifications. Signed-off-by: Linus Walleij --- include/sound/wm8903.h | 24 ------------------------ sound/soc/codecs/wm8903.c | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h index b310c5a3a958..b2ef76d5d00d 100644 --- a/include/sound/wm8903.h +++ b/include/sound/wm8903.h @@ -11,12 +11,6 @@ #ifndef __LINUX_SND_WM8903_H #define __LINUX_SND_WM8903_H -/* - * Used to enable configuration of a GPIO to all zeros; a gpio_cfg value of - * zero in platform data means "don't touch this pin". - */ -#define WM8903_GPIO_CONFIG_ZERO 0x8000 - /* * R6 (0x06) - Mic Bias Control 0 */ @@ -245,22 +239,4 @@ #define WM8903_GP5_DB_SHIFT 0 /* GP5_DB */ #define WM8903_GP5_DB_WIDTH 1 /* GP5_DB */ -#define WM8903_NUM_GPIO 5 - -struct wm8903_platform_data { - bool irq_active_low; /* Set if IRQ active low, default high */ - - /* Default register value for R6 (Mic bias), used to configure - * microphone detection. In conjunction with gpio_cfg this - * can be used to route the microphone status signals out onto - * the GPIOs for use with snd_soc_jack_add_gpios(). - */ - u16 micdet_cfg; - - int micdet_delay; /* Delay after microphone detection (ms) */ - - int gpio_base; - u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */ -}; - #endif diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 6cb3c153ba19..23e43ff40ded 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -124,6 +124,30 @@ static const char *wm8903_supply_names[WM8903_NUM_SUPPLIES] = { "DCVDD", }; +/* + * Used to enable configuration of a GPIO to all zeros; a gpio_cfg value of + * zero in platform data means "don't touch this pin". + */ +#define WM8903_GPIO_CONFIG_ZERO 0x8000 + +#define WM8903_NUM_GPIO 5 + +struct wm8903_platform_data { + bool irq_active_low; /* Set if IRQ active low, default high */ + + /* Default register value for R6 (Mic bias), used to configure + * microphone detection. In conjunction with gpio_cfg this + * can be used to route the microphone status signals out onto + * the GPIOs for use with snd_soc_jack_add_gpios(). + */ + u16 micdet_cfg; + + int micdet_delay; /* Delay after microphone detection (ms) */ + + int gpio_base; + u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */ +}; + struct wm8903_priv { struct wm8903_platform_data *pdata; struct device *dev;