From patchwork Thu Aug 6 09:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 247476 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1316055ilo; Thu, 6 Aug 2020 02:54:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBmB2ZRjqZe91nLzrNIezG2f9KAz2eJX9RBNLDN81lJTKmRhnY2FEDiNApH+Z9Hso1oUvb X-Received: by 2002:a17:906:248d:: with SMTP id e13mr3373174ejb.169.1596707655336; Thu, 06 Aug 2020 02:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596707655; cv=none; d=google.com; s=arc-20160816; b=lJpIqTq6UjG0NnsFaOwnRuZra/+qkvJk7bn42XXyCLUmE9+5lUncdGuLaPTzuNXSS2 xLXE/0LubsNiBrsus6zpw/La2s9EdiXUYVfNqqbD+74pJQlRJ4CIkfglQWYTqs/o+LX5 4b9PKMcotmS6gv78Ojbvmx5WLJ4xw6aGdEl+ETTuf/T578fX8E+28UX0W3OxwYjyID+5 b+x2IUIBZuQFBEeVQBRBpbQB+EwPMmHz5eOygAMLan0b+V1JSlicBVZwYUevEmO/4sms 0KBiOj59/5Xfhl6aYJEaIdZfWqljG//kAHhDpRtLZdb0c1/9b+T8FwD/ONwFStQJlJLD tNFw== 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=NWIXlHm6dmu3Mr/LjPf41b0etEmQpQFCVPVCIIhmwS0=; b=gfQOIcCgNgkMDgvV8AKnk9cBgyOFEBuB9TYs6a7z/HyoBDt+iC761BMP8grv+Gl5L4 k73j15ksXQPtpcvwBK8SDjc/cO5OaHUMgqCmzW/lxsnSiFGY9X1Ga8KIYphpRnKiFnZu SIkIf2RANgs+/FeNqYTjAq0TwUUWgaeA17Ilxkq0RQv8nz52yX/P6PF5CYVG3bEUzeqF xrumpBcIMsxF4LMQOqIL3GjaR9yaNQKbeDyOXksDX0sk0QcnBSKFeqV2qWCykz2GwSCH xXVOPI8oMZ+tZpZ+/KkZRJNnAUzemJdJQmYoKUEb0j/+2Z5AdOe3zFIyFmScyjanIRrr BVVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DmPSGxX3; 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 a20si2883834ejx.257.2020.08.06.02.54.15; Thu, 06 Aug 2020 02:54:15 -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=DmPSGxX3; 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 S1729125AbgHFJyN (ORCPT + 10 others); Thu, 6 Aug 2020 05:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729275AbgHFJyI (ORCPT ); Thu, 6 Aug 2020 05:54:08 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86FFC061757 for ; Thu, 6 Aug 2020 02:54:07 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id m15so25126298lfp.7 for ; Thu, 06 Aug 2020 02:54:07 -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=NWIXlHm6dmu3Mr/LjPf41b0etEmQpQFCVPVCIIhmwS0=; b=DmPSGxX38caBJtao8oTC6CnQ2I+av7LNktYoZiJkMekE8r3UqSBfWYNjJFRfRD6+6I vm1AStMj6YGeon4yH6s1sLF/lkLF3jKlI8IsfACfQcodsXFDxkmGvpMTvlEoe5sg1BkR nvKR1N/dHQRcNjpr4IuOrrdo5uynm+eR8pTmrq8jnd1psLUypZVOI3l7udNaaPrz4qjK EkLWjCi88aJlbVXHsIjiheUP7XXOXC2nTXmBNE8b0t58CEpdX/QRSo3cJR+Db/GdAZUl +BPE+bFgm4CbTUFBR5qh4oqNHwI08pUxmozWz5yneHTCbF/+/VyXSUlADOqVHkFYVj6S KAuA== 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=NWIXlHm6dmu3Mr/LjPf41b0etEmQpQFCVPVCIIhmwS0=; b=TM9MVAciDmqheJaywkStD74eKw0WdXeVl1Y4INocncZIfF5oh+9XiZfmx9YiKxBMcf ZTfK6GSVvnKlWVhLypgitYEasCZW8d6A7qNy5N09FRu0+MaBfb4ELkPGF9/yctyIHfbv N6BMO6QQhcWAMPWt5olJvuntjNOmzyZ5cTGhJZ5oTcz4gJ8T5EAdbW5zR4teuZFp4Jua P/zABji1J5lLcoLzXRRF6TATOQkJFFGKdy2+D4W9LpZuSQMkWeU/jCjRjKNZoCCPIxCK sGjJWi0aG9zsM+TCW2cKLHQxs7MlI5XW9ZfD8pAkCnUngWWv1DOK7H0bkZal2Eq+2OSu Np3w== X-Gm-Message-State: AOAM532/Sv+XqcVF9O4v65nD+vbrODUqt9V1FNtT7nVgDhGl+o2rcxFE 0KLLz62JQZ4SbchOWUBYwfn/1Q== X-Received: by 2002:ac2:5f64:: with SMTP id c4mr3673001lfc.170.1596707646207; Thu, 06 Aug 2020 02:54:06 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id y19sm2454733lfe.77.2020.08.06.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 02:54:05 -0700 (PDT) From: Linus Walleij To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, Linus Walleij , Robert Jarzmik , Dmitry Eremin-Solenikov Subject: [PATCH] power: supply: gpio-charger: Convert to GPIO descriptors Date: Thu, 6 Aug 2020 11:54:03 +0200 Message-Id: <20200806095403.974684-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. Cc: Robert Jarzmik Cc: Dmitry Eremin-Solenikov Signed-off-by: Linus Walleij --- 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 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