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: 162091 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp282491jan; Fri, 12 Apr 2019 00:17:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2gOZb0HtYoaESjKzWV8EB49XyMN/6HoAKEBX+pDGOEUjmydDg51KVFV0cuwAM87pMVALD X-Received: by 2002:a17:902:e4:: with SMTP id a91mr37049768pla.2.1555053424079; Fri, 12 Apr 2019 00:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555053424; cv=none; d=google.com; s=arc-20160816; b=zk/0oc2RFo9+Zha0tfTpmsODM7bxYBOpbqF786LlKZpLTbK2OCRZmP+IoPmpJrabNc bIIkiqJ0QtgC7zeSOTRpQQZO1nJWpQErALVpwwhwwAsRaz8mdSD/fPUlNc2Nc2DMURSi 2Fe05OZPrs//rNvYZTxMM+rcNJy4OI4unaxr20nWSvR89AkjJSNj338wy9C4WzbZUu2+ HQbtQVK8ORHZ8E+utz2rzxd6YxF+hrGlU8V5bBH06Pwy+Oh1nxReqYydLzONb61Z2fDD q5avJ7ERM34BiAPDQZG1EdLRNyAhMORXPXIIqrarvoaZqFOdqESCpw2j9AJyjnE8AeND xacA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=p61PfbIBOb/uY8rv7BKR/x17KfJY1pfrkFysGITMsNc=; b=CVNHeL0szDCrFe17+6Qk3YxOLzVBcdfg7YcpTeda7DRkjnVDULCGup8+zH0uYqpdTh moOslrkJQFhS8JS14Wzlj0EKGtdFB2e8EVLawGhZAlRd03fXJwCjYktIts/B9KKujZsr US30aBMY8+29ZxDd3C176EnQ6KXW025Wzwfh1AsQj2r+NLM3ehQK3i0rpMjarOSfzKdx /g2VKgw1h0WNI6QoSLu2bE0dozT1u/eT2TR+nnqWFKcOj7is//5iRcwNA+GLBI3XKgYl Rbe7hE+R7BPivrLIpHYSUGXgIygiC9j3AfHoW0BA9pzfnVGdbghdnWPNmyZWqV0hCbWP gF2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JcoQ0Uck; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 r9si33864116pls.323.2019.04.12.00.17.03; Fri, 12 Apr 2019 00:17:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=JcoQ0Uck; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S1726728AbfDLHRD (ORCPT + 3 others); 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-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 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(-) -- 2.20.1 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);