From patchwork Fri Jan 20 07:38:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9527651 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 2D3C960434 for ; Fri, 20 Jan 2017 07:39:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E74428452 for ; Fri, 20 Jan 2017 07:39:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 135B528620; Fri, 20 Jan 2017 07:39:53 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C588A28452 for ; Fri, 20 Jan 2017 07:39:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4600A6EB39; Fri, 20 Jan 2017 07:39:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01BB06EB3F for ; Fri, 20 Jan 2017 07:39:04 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OK200G70IL24G50@mailout2.w1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 20 Jan 2017 07:39:02 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170120073902eucas1p2601516232b6c5c11d863c9d5ab2782a5~bas_vQ-cS2309423094eucas1p2L; Fri, 20 Jan 2017 07:39:02 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 14.B0.16908.89EB1885; Fri, 20 Jan 2017 07:39:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170120073901eucas1p1c4c9ca4b72fc1e418775f59e6c3579f2~bas_JfBDZ0087500875eucas1p1R; Fri, 20 Jan 2017 07:39:01 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-07-5881be9841b8 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 29.47.10233.19EB1885; Fri, 20 Jan 2017 07:38:57 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OK200LE1IKT7D70@eusync1.samsung.com>; Fri, 20 Jan 2017 07:39:01 +0000 (GMT) From: Andrzej Hajda To: Archit Taneja , dri-devel@lists.freedesktop.org Subject: [PATCH 21/24] drm/bridge/sii8620: improve gen2 write burst IRQ routine Date: Fri, 20 Jan 2017 08:38:47 +0100 Message-id: <1484897930-1275-22-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1484897930-1275-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsWy7djPc7oz9jVGGCxp0rW4te4cq0VTx1tW i40z1rNa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7N40V pIpNQFPi7+abbCC2iIC3xJzVfWBFzALrGSWmPv4LNIqDQ1jAX+LO4TSQGhYBVYkVR38ygti8 As4Sb3d+YYbYJidx81wnmM0JFD9/4wsTSKuQgJPEtVmyExh5FzAyrGIUSS0tzk3PLTbSK07M LS7NS9dLzs/dxAgM123Hfm7Zwdj1LvgQowAHoxIP744TDRFCrIllxZW5hxglOJiVRHh71jdG CPGmJFZWpRblxxeV5qQWH2I0BbppIrOUaHI+MJbySuINTQzNLQ2NjC0szI2MlMR5p364Ei4k kJ5YkpqdmlqQWgTTx8TBKdXAGB52rGG2qt7thR5BjNKfGV7tW/BopXPtBxbJ32JiGpom0TEz dZYlXOH8clC2/l4ss1fSv4tif/d0vjTd6LWfibl1zkb7jfldDCkRj+rvGVe0J/nsP1LqaDhZ rOoWS1BUY/gX7cLkA5P5vh5gvflrSn2/zdsDAnUPj5keDVulcu/SgutaXv87lViKMxINtZiL ihMBcaa7em0CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170120073901eucas1p1c4c9ca4b72fc1e418775f59e6c3579f2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170120073901eucas1p1c4c9ca4b72fc1e418775f59e6c3579f2 X-RootMTR: 20170120073901eucas1p1c4c9ca4b72fc1e418775f59e6c3579f2 References: <1484897930-1275-1-git-send-email-a.hajda@samsung.com> Cc: Marek Szyprowski , Bartlomiej Zolnierkiewicz X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The patch adds code to report back feature complete IRQ, and code to read and drop burst writes from peer. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/bridge/sil-sii8620.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 2cc197d..77c9fb2 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -1573,12 +1573,31 @@ static void sii8620_irq_disc(struct sii8620 *ctx) sii8620_write(ctx, REG_CBUS_DISC_INTR0, stat); } +static void sii8620_read_burst(struct sii8620 *ctx) +{ + u8 buf[17]; + + sii8620_read_buf(ctx, REG_MDT_RCV_READ_PORT, buf, ARRAY_SIZE(buf)); + sii8620_write(ctx, REG_MDT_RCV_CTRL, BIT_MDT_RCV_CTRL_MDT_RCV_EN | + BIT_MDT_RCV_CTRL_MDT_DELAY_RCV_EN | + BIT_MDT_RCV_CTRL_MDT_RFIFO_CLR_CUR); + sii8620_readb(ctx, REG_MDT_RFIFO_STAT); +} + static void sii8620_irq_g2wb(struct sii8620 *ctx) { u8 stat = sii8620_readb(ctx, REG_MDT_INT_0); if (stat & BIT_MDT_IDLE_AFTER_HAWB_DISABLE) - dev_dbg(ctx->dev, "HAWB idle\n"); + if (sii8620_is_mhl3(ctx)) + sii8620_mt_set_int(ctx, MHL_INT_REG(RCHANGE), + MHL_INT_RC_FEAT_COMPLETE); + + if (stat & BIT_MDT_RFIFO_DATA_RDY) + sii8620_read_burst(ctx); + + if (stat & BIT_MDT_XFIFO_EMPTY) + sii8620_write(ctx, REG_MDT_XMIT_CTRL, 0); sii8620_write(ctx, REG_MDT_INT_0, stat); }