Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4906924rdb; Fri, 15 Sep 2023 16:42:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnagVsARD5NAn5kcMUxzsSC/VzpvrhIrPT4Y31sqUQ7N9XaFODH8nLne7Ixq2m8rAzv6Pr X-Received: by 2002:a17:902:d2c2:b0:1b3:9d13:34b3 with SMTP id n2-20020a170902d2c200b001b39d1334b3mr3269140plc.37.1694821376882; Fri, 15 Sep 2023 16:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694821376; cv=none; d=google.com; s=arc-20160816; b=sbgRDYrqgGgbfCs1r5hBn7qYtKl6im0ivgfa1kkT8ByQCW5GbrcaLT0egZeiN6rqR5 aR3kMZ1/nYmHOt04YPsU9++CHw/Q5x7qecbVhUIzgEjtjk5K06gC7/LAkKBwmB3W/LAM 5vZp5XHHYTPw0hZRZzl9L0D1W5VTmqJUbaVeEc5JLwGPGAm0T2pe92KMGvTXRYYQEsU7 6GBo8EZ1z8MF9e6/UDQJptFEGI5zump/v8dtHeCysu8moFD8g3AGNtsoqArfD6jzfnI4 xrHFiytMfqrOROmq4bULIq/ZdDs2VkE2NvHCdE3639tzYVJJLFGTmYdkIFbeigE5dwQd CjVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=j2srMlgd+gSkKgJyE08vvd3NQ0c7NlhfaDS/LP6uMFM=; fh=WyFMJiOsPnAFSNiaRKDJUr3QLeL0EjB5fGv5zZ2Xgpc=; b=w0sGlt9wS2YkWlci06oXC6+NbqS/oB2o7qZ98pYebHxxfnhvrUYyEWZeFxdIAe5YGc tEg2wh88q6rNT+nfMBxzaTO5P4Hvs6NcooiNV83skNoLvDEBiAINVO5YQmdSm40zzUMn lZ2SWT7K5H7WACoCki8nW84s+kHE4NVH9ZEnl1VwT7cq10VJdX70AQCxLssPURPuGRM3 M0C22C5gmjXdptl0yIBuDEFb0vA3r1ero/XufFEpplbj5kCSyR8zHpaUzlGMQnFGVZO9 BhWtMbIsm0r0AmqDsd/HGuV0F+ym2cDVJmIYsDpbOQS1FEmE/2p4CfOUyXkvltH2lsnA 9XWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ff6ue9Q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a7-20020a170902900700b001c3e500e6d4si3969658plp.344.2023.09.15.16.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 16:42:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ff6ue9Q3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 49C37814555E; Fri, 15 Sep 2023 14:25:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236551AbjIOVYz (ORCPT + 99 others); Fri, 15 Sep 2023 17:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237718AbjIOVYg (ORCPT ); Fri, 15 Sep 2023 17:24:36 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A66C1AC; Fri, 15 Sep 2023 14:24:16 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38FJt3GG008372; Fri, 15 Sep 2023 21:23:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=j2srMlgd+gSkKgJyE08vvd3NQ0c7NlhfaDS/LP6uMFM=; b=ff6ue9Q3as93DGU1bIye5qHvjAZIRmy8gZQHRlUetZcNyffjtzHjrs0DZf6QkyeFrSgq JuUE//udbgfarjf35n/6PdCJRBOcY63CoymEoeBOG6Zdu0Ekag1dDdj/wzUTWks/qHTQ GfSJLKVF4P0vmpuQRPFP1AwZJO6gv5Ms59eYO//0bGqkV6ZCtBVYDf8VMnd2/6NNBWgY 9zkwStdlT00YRxlCVBTKuuIMq8Ia0kJHSX4Y7CnRr7OHjGFAp3Fo7TpqwoY190VsgY+k VoY4qSs/xhiqyW83crwNm2YOC3X4g/cXkMXIol4MU43sRoGL+ZLGW1+11JcOo54Iuake uA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t4g86t5pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 21:23:56 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38FLNtRj020242 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Sep 2023 21:23:55 GMT Received: from [10.71.110.254] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Fri, 15 Sep 2023 14:23:55 -0700 Message-ID: <66dacc5c-fa00-1903-43d9-53094c516ebb@quicinc.com> Date: Fri, 15 Sep 2023 14:23:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 5/8] drm/panel: nv3052c: Allow specifying registers per panel Content-Language: en-US To: John Watts , CC: Neil Armstrong , Conor Dooley , , Sam Ravnborg , Chris Morgan , , Jagan Teki , Rob Herring , Krzysztof Kozlowski , Shawn Guo References: <20230911090206.3121440-1-contact@jookia.org> <20230911090206.3121440-6-contact@jookia.org> From: Jessica Zhang In-Reply-To: <20230911090206.3121440-6-contact@jookia.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: KEpVqJR02qWL-WP30iz1EDOS-YkFArgK X-Proofpoint-ORIG-GUID: KEpVqJR02qWL-WP30iz1EDOS-YkFArgK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-15_17,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 impostorscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150191 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:25:28 -0700 (PDT) On 9/11/2023 2:02 AM, John Watts wrote: > Panel initialization registers are per-display and not tied to the > controller itself. Different panels will specify their own registers. > Attach the sequences to the panel info struct so future panels > can specify their own sequences. > > Signed-off-by: John Watts > --- > .../gpu/drm/panel/panel-newvision-nv3052c.c | 25 ++++++++++++------- > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c > index 307335d0f1fc..b2ad9b3a5eb7 100644 > --- a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c > +++ b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c > @@ -20,11 +20,18 @@ > #include > #include > > +struct nv3052c_reg { > + u8 cmd; > + u8 val; > +}; > + > struct nv3052c_panel_info { > const struct drm_display_mode *display_modes; > unsigned int num_modes; > u16 width_mm, height_mm; > u32 bus_format, bus_flags; > + const struct nv3052c_reg *panel_regs; > + int panel_regs_len; > }; > > struct nv3052c { > @@ -36,12 +43,7 @@ struct nv3052c { > struct gpio_desc *reset_gpio; > }; > > -struct nv3052c_reg { > - u8 cmd; > - u8 val; > -}; > - > -static const struct nv3052c_reg nv3052c_panel_regs[] = { > +static const struct nv3052c_reg ltk035c5444t_panel_regs[] = { > // EXTC Command set enable, select page 1 > { 0xff, 0x30 }, { 0xff, 0x52 }, { 0xff, 0x01 }, > // Mostly unknown registers > @@ -244,6 +246,7 @@ static inline struct nv3052c *to_nv3052c(struct drm_panel *panel) > static int nv3052c_prepare(struct drm_panel *panel) > { > struct nv3052c *priv = to_nv3052c(panel); > + const struct nv3052c_reg *panel_regs = priv->panel_info->panel_regs; > struct mipi_dbi *dbi = &priv->dbi; > unsigned int i; > int err; > @@ -260,9 +263,11 @@ static int nv3052c_prepare(struct drm_panel *panel) > gpiod_set_value_cansleep(priv->reset_gpio, 0); > msleep(150); > > - for (i = 0; i < ARRAY_SIZE(nv3052c_panel_regs); i++) { > - err = mipi_dbi_command(dbi, nv3052c_panel_regs[i].cmd, > - nv3052c_panel_regs[i].val); > + int panel_regs_len = priv->panel_info->panel_regs_len; Hi John, Sorry for not catching this earlier -- can you move the declaration of panel_regs_len to the top of the function? Otherwise this throws a compiler warning. With that change, Reviewed-by: Jessica Zhang Thanks, Jessica Zhang > + > + for (i = 0; i < panel_regs_len; i++) { > + err = mipi_dbi_command(dbi, panel_regs[i].cmd, > + panel_regs[i].val); > > if (err) { > dev_err(priv->dev, "Unable to set register: %d\n", err); > @@ -466,6 +471,8 @@ static const struct nv3052c_panel_info ltk035c5444t_panel_info = { > .height_mm = 64, > .bus_format = MEDIA_BUS_FMT_RGB888_1X24, > .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, > + .panel_regs = ltk035c5444t_panel_regs, > + .panel_regs_len = ARRAY_SIZE(ltk035c5444t_panel_regs), > }; > > static const struct spi_device_id nv3052c_ids[] = { > -- > 2.42.0 >