From patchwork Fri Oct 7 15:16:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Wanner X-Patchwork-Id: 13001195 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 9FE96C433FE for ; Fri, 7 Oct 2022 15:17:34 +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: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:In-Reply-To:References: List-Owner; bh=QvKhkHZeBAkpN8ZUuZtsj9Vtuj+u1OJ2oa38NGF/QEk=; b=DKi0Xqkfsy/o74 ORwIu2d8qo1HyuakDB8tQxl0TvZE9t+xTaVhbNZls8EscWWXqo8LvlZrtlQ307CP0cjlFfmOr+TrM +UBohPBM1Fsw1h1Lp87poRTljcspriAU2smTg9ZEl/pAM78QmeLbRsQ7iF5Yy9bnaPPXIJkp+Gvdy Hmpl6DGQdqpDs2IWY63iJIA/lYyD3Y2MNLo0erq93MOjt/mK1+c5rKnNhQXrrvKEBPEjWoxPbk3mJ e6CidPmqYGnanjqybycikSPfrDc34inDFhiHxvkIiEt8st2+oWv6hL85MA7Hv9oaeHRZk4fl1tLm0 QNKjmH60pVJGiQGydtWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogp5S-009Qp4-QK; Fri, 07 Oct 2022 15:16:30 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ogp5P-009Qo7-29 for linux-arm-kernel@lists.infradead.org; Fri, 07 Oct 2022 15:16:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1665155787; x=1696691787; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xvS2h3424DyB5DP3ehn441lqaYukYwiMe+ZbFqe9uds=; b=jwGlv/tshwRdh0/3XVBWqoRPsOzaa2Mw7JAMDsoKX8YcF7b4y3ZgoegY Cg+SDAql5mg57Vb2V/j05S+GqEmmKIMHZce84iQpChyqnkhRu5jeF9bVm gLhMJ5WVvZYMlhjOaen1MKIW5pqk3FuMZRwHzIzYlMKPY/jJt0eB5ZqXL fgjBr+HLzrEeOyUQEMFMeB9NTDGrHsOlOqbxTUy4I3E8xZsg5Ee0Lm1xY QmpAKrBj+A1vTPGJxbz/y3Si1pcrK0u9xyXpjZL7gvClvQCd2aiiGi2pn TlHVio1dWdRG/SAulIZnj2tK2cuK0M+AGMHdXxILEpQ8ghpB1PlwdxARV Q==; X-IronPort-AV: E=Sophos;i="5.95,167,1661842800"; d="scan'208";a="194275888" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 07 Oct 2022 08:16:23 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 7 Oct 2022 08:16:23 -0700 Received: from ryan-Precision-5560.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 7 Oct 2022 08:16:23 -0700 From: To: , , , , CC: , , , Ryan Wanner Subject: [PATCH 0/2] pinctrl:at91-pio4:add support for pullup/down Date: Fri, 7 Oct 2022 08:16:45 -0700 Message-ID: <20221007151647.98222-1-Ryan.Wanner@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221007_081627_173109_3732B740 X-CRM114-Status: GOOD ( 11.98 ) 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: Ryan Wanner This patch set adds support for pull up/down pinctl configuration. The implementation is based off of other pinctl drivers that have implemented line bias configurations. The second patch addes a case for PIN_CONFIG_PERSIST_STATE this shows up becuse the gpiod api passes this into the new config_set function that was just implemented. Looking at other drivers like TI driver, added the ENOTSUPP to the switch case for that state flag. How this was tested was by using a gpio program that I created to test configuration from userspace. This program was run in the background using & then using gpioinfo function checked if the change has been detected by the gpiod api. Then using devmem reading the regester making sure that the correct bit was set. The registers where checked before and during the program is being run, making sure the change happens. In the program Pin 127 would be passed into the test program. Before the program was ran devmem for pin 127 config register. After the progam is running in the background devmem for the same status register is called, the result is showing the change in pinconfig. The device used to test was the SAMA5D27_som1_ek. Ryan Wanner (2): pinctrl: at91-pio4: Add configuration to userspace pinctrl: at91-pio4: Add persist state case in config drivers/pinctrl/pinctrl-at91-pio4.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) Tested-by: Nicolas Ferre