From patchwork Thu Aug 27 08:48:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 248433 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp232055ils; Thu, 27 Aug 2020 01:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjA239auSHvQ8vhlFfOiGfhXRUwK296Y2FDhJ85X8KqnF2U7WVXBuEZMUhTHhYIRj/F2M7 X-Received: by 2002:a17:906:64c6:: with SMTP id p6mr19491766ejn.348.1598518249524; Thu, 27 Aug 2020 01:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598518249; cv=none; d=google.com; s=arc-20160816; b=s4iBJC4T4K4c6U1WswvRjHQr5EdvW3ed5dLtNWjyw4HvKJcwmqi4R99ieiJT680Vut TW1le4lb9JSQWYLM+MsU8BZs9iDIBaf1xr2ymxTMhnVujIgVE41pE/qPQYpSk8jxUd71 63j1BRXZH1reMNP4oKwjwenbVE1XLamDlOdSPPgfhHxteBCcjgsZPR9K85129sHfUkgp 0asz1x3ZOYZVhVvHz7sQKlrGQ6cviv8uw3uMO7Xqe1Q/Jx2giKi2QA53wLj6KXZAEOEU 0Ih0n02LnClkfVxEx321E5n1H/MwqC0ZFg5eoJtwnJBAUaaQdRRc9VfF2G/9lcOS5kBj 4PhQ== 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=bQaUG7xBh2HjSNskZY89kjazXkJDEmZNO2sZfI4TKyk=; b=vTLKMbOHdh1aKDd6KmsVtWCWvyUIBEapPJJlStec0Gf32j9RmLdTg4fOx3Maxkn09S PDNM1fjiPSDvdq4IF1xdZovfVQwdWLU9jQeix+nZAqUS6GHFxzkF2bQn/CFmusuVNjX/ E4++0tQnJyOr6auRCYxRCMJO5Aut9Vac5Vn7EwlRCAIm2GuoWaoadF5ivjzJVjJZ+/2T IglgiCZTF/uQdYN831p9RpPr+2Y/fmTnWnsEl5a3OHRqj0eOa3DeoOPCf/+H74vVJX9i d0L4/ag5N9rMiMANBdUrY5XDUFi0nruORbKJymSdC8ViCJ9XZsRQC3f2zH1OdEb83Nop oEhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmgdF1iN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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. [23.128.96.18]) by mx.google.com with ESMTP id h6si926555ejc.567.2020.08.27.01.50.49; Thu, 27 Aug 2020 01:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmgdF1iN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S1726395AbgH0Ius (ORCPT + 10 others); Thu, 27 Aug 2020 04:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgH0Iur (ORCPT ); Thu, 27 Aug 2020 04:50:47 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD8BC061264 for ; Thu, 27 Aug 2020 01:50:46 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id f26so5495745ljc.8 for ; Thu, 27 Aug 2020 01:50:46 -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=bQaUG7xBh2HjSNskZY89kjazXkJDEmZNO2sZfI4TKyk=; b=QmgdF1iN6lMcE8BhMHvgKf3D4iGv0vkpTtNJ0kwg745FZJp+6w2xLfGFe9m/fUNysY EfT8Q8WvMYE8RdPy3xTr4NR9XN0AvFjML9WiNkVYSKucJppc6J2L0XlpJiUgm/Pr8D6s V6yzdqaFtKDI6afEQ56fMZH37HlbVmjQ1ZWKNJpLROc5Px6lGs4AQGYBneaOGapObD2B whhLHldR1JPp87fw7iHuIJrG/cy9Z3cvePIXZph5hzok/ofYUyOmaQKmr32pyaDAR43L cHoo+xZ81AkPtKWIUR/5YaowQgdYjMo2v9UoQ4kIlz30ndoYdUIJhJa6EgSJjQaQYnez 7acg== 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=bQaUG7xBh2HjSNskZY89kjazXkJDEmZNO2sZfI4TKyk=; b=bM/27AOch9cmrzhnlBXDsWe3DNMVZhz6u8o04pJPGP5n3ABuE799p9oQ7grGIhtlkl n/0py6iUlQAZqExFr5WFkRC9CTW2n1XGDK8T/z4a4qQ4W3nkryVORyYlAv05E11vIxhg VBOIIESvdQ5PlqZJZbuHH/WUOeiWQs/XfFEORQLHSCkEEBDXbDOWmn14+q1o3cMkmsM7 mEWHENEgAwiabTZhNEjSuwTR1s0O+tDfpf/W20FotxrnTMSh7g/SlkNqdfEHIcDAcS99 74sdfLnT40kLkKq8OkFK2w2b0hpYPLqV1jxnKeMnEFmQ/WPU3FmG7rfnnYclEOqn+Qcg mnVw== X-Gm-Message-State: AOAM5313/NSpHdZ5MPQ0lAXJ+zPvrXtEqXB0Xw+I6fQFRDCmmdk4kPu5 f4UGk1tVSQ94EFaff0Fu0TBIjg== X-Received: by 2002:a2e:92d0:: with SMTP id k16mr8568440ljh.70.1598518245058; Thu, 27 Aug 2020 01:50:45 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id g63sm297611lfd.28.2020.08.27.01.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 01:50:44 -0700 (PDT) From: Linus Walleij To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, Linus Walleij , Robert Jarzmik , Dmitry Eremin-Solenikov Subject: [PATCH v2] power: supply: gpio-charger: Convert to GPIO descriptors Date: Thu, 27 Aug 2020 10:48:28 +0200 Message-Id: <20200827084828.190841-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This converts the GPIO charger to use exclusively GPIO descriptors, moving the two remaining platforms passing global GPIO numbers over to using a GPIO descriptor table. Signed-off-by: Linus Walleij Cc: Robert Jarzmik Cc: Dmitry Eremin-Solenikov --- ChangeLog v1->v2: - Rebased on v5.9-rc1 --- arch/arm/mach-pxa/tosa.c | 12 ++++++++++-- arch/arm/mach-sa1100/collie.c | 14 ++++++++++++-- drivers/power/supply/gpio-charger.c | 26 +------------------------- include/linux/power/gpio-charger.h | 6 ------ 4 files changed, 23 insertions(+), 35 deletions(-) -- 2.26.2 Signed-off-by: Sebastian Reichel diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 3d2c108e911e..431709725d02 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -369,6 +369,15 @@ static struct pxaficp_platform_data tosa_ficp_platform_data = { /* * Tosa AC IN */ +static struct gpiod_lookup_table tosa_power_gpiod_table = { + .dev_id = "gpio-charger", + .table = { + GPIO_LOOKUP("gpio-pxa", TOSA_GPIO_AC_IN, + NULL, GPIO_ACTIVE_LOW), + { }, + }, +}; + static char *tosa_ac_supplied_to[] = { "main-battery", "backup-battery", @@ -378,8 +387,6 @@ static char *tosa_ac_supplied_to[] = { static struct gpio_charger_platform_data tosa_power_data = { .name = "charger", .type = POWER_SUPPLY_TYPE_MAINS, - .gpio = TOSA_GPIO_AC_IN, - .gpio_active_low = 1, .supplied_to = tosa_ac_supplied_to, .num_supplicants = ARRAY_SIZE(tosa_ac_supplied_to), }; @@ -951,6 +958,7 @@ static void __init tosa_init(void) clk_add_alias("CLK_CK3P6MI", tc6393xb_device.name, "GPIO11_CLK", NULL); gpiod_add_lookup_table(&tosa_udc_gpiod_table); + gpiod_add_lookup_table(&tosa_power_gpiod_table); platform_add_devices(devices, ARRAY_SIZE(devices)); } diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 3cc2b71e16f0..bd3a52fd09ce 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include