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: 151437 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1918792ljp; Sun, 18 Nov 2018 13:34:09 -0800 (PST) X-Google-Smtp-Source: AJdET5dvDiowtHFPvBPBInTkDz/SEQSfV+AeUCcFvpF52JC7wT8EE0X9OpwL7FgFS2TiuV1fjjzr X-Received: by 2002:a62:6d83:: with SMTP id i125-v6mr20563119pfc.184.1542576849313; Sun, 18 Nov 2018 13:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542576849; cv=none; d=google.com; s=arc-20160816; b=B4aLB01t1cjwKZy1vj6LeutJzr0RbDWPbBnIxEOiInS0dREQBrEWhz8CMad5hHvG2A N4YnQBNOg9BwEDDWl6+iyKs78YJEMl0Qir5kMb6DaGp5lKr+BeLVbFCZsAe5JOZ/TqC+ m1vv45fuN3ILfIiUouRiObiQlGw6CvqXBh9AxCZuwpHv508zs9rcQdjL9xBghtBwYpzy sYAvBVw6JkOE8tOApl6+eIsPE++D8Ez5JX4p6CHlqak2UuUAjUvU2xanyCyLq/+0MRZP gNgzdrBWQ9JYvoLtoIdUkzY7HN08TzogFORxRKwsZL7V5izAWh2BS2ZbdqTO/o43e+2K ZUcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=/rYr2UXXEPIx5OACFFtUJvsl4TrFkPFKwmgSivQNHj8=; b=KrqIAajozH/ehXfEm/Maq8SvzsREAlLo6pAyayp4ksYOckESpRav0B8x5Shgv0X+Lk 04PzNe9gdlujFKvGsBA7kBIHd46XyzJ5Ik3v5ir7GW3Weiu9qA4jLUppDalbk8BmKnRb 2hpVlzA31tYYktFcv+QXmgDHA9tFEfSvK1ctfrtQqyhdq95MX7UZhRF7bcrPzdHIqz0j 63Jppo7ZnbpwNOoJQD+9LwOdq8rv7nnptuimqBHIObaizDKqKYXvhtcmulHvl8OFkNUV +s26hALFTWDO9WfaUjdANDWYkgUn1r5R3BwU41lPBzJzmpL7XClWTZpN0E9Y/5ndW9Ul wDLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id l132-v6si27026220pfc.263.2018.11.18.13.34.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Nov 2018 13:34:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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-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" 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); }