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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD98FC433ED for ; Tue, 18 May 2021 08:59:46 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D3E961285 for ; Tue, 18 May 2021 08:59:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D3E961285 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=libero.it Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Subject:References:In-Reply-To: Message-ID:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5A/LSq2nYnOCHhMdmQcX28pJYMEb5C6pIB+N2MDFF0A=; b=bBlTTe6Ipq9Rql rTejvrzAj/lDouFJcZs0AdHyK8ba/3MLOqxFIdKMos6xqduip612s4F6KU7yGExA6gge0B8Xc6uI/ FEpChV+sWta0XI+AEpRxfS1p7FxuuR7Zd01K9XQPr/azUGjcbv+RmrWfeV5KqCerLwIjGk4lZHYRj 1sjd5afIW7ieBRrbeBzsR0EtDj2WMw+4ie9mVulmO/1z5YmSY9QuGwUDcuzAWvCdrhyt9qvIKEAE4 pDsnrVVfV0Mq2dxvuUk3BmGMhuEXiSpk9SdsCuovsDPfQfeIimTMYLdpJMhL8Usej3u8mWXKsjysj 6iD40dVofgPuIDpzyxNw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1livXt-0001BT-Ep; Tue, 18 May 2021 08:57:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1livXq-00019b-Bp for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 08:57:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=NVnw5g+VXhVolsNBA9uOez+5YRjViDjU8xB516saj4c=; b=mTeHCSovRNasymnAi7IB24b6F8 Sodj70Sy22iB3CosBdFtQZ58GjV+GutE5GmMsobmS1ppShxVLiqEKWPWS+Th03G20yTlhTu7VVqJW tCTMZ9QYmMtS7BUzzdmqtUgcvjSS8sv57TLmXs52o7WdXyxkowH251tBiQop/ISmUMp9U77vV4ksV WZ8ZxG8Ceflv6YWio9MJIr/HCumVqpvcYesU1EtObtxQP+LssD0siMEwr3cRWpgrqP0BTDcxFlKf5 zKj8DY6hyxfVtIVAwyFdV7Kmh4ABvwseeiRbtcnmhxqyjt/PACs+i5SrqWA1lAFvxeWXNobZwt29P qJTi0N/g==; Received: from smtp-32-i2.italiaonline.it ([213.209.12.32] helo=libero.it) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1livXi-00ETtY-N0 for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 08:57:41 +0000 Received: from oxapps-11-062.iol.local ([10.101.8.72]) by smtp-32.iol.local with ESMTPA id ivXflS2QoBc6YivXflyVc1; Tue, 18 May 2021 10:57:31 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1621328251; bh=NVnw5g+VXhVolsNBA9uOez+5YRjViDjU8xB516saj4c=; h=From; b=KV2KAo9X6fPXwYtzH3q+0GN7GvtyTZlWnripOO/8qsxlHQDhU3GJuxpxND0ojAX7G lWvRNSoAxsWi8o3KN0uXmHrjexb7lRQGCF+0dFsNUjH1FvQjcQfdu0oAX+J+KAinpp 6DcL+o7shC0KSna31mxXfVqm2qAFtQYeQgiSCFePD1BYQDECvQvHMDg0wSDH5WxQCX iRFiUwImB6H1uJUxluBXg+sGiobMOdfaNl1GoPb3rCy0+7Rk8tiSZqY9fSRuV1DlYD TSNbIwdFV52wCerr0D8OZT6/UEM8SzYHTZopH48AwQ81ny9PZm32oxEXSOU3UXAgSx YQ5FR+DRZQ86w== X-CNFS-Analysis: v=2.4 cv=B6l8bMhM c=1 sm=1 tr=0 ts=60a3817b cx=a_exe a=ArCppHiS2LX9rvfu7+HyXQ==:117 a=C-c6dMTymFoA:10 a=IkcTkHD0fZMA:10 a=vesc6bHxzc4A:10 a=2KMo9-giAAAA:8 a=D_9wInirL2l4cj3dWgsA:9 a=QEXdDO2ut3YA:10 a=UeCTMeHK7YUBiLmz_SX7:22 Date: Tue, 18 May 2021 10:57:31 +0200 (CEST) From: Dario Binacchi To: Tony Lindgren Cc: linux-kernel@vger.kernel.org, Haojian Zhuang , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org Message-ID: <1340368809.152927.1621328251188@mail1.libero.it> In-Reply-To: References: <20210517200002.6316-1-dariobin@libero.it> <20210517200002.6316-3-dariobin@libero.it> Subject: Re: [PATCH v2 2/2] pinctrl: single: set pinmux from pins debug file MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.3-Rev34 X-Originating-IP: 185.33.57.41 X-Originating-Client: open-xchange-appsuite x-libjamsun: B0TjijWmrbfJWP3WAkKFWo1lCjhGy9T6 x-libjamv: ghWYi9jvb6w= X-CMAE-Envelope: MS4xfCr5xJ5H3yfOGVmZvzF4wcZgFaf0rRSXvIEcInlgH1v5EZ/YwGVek1PyBI+EJJvi7FRHYPUjrF/2YiYR2VT7/91Fg7GaZuHmZYk6kh8kS7A4hBeOREmu 0flGY6ZewK/uspSQ0HLHmyr2/6a+q4L3vhIkXqXEasYtNwx20D+Kdsel1635GBLQoG1GDB6FQdz5bGgFHM3dJA7ZEKS8uLBoKzrdoTNSbopQ1irMLEgUp6/V y+eW+mIQ86THswG+MKbNcQRBB1Chdu+CEEJ0WOG9vVddkLd46N/yKcAKiTSlM8l+DJnsyvDWwzBOxcxqMy4Zu3Uj+WQzN9elFOhzbk7UwF57GQ9HD4HwxPDL Xni1zqz9pznlUCr/woNVIHlJQ2uJFwxGgseyJ0vKV+Ma7LEbe8R53Vfi+cdSOMZUp4JRvZqqMknbgQYShnEVQGP1A0C1yA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_015734_942476_B2CE8567 X-CRM114-Status: GOOD ( 19.05 ) 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 Hi Tony, > Il 18/05/2021 08:05 Tony Lindgren ha scritto: > > > Hi, > > I noticed few more things I started to wonder about after > looking at this again. > > * Dario Binacchi [210517 20:00]: > > +static int pcs_pin_dbg_set(struct pinctrl_dev *pctldev, unsigned int pin, > > + char *buf) > > +{ > > + struct pcs_device *pcs; > > + unsigned int val, mux_bytes; > > + > > + buf = skip_spaces(buf); > > + if (kstrtouint(buf, 0, &val)) > > + return -EINVAL; > > + > > + pcs = pinctrl_dev_get_drvdata(pctldev); > > + > > + mux_bytes = pcs->width / BITS_PER_BYTE; > > + pcs->write(val, pcs->base + pin * mux_bytes); > > + return 0; > > +} > > Since you're adding a new interface, how about pass unsigned > int val instead of char *buf? I thought about passing char *buf because it seemed more generic to me. As the output of pin_dbg_show() depends on the platform driver, perhaps pin_dbg_set() may need driver-dependent data. Is it possible that only the value to be set in the register (unsigned int) is required? > > > static void pcs_dt_free_map(struct pinctrl_dev *pctldev, > > struct pinctrl_map *map, unsigned num_maps) > > { > > @@ -331,6 +348,9 @@ static const struct pinctrl_ops pcs_pinctrl_ops = { > > .get_group_name = pinctrl_generic_get_group_name, > > .get_group_pins = pinctrl_generic_get_group_pins, > > .pin_dbg_show = pcs_pin_dbg_show, > > +#if IS_ENABLED(CONFIG_DEVMEM) > > + .pin_dbg_set = pcs_pin_dbg_set, > > +#endif > > .dt_node_to_map = pcs_dt_node_to_map, > > .dt_free_map = pcs_dt_free_map, > > }; > > It might be better to always have the .pin_dbg_set around to > avoid the IS_ENABLED(CONFIG_DEVMEM). Ok, I'll remove the CONFIG_DEVMEM dependency > > Does the new interface need something under Documentation too? Yes, the description of `pins` in Documentation/driver-api/pin-control.rst needs to be updated. I'll add another patch to the series. Thanks and regards, Dario > > Regards, > > Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel