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: 765777 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96A742C1BC for ; Tue, 23 Jan 2024 21:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; cv=none; b=fhm95rbQOpBPqVYhlU+utvFmNSyh5F5FJ0Luf03wucCnx62B7F8n29Hv46n/UsBzZYAkJ8xMaE+/n5g90hubnpxtmypmJKO9E8oQu+7ckg5T/9uHjzxlK/hejdoYKDBIjwS7LqmfTjrBaQrWnTT40rExh9tCrto5UDl8hqelkps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; c=relaxed/simple; bh=bLbHblfklv6DyfX+wEHJLDoaFQApt56Czv0huwiAQ40=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BcXeEXVgeQOcmS8+FkEbYJEDOj9PDUHwyJCIrftseFL1aUF6P0OhItoCMv/Gfc4swV8zd8qoo5ZzOUOJ15sG3t3WVMCNS5EwxpSnHitbls96Hj9JmQHOVldPr+K1xN12xvMMtN3nXBH8Pd0C8NxAB3Z5sCrisxlxvL8D+8KPiQA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BUmKv755; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BUmKv755" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-214917ed35aso483810fac.2 for ; Tue, 23 Jan 2024 13:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044878; x=1706649678; darn=vger.kernel.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=BUmKv755MxQanlwSAsmQm7aKMRjZM6zcE1sXgLzfmg2U1qFW/4VCgpk8Xi/K8OQbqD hdNhCn8N+xuJZUjboulgc+g7l5qAnAKwexAy5oDte/NNFrxan5BOffWbKOxAHK9ftSCV h6POxs3H3NTipy7c1LStD9/lXvgluNDxQ6BJBgvCENiGbpxyDvivA1OFTYUbk9trKPxQ 0C6XUcgVHzKbnO+GGZ+kARMLFZ0li4F4Qd1sqoAouZdIW8SESuld5OCkvibsCz6enH8v RjqtDYUSSA+AyZIwLmYs+231AiN0Wzh89feCAgGwH2nXZJBgpyMswCPbs7MYli/EQ91q Wubg== 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=AdfFdFIDPc8h7A+a9SS/jff22g9UpvBNTGMmD7r/QcDWRpJ7zKOi4NPIL09fHIN8nv fQLDNOvrGAvzzHvO8Z0PlE/IAa6vYIubkOQpFClnxuDSkqdG1YRdfALoQv0dGsY4aznB 547McvOW5O9wOfdEBpd8n2q+QUHMuZzUIwM5QVkd25RRkKtRHGtTw/Tn9cXQbSYhbsKg QK02YDT4fCLCm0IYnQM64Ox0Rdda6H1EI98x5jhmzWlEebv/JLUZ8Jtgkv71m6VI4rDl 8o0ov06hW/M2JPUCFvf5eOFCkRPfGhXDJGXTi2K0IiN6Ovm/2AaeGg9nVV/IEpB4WTsm bOwA== X-Gm-Message-State: AOJu0YwwPJGdA867HQyrB5T+EnBOt9tgVYF4H36KH/XUUuCdKtbYPn8Q yh2v4dAyrNA0uzaWMVrH1Ua6XRSDcQJYFCTqUckJSmh/Q+PwzuPp 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 765344 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1F602C1BF for ; Tue, 23 Jan 2024 21:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; cv=none; b=O5AvCKpy4TdeRvyEl8rBvpDBaPvGFAqtsIvxHi9Vd5RuKHiJ60GhY0l1CpDLb6fbzPDsK55DhMSd6u/FVlwZ5eQ6g4uUkg6POTlJXrVqo8qleJYmSCFXhZsQbvuPy+QWmSBMzu1fj3j+lXY1ZZRBvqEpwkrfCCK+txSRXXnpzJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; c=relaxed/simple; bh=1ZHP3yIW4cG47qhxCPSwerTEAfqsHzWhDkhXzRPrXPY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eoQuXyGYLvfFVSNPAKwbVdqwc9rzrO56aLWgBqzWCC8LXMkY67NRVNdOF09y52xlxqu8CQj67hsKILQNI4tfY7K8mFHyO7tDEvNH3q2oPaqNfq9G5ioKA4LSLyvF+bo18g4jU1PyvbRn8M3bB4Ql0t0sGRz4aMFienXkW+qqOrw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A4v/zdNM; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A4v/zdNM" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-2148b28ccafso469946fac.3 for ; Tue, 23 Jan 2024 13:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044879; x=1706649679; darn=vger.kernel.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=A4v/zdNMPIe+rGAZvYPl+kkyA2ppufM8tQhjXVNkazA6gj1926wDIk3bmbbLNedJmC emLdJ1LfnzNfvBxSz+zfTNEdDGUlwYdCvoiLZnEfy49BVhPioHPhIqRf7NfX1+O3IHS2 S8zycTYaPbPwqTECvQu1gP0HjTeUmXQ06Iooif5LjDSDOSByxQn/GVLgbaaEs26Zgiuy hyoKwYXJo/IBSRTcgJ07DeMfCJ90tnpLNpVm7OAx9mPcDV2yj+2Zr6ay97i1gzoxht0h /ZO5PpyVoXi7UeIRljqDfokzdS69CYDdn0mw0vHkBIazJywKqVyxO5JrILrvKdh7Cp55 7gRA== 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=NPMOoA63DCUKzNd5mXvR7AJFF1PfYzSt42xkP9kS3JYagxcQ45onHcsLwggABhznqx sYriefp0goYjDQJQcFRUeCRldRWeEyEQ0kq32+ueZZECiSHIE9OfgKBzRx9bacA+fxgO xJI7IukkRginO+6oyuXfYkO/rHjYOBnvnLC4KvpCzcj3QwApATsWqhfzREgzoReYclD+ U6D3IyxVk7rMKlCGvkiURa/ZZrAWlaf6ocRYL6nmaTLTfn3Dq3nUE6U7NzqwGQNhMhO1 3OZWfd24+hlsOgdhW0rp9hA+FFd5DdrWTv45aQHKilUZk3qzF8uj8XgWQqIruwWYRzwy uB5g== X-Gm-Message-State: AOJu0Yy9Mo4RpTfv73t128ReEFrM8OpIKR2Gyto8ERzawSH+1s6va0LC l4uVJQLxr+rjT9rBah5wMFJRM0LKGhDTcrg7kkxg54+7vcHlo1TX 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- .../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: 765776 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7390133CD2 for ; Tue, 23 Jan 2024 21:21:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; cv=none; b=DuFDDc7l5tXc1lMJ5vZfNacRiMqP5Op22H4jqzZtdrqJM6k90anzu7trkZ7UBnBT/KqwRcJCuXIWJZWOI9b5SZTyziBCQJNQM4a/OA/ykrqsOjr8sfkmkNsPvVe8WJqWTOyaOlFNCelVqfuoOnOp3k6LMjO6zUvmZMUzyKynu8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044881; c=relaxed/simple; bh=mT3LHcSVS0wNEtYyIcmIub8y/2+sQ0zbTNTXIH2BM94=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Fw//ubtfanWiFnsyFJO7JtDBN5yNynGJFETqqXlBFm/m61LjMwTcIFSaH1e9b7cPKpiryNQkfRxmVXJX4Y3fsPqEY0aW0FZPxWSpZhC+5++5GV/BkRDMlmKVo39puenSggoTLDQ5ToQl4uAJ7WVUpT4IkRZMDsZIAqm+kywlmU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c08MyxVI; arc=none smtp.client-ip=209.85.160.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c08MyxVI" Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-214917ed35aso483821fac.2 for ; Tue, 23 Jan 2024 13:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044879; x=1706649679; darn=vger.kernel.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=c08MyxVIkPAJll7ScaUYHgvF5zzaL0q2OC1NHoABT2wy6SRK6Myv6fxYHJ+DZn8DhO W9tHtbS8CzVSFQlBgxakBwO8Ukz2zeBPJEyPpootVpzRGDLPevUxokBX3I05bohF0igc jttHARHgt4suMj4WhzM3kF5sbJFsWgicTImJRRBd/vj3xzPkCQzqhBGSrquWVslRAaiG 1QVkvTQR9u8F2yNG9H+pxFXdJcnEGjyjKxmbK46frfGiBXfwjOcU5jIOhNyn2vWtzR8q Ji69QIqZBWEKF0z4XLPsKg+uivzl4+1OSa086FXyvXs9GfEtAuVLDRan2D0ZucXfoi6D 6Deg== 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=Qw5nHEKWSTWF5yHjb7ha1g20czznngBPni0SFog8BG8KBI5LP1ROsXh7gGhPH/nRja GZZlHaqcR1ZMF1QG3NSL7BtSr5kaS+hDwnc+HbvMhpg+PfXSnyCHZ2/CZlMZ+OiyN4EI GIH9vcUlc12h23s8Fdro+3NzY1Mgk1aju0tMANmsBwrmrBJKKOUOsityQDFFD100ghB3 1F9Fb393obkasbsORzyC4iHuV6z2Uv+TgEKSWCXxsnWoFSTdWqVctMIDwyCsB7iWUnUQ J/UiPjBI9i78yg+w3DKLTnE1tvxgB/FXz5hnWQ8K/460xma3Y5bTmKqUYi24+ns0xcOt y3+g== X-Gm-Message-State: AOJu0YxPr1CMpy8D/12XOlQVc2S5ViY2ErIN9vT04kS/STFYOmZ7Lrig Rp9QK3IuPAj7R6JeLTxG7ppefqqs1pmxlgK1vLrvQ/00pJ8R0yZq 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 765343 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30D0B2C1AE for ; Tue, 23 Jan 2024 21:21:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044882; cv=none; b=dfcxd/vsjzMp8Zwmp3h+P4iS6vRSosUYFNZj/mTcZoAg4NrqgSins7HJVWoNIeYTbCiVnEwcq3q0rU9fuqAvFGKGApYUbfQ0pB8yS9gjpH9nLUrC8XLpV4LnswGc7GotK02Rr9akSn4RzxxiRaODeFtmYP3lZ1qnZGzD1fScDrs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706044882; c=relaxed/simple; bh=Y1H2A+5Z9EQXjaxUM0h9jpsEThbZtsnktj3gDx+ykeE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Wzfpvaes21sHqwGgZkLlKsdcizkw5yeJx3EHFBjLmvvcFe76cNCaeW1uZqKA/1Jl05+ku0BQzHRWu39R0McFVeYUNm2XB5cZSIqb6JP7O7SpQrnxB4Dkzdtw4zujO1VZTbZhwdrh3HOOcWbhwXahlQZQF4wih6fiB+iC7hdw2Iw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W54GWEoM; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W54GWEoM" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6de424cef01so2343037a34.2 for ; Tue, 23 Jan 2024 13:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706044880; x=1706649680; darn=vger.kernel.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=W54GWEoMhun618yszUywdKtsuAhjDxv4rs4aLV+PHHnJfJkDyW4lCamUuaMq4+HpvN ugI1lE8LEXU8dV9LMeKiDtcEPSQzMIAmsGORpiRtnZcfofrlaXMcBjDbfBsKyzmcl04M ClLGc2j5RZiLYZPLjsRLmRXWXkeS8/ebpTdSiErahNNgsldiuhQQURqapeBPQ5H2Liyx aq3J3B7NjerZujcR5RckcIP4iWy22kycQxJ+V3ParrNIgY5FIZETaTp2UQT8zcO00qJ0 SbnfFVFNuWSRsKowuPBLxYIs3AoaMC8BkMX23h72jZ4crCZGgTb+xeb6eZdf3A9i8Ym7 ztVQ== 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=TO0Yr/pMWIxz5piRFDIHVsQdCYmwLMl5JfkJioVsouAFUqiHHzSxsVm+ueofgjzzRX dypcz6XkPHaTEy92awYkuMn5FHoELJ/c37zH7Nnh8EZZGbahY+8KXZ0iSmuz1HkFxLAo OEcGacA1N8VQa40IJ2ZsRFN/Y3JS7bSx3+KHuaBN0o/QtroOoiwP1bXRSBZhVUgcmjgu i6dfjBAnS/5j5CNLmGtGJpsFxjY+H1LXLERYSmNbO6VXXAUwe0WJz2ojbH7v4UnhYW/x R515FctUHrR9tFvupBSP5LK3Lf6tdDVz52Hcv6jQcBt7yIA9J6cf58thMzRvnEGjDZWj R2TA== X-Gm-Message-State: AOJu0YxFO6sSx8qBPwM+oFPRD5xkbrWiQqr2OgrtbEkcFnFblpLat7xe +djbsv4WWoghO+gmkZy6/v+tJlglHZgIkly08nBcFG2ngjkotVma0uw3mA4v 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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>; + }; +};