From patchwork Wed May 17 11:54:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Wanner X-Patchwork-Id: 13244800 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 AC2F4C77B7F for ; Wed, 17 May 2023 11:54:38 +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=oHVxijYaeX44gACq3CtRqT4dkSPI6mtPRtG0ZBmsG/s=; b=Q7lB5uY/lPfJZf 8juedxRbdMwNd5JeGNfoH9WshPsZiGnsZtGHDDWko1dpRZrYTyDdn1T5z6WFfUX9gQMPepFS1gyEn HxfQRc0GFnLdHCHIU8/p1P7mVyEaVhfTEehjfBIQm2J+DqpJllJyLXWtijhXk0lnK24+DJM2m6KPX f7bKO8cMegL9oDx3WLphoF0CFi6G8YmYiCKnLYmxYh0xYdO3q4jvR/Ygr3GsYOsNd0B/JpWr8/FJ/ rrmnY/OR1ZrhkFRd3ga3zRONtRpj+bwwpdK5DPmCGat+QUKQ8Oyu8Dkug3kN5xDPhKUT+SH4K8fDa h0h6uZNz8nnG7NXzlFaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzFjR-009guU-2s; Wed, 17 May 2023 11:54:13 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzFjO-009gt8-1T for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 11:54:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1684324450; x=1715860450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H3FtDCLhrVU8sD+tqYMnUEm+nabD8KDFiQrtCAaSPlU=; b=tPSyFyqqH24E1OW87/M7MtkXJ96Pe9OFSEdGwH04dW9oScawjnLtDUM9 g8r20bmx6fLy2XS/94+vS2Qzm8yfY+jmLWy/iMzW7w5HPnh56nrmOF69z 4SOIIWYXqXwOIzMVB3XRxYOQYAEBeBn/KgBRoVxhkP6NIJ1gQHK3tskCD MBuVIcIyj8CB5tQZrWLhxkMkBxiQD2J/Ko3/AXwdoowNE49BaEAjvAUah +WbnUBuYbe+XIOjbRJQ/U1big0Ov54JJWBbhiAFir9+WPV5iL6lZiDEmC yEe2RLqR9lfae6H8dKuJKxL5pU9SJL/vgulNr/N/TzGmYJZqVxOpCmMVl Q==; X-IronPort-AV: E=Sophos;i="5.99,282,1677567600"; d="scan'208";a="213707567" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 May 2023 04:54:08 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 17 May 2023 04:54:08 -0700 Received: from ryan-Precision-5560.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Wed, 17 May 2023 04:54:04 -0700 From: To: , , , , , , , CC: , , , , Ryan Wanner Subject: [PATCH 1/3] pinctrl: at91-pio4: Enable Push-Pull configuration Date: Wed, 17 May 2023 13:54:04 +0200 Message-ID: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_045410_505567_039E938D X-CRM114-Status: GOOD ( 11.58 ) 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 Enable push-pull configuration. Remove integer value argument from open-drain configuration as it is discarded when pinconf function is called from gpiolib. Add push-pull do debug and get functions. Signed-off-by: Ryan Wanner Acked-by: Nicolas Ferre --- drivers/pinctrl/pinctrl-at91-pio4.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 2fe40acb6a3e..3c39d62bbc3c 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -762,6 +762,11 @@ static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev, return -EINVAL; arg = 1; break; + case PIN_CONFIG_DRIVE_PUSH_PULL: + if (res & ATMEL_PIO_OPD_MASK) + return -EINVAL; + arg = 1; + break; case PIN_CONFIG_INPUT_SCHMITT_ENABLE: if (!(res & ATMEL_PIO_SCHMITT_MASK)) return -EINVAL; @@ -827,10 +832,10 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, conf &= (~ATMEL_PIO_PUEN_MASK); break; case PIN_CONFIG_DRIVE_OPEN_DRAIN: - if (arg == 0) - conf &= (~ATMEL_PIO_OPD_MASK); - else - conf |= ATMEL_PIO_OPD_MASK; + conf |= ATMEL_PIO_OPD_MASK; + break; + case PIN_CONFIG_DRIVE_PUSH_PULL: + conf &= (~ATMEL_PIO_OPD_MASK); break; case PIN_CONFIG_INPUT_SCHMITT_ENABLE: if (arg == 0) @@ -948,6 +953,8 @@ static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev, seq_printf(s, "%s ", "debounce"); if (conf & ATMEL_PIO_OPD_MASK) seq_printf(s, "%s ", "open-drain"); + if (!(conf & ATMEL_PIO_OPD_MASK)) + seq_printf(s, "%s ", "push-pull"); if (conf & ATMEL_PIO_SCHMITT_MASK) seq_printf(s, "%s ", "schmitt"); if (atmel_pioctrl->slew_rate_support && (conf & ATMEL_PIO_SR_MASK))