Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1187516ybt; Sat, 20 Jun 2020 03:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsZAAkpnwwBwdiOFkLB0u4uf13Pd8aLvHqisq3FLtFctoeTs4f0j2mMghHGuabriRMmhI8 X-Received: by 2002:a05:6402:1767:: with SMTP id da7mr7750591edb.90.1592649322194; Sat, 20 Jun 2020 03:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592649322; cv=none; d=google.com; s=arc-20160816; b=yhySDkskOvMBXSR+mZw9Ld+blt2GlAY/RoE7yiLy0Kzb9KpWSwTXdJ9TCuo52IwGFz Hwk74R0kIwW1IHFuYZXSULeyuVHAAlpGELV0fleM6469VAGlvsqdu+5NXt7ikQh8m7bq HR29ScjJWhSka56tUzZzl8hXMCLEglq2pp0KiB7QorsxzFnIOqHvtPR7zS/2zHz6TeBD AIWAm6GecDyBLrq2JdC5w7ebNmDD7N+vNTrhgUKyufMIoWPyNmjFPpv99CG/zXVULWQt CdEKUqwehZnHwrPjoEVyqZI5SAYth55xgYfzsyu8F/6/d030GaeNc42eVWC/SD1r5ioA 2FHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pjMdgo4VTBZ5f+MWSRd0SVSPFDJCHOpZnBoF42ejdJQ=; b=vAEdAdU3QcNeD+bP9whv76h34CRZ8AsKqZ3teyCMA4Oqzv3Em+3wrin2wnm5RFmedz mlHTnfo58hzVIZaG+t20wKvDnjFcAb+gzQNDK+dXOttpI3czZxiBLZRBtOrXY9ndktMZ wIemzORFJFQNBsHAmb2Hl0QrRz22fj2OZ3H2tqGAn44RchPxdYtD74Zo60hirzmDaUPN LWLmEXGvfzHqbfa0cYZPgydIfMbxrU4cRzNs8RAder3xspPzmgUH1hePaKwfP2NWlniE MhXfLCuEUSV+vPErk/w5kgvEC8NTkeI9Knoeh+59LpvUz56U4sgFvKCOQSMfARQ7VUHX wIYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr2si5489097ejb.454.2020.06.20.03.34.59; Sat, 20 Jun 2020 03:35:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgFTKcZ (ORCPT + 99 others); Sat, 20 Jun 2020 06:32:25 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:47140 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728009AbgFTKb1 (ORCPT ); Sat, 20 Jun 2020 06:31:27 -0400 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id DC51B20020; Sat, 20 Jun 2020 12:31:07 +0200 (CEST) Date: Sat, 20 Jun 2020 12:31:06 +0200 From: Sam Ravnborg To: Vinay Simha BN Cc: Jernej Skrabec , Jonas Karlman , David Airlie , Neil Armstrong , open list , "open list:DRM DRIVERS" , Andrzej Hajda , Laurent Pinchart Subject: Re: [PATCH v3 2/2] display/drm/bridge: TC358775 DSI/LVDS driver Message-ID: <20200620103106.GA15379@ravnborg.org> References: <20200618121902.16841-1-simhavcs@gmail.com> <20200618121902.16841-2-simhavcs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618121902.16841-2-simhavcs@gmail.com> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=edQTgYMH c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=Qg8_i2Z0HerwvbgKwyIA:9 a=CjuIK1q_8ugA:10 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinay. > + > +static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id) > +{ > + struct device *dev = &client->dev; > + struct drm_panel *panel; > + struct tc_data *tc; > + int ret; > + > + tc = devm_kzalloc(dev, sizeof(*tc), GFP_KERNEL); > + if (!tc) > + return -ENOMEM; > + > + tc->dev = dev; > + tc->i2c = client; > + > + ret = drm_of_find_panel_or_bridge(dev->of_node, TC358775_LVDS_OUT0, > + 0, &panel, NULL); > + if (ret < 0) > + return ret; > + if (!panel) > + return -ENODEV; > + > + panel->connector_type = DRM_MODE_CONNECTOR_LVDS; The panel is responsible for specifying the connector_type. It is wrong to let users of panel set it. Fix the panel and not the bridge driver. > + > + tc->panel_bridge = devm_drm_panel_bridge_add(dev, panel); > + if (IS_ERR(tc->panel_bridge)) > + return PTR_ERR(tc->panel_bridge); > + > + ret = tc358775_parse_dt(dev->of_node, tc); > + if (ret) > + return ret; > + > + tc->vddio = devm_regulator_get(dev, "vddio-supply"); > + if (IS_ERR(tc->vddio)) { > + ret = PTR_ERR(tc->vddio); > + dev_err(dev, "vddio-supply not found\n"); > + return ret; > + } > + > + tc->vdd = devm_regulator_get(dev, "vdd-supply"); > + if (IS_ERR(tc->vdd)) { > + ret = PTR_ERR(tc->vddio); > + dev_err(dev, "vdd-supply not found\n"); > + return ret; > + } > + > + tc->stby_gpio = devm_gpiod_get(dev, "stby", GPIOD_OUT_HIGH); > + if (IS_ERR(tc->stby_gpio)) { > + ret = PTR_ERR(tc->stby_gpio); > + dev_err(dev, "cannot get stby-gpio %d\n", ret); > + return ret; > + } > + > + tc->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); > + if (IS_ERR(tc->reset_gpio)) { > + ret = PTR_ERR(tc->reset_gpio); > + dev_err(dev, "cannot get reset-gpios %d\n", ret); > + return ret; > + } > + > + tc->bridge.funcs = &tc_bridge_funcs; > + tc->bridge.of_node = dev->of_node; > + drm_bridge_add(&tc->bridge); > + > + i2c_set_clientdata(client, tc); > + > + return 0; > +} > + Sam