From patchwork Sun Nov 18 21:31:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10688061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33A6415A7 for ; Sun, 18 Nov 2018 21:34:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E0029713 for ; Sun, 18 Nov 2018 21:34:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1808D2971F; Sun, 18 Nov 2018 21:34:10 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 01DB029713 for ; Sun, 18 Nov 2018 21:34:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B1A689C48; Sun, 18 Nov 2018 21:34:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D10089C48 for ; Sun, 18 Nov 2018 21:34:04 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id s5-v6so24452715ljd.12 for ; Sun, 18 Nov 2018 13:34:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5PzSb+PBM2UfJpuSsyt3TIXOz5ZxAm+QtR2B+8ITgFU=; b=XZwrOYXYLvcTxQt+Xbh/9VUgs8vQmmhj0k4rLkIaHSffOqSdLIegl295xWobUbnWIZ wPegTrW9eYo/VnrP08qaICVyhsYSfvgX8TRydMKXhz39b+dRKsBZtpO/Hq2es9w6SBWJ iqRXxPGB+d3ezS1CAE8Go3Pw+9zYwsen+j2xhA+cvjlenPe/Fx+CAmcheA9OAKg/+Lpv ylbBmeW5dKdCCJlvTvWRqtuHGtL5OimUuxgRh4798nujtQCLabe/U6iVGf33kPKpf7q9 SH/DEo3R8ZNOy8oKvjwOrHMYn/V3Dk5qhHgw5KvniFXztQRn991rvEaLpj9Os9D1nUtD 5yww== X-Gm-Message-State: AGRZ1gJXcG7o3Wp0JsSlAalQJzAJcESKxkb+OXb93K2la0Zlz0xgupBZ Z00gf+GLBgMHy2tO3/GJGOS2Hg== X-Google-Smtp-Source: AJdET5fijLiBO0mpm9xwvTFv9wjrIzv//uQpJQttkSjvwISnbk1YZmFx/KqVgjiCrIxZCGrMbgRZFA== X-Received: by 2002:a2e:4442:: with SMTP id r63-v6mr10174689lja.79.1542576842585; Sun, 18 Nov 2018 13:34:02 -0800 (PST) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id y1-v6sm5521518ljh.39.2018.11.18.13.34.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Nov 2018 13:34:00 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/panel: Set max rate for Ilitek ILI9881C Date: Sun, 18 Nov 2018 22:31:57 +0100 Message-Id: <20181118213157.7555-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP After adding the hs_rate and lp_rate fields to the DSI device we need to populate these accordingly so display drivers can respect them. This figure for HS rate comes from the ILI9881C manual, the calculation is explained in the comment. Cc: Daniel Vetter Cc: Andrzej Hajda Acked-by: Maxime Ripard Signed-off-by: Linus Walleij Reviewed-by: Andrzej Hajda --- ChangeLog v1->v2: - Add LP speed after Andrzej's observation. - Collect Maxime's ACK (hope it's fine also with the LP speed) --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 3ad4a46c4e94..bd276c666318 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -465,6 +465,19 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE; dsi->format = MIPI_DSI_FMT_RGB888; dsi->lanes = 4; + /* + * The datasheet (table 39) specifies "limited clock channel speed" + * for 4 lanes as 550 Mbps for RGB888. As this is 4 bits at the time, + * the maximum HS frequency is 550/4 = 137.5 MHz. + */ + dsi->hs_rate = 137500000; + /* + * Table 42 says: "Length of LP-00, LP-01, LP-10 or LP-11 periods": + * min 50ns, max 75ns. 1/50ns = max LPM rate = 20.000.000Hz. + * Since LP transmissions are to periods per bit, this should be + * 10 MHz. + */ + dsi->lp_rate = 10000000; return mipi_dsi_attach(dsi); }