Received: by 10.192.165.148 with SMTP id m20csp3177281imm; Mon, 23 Apr 2018 01:50:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/V19Jg+t1Ek7Ao6NRmd9Gk4BArih50ZpLEVbHWGLaGp5hGOSpHjWdirYyPDWWtu562wL91 X-Received: by 2002:a17:902:10c:: with SMTP id 12-v6mr20172111plb.252.1524473415083; Mon, 23 Apr 2018 01:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524473415; cv=none; d=google.com; s=arc-20160816; b=QJjtM/FDO+zbsSG0IXFrMSD02iWJT64kIbLlLsPeeC19vddGoVD/xWV9YMvFnbE9VX 8b7KeYS6AEsGwS7loC2MelmjxhmWlb/4yFR0LK0vE3GaMyUxhgnzsG6dgYa1Y2Qtwi4j t4RJhQSHktqhl0oCNLUocXkyAtxogGlGDvSmOIDRhoQo2UbnClK1i6OAlVjOBjXlBsPD 38RSeerBa2SRye4T7bT09lCZcVwnsXS5y4THvDLV2RHBPSfmR1PAWxowG7rfGSX9oNrD +ROIC27o6k3jd70Hn2GcnFUxPqEncjdMnxLxclaQZ/mGNIl+xgfDNqCzZwpHxY0y75oM DDLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6GeMzIufDk7pwpIl4U4PZYQMfjY0JoQ/+kxjQ+L24CM=; b=EF84L0kwZUFAdJOSJSWIael3ZCRRtYKLMNOPh0VrHw/tFxyEofKSaOuY5MtBwnfbky lg+wkBBMGz7NsgyWlEdHdrxGqFyoLkVLyhECgRULn8pUehofhtpJ2EHriuOE094MssOc UdGhnN3G/8ufG7iNMDeB21YowvYQ6QcIhwZ2wO6tPrOyf36I1klWqS3IwKWPDJPSSZy4 GWxLwJreQEOxtf7VI+UpSE5p9rPXWXUftHKNTIRSyOxA9CDOgwvSfHBYFwWvy/tbjUpj HiN2SSBmTPEmOK5GLdjqlvK1S+6MVhjS1jezim4pqzsawEqOrlBdaR6kJcsthg+oV94G 0ggQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si10455659pfi.117.2018.04.23.01.50.01; Mon, 23 Apr 2018 01:50:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754559AbeDWIsw (ORCPT + 99 others); Mon, 23 Apr 2018 04:48:52 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:48828 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754312AbeDWIsq (ORCPT ); Mon, 23 Apr 2018 04:48:46 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3N8hhE6031354; Mon, 23 Apr 2018 03:48:41 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 2hg1qmaa2n-1; Mon, 23 Apr 2018 03:48:40 -0500 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id 5E220611C8C1; Mon, 23 Apr 2018 03:48:40 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.301.0; Mon, 23 Apr 2018 09:48:39 +0100 Received: from localhost.localdomain (algalon.ad.cirrus.com [198.90.251.122]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id w3N8mdeG012541; Mon, 23 Apr 2018 09:48:39 +0100 Date: Mon, 23 Apr 2018 09:48:39 +0100 From: Charles Keepax To: Linus Walleij CC: Liam Girdwood , Mark Brown , , , "Richard Fitzgerald" Subject: Re: [PATCH 03/18 v2] regulator: arizona-ldo1: Look up a descriptor and pass to the core Message-ID: <20180423084839.hs5vrlgo4gzttuj3@localhost.localdomain> References: <20180422230742.3729-1-linus.walleij@linaro.org> <20180422230742.3729-3-linus.walleij@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180422230742.3729-3-linus.walleij@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=554 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804230096 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 01:07:27AM +0200, Linus Walleij wrote: > Instead of passing a global GPIO number, pass a descriptor looked > up with the standard devm_gpiod_get_optional() call. > > We have augmented the GPIO core to look up the regulator special > GPIO "wlf,ldoena" in commit 6a537d48461d > "gpio: of: Support regulator nonstandard GPIO properties". > > Cc: patches@opensource.cirrus.com > Cc: Richard Fitzgerald > Cc: Charles Keepax > Signed-off-by: Linus Walleij > --- > static struct arizona_pdata wm5102_reva_pdata = { > - .ldo1 = { > - .ldoena = S3C64XX_GPN(7), > - }, > .gpio_base = CODEC_GPIO_BASE, > .irq_flags = IRQF_TRIGGER_HIGH, > .micd_pol_gpio = CODEC_GPIO_BASE + 4, > @@ -237,10 +235,16 @@ static struct spi_board_info wm5102_reva_spi_devs[] = { > }, > }; > > -static struct arizona_pdata wm5102_pdata = { > - .ldo1 = { > - .ldoena = S3C64XX_GPN(7), > +static struct gpiod_lookup_table wm5102_reva_gpiod_table = { > + .dev_id = "spi0.1", /* SPI device name */ > + .table = { > + GPIO_LOOKUP("GPION", 7, > + "wlf,ldo1ena", GPIO_ACTIVE_HIGH), This should be wlf,ldoena. > + { }, > }, > +}; > + > +static struct arizona_pdata wm5102_pdata = { > .gpio_base = CODEC_GPIO_BASE, > .irq_flags = IRQF_TRIGGER_HIGH, > .micd_pol_gpio = CODEC_GPIO_BASE + 2, > @@ -264,6 +268,15 @@ static struct spi_board_info wm5102_spi_devs[] = { > }, > }; > > +static struct gpiod_lookup_table wm5102_gpiod_table = { > + .dev_id = "spi0.1", /* SPI device name */ > + .table = { > + GPIO_LOOKUP("GPION", 7, > + "wlf,ldo1ena", GPIO_ACTIVE_HIGH), > + { }, > + }, > +}; > + Might as well share the same lookup table between the revs since it is identical. Thanks, Charles