From patchwork Fri Apr 12 07:14:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10897315 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 925BC17E0 for ; Fri, 12 Apr 2019 07:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FFE428E45 for ; Fri, 12 Apr 2019 07:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 618EF28E52; Fri, 12 Apr 2019 07:17:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 F29F928E45 for ; Fri, 12 Apr 2019 07:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfDLHRD (ORCPT ); Fri, 12 Apr 2019 03:17:03 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38404 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726682AbfDLHRD (ORCPT ); Fri, 12 Apr 2019 03:17:03 -0400 Received: by mail-lj1-f196.google.com with SMTP id p14so7879117ljg.5 for ; Fri, 12 Apr 2019 00:17:02 -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:mime-version :content-transfer-encoding; bh=p61PfbIBOb/uY8rv7BKR/x17KfJY1pfrkFysGITMsNc=; b=JcoQ0Uckqr+LM48xL4rHdYIlP3JwXqDTmfrLIAvOyvTQ0xcb1u+q5PPAPs8ua6bx+a +lzkTGuLqB7nYTvJaoZfOtlsLsrKrtI+iULvhYrjiu0qbTye3yZ9ilwSmPfnOPgAssQw WyLhRphVpOtXyA72IYqfbLkuEK+pxi+k1+OpAkZExq1osWVOBNdsYxeqM2OTuGYPGZy4 FhDIalffE7tSHA+FAfi4/NeD8w73OneuGWvhe44Q+s0QSLxJ2M9DyMu9GavPJdd3XyNb XUM4rzWpuXDsVg9c343rvxuX+NF0nu0al/qf8wJxlThj4JKnPIIicizHzshd2l/SIvSn 4CsQ== 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:mime-version :content-transfer-encoding; bh=p61PfbIBOb/uY8rv7BKR/x17KfJY1pfrkFysGITMsNc=; b=UmLgqpObCXQh9FmMMc4lmCFTaJT2ech69y1VR6lju9iWloaM0JzRWpPFPZHC+ZmHLN HhF4z1MChysbsAlgCOtzabfKCXygpC7ax9UkGVwhZWWlrJKRJfEztAuL+a2MbejfoKiF G+lPAqa+XvzV2vjmEgmkQvRgCTSu87r1FLahTdw9TzAGJN9xVs8hol/ZIWlpsdrgM+pK er72xv7BsBCrEkt4cQzhT3TY9YIY5vkbslziVIrLD7IrVe7fHowfdjqcr3ESNoxoGVPP k2njMBlN+NmvM8f0IywGbDIYKUCZde218hqsTESZk0B+ZbLJf0fcZn+e0Wj3gM7vuz8C DbxQ== X-Gm-Message-State: APjAAAU2RTzoy3+ddty1t/91tA6CjTkUhih6Q2kpjp/l5HGkNnUz37AG /d+5ADXGbOuJqX4j4eQm7/uV7A== X-Google-Smtp-Source: APXvYqzO4Oq2MFHWFVQsE8FOqyyFxHgUWG3AZzVkQL3acyFprO802gowBxbCXaItJNIsem7T6u1IyQ== X-Received: by 2002:a2e:9e47:: with SMTP id g7mr31140306ljk.48.1555053421540; Fri, 12 Apr 2019 00:17:01 -0700 (PDT) Received: from localhost.localdomain (c-c5d3225c.014-348-6c756e10.bbcust.telenor.se. [92.34.211.197]) by smtp.gmail.com with ESMTPSA id q2sm7925455lfc.76.2019.04.12.00.16.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Apr 2019 00:17:00 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Krzysztof Kozlowski Cc: Bartlomiej Zolnierkiewicz , Charles Keepax , Linus Walleij Subject: [PATCH] ARM: s3c64xx: Tidy up handling of regulator GPIO lookups Date: Fri, 12 Apr 2019 09:14:58 +0200 Message-Id: <20190412071458.23122-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- This modified patch from Charles is sitting in one of my regulator branches. Krzsystof are you collecting S3C patches? The MAINATINERS file seems to be lacking an S3C maintainer currently... --- arch/arm/mach-s3c64xx/mach-crag6410-module.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c index 76c4855a03bc..937d0a83f8fd 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) }, }; @@ -408,6 +413,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);