From patchwork Tue Jan 23 21:21:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13528148 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF0E8C47258 for ; Tue, 23 Jan 2024 21:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1hagX+nyJ6+O4sUhgHdZVRIkx7sZ8thb4smV/fzRNCE=; b=Clm1FfVVemrMjv X+LzkQJAhF+4rpMUafB08bf6IB03Q2N2fC4b9fMnsP3S5EuNPqVBetLXZuseoyMoX3UnJ7TNWyGLG rgejbD02OU6DpxjOHYtHgtiGg4XrDBa6JpJsFrAPGUD66+tH1qr2Oi/7D5rHrplACbAB4+Ca0+FNM emSVzY2aLvrnsr4cBWRlhGw04NFBEOFQCkQmKw01EngY/0rhKIutxRtoHryW4GEnYY8bh8CoBMdLb 2OqQ1OnaNRnyK3lEL/ngwhDQyXXhkQ9WpD1hrnlXPY/mrVijTgfmIzPKXARuizdvdICfOTZiULKdP wYZKX4I4YiOaBU9//joA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSODx-000Vnm-1F; Tue, 23 Jan 2024 21:22:25 +0000 Received: from mail-ot1-f49.google.com ([209.85.210.49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSODt-000Vjt-1D for linux-rockchip@lists.infradead.org; Tue, 23 Jan 2024 21:22:23 +0000 Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6dddb927d02so2739874a34.2 for ; Tue, 23 Jan 2024 13:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044878; x=1706649678; darn=lists.infradead.org; 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=atdXaQZCw8Ctbj/HWpcWiAsjfznuoi7ii5HEQI3brC4=; b=GAIjByrfdfMn+lleEfbktH95/Tj7SIfz4TkTAvxzc8W7JWGeTVyeo2ByNWvokGHv6p wvPk2dUmS9B6tI86yndli6QdHARH4Pzbnzx4RuxpgwRkifna86RNR/a+YcWO1NpYBOsA cvZGKsX8LtMwDe6EYxiXqjU1lTL96hD9MEw8ZrhvIjBLFvx3r+q+1AUG1z0al8KfXSHI G6i1gbe7Yq8AdHvs852B+ZJx/8XHIaJ9/QSeorgVK6Uo1W+0SgN62itHlKP5oaZ+SYAl Ivddb81mQnroA1vk3NOOFqNVL8glQhisvxSlMfhvxZjiMJLeqbXrmQPCe3y1VpkOhFoF IrRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706044878; x=1706649678; 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=atdXaQZCw8Ctbj/HWpcWiAsjfznuoi7ii5HEQI3brC4=; b=bYmMY2u6fwHjUv5c3/vaxNq2rKHwSAF63OqWMIEU/RgZ43fwokWCEXOeyRVA+KX5LH Qg2yEfdGndQ/ZNDBjJA8SRe31utG4yrcOCelmAresQ6kNaN1m8civjcZsKArR2nR/3Kb pI1s7TBsbGOBAR84LyMxnRPbmfcGnqvPg1cjdjicOkeJFDUaDVBz2DmwBj10JgmRbUhr OV3oLTVpaPx1LFeE27rg/6KyUOQb9Bf2DRwoJNpKgvT9BBCk/u+wXfSecY8l2SgccZ6z +F4FR7BWeu8JEO9Nv98umUn8UCXpWWb1p2Orn0uQcYBwnV0npvjlBXCuPhobrBXj0v7k K6+w== X-Gm-Message-State: AOJu0YxzrWdIXIMwEVsc2Cbp/mktETIc8D+imPD5dGiyFFILzueJ9Ggq pY+VnC+9gxmQu8N+GKN8I2TofwxKrJGaRDYPNm9ePU3hRxzyZRfGVq6SBkLt X-Google-Smtp-Source: AGHT+IEuyIETcjdu3Kp6BJQc8aH1nwWNGAOF/jiKDUyXWKMQQLrHpX1zXf2tWflzeubfSv5BiXQ3dQ== X-Received: by 2002:a05:6871:798f:b0:214:831a:76e7 with SMTP id pb15-20020a056871798f00b00214831a76e7mr2056177oac.81.1706044878445; Tue, 23 Jan 2024 13:21:18 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id w2-20020a9d4502000000b006dc6e40ba97sm2265770ote.72.2024.01.23.13.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:21:18 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, Chris Morgan Subject: [PATCH 1/4] arm64: dts: rockchip: Move device specific properties Date: Tue, 23 Jan 2024 15:21:08 -0600 Message-Id: <20240123212111.202146-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123212111.202146-1-macroalpha82@gmail.com> References: <20240123212111.202146-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_132221_414731_2A3FF6A2 X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Chris Morgan Move device specific properties related to the ADC Joystick to different board specific device trees. This is in preparation for adding the Anbernic RG-Arc series of devices. Signed-off-by: Chris Morgan --- .../dts/rockchip/rk3566-anbernic-rg353x.dtsi | 74 +++++++++++++++++++ .../dts/rockchip/rk3566-anbernic-rg503.dts | 74 +++++++++++++++++++ .../dts/rockchip/rk3566-anbernic-rgxx3.dtsi | 74 ------------------- 3 files changed, 148 insertions(+), 74 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi index 2a2821f4c580..63a18ff36cea 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi @@ -8,11 +8,73 @@ #include "rk3566-anbernic-rgxx3.dtsi" / { + adc-joystick { + compatible = "adc-joystick"; + io-channels = <&adc_mux 0>, + <&adc_mux 1>, + <&adc_mux 2>, + <&adc_mux 3>; + pinctrl-0 = <&joy_mux_en>; + pinctrl-names = "default"; + poll-interval = <60>; + #address-cells = <1>; + #size-cells = <0>; + + axis@0 { + reg = <0>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <1023 15>; + linux,code = ; + }; + + axis@1 { + reg = <1>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <15 1023>; + linux,code = ; + }; + + axis@2 { + reg = <2>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <15 1023>; + linux,code = ; + }; + + axis@3 { + reg = <3>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <1023 15>; + linux,code = ; + }; + }; + + adc_mux: adc-mux { + compatible = "io-channel-mux"; + channels = "left_x", "right_x", "left_y", "right_y"; + #io-channel-cells = <1>; + io-channels = <&saradc 3>; + io-channel-names = "parent"; + mux-controls = <&gpio_mux>; + settle-time-us = <100>; + }; + backlight: backlight { compatible = "pwm-backlight"; power-supply = <&vcc_sys>; pwms = <&pwm4 0 25000 0>; }; + + gpio_mux: mux-controller { + compatible = "gpio-mux"; + mux-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>, + <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; + #mux-control-cells = <0>; + }; }; &cru { @@ -83,6 +145,18 @@ button-right { linux,code = ; }; + button-thumbl { + gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; + label = "THUMBL"; + linux,code = ; + }; + + button-thumbr { + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; + label = "THUMBR"; + linux,code = ; + }; + button-y { gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>; label = "WEST"; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts index c763c7f3b1b3..94e6dd61a2db 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts @@ -17,6 +17,61 @@ aliases { mmc2 = &sdmmc2; }; + adc-joystick { + compatible = "adc-joystick"; + io-channels = <&adc_mux 0>, + <&adc_mux 1>, + <&adc_mux 2>, + <&adc_mux 3>; + pinctrl-0 = <&joy_mux_en>; + pinctrl-names = "default"; + poll-interval = <60>; + #address-cells = <1>; + #size-cells = <0>; + + axis@0 { + reg = <0>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <1023 15>; + linux,code = ; + }; + + axis@1 { + reg = <1>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <15 1023>; + linux,code = ; + }; + + axis@2 { + reg = <2>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <15 1023>; + linux,code = ; + }; + + axis@3 { + reg = <3>; + abs-flat = <32>; + abs-fuzz = <32>; + abs-range = <1023 15>; + linux,code = ; + }; + }; + + adc_mux: adc-mux { + compatible = "io-channel-mux"; + channels = "left_x", "right_x", "left_y", "right_y"; + #io-channel-cells = <1>; + io-channels = <&saradc 3>; + io-channel-names = "parent"; + mux-controls = <&gpio_mux>; + settle-time-us = <100>; + }; + battery: battery { compatible = "simple-battery"; charge-full-design-microamp-hours = <3472000>; @@ -36,6 +91,13 @@ battery: battery { <3400000 0>; }; + gpio_mux: mux-controller { + compatible = "gpio-mux"; + mux-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>, + <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; + #mux-control-cells = <0>; + }; + gpio_spi: spi { compatible = "spi-gpio"; pinctrl-names = "default"; @@ -174,6 +236,18 @@ button-right { linux,code = ; }; + button-thumbl { + gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; + label = "THUMBL"; + linux,code = ; + }; + + button-thumbr { + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; + label = "THUMBR"; + linux,code = ; + }; + button-y { gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; label = "WEST"; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi index 8cbf3d9a4f22..18b8c2e7befa 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi @@ -14,51 +14,6 @@ chosen: chosen { stdout-path = "serial2:1500000n8"; }; - adc-joystick { - compatible = "adc-joystick"; - io-channels = <&adc_mux 0>, - <&adc_mux 1>, - <&adc_mux 2>, - <&adc_mux 3>; - pinctrl-0 = <&joy_mux_en>; - pinctrl-names = "default"; - poll-interval = <60>; - #address-cells = <1>; - #size-cells = <0>; - - axis@0 { - reg = <0>; - abs-flat = <32>; - abs-fuzz = <32>; - abs-range = <1023 15>; - linux,code = ; - }; - - axis@1 { - reg = <1>; - abs-flat = <32>; - abs-fuzz = <32>; - abs-range = <15 1023>; - linux,code = ; - }; - - axis@2 { - reg = <2>; - abs-flat = <32>; - abs-fuzz = <32>; - abs-range = <15 1023>; - linux,code = ; - }; - - axis@3 { - reg = <3>; - abs-flat = <32>; - abs-fuzz = <32>; - abs-range = <1023 15>; - linux,code = ; - }; - }; - adc_keys: adc-keys { compatible = "adc-keys"; io-channels = <&saradc 0>; @@ -77,16 +32,6 @@ button-mode { }; }; - adc_mux: adc-mux { - compatible = "io-channel-mux"; - channels = "left_x", "right_x", "left_y", "right_y"; - #io-channel-cells = <1>; - io-channels = <&saradc 3>; - io-channel-names = "parent"; - mux-controls = <&gpio_mux>; - settle-time-us = <100>; - }; - gpio_keys_control: gpio-keys-control { compatible = "gpio-keys"; pinctrl-0 = <&btn_pins_ctrl>; @@ -128,18 +73,6 @@ button-start { linux,code = ; }; - button-thumbl { - gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; - label = "THUMBL"; - linux,code = ; - }; - - button-thumbr { - gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; - label = "THUMBR"; - linux,code = ; - }; - button-up { gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>; label = "DPAD-UP"; @@ -172,13 +105,6 @@ button-vol-up { }; }; - gpio_mux: mux-controller { - compatible = "gpio-mux"; - mux-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>, - <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; - #mux-control-cells = <0>; - }; - hdmi-con { compatible = "hdmi-connector"; ddc-i2c-bus = <&i2c5>; From patchwork Tue Jan 23 21:21:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13528150 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A6FC47DDB for ; Tue, 23 Jan 2024 21:22:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YsD1RVfw1fcDbAZ6+zDitvGhkXkZqH/a1L67rfR1jZk=; b=r/vbZQ/7JmgbG8 F9BIecNNoUMizN2Uhc0aTmnj15peew5thdgW9ceh62h/gCaHOTO9qvtimj9WKg7wvqxhFpQ49NSst U+0gbvUx/g9RZUQEtCvOkHPTSbyk6n+33c5PtmQHu4NDafZJE1yis41EPklshJgyT/81FnT1wHxls tzhuiGiiKcjTDTov5acDo5RDaz8uUnZ532hNt9PJEn8Vj5tI2RDuf0VPTop2qbShdy1TrVyhLsocK lHLTiZDl85E5PLXZSUW1vZlFsM/QtLBHXKL14EKAoU4VzOjzO9t8RE2QN8r3IIupNpjbLCgPjU+91 Y0Tnq8U+VvSTARzWw9ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSODw-000Vmz-1T; Tue, 23 Jan 2024 21:22:24 +0000 Received: from mail-oa1-f50.google.com ([209.85.160.50]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSODt-000Vjv-2Q for linux-rockchip@lists.infradead.org; Tue, 23 Jan 2024 21:22:22 +0000 Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-206689895bfso2448252fac.1 for ; Tue, 23 Jan 2024 13:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044879; x=1706649679; darn=lists.infradead.org; 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=sWxTTmvypeY8hSwgGVw3+bFVkwR+7Vq8EoTW4jvNu7c=; b=dWxSDac37PH/5pgBj2NVwj8jZWvNKYJKF+h9Tp+6zsG7VqfeptKNVBUhBLNCT08F4u 9XcEP5Qi8x2YCv2zn5W3+/WNSGajW+CmMJ45GuAhj2OUCQUUeK8fYKZHV+XokFRjpCY9 JNl+nYCdWIpI0jFrMVzO7w9b8Mg8kTRssJtUguxxrDi3wXhulDAR9JCvKBbM8QcjzZ22 DXZRK0F4HaCylJSl06k9N4NC9upViqnp4Ud5kIp1V8jS6xxxXsgNOyeQvhuo2RCM0nrA sVQC9WnR/G8BzmwNQt7ovliS5jSg3V316i/3M/q/30dT4vAcfe3lp1sUZe8ZmhEWYIBk LsSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706044879; x=1706649679; 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=sWxTTmvypeY8hSwgGVw3+bFVkwR+7Vq8EoTW4jvNu7c=; b=MEyIJY8lrcllfWZAFNYFSIxdZQBOeqhsPcYsBnyY/OZy3Y9gdPQtsmyJtrFh1RVllS PTaDTQ8m0ZdSnFuriFiBlPXwzhwDYMaJK014etJkQtrAu7XSd4iFOS4lgrd3aANwHw27 DMbCpVnlI1rSQNE7FjPdHY+5GSX0v7BQ6rMpRmV5wbDwNq6ZcRkd4OO633UQxbIrnXBt Dlbp0FGyxqatxIruOuSYeQVCoLxjBVid+KjkiPhZo2d0W7+UIHVQsMXT1SdO9VMWRZio OrbL+5Upt1KZTiAcxC/V/p3McI/cBgiLoYHHxGzzgX2hT/NcEumDcZRxdurcU5b7wEL3 MPAQ== X-Gm-Message-State: AOJu0YwICeAaTTlsDsB3Ze0vPq9GBV6osSAp6QEyiSirYsqD/p0YqQF6 PKeslcaz8cLwUVlQnrhCnVZPnfyo4DNjciaLM/tUnmFE0wJCoQ9/k0Hg30vP X-Google-Smtp-Source: AGHT+IGK/VUGFNkHOBl97RvjCZ8ZfMUgIf4+aEkpbywEmMngm6YKO5SFrej9dQQ0OsyV/C7fuiv0gw== X-Received: by 2002:a05:6870:ac25:b0:214:7225:a0af with SMTP id kw37-20020a056870ac2500b002147225a0afmr1938740oab.84.1706044878940; Tue, 23 Jan 2024 13:21:18 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id w2-20020a9d4502000000b006dc6e40ba97sm2265770ote.72.2024.01.23.13.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:21:18 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, Chris Morgan Subject: [PATCH 2/4] dt-bindings: arm: rockchip: Add Anbernic RG-Arc Date: Tue, 23 Jan 2024 15:21:09 -0600 Message-Id: <20240123212111.202146-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123212111.202146-1-macroalpha82@gmail.com> References: <20240123212111.202146-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_132221_797030_5E88E425 X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Chris Morgan Add the Anbernic RG-Arc S and RG-Arc D devices, and consolidate all Anbernic RK3566 based devices under a single description. Signed-off-by: Chris Morgan Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/arm/rockchip.yaml | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml index 5cf5cbef2cf5..5592fdc85b9e 100644 --- a/Documentation/devicetree/bindings/arm/rockchip.yaml +++ b/Documentation/devicetree/bindings/arm/rockchip.yaml @@ -37,29 +37,16 @@ properties: - anbernic,rg351v - const: rockchip,rk3326 - - description: Anbernic RG353P + - description: Anbernic RK3566 Handheld Gaming Console items: - - const: anbernic,rg353p - - const: rockchip,rk3566 - - - description: Anbernic RG353PS - items: - - const: anbernic,rg353ps - - const: rockchip,rk3566 - - - description: Anbernic RG353V - items: - - const: anbernic,rg353v - - const: rockchip,rk3566 - - - description: Anbernic RG353VS - items: - - const: anbernic,rg353vs - - const: rockchip,rk3566 - - - description: Anbernic RG503 - items: - - const: anbernic,rg503 + - enum: + - anbernic,rg353p + - anbernic,rg353ps + - anbernic,rg353v + - anbernic,rg353vs + - anbernic,rg503 + - anbernic,rg-arc-d + - anbernic,rg-arc-s - const: rockchip,rk3566 - description: Asus Tinker board From patchwork Tue Jan 23 21:21:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13528146 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BC67C47258 for ; Tue, 23 Jan 2024 21:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B/RwNq6LHqv0COjg1xvUjSFg8FTO3CTOGWdSJTE5zx8=; b=MZPpERqEZRVEdh GBXDUbhr0fqceo7fgOOWjh/rTUk9NdkJUbATo+kH50jB9kYFetZWBIVDV/nKkieX+JwXcxAixpmV4 KfWD8nybN5q1qVmF6mUW5AKrF9nwQTP/tH0RPHhgb74VrJFnpzz2n0jYIOkx7PsmCHCSL3g4Bubv9 3m/NgX5El76u8kRZ0MFAA5gKtS8jkxFGfM2oFrxiGg3us8dy8tL+rhcXhVe8I6cNTvzJz+/slhIoJ RAvPK5ZG1b5Q8Q3NxzEO+aK2oZorpj/p50kV51uznxwCNNMB1oaSfZX+HKzfHJdiAenEe+Ezgj4hX ZR4zFyexDLGrBe3iwDpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSODw-000VnF-2p; Tue, 23 Jan 2024 21:22:24 +0000 Received: from mail-oa1-f46.google.com ([209.85.160.46]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSODt-000Vjw-2q for linux-rockchip@lists.infradead.org; Tue, 23 Jan 2024 21:22:23 +0000 Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-2148e793e12so591967fac.1 for ; Tue, 23 Jan 2024 13:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044879; x=1706649679; darn=lists.infradead.org; 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=gdI9GpC3LsV5yV1jgeEDWbIrpCqx193PqpqMfGpnGfI=; b=kainUwjaWkkkD3OAlCWDKN+BjiGyxDHsvbrNnkGzEOhKOrQ3XotmsDRyTSLJ3efbN8 OnnbHHLW0rd73YgF38RADX60Do/0/4VNVdwPW5P+kW6rShrOQ491VyCN+sFc8bQUgSV+ J3Wo2sG7uqGLx+b+trEUp0X9hv3pZRxbIBwdGY0JWnMen0IhdsnY39EtH9FYL5FBOuv6 8SNFXI4KKNfUtqO2WEO/o/XMrGnP0Qa9dluWzeF4Mrk2np9o9vy8nysW4qRVlWCwDUrS avVAQhWed5XnAP2FZW4/AH1hHQV2cdqzqOsrC91V+on2pjavJ8HkiXAMm9Q2PXammhuf Z1HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706044879; x=1706649679; 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=gdI9GpC3LsV5yV1jgeEDWbIrpCqx193PqpqMfGpnGfI=; b=HCD/tzvbCvzpO2wMI3WY9wSYyiM17NHjfcFRml6OvOfExVCGmxBn1NRqKjF6ziR7+e +NsYLPuxT1gjiUyX7Zn6qkzx4hjCgQPsp04WjnF/1d021LKlskezm3mxamHequPEDXJr ym0D/EW/pbkwnCFX9WieWHh/C6K0o85piKrBCPX9CSYYLP+V6g3Etp8nzyWBwKKjDjcs TOBObwECXtDGaOp0eaCAAg9vjH9i7/jCnJcbZvyif1Jx25Ic9zzJlHEFcfPFVRm4MuXs 5twqGVBR/EyMIQYRZQETeSUFQqhKyylEJkjfWbt5+Z3O3qyVZHM+RDwV8iZCiGDEcZCB wfRA== X-Gm-Message-State: AOJu0Yw54P+VTpZqbLfrgWi5xzXDkyzL+x3iLa5778c4d7i+h9uhOnsN X2skPTnEPNM/8pBF4zPOQofNb5rabti3EYb/yu2EBZSdxCchhaJtbQboaEdO X-Google-Smtp-Source: AGHT+IFR/4/GLbQGIaVwftUhbm+Lbo0xKQHUz9CIpu47XVWOREN12miXKXEwgyBWKKx+gxxMyJr+kA== X-Received: by 2002:a05:6870:a495:b0:214:2e3b:3742 with SMTP id j21-20020a056870a49500b002142e3b3742mr2825076oal.90.1706044879423; Tue, 23 Jan 2024 13:21:19 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id w2-20020a9d4502000000b006dc6e40ba97sm2265770ote.72.2024.01.23.13.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:21:19 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, Chris Morgan Subject: [PATCH 3/4] clk: rockchip: rk3568: Add PLL rate for 128MHz Date: Tue, 23 Jan 2024 15:21:10 -0600 Message-Id: <20240123212111.202146-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123212111.202146-1-macroalpha82@gmail.com> References: <20240123212111.202146-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_132221_920095_0A2A9F3A X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Chris Morgan Add PLL rate for 128MHz to allow the panel for the Anbernic RG-ARC series to run at 60hz. Signed-off-by: Chris Morgan --- drivers/clk/rockchip/clk-rk3568.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/rockchip/clk-rk3568.c b/drivers/clk/rockchip/clk-rk3568.c index b786ddc9af2a..8cb21d10beca 100644 --- a/drivers/clk/rockchip/clk-rk3568.c +++ b/drivers/clk/rockchip/clk-rk3568.c @@ -78,6 +78,7 @@ static struct rockchip_pll_rate_table rk3568_pll_rates[] = { RK3036_PLL_RATE(200000000, 1, 100, 3, 4, 1, 0), RK3036_PLL_RATE(148500000, 1, 99, 4, 4, 1, 0), RK3036_PLL_RATE(135000000, 2, 45, 4, 1, 1, 0), + RK3036_PLL_RATE(128000000, 1, 16, 3, 1, 1, 0), RK3036_PLL_RATE(126400000, 1, 79, 5, 3, 1, 0), RK3036_PLL_RATE(119000000, 3, 119, 4, 2, 1, 0), RK3036_PLL_RATE(115200000, 1, 24, 5, 1, 1, 0), From patchwork Tue Jan 23 21:21:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13528147 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34A4AC47DDC for ; Tue, 23 Jan 2024 21:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XzQ8NFzDc9+R04kBF86qIIPwVv+tJQhO1MQIdxB4ztI=; b=RcBXAN0Hp5//J6 JyxrI0G3G31z9WiJsTSiMy6Ub+MO8O6Bxf/vluhDGwLfv6TKSWM1uAPsH4flavDmJ1HNZWgGZJgRC YfZgWrBXJM6MgIQyJyY99VZJb4w3gmJmpLsvbhxP5iunhF5kezJW7NnlTYeWPXzCBIsDvLx9Gja5E nzIwAJtYnxCvqIiYFhNn8Cat/0wnqqnEuGlfxezFMegDdZ1du88H6doC/PAH+fi3Az7tgQzpnBgzM 3oxlB5KiqqWKpUQUi359uGFigsIYg7QGXYseS612GGxfybBxMUim6aPw8P3zrbnn482wf63AJoFqN czJ+hMblPh6qNf1I1Oqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSODy-000Voc-1N; Tue, 23 Jan 2024 21:22:26 +0000 Received: from mail-ot1-f41.google.com ([209.85.210.41]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSODv-000Vke-0e for linux-rockchip@lists.infradead.org; Tue, 23 Jan 2024 21:22:25 +0000 Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6e0f993265cso448882a34.3 for ; Tue, 23 Jan 2024 13:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044880; x=1706649680; darn=lists.infradead.org; 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=WUsZb/Hef6hbGG3VErk0RnqOC/xgv8DmG7DKbj1X9/M=; b=Lq3OaZfuGxlfb2gydVVc4+vvFlTuAQYBjNOF0Ai5JSwCPSdt+8VgbIUR9ouES3V5n2 6yNvnWhvfPmyFsGBuqgAiiyoylG7G+CQpSJzcGtu3SrVHpybQq88TLxGTkSACk5BfbEh BOoIELQ+52deYh27+IGVWcegijdCjIKmUfQUGSIF2yKSeo3oRGdD2FN02EwR/t1B3fKp Kp/WAO2eYY4C4WqfNamO6Hy5vZe2ds8/A6LM1qlDS+vL4cid7Vj0xjbQOuc0jaJCEd6t 1DeKq41+IRl1kXhkNJ6VibzlAWsP0ooVUNxv/qV4aTUwBJofznH5s+GTXOrZ6beWrL8+ z4wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706044880; x=1706649680; 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=WUsZb/Hef6hbGG3VErk0RnqOC/xgv8DmG7DKbj1X9/M=; b=EMT3PEQbQyfyMtFOAmi/DAxUGcxFUooG3Ej6QZWI6m0NF1y3Acmk6cyOs4l34Ulnmy 7p0dP/oib7e3vXZDkymgsOte6J1ShhZ/y13M+Q6caELcdcvQVBqF7yziMc7RPdrR2nGB hmSRnARBY+YFkFRT/099mGO7Eb19xp1polll5MUl6DVen3c4/FVqPHTEW8gZQ3ssJVDj W7Rzd28mBKbEJPZTQ6fyq3uDYjD6CJsDBm8kHiAyP5x7pdwFnxxKQqav+hqEMotdbJeB LCbbomQADqivhoo0gItjP+RkQs+GwIPaYshnvYNRkKeKCTHPxbdXWql8kjL1XNT+EiqX 6hHg== X-Gm-Message-State: AOJu0YxoetPSSv2rAQpLaGmtDRZ43O+mJ86kI5peApHWYBznOsY84/Oi 6/ttdKTDKzTl5gUs0qvskFyVvxdt6kBiVTW6Oe4S1fCnG/KBn50SyjVlz/lM X-Google-Smtp-Source: AGHT+IHoYQTBzj14M376es0XqjB4xp6jJSj7xoJ0LTJO8+DKXJKAOG979Nc4/JF5GA9RlC1AoCLA+A== X-Received: by 2002:a9d:4814:0:b0:6dc:5d73:d744 with SMTP id c20-20020a9d4814000000b006dc5d73d744mr496801otf.23.1706044880112; Tue, 23 Jan 2024 13:21:20 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id w2-20020a9d4502000000b006dc6e40ba97sm2265770ote.72.2024.01.23.13.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:21:19 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, Chris Morgan Subject: [PATCH 4/4] arm64: dts: rockchip: add Anbernic RG-ARC S and RG-ARC D Date: Tue, 23 Jan 2024 15:21:11 -0600 Message-Id: <20240123212111.202146-5-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123212111.202146-1-macroalpha82@gmail.com> References: <20240123212111.202146-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_132223_266571_052E4B27 X-CRM114-Status: GOOD ( 17.85 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Chris Morgan Add support for the Anbernic RG-ARC S and RG-ARC D devices. These devices feature the following: - Rockchip RK3566 SoC - 4 inch 480x640 display (rotated) - Goodix multi-touch (ARC D only, untested as I lack the device) - 1GB (ARC S) or 2GB (ARC D) of RAM - 2 SDMMC slots - eMMC (ARC D only) - Realtek 8821CS WiFi/Bluetooth - External stereo speakers - 6 face buttons (A, B, C, X, Y, Z) along with a D-Pad and start and select buttons. - A PWM vibrator. Note that the Goodix touchscreen on I2C2 is not defined, as I lack the necessary hardware to confirm it works correctly with the mainline driver. Signed-off-by: Chris Morgan --- arch/arm64/boot/dts/rockchip/Makefile | 2 + .../dts/rockchip/rk3566-anbernic-rg-arc-d.dts | 42 ++++ .../dts/rockchip/rk3566-anbernic-rg-arc-s.dts | 19 ++ .../dts/rockchip/rk3566-anbernic-rg-arc.dtsi | 237 ++++++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-d.dts create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-s.dts create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc.dtsi diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index a7b30e11beaf..647be86ea8a6 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -71,6 +71,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg-arc-d.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg-arc-s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353p.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353ps.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353v.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-d.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-d.dts new file mode 100644 index 000000000000..795fbedc3c1b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-d.dts @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rg-arc.dtsi" + +/ { + model = "Anbernic RG ARC-D"; + compatible = "anbernic,rg-arc-d", "rockchip,rk3566"; + + aliases { + mmc0 = &sdhci; + mmc1 = &sdmmc0; + mmc2 = &sdmmc1; + mmc3 = &sdmmc2; + }; +}; + +/* + * Unknown Goodix touchscreen at i2c2 0x14. Needs testing before it's + * enabled. + */ +&i2c2 { + pinctrl-0 = <&i2c2m1_xfer>; + pinctrl-names = "default"; + status = "okay"; +}; + +&sdhci { + bus-width = <8>; + mmc-hs200-1_8v; + non-removable; + pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>, + <&emmc_datastrobe>, <&emmc_rstnout>; + pinctrl-names = "default"; + vmmc-supply = <&vcc_3v3>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-s.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-s.dts new file mode 100644 index 000000000000..6264a8c78d0b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc-s.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rg-arc.dtsi" + +/ { + model = "Anbernic RG ARC-S"; + compatible = "anbernic,rg-arc-s", "rockchip,rk3566"; + + aliases { + mmc1 = &sdmmc0; + mmc2 = &sdmmc1; + mmc3 = &sdmmc2; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc.dtsi new file mode 100644 index 000000000000..a4a60e4a53d4 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg-arc.dtsi @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rgxx3.dtsi" + +/ { + backlight: backlight { + compatible = "pwm-backlight"; + power-supply = <&vcc_sys>; + pwms = <&pwm4 0 25000 0>; + }; + + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <3472000>; + charge-term-current-microamp = <300000>; + constant-charge-current-max-microamp = <2000000>; + constant-charge-voltage-max-microvolt = <4200000>; + factory-internal-resistance-micro-ohms = <117000>; + voltage-max-design-microvolt = <4172000>; + voltage-min-design-microvolt = <3400000>; + + ocv-capacity-celsius = <20>; + ocv-capacity-table-0 = <4172000 100>, <4054000 95>, <3984000 90>, <3926000 85>, + <3874000 80>, <3826000 75>, <3783000 70>, <3746000 65>, + <3714000 60>, <3683000 55>, <3650000 50>, <3628000 45>, + <3612000 40>, <3600000 35>, <3587000 30>, <3571000 25>, + <3552000 20>, <3525000 15>, <3492000 10>, <3446000 5>, + <3400000 0>; + }; + + /* Channels reversed for both headphones and speakers. */ + sound { + compatible = "simple-audio-card"; + pinctrl-0 = <&hp_det>; + pinctrl-names = "default"; + simple-audio-card,name = "rk817_ext"; + simple-audio-card,aux-devs = <&spk_amp>; + simple-audio-card,format = "i2s"; + simple-audio-card,hp-det-gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; + simple-audio-card,mclk-fs = <256>; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Headphone", "Headphones", + "Speaker", "Internal Speakers"; + simple-audio-card,routing = + "MICL", "Mic Jack", + "Headphones", "HPOL", + "Headphones", "HPOR", + "Internal Speakers", "Speaker Amp OUTL", + "Internal Speakers", "Speaker Amp OUTR", + "Speaker Amp INL", "HPOL", + "Speaker Amp INR", "HPOR"; + simple-audio-card,pin-switches = "Internal Speakers"; + + simple-audio-card,codec { + sound-dai = <&rk817>; + }; + + simple-audio-card,cpu { + sound-dai = <&i2s1_8ch>; + }; + }; + + spk_amp: audio-amplifier { + compatible = "simple-audio-amplifier"; + enable-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&spk_amp_enable_h>; + pinctrl-names = "default"; + sound-name-prefix = "Speaker Amp"; + }; +}; + +&cru { + assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>, + <&pmucru PLL_PPLL>, <&cru PLL_VPLL>; + assigned-clock-rates = <32768>, <1200000000>, + <200000000>, <128000000>; +}; + +&dsi_dphy0 { + status = "okay"; +}; + +&dsi0 { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + ports { + dsi0_in: port@0 { + reg = <0>; + dsi0_in_vp1: endpoint { + remote-endpoint = <&vp1_out_dsi0>; + }; + }; + + dsi0_out: port@1 { + reg = <1>; + mipi_out_panel: endpoint { + remote-endpoint = <&mipi_in_panel>; + }; + }; + }; + + panel: panel@0 { + compatible = "anbernic,rg-arc-panel", "sitronix,st7701"; + reg = <0>; + backlight = <&backlight>; + IOVCC-supply = <&vcc3v3_lcd0_n>; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_rst>; + reset-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_HIGH>; + rotation = <90>; + VCC-supply = <&vcc3v3_lcd0_n>; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; +}; + +/* + * Device uses a non-standard six button layout for a gamepad with X, + * Y, and Z on the top row of buttons and A, B, and C under the bottom + * row. + */ +&gpio_keys_control { + button-a { + gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>; + label = "A"; + linux,code = ; + }; + + button-b { + gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; + label = "B"; + linux,code = ; + }; + + button-c { + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; + label = "C"; + linux,code = ; + }; + + button-left { + gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>; + label = "DPAD-LEFT"; + linux,code = ; + }; + + button-r1 { + gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; + label = "TR"; + linux,code = ; + }; + + button-r2 { + gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; + label = "TR2"; + linux,code = ; + }; + + button-right { + gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>; + label = "DPAD-RIGHT"; + linux,code = ; + }; + + button-x { + gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; + label = "X"; + linux,code = ; + }; + + button-y { + gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>; + label = "Y"; + linux,code = ; + }; + + button-z { + gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; + label = "Z"; + linux,code = ; + }; +}; + +&pinctrl { + audio-amplifier { + spk_amp_enable_h: spk-amp-enable-h { + rockchip,pins = + <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + gpio-lcd { + lcd_rst: lcd-rst { + rockchip,pins = + <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + headphone { + hp_det: hp-det { + rockchip,pins = + <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pwm4 { + status = "okay"; +}; + +&rk817 { + rk817_charger: charger { + monitored-battery = <&battery>; + rockchip,resistor-sense-micro-ohms = <10000>; + rockchip,sleep-enter-current-microamp = <300000>; + rockchip,sleep-filter-current-microamp = <100000>; + }; +}; + +&vp1 { + vp1_out_dsi0: endpoint@ROCKCHIP_VOP2_EP_MIPI0 { + reg = ; + remote-endpoint = <&dsi0_in_vp1>; + }; +};