From patchwork Sat Nov 12 14:18:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Matuszczyk X-Patchwork-Id: 19181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1292262wru; Sat, 12 Nov 2022 06:24:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4NdoYjEJNTFb/SJBsyXEaggSNl7HxOce4hD9vY+cKISaSPbPiQ1gvWRhNcezmHvqR6iY3Q X-Received: by 2002:a05:6402:e0c:b0:467:6cec:709e with SMTP id h12-20020a0564020e0c00b004676cec709emr4369032edh.192.1668263048929; Sat, 12 Nov 2022 06:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668263048; cv=none; d=google.com; s=arc-20160816; b=PKnICjbis9+mvA/dixHTx+wp7HypHOkALeH1+jXjwJ+4MTaB5Gs0oULYMQYqHREtIB m/1wVJ4jk+/Ba3WHZqlz0j51WHoVTUFEbNaq+hKfYCoeVMzMCx60o/ylchKQh5NePsch JfwP3+Xj7i64XxxnigKLjCmrm557cFKry8yUHCk6GNpQjRNKlehsHfAiMmBLpZa3LK95 BxB5ZNI0yygAKuaPmRVdApaIBmC9Hm1iu/MXGMkEMXTvdygikqYOp741gduOPG+2ckEZ RomF+L7I24v6on0/B/7AN5WXn5aRuVMGggJcm6gN3MQMCOgK6ag3dFLjC+lpK3Sqd81x OicQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cr+7dkLsIQWkssfwSwIW2QDjIIkEwPc25TwB+Qcm5uo=; b=o9FbMiolxhATWOCi/kPB3CXT8d8tg/KDYYIxJL8skU2NwfA/DW36FUByMBh5c1xiZB ljqfBb408NRaf8Ag1OxC2o6LVYz9hs8pPYFlnRmjxk25OG52ga25HrCwwPFWUgiT8YJM YsIO0X129Vy66X/kopwMfYh3Faq74ibxYE4rfR+DOK/BeXlfpgXKZFlist59km8tAi0p IJC0Mgx9i0JrN8gDwUmbCJoIldhTxG8/lCgLC/3Ft5l5yO4jEzlTQ93ojgmDjMoGJhhk IL+JR8JKxwVw0rhGToz0rEFBBiWHNT8gyX7MjJKaCZxlRNul08sODKjhayw1zvvEMY1R 5kcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="UKsD0x/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l26-20020a056402029a00b00461acb2deebsi4621155edv.198.2022.11.12.06.23.45; Sat, 12 Nov 2022 06:24:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="UKsD0x/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234960AbiKLOT0 (ORCPT + 99 others); Sat, 12 Nov 2022 09:19:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234861AbiKLOTJ (ORCPT ); Sat, 12 Nov 2022 09:19:09 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B5E11836A; Sat, 12 Nov 2022 06:19:06 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id a13so11342504edj.0; Sat, 12 Nov 2022 06:19:06 -0800 (PST) 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=Cr+7dkLsIQWkssfwSwIW2QDjIIkEwPc25TwB+Qcm5uo=; b=UKsD0x/5BTuv9I4BmyFff3ZscFituJT8FVzMy4P+x8g7Wf2MoY84kUTPR8DxMkOuL1 H559lXZ7bzcyr8wmsTE3pMtmipu5Yfk/QjpFTk3QH97fzoy63E3zJoVwM0f8TpxVnTPm Lpi63S8/Sz0jTdVKe0WrNrJWPZvq8IDjRI033hdCCTizDmJv08AFv9gvk9AcdkObd+3u cHNLeRzoW2CFo8Y11wEeY5KzeknnkpeOHTgMUL3YRR7skwQIL5ac/zBMR6/eQ1iGhgGM AP431ZJAhlQeMETgUt95VLv99uuTOtfVllNTBl+HMuk6MEWro6Edy+vJx31PpwjRXq4Z JVjA== 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=Cr+7dkLsIQWkssfwSwIW2QDjIIkEwPc25TwB+Qcm5uo=; b=rIs8ju0j4wKUl7vt/bUVlX4hTRx9z1XpPm2cpai/3Nae9FUca9/YpEF/L2dGqnLfT7 KvQkLNcK6/eiZ/p0luo6OcR5AzCNEgpJs58j/eJ0tbujGb1OjTRjSewsfL1dt5YCVnda wHdAj7pbidY7YHr7B5gCi0aEVl9QSGS8wOCV6F9wijv6hgW0h2RJFPngTl+Hg1io8BBU whr2NvxQWA3CfaQE3xSyNpUCldrBmdOVp40jAszV7CeShUyXiWTmClAwBzkYdh/+Mpgj gY5eJuvWGd6yAY4mg2CASicAQaA8NjMzoPhZ9zZO9NJZUB2xwZcAYvJaBvd572lGcWZN CGLQ== X-Gm-Message-State: ANoB5plyPFKmx+ypNJG0PTNZRetkMo6v27UHjzF1uNvA/rReyJINrFZt gmI471eKFhSjnnCvlV71Nxc= X-Received: by 2002:aa7:d793:0:b0:460:d1f6:2917 with SMTP id s19-20020aa7d793000000b00460d1f62917mr5591021edq.207.1668262745128; Sat, 12 Nov 2022 06:19:05 -0800 (PST) Received: from localhost.localdomain (83.31.120.236.ipv4.supernova.orange.pl. [83.31.120.236]) by smtp.gmail.com with ESMTPSA id g21-20020a50ee15000000b004677b1b1a70sm1050148eds.61.2022.11.12.06.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Nov 2022 06:19:04 -0800 (PST) From: Maya Matuszczyk To: Rob Herring , Krzysztof Kozlowski , Heiko Stuebner Cc: =?utf-8?b?Sm/Do28gSCAuIFNwaWVz?= , Chris Morgan , Maya Matuszczyk , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] arm64: dts: rockchip: Add Anbernic RG351M Date: Sat, 12 Nov 2022 15:18:41 +0100 Message-Id: <20221112141840.516224-6-maccraft123mc@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221112141840.516224-1-maccraft123mc@gmail.com> References: <20221112141840.516224-1-maccraft123mc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749300595035117421?= X-GMAIL-MSGID: =?utf-8?q?1749300595035117421?= This device is a clone of Odroid Go Advance, with added PWM motor, internal gamepad connected on USB instead of just having it be on GPIO + ADC, and missing battery shunt resistor. There's also an LED on GPIO 77(I *guess* PB5 on &gpio2), that is controlled in a weird way: - It is set to red by setting output value to 1 - Set to green by setting output value to 0 - Set to yellow by setting gpio direction to input I have no idea how to describe that in DTS, without adding a custom driver, for now it's just left out. Signed-off-by: Maya Matuszczyk --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3326-anbernic-rg351m.dts | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index 142c83d2e5aa..b379516c15eb 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-rock-pi-s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a95x-z2.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-anbernic-rg351m.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2-v11.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go3.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts new file mode 100644 index 000000000000..7f4726d4130e --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3326-anbernic-rg351m.dts @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 Hardkernel Co., Ltd + * Copyright (c) 2020 Theobroma Systems Design und Consulting GmbH + * Copyright (c) 2022 Maya Matuszczyk + */ + +/dts-v1/; +#include "rk3326-odroid-go.dtsi" + +/ { + model = "Anbernic RG351M"; + compatible = "anbernic,rg351m", "rockchip,rk3326"; + + battery: battery { + compatible = "simple-battery"; + charge-full-design-microamp-hours = <3450000>; + charge-term-current-microamp = <300000>; + constant-charge-current-max-microamp = <2000000>; + constant-charge-voltage-max-microvolt = <4200000>; + factory-internal-resistance-micro-ohms = <100000>; + voltage-max-design-microvolt = <4100000>; + voltage-min-design-microvolt = <3500000>; + + ocv-capacity-celsius = <20>; + ocv-capacity-table-0 = <4046950 100>, <4001920 95>, <3967900 90>, <3919950 85>, + <3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>, + <3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>, + <3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>, + <3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>, + <3574170 0>; + }; + + vibrator { + compatible = "pwm-vibrator"; + pwms = <&pwm0 0 1000000 0>; + pwm-names = "enable"; + }; +}; + +/delete-node/ &builtin_gamepad; +/delete-node/ &vcc_host; /* conflicts with pwm vibration motor */ + +&internal_display { + compatible = "elida,kd35t133"; +}; + +&pwm0 { + status = "okay"; +}; + +&rk817_charger { + monitored-battery = <&battery>; +};