From mboxrd@z Thu Jan 1 00:00:00 1970 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 77DF0EE4993 for ; Wed, 23 Aug 2023 13:35:39 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xue/zSxsi/fDJGkeXgGgXnxukKCNyWgpBiwi/LimcPg=; b=vDl+J3G77l2CES KBSAA3yzhvjWnCVCe2t6K4HSCtUT3JdW5iLBwanl936DT7jIbApi5v4lEVtlVQAEfSxUWEqW1x5Vg jScVE4nJZQwk66mFHQ7RHymeaqCkPEdSWoeIQSwAJZVPBcvCuiOJ5AsOHa/q5x1KRoTSA9vvbNusy xaEx2M+gN9b+teKRVJxDBMZQPGkxgtybqXQj+RUCZHV3E0PESIxh+EZIjwMfnxWDtxZQNbsSZORM9 tnd7EM16YZo9z6CsuzXOFbTTHdf4XYm/Ln+XwV8pakpb8ERnAmLnyy5GT0w+3P0j9HWloa3jWFx/o X9b6fy6mlFLXyizwjkwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYo0p-000h2A-1b; Wed, 23 Aug 2023 13:35:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYo0m-000h1m-1M for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2023 13:35:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B3361042; Wed, 23 Aug 2023 06:35:41 -0700 (PDT) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A3CF73F740; Wed, 23 Aug 2023 06:34:58 -0700 (PDT) Date: Wed, 23 Aug 2023 14:34:55 +0100 From: Cristian Marussi To: AKASHI Takahiro , Oleksii Moisieiev , "sudeep.holla@arm.com" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" Subject: Re: [PATCH v4 3/4] pinctrl: Implementation of the generic scmi-pinctrl driver Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230823_063504_535910_9B8ECB3C X-CRM114-Status: GOOD ( 20.66 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 23, 2023 at 01:13:12PM +0900, AKASHI Takahiro wrote: > Hi Oleksii, > Hi AKASHI, Oleksii, > On Tue, Aug 08, 2023 at 06:25:35PM +0000, Oleksii Moisieiev wrote: > > scmi-pinctrl driver implements pinctrl driver interface and using > > SCMI protocol to redirect messages from pinctrl subsystem SDK to > > SCMI platform firmware, which does the changes in HW. > > > > Signed-off-by: Oleksii Moisieiev [snip] > > +static int pinctrl_scmi_pinconf_get(struct pinctrl_dev *pctldev, unsigned int _pin, > > + unsigned long *config) > > +{ > > + int ret; > > + struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); > > + enum pin_config_param config_type; > > + unsigned long config_value; > > + > > + if (!config) > > + return -EINVAL; > > + > > + config_type = pinconf_to_config_param(*config); > > + > > + ret = pinctrl_ops->config_get(pmx->ph, _pin, PIN_TYPE, config_type, &config_value); > > + if (ret) > > + return ret; > > + > > + *config = pinconf_to_config_packed(config_type, config_value); > > + > > + return 0; > > +} > > + > > +static int pinctrl_scmi_pinconf_set(struct pinctrl_dev *pctldev, > > + unsigned int _pin, > > + unsigned long *configs, > > + unsigned int num_configs) > > +{ > > + int i, ret; > > + struct scmi_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); > > + enum pin_config_param config_type; > > + unsigned long config_value; > > + > > + if (!configs || num_configs == 0) > > + return -EINVAL; > > + > > + for (i = 0; i < num_configs; i++) { > > + config_type = pinconf_to_config_param(configs[i]); > > + config_value = pinconf_to_config_argument(configs[i]); > > The generic pinconf parameters defined as "enum pin_config_param" > do not exactly match with a set of SCMI's configuration types defined > in Table 23 in the section 4.11.2.6 "PINCTRL_CONFIG_GET". > pinconf_to_config_param() simply masks the lowest 8 bits of the input > value, but doesn't convert anything. Indeed the SCMI Types table and the Linux Pinctrl subsystem types are similar but not really the same; some kind of conversion/mapping will be needed. Some trivial conversion layer will be needed also in order to address here any of the possible future changes in the Linux pinctrl subsystem definitions without having to change the SCMI server side (that typically is fw...and that anyway is bound to the SCMI spec) Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel