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: 146940 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp250210ljw; Tue, 18 Sep 2018 12:12:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYmdRuyVtTwvvaPXjtXxIKYu/qBZHWMD8bZDZk++s1YIfCP8O5M4AYcJ+f2X2tMbaaBPz1c X-Received: by 2002:adf:8919:: with SMTP id s25-v6mr25450455wrs.89.1537297957118; Tue, 18 Sep 2018 12:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537297957; cv=none; d=google.com; s=arc-20160816; b=UJw1g8JnbRn7ZHrrQ9m1Dbv68fN0Z2lC4JNcLZJl7w/zUIMnk/62BM0htvTf2CZ3cs 0UWL550plDi+YnzvJHJKr+S/QrezBpntH+CYA779CDPponItybDiIqiTLbwPIag/CHLJ W8mzGSc5+JfXRsSPc9TH1fcwvNiMK89BK9GFy/LnXahJIt37Wgff+ZR59LeFS2E91Plr SsAKDTiFgmeBOLIrRWVX7KmSIfy8Pp+b+G8Yvy4xFWh1Q2w04bAfziuz5AGnHz5Zf786 rWrVhwaPkDtaqmdDw+frLfdMOfePxv5EZORKFh9WQFn08ZmoR1WbIsGJ5GsN2PzDtwWp hARg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to; bh=bqSmHpARwrBqmXhQWFrLGHJiHwWsKREruz3iSfXEwpA=; b=GKbOtPIebFJ1WgWDjwl+B08ExLvcnZNaCu9wYR8xJZiu5eXRcAZgo7zVXLJMIFBphH ydDFNK0sspEx0bCWU6eVwoiiCoRscla/Fo3UJjLYtgUJOXC4ObDjfudq0fN3FyhBgl8Q 2GJRcTzk1P6XAee+nRdTuftyYSOyTBYKzfF+rK09W9b0lnXbHU/wbUOL/325m1MVKmok VjtrREz5fBUuF6fxS0Q7/8/a5EPidMe45pIfUN346i08oUlVb0Q5lu5fN8rxShJd62zK h2cLKiCyB8tORcWpmwkiHWAeCM18o3rlWZE1IhMACGxY09rgYtm9XuNetLAUrGSG7T45 Awjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UUcc+RVo; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id j1-v6si9722910wrs.82.2018.09.18.12.12.36; Tue, 18 Sep 2018 12:12:37 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UUcc+RVo; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS autolearn=disabled version=3.4.0 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-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 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(-) -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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; From patchwork Tue Sep 18 19:12:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 146941 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp250424ljw; Tue, 18 Sep 2018 12:12:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZyR4MtkzUjdeLbi7gnFN+gkNXpLFUNBmiINwCA9Kgvg1Tvl+sbaWOvmYHTVZzaSsyR890B X-Received: by 2002:a7b:c143:: with SMTP id z3-v6mr17581871wmi.105.1537297966562; Tue, 18 Sep 2018 12:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537297966; cv=none; d=google.com; s=arc-20160816; b=f05zxaVwJ3wVOPvD0Dj/ARPC6CzwPz3+SQ34XlM7IsH9p13fpzRnmqNNsOPlyw3QhJ RbHaQbcQSMNCDIQ9FsGt1ryEwCUblivAi/o6B7YmuMdTl0YIiZUkpkpNwokm6Mf51wAv nKhYlnUE2BRX9kfcw3zbfOL8g6I8E8QF+3kTlGV2TdaNmUu88f1j0gukpclzRqvjuNwr NDYfohR6MsTL+lo4C+FOf2uiZUCBP4YpRsVQEJkeuFGbiwAZ7fwA27gvxrhEOcPNXKxs ke1XZCTo3HebisGL0vq42lvNJIrMiAUUaAFVUSlZ0srMU+wA4GpvRcqmdP1VG8R9p+46 9a7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to; bh=efKA8Qt/2Pm0fnjgvUNVCkkoYDFQ59VKJ8KGm1o4AH0=; b=n8DO+XesLQeavmwVYEe9Dpj53lC0vBPv8Xw/DewsDoT/wREtdIF51AZtnFz9lI/m43 vzZqoo8/QDfuiic5BA8VHWGBf3e1kDK2PXd7yaZZy1gZawmRtCegdkrDioM35KN3n5v3 Y624/iNkAcG4n8mWBAaqXp8lwh8Sx6wv1XYWO+l0gOy1c9cEpGncUpqCAP4AVGiYmlSd bvkdWTXLGEp8h+HY1Qq451NkmDNwtxhDP34XVUqQdueKBRw5Gt0hQUr+dRRxRhhgtYHr asFPHZFAN5uhsSzwnWYlt0/v6BfldWCJLDMKNdyxn2WKDGEJ4sez/a0vT01+9nDCpQPK UU/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KWZOzPpx; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id z8-v6si14111773wrv.127.2018.09.18.12.12.46; Tue, 18 Sep 2018 12:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KWZOzPpx; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4A68E2678AB; Tue, 18 Sep 2018 21:12:45 +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 3AA432678B3; Tue, 18 Sep 2018 21:12:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by alsa0.perex.cz (Postfix) with ESMTP id 374602678AD for ; Tue, 18 Sep 2018 21:12:39 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id k21-v6so1455959pff.11 for ; Tue, 18 Sep 2018 12:12:39 -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=WQ7uc8QWGGpUa/KSmiOUSgVzUK79FikiAbcCtPnd3Jk=; b=KWZOzPpxBN5FUqHV7N8wPBqKBsQbI6UJ+QdC8c4ilFkdB6c80GxQs3y6Alp2tmi6TK 8e1EbDJGPx2PyQf5QyIvUXTbhAjMajXyDrDUzvI/02dj5+lkzf+GhLMzaqzfHuYzbmyc OmMD5cgJcWGnS8NdCayTUWQxBSyL2HQPfvL7M= 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=WQ7uc8QWGGpUa/KSmiOUSgVzUK79FikiAbcCtPnd3Jk=; b=eaXCXVi5Y4MOobb1RxNf2l1pNCslcFe82X8nUXfrHr/0gLBzGzXbhP2JoOYI3ap4EF do3rkgnYJiE8Z4MTBbWLHZjZhd8m5xHG7PixWhjVxqVMmXjByQBJUUnnTHv3yjM1eOKD M011bpCv5jCcnr4RI/Uug5Q1N4DNSqi5kpyf9I633e/2bPqsUWZVHnPt6zbxmLkepuFJ 7Gax6qlKYu7bmsvA2zLAtsdr88P4mJ5HeqopLubPwZGudofDWQ7m+eGsShznJopS0Bha lZC+o1PlLGhmQvCrdDRnRhHnu26kMWAGA3cAplPEawA+vnYi+PzJ3bphGpjeDbgYOUj4 6jCA== X-Gm-Message-State: APzg51DEbxwwFE3ntM43VNRWyG7ZkGdHtZUXuIeKRPSf5dr7miBmOHLV FtULF3w5wa16HPPoFpvmk5brbQ== X-Received: by 2002:a62:9101:: with SMTP id l1-v6mr32211921pfe.226.1537297958472; Tue, 18 Sep 2018 12:12:38 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id s73-v6sm34113770pfi.154.2018.09.18.12.12.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Sep 2018 12:12:37 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Date: Tue, 18 Sep 2018 12:12:33 -0700 Message-Id: <20180918191233.17178-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 2/2] sound: soc: wm8903: Cut gpio_base 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 This variable is only used inside the file, and we should never hard-code the GPIO base, so delete this. Signed-off-by: Linus Walleij --- sound/soc/codecs/wm8903.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 23e43ff40ded..545512dc4c45 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -144,7 +144,6 @@ struct wm8903_platform_data { int micdet_delay; /* Delay after microphone detection (ms) */ - int gpio_base; u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */ }; @@ -1876,17 +1875,12 @@ static const struct gpio_chip wm8903_template_chip = { static void wm8903_init_gpio(struct wm8903_priv *wm8903) { - struct wm8903_platform_data *pdata = wm8903->pdata; int ret; wm8903->gpio_chip = wm8903_template_chip; wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; wm8903->gpio_chip.parent = wm8903->dev; - - if (pdata->gpio_base) - wm8903->gpio_chip.base = pdata->gpio_base; - else - wm8903->gpio_chip.base = -1; + wm8903->gpio_chip.base = -1; ret = gpiochip_add_data(&wm8903->gpio_chip, wm8903); if (ret != 0)