From patchwork Fri Oct 28 18:40:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13024212 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 59BB2ECAAA1 for ; Fri, 28 Oct 2022 18:41:20 +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=N5RlYh5P5BDX5Lk6xd0CyICXhI5RPM+YqGsOsuxe3iY=; b=YP7e9tfTUt8W/b xxMVy6l/lwIC1Q1oOqH/cvbFvc/wTvI76eIQxNJVdea+QbB8gjFHJiCZHb3Km+aHwV7cnU0mgYC39 V4By5u4AVR5uVDOHG5WekmS8fG9B+AYOi4Bk9Qpb2Uknrk8nHu2umzaagJNcYw61ZZjeapOMxWw9k ljtCJCXWi5DmeMlH0MBVofJCl0UMzEWjDEVRMpDFE/mFIzXAj4y0WjD08TPTHvgrdiKVu0FF5W6JZ YlxtFJD0QbAnSeisugUgIJzi5qntwb/Nr26IRronIOJdhHBktwzywSB8W/pFxVWiFNUl06Mv5a0RL IDVYOUXU45CoTEgFXDBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHu-001fyx-JA; Fri, 28 Oct 2022 18:41:02 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHs-001fwG-OO for linux-rockchip@lists.infradead.org; Fri, 28 Oct 2022 18:41:01 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-13b23e29e36so7226324fac.8 for ; Fri, 28 Oct 2022 11:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=bpyIZVffuIxdOIfYvVswAUCJsvme+Kcw8Gat2LDzQEI=; b=Rg6HASonaiUryrYoyr+r4a6e1c7UDoxxLuTp/qZwATQOApibHardEl0dQtNY5YJjpM 8WUW5e8MWLHIrgzyJOJOrSUmPxEhk7s5A+a6bRCCJW96A0DbSUbhC4dTuWd+VQ+OwbN7 AuClE1+DL9NXpsoR1obzNwzbiWadGh8l9rpR8PyTAlCUVbjfuDgA76xZJ4LlhZNn+Ifa tAO1Fh2VoIwjyyBYounPwVgS9AAUdi5fHE/4rWLaEQWyhRQfk1BvJux22DaZpK+a31bA LMwZK0HNtaZjHbjG/PkwV7Xj4/YrFlw556ufHwLE2cRAxZWwnS0YW5zrx+OWWkF5OTWj FrdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bpyIZVffuIxdOIfYvVswAUCJsvme+Kcw8Gat2LDzQEI=; b=Z8HVSbhiSPZmPnPbvHZzvFhN3RCW/TaSmXyuVpgBBpdHQcyglRj2fALCD/xMKWg4yH 82B3GveI7GOsAcjH2ozZDaBwbeznXF65PD95O0uqtf9mhxHsJIi6gC6KgSa23VWldz8p fJj0wUMydyv/v/JubaVyH0Rf+P8Ezo0hJHHw/ZlVxANwG6Lr4VRyBaVBZDQ5fQK6UrkM wkRz1TBwBuMSC6OncaeHLt4Mm8Kk7Kc1EtFa81F+fBH0Bw3CCiUGHWYSnh9FA194/cbG c7EzBxvyZ3xZS79l+p/QuI9j3w9e81wIab9sXnWYgB7a6TEOmdtncg03ZLtQdA5XhW9j wswQ== X-Gm-Message-State: ACrzQf2ORV9eceygHIaHHiMk93gqx6Fzh9Zcc9Qqh1EwISPsfBdNwRxM q/k6PY322OlMXKi/g3RgkI0= X-Google-Smtp-Source: AMsMyM5SLy6kx00jwdnaLVHITsi9r1R7pxjdOG7cRPBFAbthoZStMOySAcBo5wg8n8/45qNvqBjV2Q== X-Received: by 2002:a05:6871:54e:b0:13b:29b7:e4be with SMTP id t14-20020a056871054e00b0013b29b7e4bemr351350oal.176.1666982455729; Fri, 28 Oct 2022 11:40:55 -0700 (PDT) Received: from wintermute.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id z7-20020a056830290700b0066c34486aa7sm575288otu.73.2022.10.28.11.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 11:40:55 -0700 (PDT) From: Chris Morgan To: devicetree@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, pgwipeout@gmail.com, michael.riesch@wolfvision.net, frattaroli.nicolas@gmail.com, jagan@amarulasolutions.com, Chris Morgan Subject: [PATCH 1/4] dt-bindings: arm: rockchip: Add Anbernic RG353V and RG353VS Date: Fri, 28 Oct 2022 13:40:42 -0500 Message-Id: <20221028184045.13113-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028184045.13113-1-macroalpha82@gmail.com> References: <20221028184045.13113-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_114100_814757_5A946E29 X-CRM114-Status: UNSURE ( 7.78 ) 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 entry for the Anbernic RG353V and RG353VS handheld devices. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/arm/rockchip.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml index c6c69a4e3777..29a1a30e0606 100644 --- a/Documentation/devicetree/bindings/arm/rockchip.yaml +++ b/Documentation/devicetree/bindings/arm/rockchip.yaml @@ -35,6 +35,16 @@ properties: - const: anbernic,rg353p - 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 From patchwork Fri Oct 28 18:40:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13024214 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 9927BC38A02 for ; Fri, 28 Oct 2022 18:41:26 +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=jL+7UYFGPBLfSNAu9/7UYHrfFeMRLqiceg//TWwjpFg=; b=hiVE+ZqdBaXke0 uaONm00g94LmexdmqrOXXeOR1DnmlTwx2x6cYaCMATV1awey77FPpSnPFD8zUfiaR0s1p5pGk3zTB 4CV4e9P2U1z+GfTGDfGBajKal8CWRiy6pA2p9zQhEGAUrYyAl3Q0jEj5aqlB52HkD02aMZckglzhV jE+OGFRO5dbOmFMtEuBBgpc+eQ8BFkTCdEHd/rJdDKINzI2qJ4mLfit//TGudzRDDhiuZ/vKT2SOH oAVOhFTVyt6mZzNtq/UY/HbEfS12HPyAhVDCdW84Cq75ej2Cy08ym9VUk4rqSxQzhkukJ/3gaOy+/ b2x61j4M9ClXoGUKKI8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHz-001g1R-9T; Fri, 28 Oct 2022 18:41:07 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHt-001fwZ-SH for linux-rockchip@lists.infradead.org; Fri, 28 Oct 2022 18:41:04 +0000 Received: by mail-ot1-x333.google.com with SMTP id m5-20020a9d73c5000000b0066738ce4f12so3441770otk.12 for ; Fri, 28 Oct 2022 11:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=LouHoam5+iRmoNrs0ELN6FfFkIBlxC8hLZUylAnx03Q=; b=DEfdzGsqha24l5CIOBo7L83b55r7SOUC8AqH09wuIIMfGhVsbwLUkFn6ew4WMxDzsb iIDdRsICxnCOqj+aaJ1FGfJdjTDiMnH3W0vg8MaUUTG76+Han+VjrghfLklLCbic21Gy p9kRcr5dsTg6W5DID7zyuWFdUYElKAI/ijGufwyMnhkB4YHAXx+BoP19RiEWh529euoo qwsNrpM40wsG7uExmtpalZTkScOt7BD1O6jROxfsOJQh9Ti5VgV+odx1XlKFW3+wHeVL S3PZyWxIyNVGJpKrxwfNQzscWOb76qwgXRl+Ae14YhXWr346EVWhPj1CqKpDpEizkmN5 TOYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LouHoam5+iRmoNrs0ELN6FfFkIBlxC8hLZUylAnx03Q=; b=OSS2jIcaTNQqZZIUwrqcKRAvMF4YNYhmxVEaeaJWelWR0eE5So9Z68n4ynlX14b4lh raJneFwKJpCWwwyFNwpad3DeZo/+x9evhiWNt/fdnTv6rMRbWSShSdJ3+cqLqYm4rccM iKCHomqpSS8JO/K323STJzerxXNUnduA61Vnj7LvPWnge+5tx4VgUUyHF4hcO5zaY5Mt 30yAF8iaLSltiMkRtKPcIFSNaBFhYKTfxfZ8V2ZtEkHIiMAEryVDLbqX2A6E25vaOlRj x2s1oqNx9z4jfF2PiLFn+0vKf+JAj8FC3uRkPO9gnlJlydqcqRj9D6XKtxi/LbJHLupH U7Qg== X-Gm-Message-State: ACrzQf0Ju7guHoZpV9k8SvsksgLY9rVLNhjew2IFa0Z7tba5284q5y2D USz5XwdTVssStEsYECMeQ3U= X-Google-Smtp-Source: AMsMyM6PEBOe02jFPFWDKDCe1KyxZmNUoIslBcpcXVXblcUzzg1NkAGwzgQGlsME076X40Tg6jnwfQ== X-Received: by 2002:a9d:368:0:b0:66a:ec25:62cc with SMTP id 95-20020a9d0368000000b0066aec2562ccmr368944otv.220.1666982457325; Fri, 28 Oct 2022 11:40:57 -0700 (PDT) Received: from wintermute.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id z7-20020a056830290700b0066c34486aa7sm575288otu.73.2022.10.28.11.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 11:40:56 -0700 (PDT) From: Chris Morgan To: devicetree@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, pgwipeout@gmail.com, michael.riesch@wolfvision.net, frattaroli.nicolas@gmail.com, jagan@amarulasolutions.com, Chris Morgan Subject: [PATCH 2/4] arm64: dts: rockchip: add Anbernic RG353V and RG353VS Date: Fri, 28 Oct 2022 13:40:43 -0500 Message-Id: <20221028184045.13113-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028184045.13113-1-macroalpha82@gmail.com> References: <20221028184045.13113-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_114101_949729_4E55EB77 X-CRM114-Status: GOOD ( 18.24 ) 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 Anbernic RG353V and RG353VS are both RK3566 based handheld gaming devices from Anbernic. They are functionally very similar to the RG353P with the following distinct differences: - The battery size of the RG353V and RG353VS is 3200mAh instead of 3500mAh. - The audio uses the PMIC's internal amplifier for a mono speaker instead of an external amplifier with stereo speakers. - The GPIOs for the R1 and R2 buttons are switched. As for the differences between the RG353V and RG353VS, they are as follows: - The RG353VS has no touchscreen on i2c2. - The RG353VS has no eMMC. - The RG353VS has 1GB of RAM instead of 2GB. Signed-off-by: Chris Morgan --- arch/arm64/boot/dts/rockchip/Makefile | 2 + .../dts/rockchip/rk3566-anbernic-rg353p.dts | 83 +++++++------ .../dts/rockchip/rk3566-anbernic-rg353v.dts | 114 ++++++++++++++++++ .../dts/rockchip/rk3566-anbernic-rg353vs.dts | 87 +++++++++++++ .../dts/rockchip/rk3566-anbernic-rg353x.dtsi | 60 +++++++++ .../dts/rockchip/rk3566-anbernic-rg503.dts | 51 ++++++++ .../dts/rockchip/rk3566-anbernic-rgxx3.dtsi | 46 ------- 7 files changed, 358 insertions(+), 85 deletions(-) create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index 8c15593c0ca4..a1f38acb8dfa 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -62,6 +62,8 @@ 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-rg353p.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353v.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353vs.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg503.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.1.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.2.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts index 7a20e2d6876a..80716b2ebd29 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts @@ -5,7 +5,7 @@ #include #include #include -#include "rk3566-anbernic-rgxx3.dtsi" +#include "rk3566-anbernic-rg353x.dtsi" / { model = "RG353P"; @@ -18,26 +18,47 @@ aliases { mmc3 = &sdmmc2; }; - backlight: backlight { - compatible = "pwm-backlight"; - power-supply = <&vcc_sys>; - pwms = <&pwm4 0 25000 0>; - }; -}; + /* Channels reversed for both headphones and speakers. */ + sound { + compatible = "simple-audio-card"; + 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"; -&gpio_keys_control { - button-a { - gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; - label = "EAST"; - linux,code = ; + simple-audio-card,codec { + sound-dai = <&rk817>; + }; + + simple-audio-card,cpu { + sound-dai = <&i2s1_8ch>; + }; }; - button-left { - gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>; - label = "DPAD-LEFT"; - linux,code = ; + 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"; }; +}; +&gpio_keys_control { button-r1 { gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; label = "TR"; @@ -49,27 +70,6 @@ button-r2 { label = "TR2"; linux,code = ; }; - - button-right { - gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>; - label = "DPAD-RIGHT"; - linux,code = ; - }; - - button-y { - gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>; - label = "WEST"; - linux,code = ; - }; -}; - -&i2c0 { - /* This hardware is physically present but unused. */ - power-monitor@62 { - compatible = "cellwise,cw2015"; - reg = <0x62>; - status = "disabled"; - }; }; &i2c2 { @@ -78,8 +78,13 @@ &i2c2 { status = "okay"; }; -&pwm4 { - status = "okay"; +&pinctrl { + audio-amplifier { + spk_amp_enable_h: spk-amp-enable-h { + rockchip,pins = + <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &sdhci { diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts new file mode 100644 index 000000000000..885234a023e1 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rg353x.dtsi" + +/ { + model = "RG353V"; + compatible = "anbernic,rg353v", "rockchip,rk3566"; + + aliases { + mmc0 = &sdhci; + mmc1 = &sdmmc0; + mmc2 = &sdmmc1; + mmc3 = &sdmmc2; + }; + + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <3151000>; + 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 headphones. */ + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "rk817_int"; + 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", "SPKO"; + + simple-audio-card,codec { + sound-dai = <&rk817>; + }; + + simple-audio-card,cpu { + sound-dai = <&i2s1_8ch>; + }; + }; +}; + +&gpio_keys_control { + button-r1 { + gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; + label = "TR"; + linux,code = ; + }; + + button-r2 { + gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; + label = "TR2"; + linux,code = ; + }; +}; + +&i2c2 { + pintctrl-names = "default"; + pinctrl-0 = <&i2c2m1_xfer>; + status = "okay"; +}; + +&pinctrl { + touch { + touch_rst: touch-rst { + rockchip,pins = + <4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&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>; + }; +}; + +&sdhci { + pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>, <&emmc_datastrobe>, <&emmc_rstnout>; + pinctrl-names = "default"; + bus-width = <8>; + mmc-hs200-1_8v; + non-removable; + vmmc-supply = <&vcc_3v3>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts new file mode 100644 index 000000000000..a7dc462fe21f --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353vs.dts @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rg353x.dtsi" + +/ { + model = "RG353VS"; + compatible = "anbernic,rg353vs", "rockchip,rk3566"; + + aliases { + mmc0 = &sdmmc0; + mmc1 = &sdmmc1; + mmc2 = &sdmmc2; + }; + + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <3151000>; + 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 headphones. */ + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "rk817_int"; + 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", "SPKO"; + + simple-audio-card,codec { + sound-dai = <&rk817>; + }; + + simple-audio-card,cpu { + sound-dai = <&i2s1_8ch>; + }; + }; +}; + +&gpio_keys_control { + button-r1 { + gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; + label = "TR"; + linux,code = ; + }; + + button-r2 { + gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; + label = "TR2"; + linux,code = ; + }; +}; + +&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>; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi new file mode 100644 index 000000000000..65a80d1f6d91 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi @@ -0,0 +1,60 @@ +// 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>; + }; +}; + +&cru { + assigned-clocks = <&cru PLL_GPLL>, <&pmucru PLL_PPLL>, <&cru PLL_VPLL>; + assigned-clock-rates = <1200000000>, <200000000>, <241500000>; +}; + +&gpio_keys_control { + button-a { + gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; + label = "EAST"; + linux,code = ; + }; + + button-left { + gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>; + label = "DPAD-LEFT"; + linux,code = ; + }; + + button-right { + gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>; + label = "DPAD-RIGHT"; + linux,code = ; + }; + + button-y { + gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>; + label = "WEST"; + linux,code = ; + }; +}; + +&i2c0 { + /* This hardware is physically present but unused. */ + power-monitor@62 { + compatible = "cellwise,cw2015"; + reg = <0x62>; + status = "disabled"; + }; +}; + +&pwm4 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts index 3dc01549a5b4..c56c290f0d87 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts @@ -29,6 +29,50 @@ gpio_spi: spi { cs-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; num-chipselects = <0>; }; + + /* Channels reversed for both headphones and speakers. */ + sound { + compatible = "simple-audio-card"; + 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 = <&cru PLL_GPLL>, <&pmucru PLL_PPLL>, <&cru PLL_VPLL>; + assigned-clock-rates = <1200000000>, <200000000>, <500000000>; }; &gpio_keys_control { @@ -76,6 +120,13 @@ button-y { }; &pinctrl { + audio-amplifier { + spk_amp_enable_h: spk-amp-enable-h { + rockchip,pins = + <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + gpio-spi { spi_pins: spi-pins { rockchip,pins = diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi index 2b455143b86d..010c6a77a9da 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi @@ -217,37 +217,6 @@ red_led: led-2 { }; }; - /* Channels reversed for both headphones and speakers. */ - sound { - compatible = "simple-audio-card"; - simple-audio-card,name = "anbernic_rk817"; - 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>; - }; - }; - sdio_pwrseq: sdio-pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&rk817 1>; @@ -258,14 +227,6 @@ sdio_pwrseq: sdio-pwrseq { reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_LOW>; }; - 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"; - }; - vcc3v3_lcd0_n: regulator-vcc3v3-lcd0 { compatible = "regulator-fixed"; gpio = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; @@ -607,13 +568,6 @@ &i2s1m0_sdi0 }; &pinctrl { - audio-amplifier { - spk_amp_enable_h: spk-amp-enable-h { - rockchip,pins = - <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; - gpio-btns { btn_pins_ctrl: btn-pins-ctrl { rockchip,pins = From patchwork Fri Oct 28 18:40:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13024211 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 C4AB4FA3742 for ; Fri, 28 Oct 2022 18:41:15 +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=Ayyga+XiSLTvIdAjDcm6cNHDZ3Mp8mkcphqWeH38n/A=; b=NslbmshWeW7s/S HjZHYVuAUZ4z/iUzpI+tGtierZDJObMvkeNmw+1Bxql+wnVo6P59ehNSNByRObftNtiDqXqbixZS8 sH4yLR6Sbs7W7xVDl4RCAnp/Ene0/gwPthbTaBWHZ6UqziYXP5SwuVmsTm4puvdS8GBTOgdhQlcMr Jcru1TN0nhpRqwL6oTkJi32KX9qmiU4y2sSc36cCdbQJ4ICvx3IhWLIkA2z/rYf+jW24JWHUKa3Id GK3wlvYs37B2mRrYqfHxAgg1gton+BvjQXuKz/C0UUuwXb0exeYAuQsaM7Z5fAux6YKSc8YM/k00m DDT73ufHqXhBKgqbnscg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHx-001g0W-Ps; Fri, 28 Oct 2022 18:41:05 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHt-001fwz-Pa for linux-rockchip@lists.infradead.org; Fri, 28 Oct 2022 18:41:03 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-13c569e5ff5so6855964fac.6 for ; Fri, 28 Oct 2022 11:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=4ynt6JT69HA02Oq8WM7F4kqQBK5tLRg6dL8O0dxxMqc=; b=Pkxqg5BTmAVShE5+autPmavgdFYq6sH3gqtICfzT0mN6bJR+ty/vuMl3uFmwHMKo9p HxesyXUXBX7PAjdTJjoQME0bpqDjP7Nd5aH3U916XVNT4eAwgCPjs7ZShnS9nbuACiuZ KAzbXeLo911fjY4jWF9NQqzULD6s73f+P6fB0wUNRKWun+9B+yngWCLqRXI0L0uxwMC/ L8EaT4F6iPo5S8ySdgbOuUwu+HNKi+fGkpICDRSlGD0CBETdTJK+el4YUjWox7TvIJ/s VPOR8rSNjLJbnZYh4UZxFarAv2fPP8K3GETpoAStdDLzEs+jbeuc79rwGCIRQyk0GRJI PqUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4ynt6JT69HA02Oq8WM7F4kqQBK5tLRg6dL8O0dxxMqc=; b=TXvOkCYTmiGYaKwized8Y01i+yVrJakY5CibA/qEzai9L0Re65V0+KKgVguLLB9G6N 8HzXhF+cdhUlOYQKRnG9KocgvoRVVKR2I8Mju/6tRJqQ+GFpGY/S+oKLmJlqZna+8Mpk ziSKWrMY2hUT3KTZb64YE/0MltPE3M/kMcP7yIebgD9iQc/6QqJRtjAf9ioWD2+SES/M 0lpVHbAubyQMMVKIQmU8KgFrI74xLLTsHlwns0tiIrJCxzpOAD36K4TwtQNCdqyUShie Ls4QvNEUHycjfOdTxzR8bcd5+DGeEp69jevhDYtWujP9XkS5TGP6sTg95R6jibhCoXkz uVQw== X-Gm-Message-State: ACrzQf3NM/mnMeuB09F9dROaG8rsuyhAbXmVRRrlO7dqa1gTapjN+lR/ VbzpB0OoIwjTV/qaCKxd7njRRJHzjhM= X-Google-Smtp-Source: AMsMyM7F+br2pqNe1GmsfyUORiHlcDIJZu1fQJXHoowqOaPfw/dZ2FJlY96pJhMt2R8m5hOOY3HUZQ== X-Received: by 2002:a05:6870:a449:b0:13c:7d1c:5116 with SMTP id n9-20020a056870a44900b0013c7d1c5116mr325067oal.27.1666982458410; Fri, 28 Oct 2022 11:40:58 -0700 (PDT) Received: from wintermute.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id z7-20020a056830290700b0066c34486aa7sm575288otu.73.2022.10.28.11.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 11:40:57 -0700 (PDT) From: Chris Morgan To: devicetree@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, pgwipeout@gmail.com, michael.riesch@wolfvision.net, frattaroli.nicolas@gmail.com, jagan@amarulasolutions.com, Chris Morgan Subject: [PATCH 3/4] arm64: dts: rockchip: add rk817 chg to RG353P and RG503 Date: Fri, 28 Oct 2022 13:40:44 -0500 Message-Id: <20221028184045.13113-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028184045.13113-1-macroalpha82@gmail.com> References: <20221028184045.13113-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_114101_849809_327DD905 X-CRM114-Status: GOOD ( 10.28 ) 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 internal battery and charger for the Anbernic RG353P and RG503. Battery values are taken from the BSP Kernel device tree. Signed-off-by: Chris Morgan --- .../dts/rockchip/rk3566-anbernic-rg353p.dts | 28 +++++++++++++++++++ .../dts/rockchip/rk3566-anbernic-rg503.dts | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts index 80716b2ebd29..63cff402f3a8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts @@ -18,6 +18,25 @@ aliases { mmc3 = &sdmmc2; }; + 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"; @@ -87,6 +106,15 @@ spk_amp_enable_h: spk-amp-enable-h { }; }; +&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>; + }; +}; + &sdhci { pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>, <&emmc_datastrobe>, <&emmc_rstnout>; pinctrl-names = "default"; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts index c56c290f0d87..5dafcc86296b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts @@ -17,6 +17,25 @@ aliases { mmc2 = &sdmmc2; }; + 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>; + }; + gpio_spi: spi { compatible = "spi-gpio"; pinctrl-names = "default"; @@ -136,3 +155,12 @@ spi_pins: spi-pins { }; }; }; + +&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>; + }; +}; From patchwork Fri Oct 28 18:40:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13024210 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 B373FECAAA1 for ; Fri, 28 Oct 2022 18:41:13 +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=i8RfPLT8fkKWlEAEsdfO3cgq3q8HDg5PNTOVENrShIY=; b=RIzawDBXf6vCFZ kK0bfqYKKMvMgLnjnQy59QvUrdrUv5extZUXxaH9Om/qi97nW4dWqiQKchvuP8FlGf5bk3KplbjID MnslDw/l2A6U+JCSUACQBP/pXWWRPqeX/690XOFDnpAdn6eeUrlH4DQkTJnou64zsuXthBQP1pG7G DLky8/LQI6k09llz/8Azeix7YDCGCPVaFdR3SbGc3X+AxINJbc1mAZCjwJhWgPUAvlW5KSpCgH5GX 7aHxl4LCExFk9ZQMIgUO+xzT7Rplg3mXtCaZUmKzFO3hwylb3d/Bf+k3pdYZrh1wmx36YmfSq9b9I coYFOJUfbE0VidCgaGdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHu-001fz5-Sb; Fri, 28 Oct 2022 18:41:02 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ooUHs-001fxF-Ny for linux-rockchip@lists.infradead.org; Fri, 28 Oct 2022 18:41:01 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-13ae8117023so7220579fac.9 for ; Fri, 28 Oct 2022 11:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=S/QWdUrpoDZLh0j4C0GXLsHelBZKLzsXC5vrQ1PadXQ=; b=Wgxsaf2Rsru3M8eSrCoWXWrgCionlrDnASbc5lqgvZwg9uun0ZgnaSiLlIg29jVBqo 8Hx0RTXJQw4fl5ESXlFhvMT78Jrcu0w4+/6OfHWXPVx91AM4qoft1HIAK/Fdrr0GlEBc 0/sBmdcLsx3D8neoBzRlTV3/ncrnm8+RZKRIugu0yhMwE573VJqpZAWAeJYVrTyYpL5G Dxr8UrvOg6exXxjAmSImrYnuP5BGE95PqHOH64VO5LfaB+LGW/jOOHTE8ae025A7A+Ae vHlUMVNsCDTuKn/fmoEgZ1Cy27grqGsdgQpCF16z8fXhps3Tu4nOn0w/CfHdxVhMmaPS arjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=S/QWdUrpoDZLh0j4C0GXLsHelBZKLzsXC5vrQ1PadXQ=; b=QcecuobygNTbuJfwlXA3GBSLV3imlwgPsz7yPeKeBDC9re/EaY3sH/mxIkWWwBKCK8 +8DfPGdRb37ko7XZ52ssaSOUnFBqsK0grAeORliZy9n9PfjsIExnciKwO4xgdlT4ROVk U209oh5tYfhfSL2vbWSazSpEAbqQN0xTnK07/zjLEsuR1vMEmYRkKvIRYgMC54tV3wo0 bvcnhM7wvuIdakYep+uEDje618SC1Egeqq4RTKYaFzg6XYIt9wP27T33ja3mg5lj76LZ Ic33leT9vbnk8ONMh55uCN/0bqH2uihw6LQgRgkTNX9r8tTxOFCagVAdToQkflml1VDF FF7w== X-Gm-Message-State: ACrzQf1jv1EZ8wKGvVUeJLRU7n7C2llOqLQJ5UESJf08y9z8jiTuAXCx 468bx/0XqCN+N1mYosAXWRw= X-Google-Smtp-Source: AMsMyM4EtixCoGnMGFt/ySf74KgfXFP5uO9BIdChyGv4Qii0/JcSmapSzYVdjqh7xM4Yg2bcxsDx3g== X-Received: by 2002:a05:6870:3452:b0:127:74a6:365c with SMTP id i18-20020a056870345200b0012774a6365cmr9848211oah.169.1666982459561; Fri, 28 Oct 2022 11:40:59 -0700 (PDT) Received: from wintermute.localdomain (76-244-6-13.lightspeed.rcsntx.sbcglobal.net. [76.244.6.13]) by smtp.gmail.com with ESMTPSA id z7-20020a056830290700b0066c34486aa7sm575288otu.73.2022.10.28.11.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 11:40:58 -0700 (PDT) From: Chris Morgan To: devicetree@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, pgwipeout@gmail.com, michael.riesch@wolfvision.net, frattaroli.nicolas@gmail.com, jagan@amarulasolutions.com, Chris Morgan Subject: [PATCH 4/4] arm64: dts: rockchip: add poll-interval to RGxx3 devices Date: Fri, 28 Oct 2022 13:40:45 -0500 Message-Id: <20221028184045.13113-5-macroalpha82@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221028184045.13113-1-macroalpha82@gmail.com> References: <20221028184045.13113-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221028_114100_813791_BE2DFEB5 X-CRM114-Status: UNSURE ( 8.46 ) 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 adc-joystick polling for all Anbernic RGxx3 based devices. They are all functionally identical in how they work. Signed-off-by: Chris Morgan --- arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi index 010c6a77a9da..41262a69d33e 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi @@ -22,6 +22,7 @@ adc-joystick { <&adc_mux 3>; pinctrl-0 = <&joy_mux_en>; pinctrl-names = "default"; + poll-interval = <60>; #address-cells = <1>; #size-cells = <0>;