Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4160463imm; Mon, 14 May 2018 03:35:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrBt95kzspFhWNy02sjRT3tAOVoQjqG/cjecnsGXeyhxnPheironDsWGymi3TI6UwB3T4Sx X-Received: by 2002:a62:1fc8:: with SMTP id l69-v6mr9934211pfj.49.1526294133610; Mon, 14 May 2018 03:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526294133; cv=none; d=google.com; s=arc-20160816; b=isFdKtFYEVnAnPAyb8v2EU5fZKovHqXA4J23sJucBexNQP5eA7hSPqJLSMz8Y7PfGX nYNPAqZj0xpfacxhQyCfmRGSrxieLzK5U3skbFWdZNCGKKLj8mc/+wslLzJUmG1jF9kb i0TTl+GBTp0YJQxSTh9GfnEfNFAZ8Zy4Mc+yTH6LC5yjYioe2ADfcWpx9OVRpwGgFNBF 1EpmCNZtLDV/rMGDADfzl2qUqBwwgpvC8tCCRq7/ExTIO+BBTiFlGXLsdgNTJwx9RoAF 6YgeSrP6uyIxSCHuQ+ko5vtwKaln3GMJkGqXY/xG0gcBAphusL0XTl057PeauBJKmtX3 sVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=cpnfQ2Oi2Q8JyDFBmkQkRigSNHjjqjq3//eSElZ8tnE=; b=vdTg001Phi2zmNpb1nHXjm+lel0zIO4Guqm8WV4kRb76rHaMfjMjaHmMN4yoDsgfOF 0+mwFha46xS+ETXTgg+J6es26kdexo9AQiK6ba6W0v7EY4U8NfrVT1gLrCXYtqpGriwD voXhogx9tD4XeDy+AY93ewGmEjW/yLqXvTWva3xymJMGX311uSE7OF0F1KwIVWdsSLcf n4+Tsjq6K2GX7No7ZGxoqnq4GBCtIfctwSBNu4w+2pDuIawKHbErb+cNzMr1iqHMszLm fx9sw7KiZtLRDeU8giwDg35VyzpaZa68kAs7Sod0q19Xs8Mz+OgR/PoAj5IEf0z3Z/3E zATQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=UmDzXnv+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9-v6si10293256pll.423.2018.05.14.03.35.18; Mon, 14 May 2018 03:35:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=UmDzXnv+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752142AbeENKd7 (ORCPT + 99 others); Mon, 14 May 2018 06:33:59 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50805 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbeENKd5 (ORCPT ); Mon, 14 May 2018 06:33:57 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180514103354euoutp01471b52cad956559837cf055076535c2a~ufFZzCc9b1813918139euoutp01Q for ; Mon, 14 May 2018 10:33:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180514103354euoutp01471b52cad956559837cf055076535c2a~ufFZzCc9b1813918139euoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1526294034; bh=cpnfQ2Oi2Q8JyDFBmkQkRigSNHjjqjq3//eSElZ8tnE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=UmDzXnv+JAl97xu3Fg8TsMMQ3hghQ5f+0me7AV7b+VhzqcqnUQ4GzoRUCwV0kJCjI 6gjsQpe44cKMcsacvNQczrqBoUjssZtkn1BE5dntMotWZOdUAl3RLpyOXMcHHfnUWT 3NqyFgkXA+V1KzaU9DhrYqMS7Mn3fQUxOQQS1Q30= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180514103352eucas1p2eb78f056731edbdd4be6d2693c2bd931~ufFYI45rS3152831528eucas1p2a; Mon, 14 May 2018 10:33:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id DC.41.05700.01669FA5; Mon, 14 May 2018 11:33:52 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180514103351eucas1p1e8fcc7e4448f9b0c981f31bd4d1b2e30~ufFWvPN1k0255702557eucas1p1D; Mon, 14 May 2018 10:33:51 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180514103350eusmtrp27ae7de4045a6704ccdee0b1701587816~ufFWRXtJb0972609726eusmtrp2F; Mon, 14 May 2018 10:33:50 +0000 (GMT) X-AuditID: cbfec7f2-1dbff70000011644-98-5af9661045ae Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 0C.B5.04183.E0669FA5; Mon, 14 May 2018 11:33:50 +0100 (BST) Received: from [106.120.43.17] (unknown [106.120.43.17]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180514103350eusmtip2c5c29680c1366fc4bf9f1fedabda12e6~ufFVwfMFU0638706387eusmtip2g; Mon, 14 May 2018 10:33:50 +0000 (GMT) Subject: Re: [PATCH v2 2/2] drm/bridge: sii902x: add optional power supplies To: Philippe CORNU , Archit Taneja , Laurent Pinchart , David Airlie , Rob Herring , Mark Rutland , "dri-devel@lists.freedesktop.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Yannick FERTRE , Benjamin Gaignard , Alexandre TORGUE From: Andrzej Hajda Message-ID: <69a9da79-63df-6d0a-52e3-729ec8937484@samsung.com> Date: Mon, 14 May 2018 12:33:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJKsWRmVeSWpSXmKPExsWy7djP87oCaT+jDG5e4LDoPXeSyWLjk9OM Fk0db1ktmg6dYrOYf+Qcq8WVr+/ZLDonLmG3uLxrDpvF0usXmSwetLxgtWjde4Tdor2zlc2B x2PNvDWMHpf7epk8ZnfMZPXYtKqTzePOtT1sHtu/PWD1uN99nMnj6Y+9zB6fN8kFcEZx2aSk 5mSWpRbp2yVwZUy5nlPwTb7i8Lw7jA2MUyW7GDk5JARMJJ4fO8LaxcjFISSwglGi4fhxKOcL o8SSzqtsEM5nRol3He/ZYVo+/D0EVbWcUeLrtUfsEM5bRokJpy4xg1QJC/hILOm9zAiSEBHY zSyx+OEcFhCHWaCLUeLbsXlgVWwCmhJ/N99kA7F5Bewknv9dywhiswioSnSsXc4EYosKREg0 Pf/JDlEjKHFy5hMWEJtTwEpi/vMpYL3MAvIS29/OYYawxSVuPZnPBLJMQuAnu0T/lV3MEIe7 SKx+sg/KFpZ4dXwL1EMyEv93zmeCsKslbr5oYoFo7mCUuP+7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mlxbnpucVGesWJ ucWleel6yfm5mxiBEb3t2M8tOxi73gUfYhTgYFTi4V2x8keUEGtiWXFl7iFGCQ5mJRHe3UY/ o4R4UxIrq1KL8uOLSnNSiw8xmgI9N5FZSjQ5H5hs8kriDU0NzS0sDc2NzY3NLJTEec8bVEYJ CaQnlqRmp6YWpBbB9DFxcEo1MCZd///J/MWGyw9y31nZpb2Tm9d/7UlccVp97txleXacZ7b+ fflaf+FvJ+NlP72spKb2mhcftefi2Lh7f2XN7euZiz9On7Zb9t+24jd19U4n2v12niksYNXL zfijMunkJzt5o+CcvQuN2Uumxqneu7po5/HDSZv05yxqnGRenXmq8kqRwJ+PmySUWIozEg21 mIuKEwEAY+43/gIAAA== X-CMS-MailID: 20180514103351eucas1p1e8fcc7e4448f9b0c981f31bd4d1b2e30 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-MTR: 20180514103351eucas1p1e8fcc7e4448f9b0c981f31bd4d1b2e30 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180514093922epcas2p4090c2d4819b470f2618ba4a333cecb2c X-RootMTR: 20180514093922epcas2p4090c2d4819b470f2618ba4a333cecb2c References: <20180425075314.19137-1-philippe.cornu@st.com> <20180425075314.19137-3-philippe.cornu@st.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.05.2018 11:38, Philippe CORNU wrote: > Hi Laurent, Archit, Andrzej & Yannick, > > Do you have any comments on this v2 driver part? > (more details regarding v1/v2 differences in the cover letter > https://www.spinics.net/lists/dri-devel/msg174137.html) > > Thank you, > Philippe :-) > > > On 04/25/2018 09:53 AM, Philippe Cornu wrote: >> Add the optional power supplies using the description found in >> "SiI9022A/SiI9024A HDMI Transmitter Data Sheet (August 2016)". >> >> The sii902x input IOs are not "io safe" so it is important to >> enable/disable voltage regulators during probe/remove phases to >> avoid damages. What exactly does it mean? Ie I understand that the chip has some limitations, but why enabling/disabling regulators in probe/remove should solve it? Regards Andrzej >> >> Signed-off-by: Philippe Cornu >> --- >> drivers/gpu/drm/bridge/sii902x.c | 38 ++++++++++++++++++++++++++++++++++---- >> 1 file changed, 34 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c >> index 60373d7eb220..c367d7b91ade 100644 >> --- a/drivers/gpu/drm/bridge/sii902x.c >> +++ b/drivers/gpu/drm/bridge/sii902x.c >> @@ -24,6 +24,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -86,6 +87,7 @@ struct sii902x { >> struct drm_bridge bridge; >> struct drm_connector connector; >> struct gpio_desc *reset_gpio; >> + struct regulator_bulk_data supplies[2]; >> }; >> >> static inline struct sii902x *bridge_to_sii902x(struct drm_bridge *bridge) >> @@ -392,23 +394,42 @@ static int sii902x_probe(struct i2c_client *client, >> return PTR_ERR(sii902x->reset_gpio); >> } >> >> + sii902x->supplies[0].supply = "iovcc"; >> + sii902x->supplies[1].supply = "vcc12"; >> + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(sii902x->supplies), >> + sii902x->supplies); >> + if (ret) { >> + dev_err(dev, "Failed to get power supplies: %d\n", ret); >> + return ret; >> + } >> + >> + ret = regulator_bulk_enable(ARRAY_SIZE(sii902x->supplies), >> + sii902x->supplies); >> + if (ret) { >> + dev_err(dev, "Failed to enable power supplies: %d\n", ret); >> + return ret; >> + } >> + >> + usleep_range(10000, 20000); >> + >> sii902x_reset(sii902x); >> >> ret = regmap_write(sii902x->regmap, SII902X_REG_TPI_RQB, 0x0); >> if (ret) >> - return ret; >> + goto err_disable_regulator; >> >> ret = regmap_bulk_read(sii902x->regmap, SII902X_REG_CHIPID(0), >> &chipid, 4); >> if (ret) { >> dev_err(dev, "regmap_read failed %d\n", ret); >> - return ret; >> + goto err_disable_regulator; >> } >> >> if (chipid[0] != 0xb0) { >> dev_err(dev, "Invalid chipid: %02x (expecting 0xb0)\n", >> chipid[0]); >> - return -EINVAL; >> + ret = -EINVAL; >> + goto err_disable_regulator; >> } >> >> /* Clear all pending interrupts */ >> @@ -424,7 +445,7 @@ static int sii902x_probe(struct i2c_client *client, >> IRQF_ONESHOT, dev_name(dev), >> sii902x); >> if (ret) >> - return ret; >> + goto err_disable_regulator; >> } >> >> sii902x->bridge.funcs = &sii902x_bridge_funcs; >> @@ -434,6 +455,12 @@ static int sii902x_probe(struct i2c_client *client, >> i2c_set_clientdata(client, sii902x); >> >> return 0; >> + >> +err_disable_regulator: >> + regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), >> + sii902x->supplies); >> + >> + return ret; >> } >> >> static int sii902x_remove(struct i2c_client *client) >> @@ -443,6 +470,9 @@ static int sii902x_remove(struct i2c_client *client) >> >> drm_bridge_remove(&sii902x->bridge); >> >> + regulator_bulk_disable(ARRAY_SIZE(sii902x->supplies), >> + sii902x->supplies); >> + >> return 0; >> } >>