From patchwork Mon May 14 08:06:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 135676 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1440310lji; Mon, 14 May 2018 01:08:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrbFLIix9rDjNxlgoEsPrSsd8eWvWVoyykb9zV2ugT8xsdjzkeHfUz1C4Ufgk7Nr52Ut0Yv X-Received: by 2002:a63:4004:: with SMTP id n4-v6mr4302614pga.248.1526285296663; Mon, 14 May 2018 01:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526285296; cv=none; d=google.com; s=arc-20160816; b=cPAFsMhVEPqlSOs+D40xqciLFKHzWDX0NdeXCimvou97zINc80r7Hroacuw7fOe21O 0nblZbhyI+0dwIDauFn5erzrOmtv1dNlMrVE6qiw0S0V1kIJGZKJrM43hzG7R265I2hf iTx4M+bKI6QwqWQhFFtCGLHg46WO8gUzDqwe05Ns5TAGKe/QBU0RJrW9fnkr5KLc/JY1 /d4QUbNLPfKducPymtvY5abUd4Az+84qzZ/j0tXYRE9ZMiKL9k7Ad0Tu4UCNIezTx7r2 f2q3Ysdbrv9TPpxozPCHEqwbqw8ScAv9+WNCiVY+LdRziSzkfuuoyRujGn7UXr5vcroS 1fTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PBEaF+OG1gZgFtTHMsGljuBEAx17IQCDRITqW+e1xh8=; b=vEPoxZTXC/NWVTONwPdPCWubbadiFgO/KKO0pAdLjasrhH13eCKOLidicKWWPB9fZ1 FMZIGYueAaKm3T79+oH8QA714NfgYojJI7Yf8QvH+2PLGtyzDv8LJYTXWIkgWnLcms3f m1k0uzV4qjpyNv6hMwYNMCryxVC11auE4/jC6np1qsWaMPCrvmQWre+p0Dqg+d9y4UdK KNDSWKwy2OLAMWa6W1JtQPe7MRYOMvPltzOJG+Hcar43Tz4aJkAz9+lsAWNPOfkwjnDS wyVoIH2LlAfUTKwTVMxe/1tK/kmwv2vN0EG4SDnyYMwtShs4x4bKzbQ1Id1b/gcTcn5b ydLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xr6frUf5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2-v6si8785681pfb.1.2018.05.14.01.08.16; Mon, 14 May 2018 01:08:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Xr6frUf5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752454AbeENIIN (ORCPT + 29 others); Mon, 14 May 2018 04:08:13 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:36108 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbeENIHd (ORCPT ); Mon, 14 May 2018 04:07:33 -0400 Received: by mail-lf0-f66.google.com with SMTP id t129-v6so16538463lff.3 for ; Mon, 14 May 2018 01:07:32 -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:in-reply-to:references; bh=PBEaF+OG1gZgFtTHMsGljuBEAx17IQCDRITqW+e1xh8=; b=Xr6frUf5cnEDYqTxmLA7Dezz5Vw/B5qWmkKxwzNAMeQ7M+XMKaruGi/v75cV1B+uLU UdbZVPNNdoG9TyUNdo77cLyYvF3CLI/D1xQTemDTqaImYPLiVly24xCfUNo9UgHdAVpy FxDp2wemKrH+BLtBh5NqQuKKFb2Y2fgHHcYAQ= 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:in-reply-to :references; bh=PBEaF+OG1gZgFtTHMsGljuBEAx17IQCDRITqW+e1xh8=; b=AwJConGxWznk99MUMi/07nKp4HIZ+V8yU6jIYNjKCKrWWX2WoeSa9Vg5o5ynsio7aG aLMBgvvbtvCe3+C23BbY8N1N/uSaJYNSXpyg2doUTZIi2rIvb9gDt5T68TYmO0CIVSk6 1V5dPesx6F4Bz5dbGQv5fw6h7UJwSJjv4moDdq1EpAdqzyDGFP3cLEQVyPndW209+PQc vSNBR+DF2BMieeZG2vm8M8gJffV0JngL8gsj03X2j1f7vBbIxuHg69thjaMaEDvv84t5 a9O1CgMhtp0+heGOmq5uUD/CLkc6CCJBS0qF7WVC2DimTcf47rrMiK7rhdIO4C0psJp/ HNWA== X-Gm-Message-State: ALKqPwe/1YBmByV09ghUR2bWAJEea0giZgERWJNqxRZWk8NNh/QW2Rr2 PHZGjkQO/NAcRBqZAMSoatBtmw== X-Received: by 2002:a19:b55a:: with SMTP id e87-v6mr7723655lff.54.1526285252019; Mon, 14 May 2018 01:07:32 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id s4-v6sm1725265ljh.9.2018.05.14.01.07.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 01:07:30 -0700 (PDT) From: Linus Walleij To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Charles Keepax , Linus Walleij Subject: [PATCH 19/19 v3] ARM: s3c64xx: Tidy up handling of regulator GPIO lookups Date: Mon, 14 May 2018 10:06:40 +0200 Message-Id: <20180514080640.12515-20-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514080640.12515-1-linus.walleij@linaro.org> References: <20180514080640.12515-1-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Charles Keepax Rather than unconditionally registering the GPIO lookup table only do so for devices that require it. Signed-off-by: Charles Keepax [Fixed up to also handle wm5102 and wm5102 reva] Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Including this in my patch series. --- arch/arm/mach-s3c64xx/mach-crag6410-module.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) -- 2.17.0 diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c index 76c4855a03bc..56ec212442ad 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c @@ -328,6 +328,8 @@ static const struct { int num_i2c_devs; const struct spi_board_info *spi_devs; int num_spi_devs; + + struct gpiod_lookup_table *gpiod_table; } gf_mods[] = { { .id = 0x01, .rev = 0xff, .name = "1250-EV1 Springbank" }, { .id = 0x02, .rev = 0xff, .name = "1251-EV1 Jura" }, @@ -362,13 +364,16 @@ static const struct { .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) }, { .id = 0x3c, .rev = 0xff, .name = "1273-EV1 Longmorn" }, { .id = 0x3d, .rev = 0xff, .name = "1277-EV1 Littlemill", - .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) }, + .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs), + .gpiod_table = &wm8994_gpiod_table }, { .id = 0x3e, .rev = 0, .name = "WM5102-6271-EV1-CS127 Amrut", .spi_devs = wm5102_reva_spi_devs, - .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs) }, + .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs), + .gpiod_table = &wm5102_reva_gpiod_table }, { .id = 0x3e, .rev = -1, .name = "WM5102-6271-EV1-CS127 Amrut", .spi_devs = wm5102_spi_devs, - .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs) }, + .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs), + .gpiod_table = &wm5102_gpiod_table }, { .id = 0x3f, .rev = -1, .name = "WM2200-6271-CS90-M-REV1", .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) }, }; @@ -391,10 +396,6 @@ static int wlf_gf_module_probe(struct i2c_client *i2c, rev == gf_mods[i].rev)) break; - gpiod_add_lookup_table(&wm5102_reva_gpiod_table); - gpiod_add_lookup_table(&wm5102_gpiod_table); - gpiod_add_lookup_table(&wm8994_gpiod_table); - if (i < ARRAY_SIZE(gf_mods)) { dev_info(&i2c->dev, "%s revision %d\n", gf_mods[i].name, rev + 1); @@ -408,6 +409,9 @@ static int wlf_gf_module_probe(struct i2c_client *i2c, spi_register_board_info(gf_mods[i].spi_devs, gf_mods[i].num_spi_devs); + + if (gf_mods[i].gpiod_table) + gpiod_add_lookup_table(gf_mods[i].gpiod_table); } else { dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n", id, rev + 1);