From patchwork Thu Nov 9 21:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13451774 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 89327C4332F for ; Thu, 9 Nov 2023 21:50:28 +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=2/parrOj3o+ilKFCsjWArL/pQptQRVOPcvzNI1vYRE0=; b=001BmZrHRonJ/B XREbKR3P8vO/sKclCwpOV84jlaoepBIoRwShnXo0lVQkfLxmbq5Gd2Dqio1iA0ZO9qF6nXTtIA7WR SSrQd+XCAnHXaVEtzZm1YOJpkQQXc+AxQ8IlkdC3jVQRPuNKSmtUMnDhaQ3T90euCb7S96T/1Ix1l BS9gk6F118jXiR4ilHSVE1aztQZ/i3GqoNaO3MK2akKhnGmBaQofYGjHZV476y9hFMo18CZBGw34n RzCfGVzcVtIgwogQPil4JdJbbgk2ypCawlwla8RN+tC/Hrs0bv9UJCCAx3dR8vmtKvtF6+6Lz4umu vfJ2mui92rabztl5JJuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cuq-007I39-2v; Thu, 09 Nov 2023 21:50:20 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cum-007I1W-33 for linux-rockchip@lists.infradead.org; Thu, 09 Nov 2023 21:50:18 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1f00b95dc43so764618fac.3 for ; Thu, 09 Nov 2023 13:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699566615; x=1700171415; 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=FMh7dJy6c7Z6dmqAsf3sJ7b9dHtCKsqZ04NpaCQ7mOU=; b=CkaWKwZzxq0L3YkOzclVQ6nmbKZyF1vGAFHBH117bGZFX65zLnJN+Jo5Zls8N2TXL/ zYqJJOfaQOk+8zroyWiN4Apj3Tlb18Thn/uOoUE12lWDzKN2zKVwZuuEZiW/z+R7fWus bM7+C1xlabhnT+tRod1buBSwO8oyPRBI/cIVcgLk0jqWBhv91BX6A9N1lhbq9z7RO/42 XBzQ9Ew1bME5f0ScpX/hzjM8baWsao+kGroCyAJtbpByheIN4jngkEnHGmMNkqe7WiBh nYLKF26Jzis0iUWR2TG2AHN5vpc8rP2K02/ZMXhVEcTDBpo1tdNVApNxTxUK+++3KcSr 8TfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699566615; x=1700171415; 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=FMh7dJy6c7Z6dmqAsf3sJ7b9dHtCKsqZ04NpaCQ7mOU=; b=bxR55eROiXwwYzx1kkmz5IsuPF8gzK6UqNkikVvqwFHetiwwk1Rj6C8w3aXlgN+aFq o6T2EQBqB4suwiUqa6HH/obNxxf5xH2X0oJXEDpww2SYR0c7DfYKQyOOhmEvy70n71HP VCCRsodJtaq1FHxJtKOwAt3eVqxsW8j/4wLE3ShoJCymkhpOP60eU+sQB9uDtR0xaiNw rbX3NX4I+kHA19Szahaj+pdE8rRSZJBiCWafVCv7UVDJz9707E3QNN9A8iJFip63YKPT AjoEO5L5u1/jVQmAxjD6Nm5U35THvzOOxnXwgmBghjlpF+vnHfQq3OKZ/wLYl5EhxWTa clQA== X-Gm-Message-State: AOJu0YzQVFgXETbD71FvIlL/oun3RKqeqncSv8hk4lvbbPi/kExH860l 38ophh/heRqw0uABxf2UrRREvFW389M= X-Google-Smtp-Source: AGHT+IHVkaf5YA3dz3qNIlTDI7draK5AFkU+1KX4tYYgrlpOTTqQ4WZJrARdU/LxrRrJ6a3/Gg2NuA== X-Received: by 2002:a05:6870:1099:b0:1ef:62fc:d51c with SMTP id 25-20020a056870109900b001ef62fcd51cmr5227511oaq.51.1699566615423; Thu, 09 Nov 2023 13:50:15 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id tp22-20020a0568718b9600b001d4d8efa7f9sm864003oab.4.2023.11.09.13.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:50:15 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, daniel@ffwll.ch, airlied@gmail.com, sam@ravnborg.org, neil.armstrong@linaro.org, heiko@sntech.de, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, Chris Morgan Subject: [PATCH V2 1/4] dt-bindings: display: panel: Update NewVision NV3051D compatibles Date: Thu, 9 Nov 2023 15:50:04 -0600 Message-Id: <20231109215007.66826-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109215007.66826-1-macroalpha82@gmail.com> References: <20231109215007.66826-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_135016_984790_343252B6 X-CRM114-Status: GOOD ( 14.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 Update the NewVision NV3051D compatible strings by adding a new panel, the powkiddy,rk2023-panel, and removing another entry, the anbernic,rg353v-panel. The rg353v-panel is exactly identical to the rg353p-panel and is not currently in use by any existing device tree. The rk2023-panel is similar to the rg353p-panel but has slightly different timings. I originally wrote the driver checking for the newvision,nv3051d compatible string which worked fine when there was only 1 panel type. When I added support for the 351v-panel I *should* have changed how the compatible string was handled, but instead I simply added a check in the probe function to look for the secondary string of "anbernic,rg351v-panel". Now that I am adding the 3rd panel type of "powkiddy,rk2023-panel" I am correcting the driver to do it the right way by checking for the specific compatibles. Signed-off-by: Chris Morgan --- .../devicetree/bindings/display/panel/newvision,nv3051d.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml index cce775a87f87..7a634fbc465e 100644 --- a/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml +++ b/Documentation/devicetree/bindings/display/panel/newvision,nv3051d.yaml @@ -21,7 +21,7 @@ properties: - enum: - anbernic,rg351v-panel - anbernic,rg353p-panel - - anbernic,rg353v-panel + - powkiddy,rk2023-panel - const: newvision,nv3051d reg: true From patchwork Thu Nov 9 21:50:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13451775 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 DCD0DC4167B for ; Thu, 9 Nov 2023 21:50:28 +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=y5ScuvXj5cP1iMLeGGkwggC5CnMBJNVnydeL+xH/y2w=; b=GkcXBP8aIAIA0L bi7NCDXggHdwsywsiCwGtbHZjFLvqLleE6TZxwsljUqRwCzOTS665srOFOb5pF/eIjAB29Q6R7ESN rw24xpcnTbIv7l3TqYgJU1wcGOvUXQzoby+xUBx95/Xtp95x/tCxa1oziW4hAZeuVVqWbaymid24+ D6GeOBRhRzLNsXDzR48T7ThpMxnBUSE2/P/dx+LGk4FQva/Q9b98Ea61S8nFi1pwCbHlD3piHkds/ AEPsXost3vAkNnZwHR5ejxFrCpEB37iATJA/bMU45FSm8s/H+rocijcCBKgF4H3UkcepT5yEqjvZf D8GrjNB6j6adu1ESOrpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cus-007I3d-2Q; Thu, 09 Nov 2023 21:50:22 +0000 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cuo-007I1X-0X for linux-rockchip@lists.infradead.org; Thu, 09 Nov 2023 21:50:20 +0000 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-581e5a9413bso727174eaf.1 for ; Thu, 09 Nov 2023 13:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699566616; x=1700171416; 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=JZXYYoZ9YXR8OaFb0rqU8J6WjFq3wVUlkQ9dvWsztWg=; b=eAM0As/cEDcDgmg7mpvqS9ZyjJvkyDwKtqkQioe2l5RD6nGJIUrWE3YzFcvtClP+cD nuC+T5DrzOll3WxzWk4mH7RoatM/mPzuU+rBei1vnnO6dl0d+H4ABAL5kKTGccPGT7L1 s41vH6VH5n4HpwCnDwYUPbLpwVQeVe2NIf6BtoojVbn/GcbhMIT0jZLb97wiaTfF46Wz szM++os49oUbGITLhz2u/ZXjJzPFyOrdooa5iWG2jSL3mKAvoTKSWNohlZrskcABlNGW AcrdYhbL0rphGy4Q8WofX9pJPHQSI69AL8IjdhbzKNYjXi/ijv/CECgyQWAu2nBbezLC jK2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699566616; x=1700171416; 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=JZXYYoZ9YXR8OaFb0rqU8J6WjFq3wVUlkQ9dvWsztWg=; b=B5/MF2hxlV1LSj+1ADu0FknTbhelF/vFsw0gY533z317X9VuwwZdhXB115txDol1CK 0bwd53O4fr+2DM61xD+eL5xpXZ4RZBWZvn05OhMbuyneob5pVphYr7HGzsmE6ij4FTCp ae29BveTJ3GhSd5bxj8NeCQFaG4VyQmn0YMc0XRgUChuIt1zCG1ganSQG3pfFIkX5wOJ 5zp+6zrHCNTQGJayFHbNcYnyP5qoczqKlVE2hgr3Brbg77HZGy50GP2x3Qhk+nV1gLHN u3suPQatQhRbp2Ez+ElCD6A0f5ZjsWGCOuzRANcuEjNMiQpsC70aGB4odbTrqHBz/jZG 37Zg== X-Gm-Message-State: AOJu0YwAyVEoYhtTepEtD9fIW9s9qIfXJLpwQhYt0UaYzb23Ny4HAUPO jCuPg48lyTHKXk+CoTIXzNtVsIFLmyo= X-Google-Smtp-Source: AGHT+IEtAOh2Ri8u8l/d3qukxgFDNHa7aYcFKcebfV58wRHC8Ih0NADj5oYrY2SJCPHCMy77yPkxmQ== X-Received: by 2002:a05:6870:9193:b0:1ea:4338:209d with SMTP id b19-20020a056870919300b001ea4338209dmr6168405oaf.31.1699566616026; Thu, 09 Nov 2023 13:50:16 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id tp22-20020a0568718b9600b001d4d8efa7f9sm864003oab.4.2023.11.09.13.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:50:15 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, daniel@ffwll.ch, airlied@gmail.com, sam@ravnborg.org, neil.armstrong@linaro.org, heiko@sntech.de, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, Chris Morgan Subject: [PATCH V2 2/4] nv3051d: Add Powkiddy RK2023 Panel Support Date: Thu, 9 Nov 2023 15:50:05 -0600 Message-Id: <20231109215007.66826-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109215007.66826-1-macroalpha82@gmail.com> References: <20231109215007.66826-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_135018_199329_E1564D35 X-CRM114-Status: GOOD ( 16.35 ) 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 Refactor the driver to add support for the powkiddy,rk2023-panel panel. This panel is extremely similar to the rg353p-panel but requires a smaller vertical back porch and isn't as tolerant of higher speeds. Note that while all of these panels are identical in size (70x57) it is possible future panels may not be. Tested on my RG351V, RG353P, RG353V, and RK2023. Signed-off-by: Chris Morgan --- .../gpu/drm/panel/panel-newvision-nv3051d.c | 57 +++++++++++++++---- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c index 79de6c886292..94d89ffd596b 100644 --- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c +++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c @@ -28,6 +28,7 @@ struct nv3051d_panel_info { unsigned int num_modes; u16 width_mm, height_mm; u32 bus_flags; + u32 mode_flags; }; struct panel_nv3051d { @@ -261,6 +262,8 @@ static int panel_nv3051d_unprepare(struct drm_panel *panel) usleep_range(10000, 15000); + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + regulator_disable(ctx->vdd); return 0; @@ -385,15 +388,7 @@ static int panel_nv3051d_probe(struct mipi_dsi_device *dsi) dsi->lanes = 4; dsi->format = MIPI_DSI_FMT_RGB888; - dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | - MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET; - - /* - * The panel in the RG351V is identical to the 353P, except it - * requires MIPI_DSI_CLOCK_NON_CONTINUOUS to operate correctly. - */ - if (of_device_is_compatible(dev->of_node, "anbernic,rg351v-panel")) - dsi->mode_flags |= MIPI_DSI_CLOCK_NON_CONTINUOUS; + dsi->mode_flags = ctx->panel_info->mode_flags; drm_panel_init(&ctx->panel, &dsi->dev, &panel_nv3051d_funcs, DRM_MODE_CONNECTOR_DSI); @@ -481,16 +476,56 @@ static const struct drm_display_mode nv3051d_rgxx3_modes[] = { }, }; -static const struct nv3051d_panel_info nv3051d_rgxx3_info = { +static const struct drm_display_mode nv3051d_rk2023_modes[] = { + { + .hdisplay = 640, + .hsync_start = 640 + 40, + .hsync_end = 640 + 40 + 2, + .htotal = 640 + 40 + 2 + 80, + .vdisplay = 480, + .vsync_start = 480 + 18, + .vsync_end = 480 + 18 + 2, + .vtotal = 480 + 18 + 2 + 4, + .clock = 24150, + .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC, + }, +}; + +static const struct nv3051d_panel_info nv3051d_rg351v_info = { .display_modes = nv3051d_rgxx3_modes, .num_modes = ARRAY_SIZE(nv3051d_rgxx3_modes), .width_mm = 70, .height_mm = 57, .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET | + MIPI_DSI_CLOCK_NON_CONTINUOUS, +}; + +static const struct nv3051d_panel_info nv3051d_rg353p_info = { + .display_modes = nv3051d_rgxx3_modes, + .num_modes = ARRAY_SIZE(nv3051d_rgxx3_modes), + .width_mm = 70, + .height_mm = 57, + .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET, +}; + +static const struct nv3051d_panel_info nv3051d_rk2023_info = { + .display_modes = nv3051d_rk2023_modes, + .num_modes = ARRAY_SIZE(nv3051d_rk2023_modes), + .width_mm = 70, + .height_mm = 57, + .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET, }; static const struct of_device_id newvision_nv3051d_of_match[] = { - { .compatible = "newvision,nv3051d", .data = &nv3051d_rgxx3_info }, + { .compatible = "anbernic,rg351v-panel", .data = &nv3051d_rg351v_info }, + { .compatible = "anbernic,rg353p-panel", .data = &nv3051d_rg353p_info }, + { .compatible = "powkiddy,rk2023-panel", .data = &nv3051d_rk2023_info }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, newvision_nv3051d_of_match); From patchwork Thu Nov 9 21:50:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13451776 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 8CF69C4332F for ; Thu, 9 Nov 2023 21:50:32 +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=2IDl2FkjZEBPwQ5pHswXc8ubhUpS4UE95Fg6g0YhE5E=; b=jD0VE9QM8G8pXI 41IhOGI92G7dQySFwgidK76idoj9qXdJkub2rafGTTuI06FBrtdKxCTSfiv/YfiQE6woulv0XN1Rl 0aKfZsonYnVu3lIUjGKhVLV1AJDMz1wWpxPrDCJgcZb+iFCe75CTWIFFXI22Ptbk38mGqi1PPXxtB RfSZCz1Mxv5rE884o+I5OCEu8CtfdlOzHaB3B1TlsHUogNdLRt77500q/sLg6FpLn9dUi7NJauJjT JHpfIUpVpTSXNS1Zzp9M8O8Cew4i7tWmo2+nh9BsRzf6gu08vEu28EnqCttrhMdvEL4oHRxEEoBpZ XkDh41PS/GNEbXRbHMhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cus-007I3P-15; Thu, 09 Nov 2023 21:50:22 +0000 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cuo-007I1y-0H for linux-rockchip@lists.infradead.org; Thu, 09 Nov 2023 21:50:19 +0000 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5844bc378feso740173eaf.0 for ; Thu, 09 Nov 2023 13:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699566616; x=1700171416; 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=qOIInztUelC8mrrk/uWmLptClIvVfVoKK3NnyJG316E=; b=J+3UbNRm88LmpMva6sEmnK4rQimi9ux2KZ8s8hzD2b67EyDhXlJEnUdbl1dw855f5T jj2YXmzYX/NlJ873MIpHbcSL36kzdySGXWTXLMqKoMANrb3aJTqJgC/jsRyECOKZlEfa 8aXzVq5RE23shkiHCFvqfP8+eLtAAlL0JrzZgIesOZJV5lGyaakD54/RBqKdCC4lXLEb 3+u/PpS5kjeqwBMKu7/1ZsaP0br6wEcoWckgR0s8TeCjgkEyjE4X4S+CtRxt7bp4EbiA Pt5LVROXHSjFJMEfvMOUzXUvT7tKb7WEHrjOmOxCfueXgKo+Vu/t0wH6O7EcBYgrxeqq 444A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699566616; x=1700171416; 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=qOIInztUelC8mrrk/uWmLptClIvVfVoKK3NnyJG316E=; b=c7fCAbhCYttoFMxk13DLHAXnxJGQGBjomfJ0etdsry37IaObmvsXI4A6cWq7YmBND2 r/QDQOKN6AVfRrGToSh02fuVuFjg1ueJVY0+Hg8APAnlGf6JheD37wqUo00IKc/5l2dE MPrk+GO61Wm5R6wzPZ8FwbvDB497ksZxnbTbc+7bPehC3D10ZS2hz2G7hFSPBF7hnZnx Jy8FfVTrVrSjh12QrHpooFCW1ghhaE8NuYF/eMH10bDIX/6YAbQhFgX+I4+j1ZZ1SQsT Q7u4lLDDORYuFQVR6L9M6+KTLK10e+wWHDBKHlEcb6pmqz2Kipeqlj0nP58xaELVs4Bs 1Pig== X-Gm-Message-State: AOJu0Yzw3anQs/fEVWNXoWMVLjd/RXWd5lXxLc0fp4qQUK6veSYKDmHq QRHfWBe0jD5jlc1WKThx2wogbONOar8= X-Google-Smtp-Source: AGHT+IHkwhRJa6UQv0a+N/kr01xqCaRwiUsLDnT12DrqEx72ojhNPbns7tXYrlhU6YlgyYlLVsA/qQ== X-Received: by 2002:a05:6870:72d1:b0:1e9:bd5c:ae38 with SMTP id o17-20020a05687072d100b001e9bd5cae38mr6871083oak.2.1699566616706; Thu, 09 Nov 2023 13:50:16 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id tp22-20020a0568718b9600b001d4d8efa7f9sm864003oab.4.2023.11.09.13.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:50:16 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, daniel@ffwll.ch, airlied@gmail.com, sam@ravnborg.org, neil.armstrong@linaro.org, heiko@sntech.de, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, Chris Morgan Subject: [PATCH V2 3/4] dt-bindings: arm: rockchip: Add Powkiddy RK2023 Date: Thu, 9 Nov 2023 15:50:06 -0600 Message-Id: <20231109215007.66826-4-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109215007.66826-1-macroalpha82@gmail.com> References: <20231109215007.66826-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_135018_123909_C7996397 X-CRM114-Status: UNSURE ( 8.83 ) 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 The Powkiddy RK2023 is a handheld gaming device made by Powkiddy and powered by the Rockchip RK3566 SoC. Group the Powkiddy RK3566 based devices together as they are both extremely similar. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/arm/rockchip.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml b/Documentation/devicetree/bindings/arm/rockchip.yaml index 5f7c6c4aad8f..5b015c4ed775 100644 --- a/Documentation/devicetree/bindings/arm/rockchip.yaml +++ b/Documentation/devicetree/bindings/arm/rockchip.yaml @@ -674,9 +674,11 @@ properties: - const: pine64,soquartz - const: rockchip,rk3566 - - description: Powkiddy RGB30 + - description: Powkiddy RK3566 Handheld Gaming Console items: - - const: powkiddy,rgb30 + - enum: + - powkiddy,rgb30 + - powkiddy,rk2023 - const: rockchip,rk3566 - description: Radxa Compute Module 3(CM3) From patchwork Thu Nov 9 21:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13451778 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 6163EC04A92 for ; Thu, 9 Nov 2023 21:50:34 +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=hwSjbfuSjAQqX1k7rJtSJvdVHGze1bUqgVgkHxGOcAc=; b=HDAXw0w/0R5acx bI7vGwVLEklouSw+x93BQYdVyo6flKK0rXFOnA6Hlveaqg56nTpPb3d8rj10oqKsoeRl2Ob7xf+dS eNA0cdk3qcDnFVtQ8sO0Cyf31StiWyKyyDpGNJtEPXLz8QRdr7tQoQ6YQQ1KV4hRydI1S5nr7EjCa +fhpZUYQr5z0vnDihNsKbDg5ncamDiYnhR5iIZx6KpMu0Me4Ht9KYTeD7xiZe9u+jz3C32OdZQ4K4 oxBw+lbjp7NuqMWnMFH4oC5veiCJ8W2GGOjC2CL0eRQMeUv9iYAiJ4gNdwblqOWynYK0qEaKqYoWd wlOYAedDWyBuQNzIvrHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cut-007I3q-0R; Thu, 09 Nov 2023 21:50:23 +0000 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1Cuo-007I1z-1t for linux-rockchip@lists.infradead.org; Thu, 09 Nov 2023 21:50:20 +0000 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1ef36a04931so740265fac.2 for ; Thu, 09 Nov 2023 13:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699566617; x=1700171417; 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=3DGkshjIHPHqrLgiVy7/6CmJvBr+EISIw4GQXmD/W08=; b=Ryas4RpjT9H7bPCSP241q/7Xf0h1SGW9bDK4DqbStu7H5xNJpVZqsU+qtxjRIBaGQH /ghw7zd+NH13DrFBVSO1CDGDDarRv83imMhuI/Dg5ufbXsWVTL4AypjYwotyn+mANyq+ qAgA5LFhFn7S0qyJyqWZZR5xgwNBmbd9wqyKAYhhfdR2WZJjsUQyRk6cDdRPda63yEcc j4xcM03Qe4d3ZtCeEKYGfp0K8iOw7+cE7Gl9zMxaRS5ZRb9BxdTOzy5SpIsffv2abiA2 MDopeNAIbEZPz5xMkGYHTlHb3ZpHdxWq0JNnwZKwK0/v9uqNBMrGha6BQ8u3P1BpfJQx JAcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699566617; x=1700171417; 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=3DGkshjIHPHqrLgiVy7/6CmJvBr+EISIw4GQXmD/W08=; b=JMtFx9cwMnSW8ruh3vCQrrVxqbAb7eft1EfeQbTRFTGsApsS37bEJBVyLSMTLdIZ3c iMQ/3+CSuEGbFscs6VYhHJha+0+kHVZYoqMf/USfHr0MnV8DpcYrF4UPt03Ox9UhEJD4 J3D3qi80kxjsr7z1VtK9CLByJdjHyk6/BAgT1oYCweNaieIniNrXQoSqQqyotyfoZDrT ILEeIirNvXqwDP690oQ1SDJhbBGKsdf7kyPMSnS8v5BXTl7vDrZCEs7i61D0SYev5EKr MkamjTxqUK2Uc1i/dKMWizUdR7iuHdt1vqDcVg7TNBYCPzSMcnsCR4ALSB9l9fzoH1+k 32eA== X-Gm-Message-State: AOJu0YzAVITIHqHV968t+c0Et2ymVjeQDY+MnLz6wEtZdPRQbpzN3e/t oyu9kqoCw8BDhtgxuiGdApE+wpXpgyQ= X-Google-Smtp-Source: AGHT+IH7PDMX7iXAIZ8yqt5YSqIDql/sLbJWD1fjGFx4WHlXQtgYjIHyklpY+dZADiHSfKma4fSw0g== X-Received: by 2002:a05:6870:910c:b0:1e9:a917:cf46 with SMTP id o12-20020a056870910c00b001e9a917cf46mr6894397oae.19.1699566617268; Thu, 09 Nov 2023 13:50:17 -0800 (PST) Received: from localhost.localdomain ([75.28.21.198]) by smtp.gmail.com with ESMTPSA id tp22-20020a0568718b9600b001d4d8efa7f9sm864003oab.4.2023.11.09.13.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:50:17 -0800 (PST) From: Chris Morgan To: linux-rockchip@lists.infradead.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, daniel@ffwll.ch, airlied@gmail.com, sam@ravnborg.org, neil.armstrong@linaro.org, heiko@sntech.de, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, Chris Morgan Subject: [PATCH V2 4/4] arm64: dts: rockchip: add Powkiddy RK2023 Date: Thu, 9 Nov 2023 15:50:07 -0600 Message-Id: <20231109215007.66826-5-macroalpha82@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109215007.66826-1-macroalpha82@gmail.com> References: <20231109215007.66826-1-macroalpha82@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_135018_631419_BF916EA0 X-CRM114-Status: GOOD ( 15.33 ) 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 Powkiddy RK2023. The Powkiddy RK2023 is a handheld gaming device with a 3.5 inch screen powered by the Rockchip RK3566 SoC. The device is almost identical to the Anbernic RG353P except it lacks eMMC, a function button, a touch screen, no UART headers on the board, and the panel has slightly different timings. Signed-off-by: Chris Morgan --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../dts/rockchip/rk3566-powkiddy-rk2023.dts | 161 ++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rk2023.dts diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index a18f33bf0c0e..f969618da352 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -78,6 +78,7 @@ 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 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-powkiddy-rgb30.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-powkiddy-rk2023.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-a.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-b.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-radxa-cm3-io.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rk2023.dts b/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rk2023.dts new file mode 100644 index 000000000000..5740412f6b2b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3566-powkiddy-rk2023.dts @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3566-anbernic-rg353x.dtsi" + +/ { + model = "RK2023"; + compatible = "powkiddy,rk2023", "rockchip,rk3566"; + + aliases { + 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 = <4250000>; + 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>, <4092000 95>, <4035000 90>, <3990000 85>, + <3939000 80>, <3895000 75>, <3852000 70>, <3807000 65>, + <3762000 60>, <3713000 55>, <3672000 50>, <3647000 45>, + <3629000 40>, <3613000 35>, <3598000 30>, <3578000 25>, + <3550000 20>, <3519000 15>, <3479000 10>, <3438000 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>; + }; + }; + +}; + +/delete-node/ &adc_keys; + +&chosen { + /delete-property/ stdout-path; +}; + +&cru { + assigned-clocks = <&pmucru CLK_RTC_32K>, <&cru PLL_GPLL>, + <&pmucru PLL_PPLL>, <&cru PLL_VPLL>; + assigned-clock-rates = <32768>, <1200000000>, + <200000000>, <115200000>; +}; + +&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 = ; + }; +}; + +/delete-node/ &{/i2c@fdd40000/regulator@40}; + +&i2c0 { + vdd_cpu: regulator@1c { + compatible = "tcs,tcs4525"; + reg = <0x1c>; + fcs,suspend-voltage-selector = <1>; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1390000>; + regulator-name = "vdd_cpu"; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc_sys>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; +}; + +/* + * Device has 2 controllable LEDs (a red and a green) along with a red + * LED that cannot be controlled and is always on when device is + * powered. + */ + +/delete-node/ &{/pwm-leds/led-2}; + +&leds { + green_led: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + max-brightness = <255>; + pwms = <&pwm6 0 25000 0>; + }; + + red_led: led-1 { + color = ; + function = LED_FUNCTION_CHARGING; + max-brightness = <255>; + pwms = <&pwm7 0 25000 0>; + }; + +}; + +&panel { + compatible = "powkiddy,rk2023-panel", "newvision,nv3051d"; +}; + +&pwm5 { + status = "disabled"; +}; + +&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>; + }; +}; + +/* There is no UART header visible on the board for this device. */ +&uart2 { + status = "disabled"; +}; + +/delete-node/ &vibrator;