From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6801CC433EF for ; Tue, 22 Feb 2022 14:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232901AbiBVOrK (ORCPT ); Tue, 22 Feb 2022 09:47:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbiBVOrH (ORCPT ); Tue, 22 Feb 2022 09:47:07 -0500 Received: from 189.cn (ptr.189.cn [183.61.185.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F5251FC; Tue, 22 Feb 2022 06:46:39 -0800 (PST) HMM_SOURCE_IP: 10.64.8.31:53590.1226820573 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-114.242.206.180 (unknown [10.64.8.31]) by 189.cn (HERMES) with SMTP id 2669A100282; Tue, 22 Feb 2022 22:46:36 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-b7fbf7d79-bwdqx with ESMTP id 608c66110ce94bae849ff8b258bd58fa for maxime@cerno.tech; Tue, 22 Feb 2022 22:46:38 CST X-Transaction-ID: 608c66110ce94bae849ff8b258bd58fa X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 Sender: 15330273260@189.cn Message-ID: <54ea69d7-2fac-74dc-2ef6-843a666cff85@189.cn> Date: Tue, 22 Feb 2022 22:46:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v10 3/4] drm/lsdc: add drm driver for loongson display controller Content-Language: en-US To: Maxime Ripard Cc: Thomas Zimmermann , Roland Scheidegger , Zack Rusin , Christian Gmeiner , David Airlie , Daniel Vetter , Rob Herring , Thomas Bogendoerfer , Dan Carpenter , Krzysztof Kozlowski , Andrey Zhizhikin , Sam Ravnborg , "David S . Miller" , Jiaxun Yang , Lucas Stach , Maarten Lankhorst , Ilia Mirkin , Qing Zhang , suijingfeng , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, Randy Dunlap , kernel test robot References: <20220220145554.117854-1-15330273260@189.cn> <20220220145554.117854-4-15330273260@189.cn> <20220222082747.66otrkc4zwvhem7w@houat> From: Sui Jingfeng <15330273260@189.cn> In-Reply-To: <20220222082747.66otrkc4zwvhem7w@houat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/2/22 16:27, Maxime Ripard wrote: >> + if (!of_device_is_available(output)) { >> + of_node_put(output); >> + drm_info(ddev, "connector%d is not available\n", index); >> + return NULL; >> + } >> + >> + disp_tims_np = of_get_child_by_name(output, "display-timings"); >> + if (disp_tims_np) { >> + lsdc_get_display_timings_from_dtb(output, &lconn->disp_tim); >> + lconn->has_disp_tim = true; >> + of_node_put(disp_tims_np); >> + drm_info(ddev, "Found display timings provided by connector%d\n", index); >> + } >> + >> + connector_type = lsdc_get_connector_type(ddev, output, index); >> + >> + if (output) { >> + of_node_put(output); >> + output = NULL; >> + } >> + >> +DT_SKIPED: >> + >> + /* Only create the i2c channel if display timing is not provided */ >> + if (!lconn->has_disp_tim) { >> + const struct lsdc_chip_desc * const desc = ldev->desc; >> + >> + if (desc->have_builtin_i2c) >> + lconn->ddc = lsdc_create_i2c_chan(ddev, index); >> + else >> + lconn->ddc = lsdc_get_i2c_adapter(ddev, index); > This looks weird: the connector bindings have a property to store the > i2c controller connected to the DDC lines, so you should use that > instead. > This is not  weird,  ast, mgag200, hibmc do the same thing.