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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B065C6FD20 for ; Fri, 24 Mar 2023 12:55:58 +0000 (UTC) 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) 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-Google-Smtp-Source: AKy350ZVw09EQUWDlmPcDyysVPL53oUJm5u9v9HWaFL5ybk5h3aKYk2oGplFZ3rbLc/ordo9YYvXvg== 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 Content-Transfer-Encoding: 8bit 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 -- 2.38.1