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: 13451792 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 5DEC1C4332F for ; Thu, 9 Nov 2023 21:50:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBBD610E927; Thu, 9 Nov 2023 21:50:53 +0000 (UTC) Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3EA6D10E928 for ; Thu, 9 Nov 2023 21:50:16 +0000 (UTC) Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-587b1231dbeso726361eaf.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.freedesktop.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=OOmg8++fBzh4g+U46qCtNyVBYIwDCm0zvtDrnzWcd8Y/q7pIxe6KMH0uhgDh/S3eUJ N+b3a4KRY/GfTXGkzrQavkEsL0Ivm2EnjCwyPcbyEVNpfb4HNjem2k5TBWUyMkcNXHXe 78QJtvd7z2HayBiyf7jt73Oy+Q1x9juMzW8wtJeK/ONzoF3ZXvg2rsE+f7pePaXdsMe4 VkY7oI9gmlhsZV28RX46sBTjhU0JstzEl3nGuce/dgpi9Hqf/2we4ypn1/yCWz78vMrU dymGB33AJAzEDTVznuS0Pa9iqNVV13hHIYN3JjPQ426YgguSdlvDpcZ515NSx6irbENK qMEw== 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=RuZyoDD+bJy2EPaVpXDqtPJGs+f8s2mOSS3sBe33GF5+fOcRqE2SNl8s0d7yD4Geir IEMKTFLmbMx0NDHENbyrjxvTjFr3fLJDdCvsUIoI8e5ipaOPWSwJ84e+rTMwvV/QFfvX ZPztEBLSAYgxllWX1gWONtM3M+orjO1msRpj4TdXjlI3X7nQOaQjr7eQYPgWnY/geSqP uFs9dyD3KPtigMpe+e7YJEbqD98ZR02zgxDCStfAg+TEYYvQ8ihIfKBTsW0sgsm18uul Xr2yW9FoAV9ntW+cusCIj56LaJcc6VHRnw/NYqPHOHZ0MfYahSar7uOrs9OWpLeGk72I 1sEQ== X-Gm-Message-State: AOJu0Yy+/lZ0sdlQvtlf55FMSLdbMM7hiv2kkBuyM2ujODktQT0p7IHh AUhF+R0+MCR+LxroRRYn1EAg7RB6k9g= 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, sam@ravnborg.org, Chris Morgan , sebastian.reichel@collabora.com, dri-devel@lists.freedesktop.org, robh+dt@kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 13451796 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 5FFF4C4332F for ; Thu, 9 Nov 2023 21:51:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E342510E92D; Thu, 9 Nov 2023 21:50:58 +0000 (UTC) Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5CD310E929 for ; Thu, 9 Nov 2023 21:50:16 +0000 (UTC) Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5869914484fso732751eaf.0 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.freedesktop.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=KrCGNvsk/rsf2luyI0C6dLeazd0qzDJ7Hr1u0jOiCVY176U+c3O50mem7LQOYPP4Rb CcbmVqzjZkWpwONKJu8zxfSDA4OB07A67Zp6S4pqpayyTq5rFnDhQTl2zcN1RuWEzN8K bT+KnFvCKvYPNVckRyb9mHx8/qpwYcSb+J9XwTcdn/4VW9vQ2L5I4F2guGqOKtO/eedp 70RPUPKKUEJGGFVJOa/fvhMWo4mUxfGR1srTzM85WWcgdcdRNqRWlbcfMXzkDs+zH6YB YPyLcoC4Us7DuvZD4t4gIaznLIDXGtV8jzNkLxEOeXOmwSQSWYYuUPvtVYFAH8ss8lA9 3z9Q== 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=FR+cvYepTfjRTi8l/TkNW1hBX6QkXLLGW6OJYShzR+9KzVXJj2ZjzPczQvaT16iM0P 4qzgF62Ol8YOKPA6fYLkiqaCzRcVzclGBRXLJX/I7tlqCwG5C5Z8hxtFxKFn7dVWWNq4 GyjB/yeAsxRs7CqCZ73LgV7L6CeRMtwB34EbDkxXBZ5VndZzzNErs+y4TXd0oVhOBddU jFYFBEyURm6EtnSkCTsHfLP7LrYUErqkHr4rYauFwDVutiRp1eXu6/py8vtqZOpz3pmd pbipWBrt6kyw9+w2dB/mrQypEoQ5vsrC9yi7kSHuBzDVtYsiRdPCidRXht2mRg9dTu+7 DHuw== X-Gm-Message-State: AOJu0Ywd+8BL/LLlbB3aBWbGEvv4gjkNgi9XH7bX9Gj+jDi0qUH0x1TG cwKxvNTmE6loWc1+AS4PTJA= 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, sam@ravnborg.org, Chris Morgan , sebastian.reichel@collabora.com, dri-devel@lists.freedesktop.org, robh+dt@kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 13451794 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E7F5EC4332F for ; Thu, 9 Nov 2023 21:51:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D0BF10E928; Thu, 9 Nov 2023 21:50:56 +0000 (UTC) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F8D310E92A for ; Thu, 9 Nov 2023 21:50:17 +0000 (UTC) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1f4a9dd83d6so71856fac.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.freedesktop.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=OyhWfq039aPSr66eoqjjSvV2jFExa63GEvBC7Xlv6DEbb8nq2YNKI9CWF0Lvt5YlPL 2d1H/wL2doiOEuFi0PZ2yEFZey8Ds1fTJ12CkaCMXIkd3JQBwnOFLX6sF+nbJ8pZZL8F EA1o/XYQD053ykue0c7MV1kqcxAUCs7EXS01toYWeB2HcoRgJi95yu85OugXkEJR01By AfVadvRj5zgTtaKvCUoJLzQWlvL2vGP/1QrPRNsI3fPOhGhe7myDWhBPPevGzxqzfDY4 TWmZISjcMUeNXaMAPAhEQozmOxEgefSmNBAxJVUK61/XuLPhUssBSjxKxHGgscLG1yuS 94bQ== 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=DAznIFt9/N4wCNKm4pFea/Z2gmaL5LFnSOiP5lo/tqLBL00m3VkpxV7soioF9s3WUE FE8l2oh4DB+1PtRJcVAeYYFqjem86U74iEffncJWPZbq5zWrvbZVuHflyPy1XN0OEHjg KDn9aNdj5byJqhvftzZDKhXKYv0W9dhGMNiOkzp6sxEMho7y/JAYIQeaqePTuiSDMWI4 zVXrq0ojlnqN8ARhUdj3AHclb64pdl7FsiWruVzuEfoYuVUma5l5UwcpViNjtxXBn2IW doW6jLZih3b3rrZDlaQ3oKp1vfsr1P0N+YBD8WIOIOyFNUoH9QjGgvj6oPL59ZKUn3wR BDIw== X-Gm-Message-State: AOJu0YzpM5VAbUAkyEafjqMTOPUeNsNtzwGVOfr97VZKtMYLGOg7X2/x F0icqjVLdP2Yvbm+w/GecK0= 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, sam@ravnborg.org, Chris Morgan , sebastian.reichel@collabora.com, dri-devel@lists.freedesktop.org, robh+dt@kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 13451795 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4B831C4167B for ; Thu, 9 Nov 2023 21:51:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A98B010E929; Thu, 9 Nov 2023 21:50:57 +0000 (UTC) Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2152910E92D for ; Thu, 9 Nov 2023 21:50:18 +0000 (UTC) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1ef9f1640a5so744007fac.3 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.freedesktop.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=Eu0amPNF26KW9TR1flYGpRkvjmFZs+pNfef6/0uCTzQPEbvzo92Sg8ALDmDrDCZ9yj e8vFszzayPDG7J39v7iR/Q6nVEXvoze2MfovGo9C0JfvlMs3K2NlEB+ey+xRiDWoFUMM 2QZmpzTBeoZJqpT4nQScqTbY30HVwbxsGEambhX3e8NlyoVGs6qZwl+phgoOrGaeVjon 1hLThlCcWjxS9whXWxPaTVB0sa8P9J5uJg9n528aqJAMj+CY2k6jl1Lbl6f4yCsmuNbX 8uJywqokjPr5IC8TxyjRaVAEmq+7qmF9WOegWg5z8Vqm/FpVTPiE946+sT7ST5FGz/lK 7gmQ== 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=cFoQk5EhL/epjLbgWXzRn1saXSQsbRaVvBjVR7jYtHU7h1VeDQPHsbwjqgXTgDzdtz UVLITd6kLq6i2Di7Z23zMP/xYPqd+oExQuWvxTTLdflx3rKaEjMhKGRpJht3wGgF8ek5 EEHwihw68hQ5nxNxfra7ai3P3fH4m6wMILEsCYzKBcKUGkCPjplLvHK8nQzcKpH3zzXh BgkRduv0iXhUzO9OQDGuoknlSZpKX5yAd6UDXJ9epCFPGY2lk8hooVaAzx7BNp1P9HhO To6j8wAk2yr99wuMVYXDMfDticKEFsl/fHhLx39ezIIMotMYKOAcSgDYOVLTt1pHnzAw YnQQ== X-Gm-Message-State: AOJu0Yzowo4fJzNNjReBm86t5TObHgdkK9eVe+n2Nu++bp2dOPk7Y6aN EdzvavhfS6xU9LOE0+JGRZk= 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, neil.armstrong@linaro.org, sam@ravnborg.org, Chris Morgan , sebastian.reichel@collabora.com, dri-devel@lists.freedesktop.org, robh+dt@kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;