From patchwork Fri Jul 8 13:14:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 588509 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp639525mab; Fri, 8 Jul 2022 06:15:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdc1bgVpYobubtDFAx6SV7KWmcNLrLuucL0M12YR7aVqL/Q7bCI4b1ziE5XzYyfo+PZ2G8 X-Received: by 2002:a05:6512:314e:b0:47f:8341:2099 with SMTP id s14-20020a056512314e00b0047f83412099mr2315689lfi.367.1657286149157; Fri, 08 Jul 2022 06:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657286149; cv=none; d=google.com; s=arc-20160816; b=K+Mccm3lngRPc2Ex9V/c9hxMv6rX3kLWJGGxR1oj5ACHL2JBEQKgFQixy7ADg9DIf/ gxV/k6UdbluX5ErXQigZIQ7MzhrL4i7XH3arA4Vm0gINPdMaIXbHhHuR6UtSoIsNEIkH DfSu1KJsPy2JrjoKO4us5d/uEwWBaFDOP1nCfRRw16Pt+cD9gWmnsaZEWhyAmmMeR9Xg ikVq0hdGKWUsnjdjoKntarEMM54YumVYGAg8E6UIF14tM4O8gdhJeOe+5EvlaaNXiVEV Ns1WROd55pglFZtKe2bLsIUBXREMOptWQrAF4Uz646fVQf/2G6cSL3YM1m430XSIdoQp bgxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PMVLhXBuzk8fEj1RLYQplSRsB4urUW8SCFVD/5OczaQ=; b=xVxKK3M8kY3AU8KbBgiqetp8biuCSOKRxDiHdrZZM+b9w0TgJEwINVOMlwn0NPnUkN eBJp5YwaVLQ6o5ebcy3JeMfYoaETtnldGzOfiyEMqLBkBK3UZ7VgSImMUp97iWG57rxe +wuQegKcLQ18YvfeojuROTSBpU1uEv3XV3yqAU2Xv5KwrqukJKx0paDdhJ9733sdnkv8 Z7msopjNCEPp77wJ2TsUvBRfYmJ9JECfSY+VxQ3ucHrzeGy6l49+MLfZ+hRttCEJU1Rn YH9g8P8hELXTL8Bd3Z0dPWkPT03TmqO8AszFGWlKvYlOFzH/tm9Y/kY/vJkGpqudLHR8 UADQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tf8NLO+4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id q25-20020a2e9699000000b0025d3b059656si8707732lji.81.2022.07.08.06.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 06:15:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tf8NLO+4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89D54845B4; Fri, 8 Jul 2022 15:14:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Tf8NLO+4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF8DE845B1; Fri, 8 Jul 2022 15:14:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4CF48845B1 for ; Fri, 8 Jul 2022 15:14:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x62b.google.com with SMTP id m14so16343866plg.5 for ; Fri, 08 Jul 2022 06:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PMVLhXBuzk8fEj1RLYQplSRsB4urUW8SCFVD/5OczaQ=; b=Tf8NLO+4FZwPOPZC/U13CbNRu6ueR3rFEQaU6qFM/Q0nLllLGzidTaL39PAraY9H5A begsgHQLx+G1YOXBvVAPobRatkm2P7eeBdzwlxzQXVFxtVMwYP0oFM2haOWyrg4hbeb3 ePEmstdtgVD5CmZKtcEbQGg4rCziPYe6FOdy0nXZ2mqxkxG1hWgOg6NLjYckhLNF86n7 +g8Uq17vsyA2n0dHwGsBFrH4KSLZxOJTBQMmBWLgq+qMnzL4W3YC7K9MZGhq1XUw7XDY YqZnxD9PTLGEyI1g6miAE+apq3p2VFOgKzMa+7lU6gwRZOe/83vFk5ypBqDKAUwWICv+ 4l/A== 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=PMVLhXBuzk8fEj1RLYQplSRsB4urUW8SCFVD/5OczaQ=; b=CiLxuikYuVDJvbjO+/3uakIPsE8hA0n1QWcx1zKuc861OJ7zIclIfb5MUTDqUSfacg Zxm/NDaaUx9+lTcbZljLv475Ni6nSLTnsw1Uyr6/vSRT0et24SORY+bq7K5MQWR+UvuL uokxIZNa3ojd4re8OsoQfGr0KYTEeRV0ESqL4WtraKA+xF0R27hCud/4A/4WRHwdWD4l zP5KxQffkx+nCIgkzoIYqWU2+eYLuNObhyU5Lf14F46q4CV6LSdPW/CyCjns7tit7XYD AtPFpL9CnqqICVzdaf6IcyViqYfb/oOvJS3RvXylDHLQe2xnmQGhEFQR1TZBhESlbl6M yOcg== X-Gm-Message-State: AJIora8y7X03hl2q5eD79sOEhR2fTms1GnTROBIT4vq/BJdPeIKVR+B2 MefrQ4f+C/JWhg/GOVRLHqyJTaLalAsPUQ== X-Received: by 2002:a17:90b:4c0b:b0:1ef:f525:97ba with SMTP id na11-20020a17090b4c0b00b001eff52597bamr1988455pjb.44.1657286089415; Fri, 08 Jul 2022 06:14:49 -0700 (PDT) Received: from localhost.localdomain ([182.77.21.191]) by smtp.gmail.com with ESMTPSA id c9-20020a624e09000000b0052974b651b9sm2026493pfb.38.2022.07.08.06.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 06:14:49 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, peng.fan@nxp.com, jh80.chung@samsung.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, stephan@gerhold.net, vinod.koul@linaro.org, nicolas.dechesne@linaro.org, mworsfold@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v2 7/9] pinctrl: qcom: Add pinctrl driver for QCS404 SoC Date: Fri, 8 Jul 2022 18:44:02 +0530 Message-Id: <20220708131404.1489347-8-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220708131404.1489347-1-sumit.garg@linaro.org> References: <20220708131404.1489347-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Currently this pinctrl driver only supports BLSP UART2 specific pin configuration. Signed-off-by: Sumit Garg Reviewed-by: Ramon Fried --- arch/arm/mach-snapdragon/Makefile | 1 + arch/arm/mach-snapdragon/pinctrl-qcs404.c | 55 +++++++++++++++++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + 4 files changed, 58 insertions(+) create mode 100644 arch/arm/mach-snapdragon/pinctrl-qcs404.c diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index 962855eb8c..cb8c1aa8d2 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -15,4 +15,5 @@ obj-y += dram.o obj-y += pinctrl-snapdragon.o obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o +obj-y += pinctrl-qcs404.o obj-$(CONFIG_SDM845) += pinctrl-sdm845.o diff --git a/arch/arm/mach-snapdragon/pinctrl-qcs404.c b/arch/arm/mach-snapdragon/pinctrl-qcs404.c new file mode 100644 index 0000000000..889ead0f57 --- /dev/null +++ b/arch/arm/mach-snapdragon/pinctrl-qcs404.c @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QCS404 pinctrl + * + * (C) Copyright 2022 Sumit Garg + */ + +#include "pinctrl-snapdragon.h" +#include + +#define MAX_PIN_NAME_LEN 32 +static char pin_name[MAX_PIN_NAME_LEN] __section(".data"); +static const char * const msm_pinctrl_pins[] = { + "SDC1_RCLK", + "SDC1_CLK", + "SDC1_CMD", + "SDC1_DATA", + "SDC2_CLK", + "SDC2_CMD", + "SDC2_DATA", +}; + +static const struct pinctrl_function msm_pinctrl_functions[] = { + {"blsp_uart2", 1}, +}; + +static const char *qcs404_get_function_name(struct udevice *dev, + unsigned int selector) +{ + return msm_pinctrl_functions[selector].name; +} + +static const char *qcs404_get_pin_name(struct udevice *dev, + unsigned int selector) +{ + if (selector < 120) { + snprintf(pin_name, MAX_PIN_NAME_LEN, "GPIO_%u", selector); + return pin_name; + } else { + return msm_pinctrl_pins[selector - 120]; + } +} + +static unsigned int qcs404_get_function_mux(unsigned int selector) +{ + return msm_pinctrl_functions[selector].val; +} + +struct msm_pinctrl_data qcs404_data = { + .pin_count = 126, + .functions_count = ARRAY_SIZE(msm_pinctrl_functions), + .get_function_name = qcs404_get_function_name, + .get_function_mux = qcs404_get_function_mux, + .get_pin_name = qcs404_get_pin_name, +}; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c index d1c560dd40..c2148a5d0a 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c @@ -119,6 +119,7 @@ static const struct udevice_id msm_pinctrl_ids[] = { #ifdef CONFIG_SDM845 { .compatible = "qcom,tlmm-sdm845", .data = (ulong)&sdm845_data }, #endif + { .compatible = "qcom,tlmm-qcs404", .data = (ulong)&qcs404_data }, { } }; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h index ea524312a0..178ee01a41 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h @@ -28,5 +28,6 @@ struct pinctrl_function { extern struct msm_pinctrl_data apq8016_data; extern struct msm_pinctrl_data apq8096_data; extern struct msm_pinctrl_data sdm845_data; +extern struct msm_pinctrl_data qcs404_data; #endif