From patchwork Mon Jan 24 14:16:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 534791 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CF7FC4167B for ; Mon, 24 Jan 2022 14:30:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238802AbiAXOaf (ORCPT ); Mon, 24 Jan 2022 09:30:35 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:48036 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238837AbiAXO3w (ORCPT ); Mon, 24 Jan 2022 09:29:52 -0500 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220124142951epoutp04b5d91f4d9d57d849e5bc545e66e6c628~NO0FqmNbr2558625586epoutp04J for ; Mon, 24 Jan 2022 14:29:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220124142951epoutp04b5d91f4d9d57d849e5bc545e66e6c628~NO0FqmNbr2558625586epoutp04J DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1643034591; bh=qPGhD84tRJvx/z9F3ETkqxZkn17JRczHeh0S7mwrbPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/frSR7FqSy8vgptxUHYB9sKD95mrX5Oz//+E9sDNkwRI8bxMprNKyePigUmz9tiT r7FcPqQTPEavZmrRTPWlr7QgkylDjNg7moSPEJCJSMXU+Y1kGMTJigfyFxpQ25C/9i 8EKB/UJ9oPDNwGOIIeY78nOQLc3muYgti6NTDUlg= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20220124142950epcas5p24eec8376f2f6a46ef13d41da0f1b5c01~NO0E0eEbi0974809748epcas5p2N; Mon, 24 Jan 2022 14:29:50 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4JjC6y74kQz4x9Pv; Mon, 24 Jan 2022 14:29:46 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id F6.34.05590.AD7BEE16; Mon, 24 Jan 2022 23:29:46 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20220124142946epcas5p11997a3c37546d37cac91f690a2a602bf~NO0BII2A62099820998epcas5p1Y; Mon, 24 Jan 2022 14:29:46 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220124142946epsmtrp2c4b48d4e9fcca2edbb5eb6232335aef9~NO0BHPsMW1656816568epsmtrp2N; Mon, 24 Jan 2022 14:29:46 +0000 (GMT) X-AuditID: b6c32a4b-723ff700000015d6-cd-61eeb7da7b72 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 13.BB.08738.AD7BEE16; Mon, 24 Jan 2022 23:29:46 +0900 (KST) Received: from Jaguar.sa.corp.samsungelectronics.net (unknown [107.108.73.139]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220124142942epsmtip1352d15b16d6f8a9fab3d2c5b67cb804f~NOz91qGhm1063810638epsmtip1j; Mon, 24 Jan 2022 14:29:42 +0000 (GMT) From: Alim Akhtar To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: soc@kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, olof@lixom.net, arnd@arndb.de, linus.walleij@linaro.org, catalin.marinas@arm.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, s.nawrocki@samsung.com, linux-samsung-soc@vger.kernel.org, pankaj.dubey@samsung.com, sboyd@kernel.org, Alim Akhtar , linux-fsd@tesla.com, Ajay Kumar Subject: [PATCH v5 12/16] pinctrl: samsung: add FSD SoC specific data Date: Mon, 24 Jan 2022 19:46:40 +0530 Message-Id: <20220124141644.71052-13-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220124141644.71052-1-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSfUwTZxjPe71eC67mrMresWywY2RDA7SjrVe1k2yI5zSOzW1uLrG7lUtL +pleO5QsGcomykf5qAQCWMG4jfARBJkjRRgCoiGiG9CCAgoCCyOOD5kogrqWw+2/X35fT97n fYQ88RksWJhksjFWE20gsED0YntEROTtX6dpSXqLgmyduYySI66LGPk0v1NAzvyUBcgzHTf4 ZN3fjxHy1PLPCFk/5uWTc1l3+OTo1AGy112KkUU3WxCyq38eI8/+8o+A/KG5Q0C230/nk8+8 dSg51r+MxYqpalc1oJae5AOqODUbo+orT2LUkPcSRl049x3Vd+0Yn3I0VALq2bHTAmq+/vWE wIP67TqGTmSsoYxJY05MMmlVxJ796vfVcoVEGilVkluIUBNtZFRE3N6EyPgkg+9RROg3tMHu oxJoliWi391uNdttTKjOzNpUBGNJNFhkliiWNrJ2kzbKxNi2SiWSd+Q+41d6nXc4C7U8fPvw vQeHUkFzWAYIEEJcBu/UXOFngEChGG8C8HbqEuoXxPgDAAvbjnDCPIBzFYPYi0RBbRefM7l9 CeeXnOl7BA6PTgj8AoZvhsOFDYgfb8Dj4cDRE4jfxMMreDCrcmFFWI/vhEUZQyutKB4O3X3H V3gRroKFBbN8bloIrDrfyvPjAB/vKl9YKYL4JSEc6zgFOFMcrEl7uhpYD6euNgg4HAznp5t9 A4Q+rIdZ7hiO/hb+6OpEObwDtvaVon4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ygRGvgWMDKsYJVMLinPTc4sN C4zyUsv1ihNzi0vz0vWS83M3MYLjQUtrB+OeVR/0DjEycTAeYpTgYFYS4a1KeZcoxJuSWFmV WpQfX1Sak1p8iFGag0VJnPdC18l4IYH0xJLU7NTUgtQimCwTB6dUA1P+ygv8mgofnxrsXxY3 523W1a9vas//L78Xpc6qoJZyJ1XT49/aYJ7HwvyHT7/b/LCOY9+u3VlKvWqCdrGXf2YleqRf LwxQSBAKf1fCUJV4O+Auw8yX54pmHH7xruXklj0nJZrOmf0VDVVK7N0swJsRJmUictKp+Hhw YmTZ0gwvlr8Sk27nMcoaevtaNOxMKjrvp1gxQeXyeaGgLIvjcdKtUcr7WM/1Lzn9cK9Pwoef Ihs+6mV7hO66cFqmaZmzQZ+04a8fXiVTcq7sVt+hIntB7MFNHTaXtFjui48ruo6IRMyZuHlf bd1S44NuFv8mJSp+VF0+6w3HuzX9kYcaVr9+8I2DaZ9ErP/LQ+wbZiixFGckGmoxFxUnAgCf rTzJ9gIAAA== X-CMS-MailID: 20220124142946epcas5p11997a3c37546d37cac91f690a2a602bf X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220124142946epcas5p11997a3c37546d37cac91f690a2a602bf References: <20220124141644.71052-1-alim.akhtar@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Adds Tesla FSD SoC specific data to enable pinctrl. FSD SoC has similar pinctrl controller as found in the most Samsung/Exynos SoCs. Cc: linux-fsd@tesla.com Acked-by: Linus Walleij Signed-off-by: Ajay Kumar Signed-off-by: Alim Akhtar --- .../pinctrl/samsung/pinctrl-exynos-arm64.c | 71 +++++++++++++++++++ drivers/pinctrl/samsung/pinctrl-samsung.c | 2 + drivers/pinctrl/samsung/pinctrl-samsung.h | 1 + 3 files changed, 74 insertions(+) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c index 4102ce955bd7..d291819c2f77 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c @@ -725,3 +725,74 @@ const struct samsung_pinctrl_of_match_data exynosautov9_of_data __initconst = { .ctrl = exynosautov9_pin_ctrl, .num_ctrl = ARRAY_SIZE(exynosautov9_pin_ctrl), }; + +/* + * Pinctrl driver data for Tesla FSD SoC. FSD SoC includes three + * gpio/pin-mux/pinconfig controllers. + */ + +/* pin banks of FSD pin-controller 0 (FSYS) */ +static const struct samsung_pin_bank_data fsd_pin_banks0[] __initconst = { + EXYNOS850_PIN_BANK_EINTG(7, 0x00, "gpf0", 0x00), + EXYNOS850_PIN_BANK_EINTG(8, 0x20, "gpf1", 0x04), + EXYNOS850_PIN_BANK_EINTG(3, 0x40, "gpf6", 0x08), + EXYNOS850_PIN_BANK_EINTG(2, 0x60, "gpf4", 0x0c), + EXYNOS850_PIN_BANK_EINTG(6, 0x80, "gpf5", 0x10), +}; + +/* pin banks of FSD pin-controller 1 (PERIC) */ +static const struct samsung_pin_bank_data fsd_pin_banks1[] __initconst = { + EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpc8", 0x00), + EXYNOS850_PIN_BANK_EINTG(7, 0x020, "gpf2", 0x04), + EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpf3", 0x08), + EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpd0", 0x0c), + EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpb0", 0x10), + EXYNOS850_PIN_BANK_EINTG(8, 0x0a0, "gpb1", 0x14), + EXYNOS850_PIN_BANK_EINTG(8, 0x0c0, "gpb4", 0x18), + EXYNOS850_PIN_BANK_EINTG(4, 0x0e0, "gpb5", 0x1c), + EXYNOS850_PIN_BANK_EINTG(8, 0x100, "gpb6", 0x20), + EXYNOS850_PIN_BANK_EINTG(8, 0x120, "gpb7", 0x24), + EXYNOS850_PIN_BANK_EINTG(5, 0x140, "gpd1", 0x28), + EXYNOS850_PIN_BANK_EINTG(5, 0x160, "gpd2", 0x2c), + EXYNOS850_PIN_BANK_EINTG(7, 0x180, "gpd3", 0x30), + EXYNOS850_PIN_BANK_EINTG(8, 0x1a0, "gpg0", 0x34), + EXYNOS850_PIN_BANK_EINTG(8, 0x1c0, "gpg1", 0x38), + EXYNOS850_PIN_BANK_EINTG(8, 0x1e0, "gpg2", 0x3c), + EXYNOS850_PIN_BANK_EINTG(8, 0x200, "gpg3", 0x40), + EXYNOS850_PIN_BANK_EINTG(8, 0x220, "gpg4", 0x44), + EXYNOS850_PIN_BANK_EINTG(8, 0x240, "gpg5", 0x48), + EXYNOS850_PIN_BANK_EINTG(8, 0x260, "gpg6", 0x4c), + EXYNOS850_PIN_BANK_EINTG(8, 0x280, "gpg7", 0x50), +}; + +/* pin banks of FSD pin-controller 2 (PMU) */ +static const struct samsung_pin_bank_data fsd_pin_banks2[] __initconst = { + EXYNOS850_PIN_BANK_EINTN(3, 0x00, "gpq0"), +}; + +const struct samsung_pin_ctrl fsd_pin_ctrl[] __initconst = { + { + /* pin-controller instance 0 FSYS0 data */ + .pin_banks = fsd_pin_banks0, + .nr_banks = ARRAY_SIZE(fsd_pin_banks0), + .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, + }, { + /* pin-controller instance 1 PERIC data */ + .pin_banks = fsd_pin_banks1, + .nr_banks = ARRAY_SIZE(fsd_pin_banks1), + .eint_gpio_init = exynos_eint_gpio_init, + .suspend = exynos_pinctrl_suspend, + .resume = exynos_pinctrl_resume, + }, { + /* pin-controller instance 2 PMU data */ + .pin_banks = fsd_pin_banks2, + .nr_banks = ARRAY_SIZE(fsd_pin_banks2), + }, +}; + +const struct samsung_pinctrl_of_match_data fsd_of_data __initconst = { + .ctrl = fsd_pin_ctrl, + .num_ctrl = ARRAY_SIZE(fsd_pin_ctrl), +}; diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 568b6e65dfed..f610beab23a0 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1320,6 +1320,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = { .data = &exynos850_of_data }, { .compatible = "samsung,exynosautov9-pinctrl", .data = &exynosautov9_of_data }, + { .compatible = "tesla,fsd-pinctrl", + .data = &fsd_of_data }, #endif #ifdef CONFIG_PINCTRL_S3C64XX { .compatible = "samsung,s3c64xx-pinctrl", diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index 1f8d30ba05af..5b32d3f30fcd 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -342,6 +342,7 @@ extern const struct samsung_pinctrl_of_match_data exynos7_of_data; extern const struct samsung_pinctrl_of_match_data exynos7885_of_data; extern const struct samsung_pinctrl_of_match_data exynos850_of_data; extern const struct samsung_pinctrl_of_match_data exynosautov9_of_data; +extern const struct samsung_pinctrl_of_match_data fsd_of_data; extern const struct samsung_pinctrl_of_match_data s3c64xx_of_data; extern const struct samsung_pinctrl_of_match_data s3c2412_of_data; extern const struct samsung_pinctrl_of_match_data s3c2416_of_data;