From patchwork Mon Nov 9 12:17:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Palmer X-Patchwork-Id: 11891431 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 212101130 for ; Mon, 9 Nov 2020 12:18:28 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 1BDB3207BC; Mon, 9 Nov 2020 12:18:28 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8444920867 for ; Mon, 9 Nov 2020 12:18:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=0x0f.com header.i=@0x0f.com header.b="es61WEQD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8444920867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=0x0f.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=daniel@0x0f.com Received: by mail-pg1-f196.google.com with SMTP id z24so7024258pgk.3 for ; Mon, 09 Nov 2020 04:18:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BJndKSj8My/lD4O/+Sp04VAWacA8AAsvTE/T22US8mE=; b=es61WEQDXvBAwbtrTXGrIPFFVg54mRQzr2/r4Y5K8y0O9QFX5jXWR0bem2fJai8Ft8 /HCPTo2YOBTI88TE46yfE0q/TSyMVJ5jEaOVEZGp18KzB1OTQipEYDUXpVd07BT3d0Me 8AEZsxS4huYBf3SzoXERwWRo3rLLHiswNu7j4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BJndKSj8My/lD4O/+Sp04VAWacA8AAsvTE/T22US8mE=; b=oCbAlBI5zzOCP8iAw6OKpwn6+jW5l6xKKuqi4KKt/LYlUL4AnseOf7BVEptYjX7nz4 6d1vaOseesjKXV0ro+MPuMiX7apTbHSe+d/B0duNbyHsK55BQdi6SQQDVllUAduZeLXh Yvg0ei87ruaMb0mwEHDlGNwvLUTx0F85x5ByKJOsmeyW0sVPqRQzCWbAPlVqAXrZ6VIU z7i1nRrVz36xP7U7RkgzChuPRzYH5sWAdr0hYT6reyzX/eglPh9YfVC23HrwaAh4FeuR rl9VrgTXWxHL/fr4Uup6o64XOOHXBPLsNE8VXGltUQGtx955XTH/Ldvdko4U+dEbvFkq xikw== X-Gm-Message-State: AOAM532TgxFTnLi62letjf8mJbmtgGaPN+MQR7X3Dudnev2DAmPRAbFO oWc/D0An+1kdBjqt2vDdfrqhqUFGC5epfQ== X-Google-Smtp-Source: ABdhPJwhFxAidMBTYaFliqwEcl6vTF7HtAm7p5OhDrlTlcJQD3uuKmEIo19PThFVwl2x53CA/x72YA== X-Received: by 2002:aa7:91cf:0:b029:18a:9972:1aa9 with SMTP id z15-20020aa791cf0000b029018a99721aa9mr13540279pfa.46.1604924306431; Mon, 09 Nov 2020 04:18:26 -0800 (PST) Received: from shiro.work (p1268123-ipngn200803sizuokaden.shizuoka.ocn.ne.jp. [118.13.124.123]) by smtp.googlemail.com with ESMTPSA id i123sm11425204pfc.13.2020.11.09.04.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 04:18:26 -0800 (PST) From: Daniel Palmer List-Id: To: soc@kernel.org, linux-gpio@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, maz@kernel.org, w@1wt.eu, Daniel Palmer Subject: [PATCH v3 1/5] dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver Date: Mon, 9 Nov 2020 21:17:27 +0900 Message-Id: <20201109121731.1537580-2-daniel@0x0f.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109121731.1537580-1-daniel@0x0f.com> References: <20201109121731.1537580-1-daniel@0x0f.com> MIME-Version: 1.0 Header adds defines for the gpio number of each pad from the driver view. The gpio block seems to have enough registers for 128 lines but what line is mapped to a physical pin depends on the chip. The gpio block also seems to contain some registers that are not related to gpio but needed somewhere to go. Because of the above the driver itself uses the index of a pin's offset in an array of the possible offsets for a chip as the gpio number. Signed-off-by: Daniel Palmer Reviewed-by: Rob Herring --- MAINTAINERS | 1 + include/dt-bindings/gpio/msc313-gpio.h | 53 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 include/dt-bindings/gpio/msc313-gpio.h diff --git a/MAINTAINERS b/MAINTAINERS index 3da6d8c154e4..db9c008a0395 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2133,6 +2133,7 @@ W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ +F: include/dt-bindings/gpio/msc313-gpio.h ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT M: Michael Petchkovsky diff --git a/include/dt-bindings/gpio/msc313-gpio.h b/include/dt-bindings/gpio/msc313-gpio.h new file mode 100644 index 000000000000..2dd56683d3c1 --- /dev/null +++ b/include/dt-bindings/gpio/msc313-gpio.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * GPIO definitions for MStar/SigmaStar MSC313 and later SoCs + * + * Copyright (C) 2020 Daniel Palmer + */ + +#ifndef _DT_BINDINGS_MSC313_GPIO_H +#define _DT_BINDINGS_MSC313_GPIO_H + +#define MSC313_GPIO_FUART 0 +#define MSC313_GPIO_FUART_RX (MSC313_GPIO_FUART + 0) +#define MSC313_GPIO_FUART_TX (MSC313_GPIO_FUART + 1) +#define MSC313_GPIO_FUART_CTS (MSC313_GPIO_FUART + 2) +#define MSC313_GPIO_FUART_RTS (MSC313_GPIO_FUART + 3) + +#define MSC313_GPIO_SR (MSC313_GPIO_FUART_RTS + 1) +#define MSC313_GPIO_SR_IO2 (MSC313_GPIO_SR + 0) +#define MSC313_GPIO_SR_IO3 (MSC313_GPIO_SR + 1) +#define MSC313_GPIO_SR_IO4 (MSC313_GPIO_SR + 2) +#define MSC313_GPIO_SR_IO5 (MSC313_GPIO_SR + 3) +#define MSC313_GPIO_SR_IO6 (MSC313_GPIO_SR + 4) +#define MSC313_GPIO_SR_IO7 (MSC313_GPIO_SR + 5) +#define MSC313_GPIO_SR_IO8 (MSC313_GPIO_SR + 6) +#define MSC313_GPIO_SR_IO9 (MSC313_GPIO_SR + 7) +#define MSC313_GPIO_SR_IO10 (MSC313_GPIO_SR + 8) +#define MSC313_GPIO_SR_IO11 (MSC313_GPIO_SR + 9) +#define MSC313_GPIO_SR_IO12 (MSC313_GPIO_SR + 10) +#define MSC313_GPIO_SR_IO13 (MSC313_GPIO_SR + 11) +#define MSC313_GPIO_SR_IO14 (MSC313_GPIO_SR + 12) +#define MSC313_GPIO_SR_IO15 (MSC313_GPIO_SR + 13) +#define MSC313_GPIO_SR_IO16 (MSC313_GPIO_SR + 14) +#define MSC313_GPIO_SR_IO17 (MSC313_GPIO_SR + 15) + +#define MSC313_GPIO_SD (MSC313_GPIO_SR_IO17 + 1) +#define MSC313_GPIO_SD_CLK (MSC313_GPIO_SD + 0) +#define MSC313_GPIO_SD_CMD (MSC313_GPIO_SD + 1) +#define MSC313_GPIO_SD_D0 (MSC313_GPIO_SD + 2) +#define MSC313_GPIO_SD_D1 (MSC313_GPIO_SD + 3) +#define MSC313_GPIO_SD_D2 (MSC313_GPIO_SD + 4) +#define MSC313_GPIO_SD_D3 (MSC313_GPIO_SD + 5) + +#define MSC313_GPIO_I2C1 (MSC313_GPIO_SD_D3 + 1) +#define MSC313_GPIO_I2C1_SCL (MSC313_GPIO_I2C1 + 0) +#define MSC313_GPIO_I2C1_SDA (MSC313_GPIO_I2C1 + 1) + +#define MSC313_GPIO_SPI0 (MSC313_GPIO_I2C1_SDA + 1) +#define MSC313_GPIO_SPI0_CZ (MSC313_GPIO_SPI0 + 0) +#define MSC313_GPIO_SPI0_CK (MSC313_GPIO_SPI0 + 1) +#define MSC313_GPIO_SPI0_DI (MSC313_GPIO_SPI0 + 2) +#define MSC313_GPIO_SPI0_DO (MSC313_GPIO_SPI0 + 3) + +#endif /* _DT_BINDINGS_MSC313_GPIO_H */