From patchwork Fri Mar 24 08:04:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 666553 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp449225wrt; Fri, 24 Mar 2023 05:56:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bIjY+GqM7Sp8xhkMtJZooM86pGbDYCqksGxYGFjcIDRUChmeyMZdy7ZjcGBdql1NMrXbmG X-Received: by 2002:a17:902:fa48:b0:1a2:1513:44bf with SMTP id lb8-20020a170902fa4800b001a2151344bfmr2375854plb.1.1679662561615; Fri, 24 Mar 2023 05:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679662561; cv=none; d=google.com; s=arc-20160816; b=VR7CYPCcGY/QUSh2HXewv6sjsn+XYtw1qERteosp27jo+qm18gc75VS79sPlcDWcID 8PHWCD/8YbpxnBs2Wa/x9pKeDrsyLNxEI2k+8L+Wa+EuZgysnYIPl5EKQp3WTmThu0jf dIvjYJUax+a9WOXYBenLrO/cp4/NFeBmK6oNXHRgVeHFvijFxxP6F9+kafDyb0w5PlOp o/4eH7r5zLqvX2EQdtZSpBKbCod5lOGXpVyaP5jY+c2AjsPsSxGqHjK9tbHtv7WlBNhF Q/V192h9AQvfbhPvc+Hq/9NYIRtG9VM/u15N4kMVuyIlMJZo8died9ZRGT57BN7AMzm7 gSvg== 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=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=xQOd8wYk2wUbbxzloVHMRnljUVzEULAlB/LzyrY7tweMIp0T2nDK/Pslz1XW01lp0F hBOxP/twtgnvsJBdm30reXQPFTaKZkDTWzkuT56RHE640T+iYbWMHiLrc06Jbarr5Ka/ m4LO+15qF0KfQYaP1Y1mvX0eD9F2Rtojy48RE/JgJP2l7L84fkuac4HoDnHrjQEr4rdv ddvI5M8Yf/pwlb7B248A5EjmZk2mhV6mcMOhpT+HYMIOBqKuvxWjF1ZssY/Csya77QMM sfLagwNhp4zxq7Etpjx7Gr4zeuQlPWZbUn27ZKVFhEKrJUjibpJiiP2Y1o1Z6kp9hTG0 ah7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UmLU/n/O"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id n8-20020a170902d2c800b0019a95ab6b4esi23126345plc.407.2023.03.24.05.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 05:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UmLU/n/O"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 99CB785DBD; Fri, 24 Mar 2023 13:55:06 +0100 (CET) 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="UmLU/n/O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 18ED6859E5; Fri, 24 Mar 2023 09:05:32 +0100 (CET) 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (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 6E57D859B4 for ; Fri, 24 Mar 2023 09:05:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bhupesh.sharma@linaro.org Received: by mail-pl1-x62c.google.com with SMTP id k2so1142713pll.8 for ; Fri, 24 Mar 2023 01:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679645127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=UmLU/n/OtLAgeVL+5/fc9gguEYOS6PzIOtFF9EAfErTUsxbBMm8mW6RkUOvNGQAMuz ICDox9Nb+X5HGj+XaDQp85g2kuiBl6EsPAwGufnRSn/JlWjpD72w2afdnWsxbIK/bNAC sMHWDlk4EPNlNSex2/TOWbSwC62+lVgRcxpTgGrOA8ciKnxTcIQBqDtR+0oYRA1ATm6R wuoOUmdbOt/rhtloU3A9t5RqzprnZC8h+X0L76BhbgAz8RtOfEwOaG0w7N3Eh1/QKgV8 wWpxa+V9MU4WbCpp1poN+Q+Y2zGVZhLdFOuNm/fVQxKrYrtgdGfYsFjfBHLb8hkxZiuK Hwtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679645127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5DJCYWdUzjDhq6fVFbLKKsDuY51xqKuy1CHbZaEYFUc=; b=gzkQDXhJL55IAno/AOooIWTJH9XeVBy95X1AN+zpt003lH77IOK2bSjT1394/h74/7 cRD683EqvMTfCrxEvZp5+zajCjlN+1YSwgBeqcNfZtlSHVcY4vBu4Bv/AjjjC/ZzzIaa DqNR2LSjibz0tq7ZFFUjSW39YCavNWmR9HITaPVB3BoZ1yBbmuGCGg9A5l2oNOhdAfY/ I9ow76cwquj3n2SatkG6X7A/VtXo9mTn80ENaNaYcTGdU2NVxW6WK0qb9MsKrTJZADJe h83vR9HIyLVbJvtg9moZuPVMTdUWjnpqgEwJbcc7lrl61FkYGNNdGwbWDNz4YkSybwQJ uKLg== X-Gm-Message-State: AAQBX9fTJeyieBFy73FhTZ3huzcuAYYw3t5W342PjPNlgx7jGyubuAd2 1gU5lI5JTtrFXfAHWDoVEHi+F/rvBW80nSKLzpE= X-Received: by 2002:a17:902:d485:b0:19f:3e33:b845 with SMTP id c5-20020a170902d48500b0019f3e33b845mr2037648plg.26.1679645127348; Fri, 24 Mar 2023 01:05:27 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:1c60:d4c3:8671:83c0:33ae:5a96]) by smtp.gmail.com with ESMTPSA id s22-20020a170902989600b001a04a372fa0sm12205293plp.251.2023.03.24.01.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 01:05:27 -0700 (PDT) From: Bhupesh Sharma To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, peng.fan@nxp.com, rfried.dev@gmail.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org Subject: [PATCH 4/5] pinctrl: qcom: Add pinctrl driver for SM6115 SoC Date: Fri, 24 Mar 2023 13:34:17 +0530 Message-Id: <20230324080418.3856409-5-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> References: <20230324080418.3856409-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 24 Mar 2023 13:54:51 +0100 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.8 at phobos.denx.de X-Virus-Status: Clean Currently this pinctrl driver only supports debug UART specific pin configuration. Signed-off-by: Bhupesh Sharma --- arch/arm/mach-snapdragon/Makefile | 1 + .../arm/mach-snapdragon/pinctrl-qrb4210-rb2.c | 59 +++++++++++++++++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + 4 files changed, 62 insertions(+) create mode 100644 arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index 23aa1a974c..4ee6a3902e 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -16,6 +16,7 @@ obj-y += pinctrl-snapdragon.o obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o obj-y += pinctrl-qcs404.o +obj-y += pinctrl-qrb4210-rb2.o obj-y += pinctrl-sdm845.o obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o diff --git a/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c b/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c new file mode 100644 index 0000000000..a8ab67f20a --- /dev/null +++ b/arch/arm/mach-snapdragon/pinctrl-qrb4210-rb2.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm SM6115 pinctrl + * + * (C) Copyright 2023 Bhupesh Sharma + * + */ + +#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[] = { + "UFS_RESET", + "SDC1_RCLK", + "SDC1_CLK", + "SDC1_CMD", + "SDC1_DATA", + "SDC2_CLK", + "SDC2_CMD", + "SDC2_DATA", +}; + +static const struct pinctrl_function msm_pinctrl_functions[] = { + {"qup4", 1}, + {"gpio", 0}, +}; + +static const char *sm6115_get_function_name(struct udevice *dev, + unsigned int selector) +{ + return msm_pinctrl_functions[selector].name; +} + +static const char *sm6115_get_pin_name(struct udevice *dev, + unsigned int selector) +{ + if (selector < 113) { + snprintf(pin_name, MAX_PIN_NAME_LEN, "GPIO_%u", selector); + return pin_name; + } else { + return msm_pinctrl_pins[selector - 113]; + } +} + +static unsigned int sm6115_get_function_mux(unsigned int selector) +{ + return msm_pinctrl_functions[selector].val; +} + +struct msm_pinctrl_data sm6115_data = { + .pin_count = 120, + .functions_count = ARRAY_SIZE(msm_pinctrl_functions), + .get_function_name = sm6115_get_function_name, + .get_function_mux = sm6115_get_function_mux, + .get_pin_name = sm6115_get_pin_name, +}; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c index 826dc51486..e7efb5b29f 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.c +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.c @@ -151,6 +151,7 @@ static const struct udevice_id msm_pinctrl_ids[] = { { .compatible = "qcom,msm8916-pinctrl", .data = (ulong)&apq8016_data }, { .compatible = "qcom,msm8996-pinctrl", .data = (ulong)&apq8096_data }, { .compatible = "qcom,sdm845-pinctrl", .data = (ulong)&sdm845_data }, + { .compatible = "qcom,sm6115-pinctrl", .data = (ulong)&sm6115_data }, { .compatible = "qcom,qcs404-pinctrl", .data = (ulong)&qcs404_data }, { } }; diff --git a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h index 178ee01a41..7f543b0f5a 100644 --- a/arch/arm/mach-snapdragon/pinctrl-snapdragon.h +++ b/arch/arm/mach-snapdragon/pinctrl-snapdragon.h @@ -28,6 +28,7 @@ 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 sm6115_data; extern struct msm_pinctrl_data qcs404_data; #endif