From patchwork Mon Jan 15 17:33:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10165075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFE9860245 for ; Mon, 15 Jan 2018 17:34:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A97D7201BD for ; Mon, 15 Jan 2018 17:34:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E299205AF; Mon, 15 Jan 2018 17:34:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FD8B201BD for ; Mon, 15 Jan 2018 17:34:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750710AbeAOReI (ORCPT ); Mon, 15 Jan 2018 12:34:08 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60359 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258AbeAOReH (ORCPT ); Mon, 15 Jan 2018 12:34:07 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180115173405euoutp024b07a980fad16a93a2e85d13746b1d89~KDDTnEXJ00536305363euoutp02c; Mon, 15 Jan 2018 17:34:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180115173405euoutp024b07a980fad16a93a2e85d13746b1d89~KDDTnEXJ00536305363euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1516037645; bh=8X69u9n2Zfp/ev1WcKGl26vAuyfOz1Nq1zSOMu3eTsg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=VTHGTON9iiewtJjM9pQNDyJCHQmdnqobD+TFyVLsvAFT5oo6iIUbrrID+4bQdvj8i Cfu2ypm4zhpvrGLiEbc14EK3Wo5JWrELdEurX45iBNL7kzw0n5hK/ZRb22Tmk+eX/S mGqAYzq3yhkTzhoNBQGz5/otX+BXOzBoWvWJWNG4= Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180115173405eucas1p1c573cff835ce7c9b7526a9a8492cb8f6~KDDS6zHvp0898108981eucas1p19; Mon, 15 Jan 2018 17:34:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 6C.DA.30163.C06EC5A5; Mon, 15 Jan 2018 17:34:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180115173404eucas1p11cd93514b1c6cefedca81b4d06de860e~KDDSNbBMB1627616276eucas1p1M; Mon, 15 Jan 2018 17:34:04 +0000 (GMT) X-AuditID: cbfec7f4-f790c6d0000075d3-4a-5a5ce60c57c4 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id EB.B9.18832.C06EC5A5; Mon, 15 Jan 2018 17:34:04 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P2L00H20Y4QIA10@eusync4.samsung.com>; Mon, 15 Jan 2018 17:34:04 +0000 (GMT) From: Andrzej Hajda To: Archit Taneja , Laurent Pinchart Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/3] drm/bridge/sii8620: perform I2C bus recovery after reset Date: Mon, 15 Jan 2018 18:33:55 +0100 Message-id: <20180115173357.31067-2-a.hajda@samsung.com> X-Mailer: git-send-email 2.15.1 In-reply-to: <20180115173357.31067-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsWy7djPc7o8z2KiDBYetrC4te4cq0VTx1tW i40z1rNaXPn6ns2ic+ISdosZ5/cxWaw9cpfdgd3jcl8vk8fsjpmsHve7jzN59G1ZxejxeZNc AGsUl01Kak5mWWqRvl0CV8bp3m7GgqmcFXdvmjQw3mHvYuTgkBAwkbi0MLiLkRPIFJO4cG89 WxcjF4eQwFJGidsXTrFCOJ8ZJRY8u8ICUWUi0X7/GTtEYhmjxJO7C5khnP9AzvJDYFVsApoS fzffZAOxRQSSJE6f+wA2l1ngEqPE65PdjCAJYQF/iWvb3oA1sAioSqz4cxbM5hWwkFizej8b xDp5iQlbmsDinAKWEg0HfrKADJIQ6GGTeD6znwmiyEVixqk2qAZhiVfHt7BD2DISnR0HmSAa uhklPvWfYIdwpjBK/Pswgxmiylri8PGLrCA2swCfxKRt05khQcMr0dEmBFHiIbHmbifUMkeJ V18WQUOmh1Fi+8Zz7BMYpRcwMqxiFEktLc5NTy020StOzC0uzUvXS87P3cQIjNbT/45/2cG4 +JjVIUYBDkYlHl6LbTFRQqyJZcWVuYcYJTiYlUR4G4OBQrwpiZVVqUX58UWlOanFhxilOViU xHlto9oihQTSE0tSs1NTC1KLYLJMHJxSDYyb37FOcp9v9rRw0/qywAy21asVC3O6wsNmrGY2 e7r06KczE68z7m0xMrq4829Q+IRErntp1/axNZ9ayfw081U8n/dOiakn703IfPD5++Xd+xKf 88iuS/AM8S2bHCbypb1l5iNtweX7XyxrrWb69PhfKf/E3wxbrVdZTvoyeULwdce7USx3HdQY lFiKMxINtZiLihMB0E5JZdICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprILMWRmVeSWpSXmKPExsVy+t/xa7o8z2KiDJb1SFjcWneO1aKp4y2r xcYZ61ktrnx9z2bROXEJu8WM8/uYLNYeucvuwO5xua+XyWN2x0xWj/vdx5k8+rasYvT4vEku gDWKyyYlNSezLLVI3y6BK+N0bzdjwVTOirs3TRoY77B3MXJySAiYSLTffwZli0lcuLeerYuR g0NIYAmjxDb7LkYuILORSWLjxy5GkBo2AU2Jv5tvsoHYIgJJEhsfHmIBKWIWuMIo0f6tC2yQ sICvxJOuV2ANLAKqEiv+nGUBsXkFLCTWrN7PBrFMXmLCliawOKeApUTDgZ9gthBQzcINE9gm MPIuYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERhQ24793LyD8dLG4EOMAhyMSjy8Ftti ooRYE8uKK3MPMUpwMCuJ8DYGA4V4UxIrq1KL8uOLSnNSiw8xSnOwKInz9u5ZHSkkkJ5Ykpqd mlqQWgSTZeLglGpg1LpWsfWYeN3aHdE184XvyLxZM2XlErcPm95uUbpu0jtHuPaZSEph5qp3 LMKZPgzRdzfofo5MTk7+Lnutc27Lg42ZfwyqezZG2F6Z++un4Pn+hPfBt0NS9+a+eqLyu66F P+eCySR3qeTrxu6VkhtmbpNXm8x+Z7VSxIMwLtmjqxcdafunyG0xX4mlOCPRUIu5qDgRAG5v 9DQkAgAA X-CMS-MailID: 20180115173404eucas1p11cd93514b1c6cefedca81b4d06de860e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180115173404eucas1p11cd93514b1c6cefedca81b4d06de860e X-RootMTR: 20180115173404eucas1p11cd93514b1c6cefedca81b4d06de860e References: <20180115173357.31067-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Chip has known bug which causes I2C client state machine to frequently enter non-idle mode after chip reset. Let's ask I2C adapter to perform bus recovery to mitigate this bug. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/bridge/sil-sii8620.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 86789f8918a4..db93e5e0497c 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -978,6 +978,8 @@ static int sii8620_hw_off(struct sii8620 *ctx) static void sii8620_hw_reset(struct sii8620 *ctx) { + struct i2c_client *i2c = to_i2c_client(ctx->dev); + usleep_range(10000, 20000); gpiod_set_value(ctx->gpio_reset, 0); usleep_range(5000, 20000); @@ -985,6 +987,9 @@ static void sii8620_hw_reset(struct sii8620 *ctx) usleep_range(10000, 20000); gpiod_set_value(ctx->gpio_reset, 0); msleep(300); + + /* I2C bus recovery prevents I2C errors due to known bug in the chip */ + i2c_recover_bus(i2c->adapter); } static void sii8620_cbus_reset(struct sii8620 *ctx)