Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1205371ioo; Fri, 27 May 2022 04:01:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTIOP5cV+huQ2DSmiFv92zuAnKnzEJbG+MrYMS37PhKENsI9WrBj26wWOtyBNG0DcM51fO X-Received: by 2002:a17:906:58c3:b0:6fe:7d3:a6c3 with SMTP id e3-20020a17090658c300b006fe07d3a6c3mr36136857ejs.317.1653649314456; Fri, 27 May 2022 04:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653649314; cv=none; d=google.com; s=arc-20160816; b=DwJZqE8SrsTmn9oLkZgL6rocGnynRQkMEYJ/20bcgpPVW1zOEDFOVC61guARfTxVVW g7zvJirz6JorsIQEFvCGNAezfElrvQpo2/hSVZDuKmlKN2AIh3h3cawSPtDbxxfLtJrB t8ruE45MKuiZ6vta6DQeq3mljmMQ4zm9ae7/zcjtgUqgtwPjzMkUaC2Mg8C8v/vcnO16 XhBqfQHKvZbYthf4B4s2r7ZZemyv5Gix04GftM/75LMVn1TBDDWd/Jo737+QRsPpU9ds g8mTEdxJEJxgg3VK3QGJVgCKByhAiiRJCZVUVzBXZusYyJD5DzHup6a4+lTNOZ9esfO5 0Khg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=j0PQ9KvLcDyhGe/3AHaycqSIR9icXjVWVlUf+JYxn18=; b=mr9pck021WBjdGop0A59D4HM201Kk7NsMVcuzONQdx6CgkTgNbb99gmCjumVK55bWA XmidRzn+zHdzEmpkJMBQBeClUgTb01+2nu19WHROLmXreBecNWEMHtGTV6qm7deBogat r1blJ+svHntva508iRTZvef9ITEOa7HgawbKVvI0R/dU11lH+lEzsXzYdzX0lnqAo1tm 9y3SjdOMLGu4Uz8HQXUhU34nuFeAake1u+3KXxZ+xx9AFgryXRasEjFp3D9bA7RQ0y0r n91OK8A+5OziRXjiyE+mF2c+QyayaxkylasEEFn66UKpRssiObTCMEx5ss0I7MMxirwg LI0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERm27+39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m25-20020aa7c499000000b0042bf7a4c041si1871737edq.150.2022.05.27.04.01.27; Fri, 27 May 2022 04:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERm27+39; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347729AbiEZOh5 (ORCPT + 99 others); Thu, 26 May 2022 10:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233650AbiEZOhg (ORCPT ); Thu, 26 May 2022 10:37:36 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052CED6820 for ; Thu, 26 May 2022 07:37:31 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id i27so3326523ejd.9 for ; Thu, 26 May 2022 07:37:30 -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=j0PQ9KvLcDyhGe/3AHaycqSIR9icXjVWVlUf+JYxn18=; b=ERm27+39gtNECxQMYFX5EkW3ltwET1+2QLwXKG10T6xvWxBHHxrlFqCWX3PptaiPXg Otbc2egol/N+bCdp22qnTPAiTop/KSIiuRi2pW/Qyugyy8Eb0LWGNet2rKcY54LDmpyC GSGV/P5YYmV2gciXxlUxFxehFmYZsYOKWxW9ygr0XX9s/v11mVMJMr+VFRXjPcasdTaC 7nitZtcw4E5HimUb9YTQS49PwBD3b0mgqoMWsJpbadGOygjkDROVl7u52ACrO8Vr4ZxE T89UCdcpRqdZk9w5hiu3x/k9PIWTTkg/wE8UNH7pCm4HOlK93XkeOXMpYrmvZdYdMtWl U85g== 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=j0PQ9KvLcDyhGe/3AHaycqSIR9icXjVWVlUf+JYxn18=; b=71pln+ewYXeRt5THFAGRAzJq9pe+EK+2uOiXAUyLe1AgzqARj4JxNDyHZF+AoLCeS/ Y42rsFztD7cErRdlnKg+H0fNA2Bb0bjHhmt3e1f2HY1xBMqlpBpWtZHEokbKCz6Ge+wu c8tHcSzl583G5eHW5pSoYWipceRahGVPy3A1C94kmLis27T08e4eo0pXMTLsjhwH7HDy 4tRTRT6UjD4sugbH0txTA73BN4q3CR44JzLSDStb1zYXE34I1cQ9MwL1WbHi4YznHN2O U23t5YvS/mRSoyJcKLmPpUN/LqhUBXUqw7LvWe/GO4oI8sSyMNvkTGvUzgNmgvkS9MLg AtOg== X-Gm-Message-State: AOAM533SqeOPV20p1i9QkOCShQ8bU5m6W8wmjFxs+uASZ5DSjzv57Rz3 o5s5GtEJUniVC7962+k/670ixw== X-Received: by 2002:a17:906:b048:b0:6fe:be4a:3ecf with SMTP id bj8-20020a170906b04800b006febe4a3ecfmr23471529ejb.104.1653575849408; Thu, 26 May 2022 07:37:29 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id f27-20020a50a6db000000b0042be2dfa8bdsm267962edc.81.2022.05.26.07.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 07:37:28 -0700 (PDT) From: Krzysztof Kozlowski To: Rob Herring , Krzysztof Kozlowski , Alim Akhtar , Tomasz Figa , Sylwester Nawrocki , Linus Walleij , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 7/7] dt-bindings: pinctrl: deprecate header with register constants Date: Thu, 26 May 2022 16:37:07 +0200 Message-Id: <20220526143707.767490-8-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220526143707.767490-1-krzysztof.kozlowski@linaro.org> References: <20220526143707.767490-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For convenience (less code duplication, some meaning added to raw number), the pin controller pin configuration register values were defined in the bindings header. These are not some IDs or other abstraction layer but raw numbers used in the registers These constants do not fit the purpose of bindings. They do not provide any abstraction, any hardware and driver independent ID. With minor exceptions, the Linux drivers actually do not use the bindings header at all. All of the constants were moved already to headers local to DTS (residing in DTS directory), so remove any references to the bindings header and add a warning tha tit is deprecated. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 6 ++---- drivers/pinctrl/samsung/pinctrl-exynos.h | 3 +++ drivers/pinctrl/samsung/pinctrl-samsung.c | 4 +--- drivers/pinctrl/samsung/pinctrl-samsung.h | 8 ++++++++ include/dt-bindings/pinctrl/samsung.h | 3 +++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 6d7ca1758292..a8212fc126bf 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -27,8 +27,6 @@ #include #include -#include - #include "pinctrl-samsung.h" #include "pinctrl-exynos.h" @@ -173,7 +171,7 @@ static int exynos_irq_request_resources(struct irq_data *irqd) con = readl(bank->pctl_base + reg_con); con &= ~(mask << shift); - con |= EXYNOS_PIN_FUNC_EINT << shift; + con |= EXYNOS_PIN_CON_FUNC_EINT << shift; writel(con, bank->pctl_base + reg_con); raw_spin_unlock_irqrestore(&bank->slock, flags); @@ -196,7 +194,7 @@ static void exynos_irq_release_resources(struct irq_data *irqd) con = readl(bank->pctl_base + reg_con); con &= ~(mask << shift); - con |= EXYNOS_PIN_FUNC_INPUT << shift; + con |= PIN_CON_FUNC_INPUT << shift; writel(con, bank->pctl_base + reg_con); raw_spin_unlock_irqrestore(&bank->slock, flags); diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h index bfad1ced8017..7bd6d82c9f36 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.h +++ b/drivers/pinctrl/samsung/pinctrl-exynos.h @@ -16,6 +16,9 @@ #ifndef __PINCTRL_SAMSUNG_EXYNOS_H #define __PINCTRL_SAMSUNG_EXYNOS_H +/* Values for the pin CON register */ +#define EXYNOS_PIN_CON_FUNC_EINT 0xf + /* External GPIO and wakeup interrupt related definitions */ #define EXYNOS_GPIO_ECON_OFFSET 0x700 #define EXYNOS_GPIO_EFLTCON_OFFSET 0x800 diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 26d309d2516d..4837bceb767b 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -26,8 +26,6 @@ #include #include -#include - #include "../core.h" #include "pinctrl-samsung.h" @@ -614,7 +612,7 @@ static int samsung_gpio_set_direction(struct gpio_chip *gc, data = readl(reg); data &= ~(mask << shift); if (!input) - data |= EXYNOS_PIN_FUNC_OUTPUT << shift; + data |= PIN_CON_FUNC_OUTPUT << shift; writel(data, reg); return 0; diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index fc6f5199c548..9af93e3d8d9f 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -53,6 +53,14 @@ enum pincfg_type { #define PINCFG_UNPACK_TYPE(cfg) ((cfg) & PINCFG_TYPE_MASK) #define PINCFG_UNPACK_VALUE(cfg) (((cfg) & PINCFG_VALUE_MASK) >> \ PINCFG_VALUE_SHIFT) +/* + * Values for the pin CON register, choosing pin function. + * The basic set (input and output) are same between: S3C24xx, S3C64xx, S5PV210, + * Exynos ARMv7, Exynos ARMv8, Tesla FSD. + */ +#define PIN_CON_FUNC_INPUT 0x0 +#define PIN_CON_FUNC_OUTPUT 0x1 + /** * enum eint_type - possible external interrupt types. * @EINT_TYPE_NONE: bank does not support external interrupts diff --git a/include/dt-bindings/pinctrl/samsung.h b/include/dt-bindings/pinctrl/samsung.h index 950970634dfe..23e2ffcf6ab8 100644 --- a/include/dt-bindings/pinctrl/samsung.h +++ b/include/dt-bindings/pinctrl/samsung.h @@ -10,6 +10,9 @@ #ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__ #define __DT_BINDINGS_PINCTRL_SAMSUNG_H__ +#warning "These bindings were deprecated, because they do not match the actual bindings but register values." \ + "Instead include the header in the DTS source directory." + #define EXYNOS_PIN_PULL_NONE 0 #define EXYNOS_PIN_PULL_DOWN 1 #define EXYNOS_PIN_PULL_UP 3 -- 2.34.1