From patchwork Wed Nov 24 23:04:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12693594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37ACCC433F5 for ; Wed, 24 Nov 2021 23:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TdyD849AgvO/QL4SPMEF547JF1shT0qkdmE2x7rKbDo=; b=d3vosmO7cF4COw oQXQ9HWqaEnPgRyCmr4SegkgRGyl/Az1o0qHxqP25YNzTRJMgQK7QAEVJ7l+QwY1MsMm9sxfrF/He jiTqtYrEw7qBuSK8gzEliqGao+kRLlrS3TAH/objboYV2EmVQliOE2Mi+gijjveBQUkGnVwF7a8z9 sgGTTmAc1U8G9YvRFh1Xv7CAMaRLzNX680o/ZNZPCaWW/BN70NY9x5hbrzCU114sCIuhiIBp9D5uc NVghKONUJDPRMpTgRBeSL3yUmUgoELMTZ36uqD5gr7mwwNaagvW0K5iIYgwVKGKJId7yTczdOQbG8 BYHSwwErJCV8W7evnIZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mq1KV-00610A-72; Wed, 24 Nov 2021 23:05:31 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mq1Jy-0060tl-NV for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 23:05:00 +0000 Received: by mail-lf1-x12a.google.com with SMTP id b40so11221330lfv.10 for ; Wed, 24 Nov 2021 15:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YVkTUK7QkjIeFdpB9hVLrTY5BoIQjyOYtxWUGwbvJys=; b=kL/fVgVn10AbM0lKYm76V+9I42RK7/GvBIURJGR8n2ZR4lXDzve1AorLsLZ6GvintH Ml8g8BKIMgZYfaNyI1Mw6jYiq+xc4mnote0sT054Cjd0jTLfvmQVyNFryxYdRLDgFTf2 nGiWvuKURLzZ6MVUyUEIVRZsaOS69rOClS2qPukxGaEljXP/uS2zgdrpNDVzrCO64sZ3 b1WQBeEt+UKjU/K8/Yg0VorHNDjMnvqJgk4SMVv5JVCnd5LbQ6R/VpJ5K8+gBdi/cP4z sOpwGIEA5JAL2XG/uAHpFHEtoscF6nP8gGON9Qr07D1VJYIu63H/b+uBqQb6SKlVc3fE IqPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YVkTUK7QkjIeFdpB9hVLrTY5BoIQjyOYtxWUGwbvJys=; b=FjgpvCT54A+fWXuTtUSq4VLDyG3ewi6B3HT9RlNbH4hLCtdajRpQW9V2mOBk7P61qS BdQ4km6F+dHVNoH4zNlkV9cbObRixDsMnywmKodN1AmI4hKQ8ly8+zjelnqlkL8VKolp Ooph/rZT9DLo5MIV7R281n38ZiELHCr6NYa6nQB5ZTCEDV7druW8HfENTF7n70ub3OW1 nz7y9ySqrukY4z5e9K6U4zKnIfIIyGP64EZ5gmmbm0+SAvbIIO4PIuQr73kFPAgEHSl/ 2IUxylKfUQ12jewFEA0aoFKCdlYHQqBFTbKZ22oKiFaYHP7xbcypNmqJEO7CjzORBxlx D1Qw== X-Gm-Message-State: AOAM532Qu0J75yabANy05gJwFqsn+InadXMtzATSA2/SD5Q0DbvxaD03 q35rgsH48s3EPRYOx5ZIuvA= X-Google-Smtp-Source: ABdhPJyAbaZJqJqseIcqpYz/VNW4WSEM4wxx6mxoUSpt0+BE7dUQIugjOrYjhoVf6yWSu5lF8vYrog== X-Received: by 2002:a05:6512:a91:: with SMTP id m17mr19411033lfu.638.1637795097079; Wed, 24 Nov 2021 15:04:57 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id t15sm106243lfp.181.2021.11.24.15.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 15:04:56 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Linus Walleij , Rob Herring Cc: Tony Lindgren , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2 3/6] pinctrl: prepare API for reading pins, groups & functions Date: Thu, 25 Nov 2021 00:04:36 +0100 Message-Id: <20211124230439.17531-4-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211124230439.17531-1-zajec5@gmail.com> References: <20211124230439.17531-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_150458_802771_7A4C3234 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki That API can be used for parsing platform data (coming from e.g. DT or ACPI) into pinctrl generic structures. Signed-off-by: Rafał Miłecki --- V2: New patch in the series to address Andy's API review --- drivers/pinctrl/core.c | 12 ++++++++++++ drivers/pinctrl/core.h | 4 ++++ drivers/pinctrl/pinmux.c | 6 ++++++ drivers/pinctrl/pinmux.h | 2 ++ 4 files changed, 24 insertions(+) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index ffe39336fcac..53b3e8b54a9b 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -515,8 +515,20 @@ void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev, } EXPORT_SYMBOL_GPL(pinctrl_remove_gpio_range); +int pinctrl_generic_load_pins(struct pinctrl_desc *pctldesc, struct device *dev) +{ + return -ENOENT; +} +EXPORT_SYMBOL_GPL(pinctrl_generic_load_pins); + #ifdef CONFIG_GENERIC_PINCTRL_GROUPS +int pinctrl_generic_load_groups(struct pinctrl_dev *pctldev) +{ + return -ENOENT; +} +EXPORT_SYMBOL_GPL(pinctrl_generic_load_groups); + /** * pinctrl_generic_get_group_count() - returns the number of pin groups * @pctldev: pin controller device diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h index 840103c40c14..def60d89d37b 100644 --- a/drivers/pinctrl/core.h +++ b/drivers/pinctrl/core.h @@ -182,6 +182,8 @@ struct pinctrl_maps { unsigned num_maps; }; +int pinctrl_generic_load_pins(struct pinctrl_desc *pctldesc, struct device *dev); + #ifdef CONFIG_GENERIC_PINCTRL_GROUPS /** @@ -198,6 +200,8 @@ struct group_desc { void *data; }; +int pinctrl_generic_load_groups(struct pinctrl_dev *pctldev); + int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev); const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 6cdbd9ccf2f0..ef7d2cbf0946 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -788,6 +788,12 @@ void pinmux_init_device_debugfs(struct dentry *devroot, #ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS +int pinmux_generic_load_functions(struct pinctrl_dev *pctldev) +{ + return -ENOENT; +} +EXPORT_SYMBOL_GPL(pinmux_generic_load_functions); + /** * pinmux_generic_get_function_count() - returns number of functions * @pctldev: pin controller device diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 78c3a31be882..85e5e3a0222f 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -134,6 +134,8 @@ struct function_desc { void *data; }; +int pinmux_generic_load_functions(struct pinctrl_dev *pctldev); + int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev); const char *