From patchwork Tue Nov 27 13:40: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: 10700561 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 9E1A713BB for ; Tue, 27 Nov 2018 13:41:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B0762B3C9 for ; Tue, 27 Nov 2018 13:41:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F3922B3B4; Tue, 27 Nov 2018 13:41:04 +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 233912B334 for ; Tue, 27 Nov 2018 13:41:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B13B6E14D; Tue, 27 Nov 2018 13:41:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id E12AD6E14D for ; Tue, 27 Nov 2018 13:41:01 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id b20so16431734lfa.12 for ; Tue, 27 Nov 2018 05:41:01 -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=KntQsQfrrrxZW6cyJjBW7tGxcsWab6dlSzBMfL1EpVg=; b=q3hvjhOKRfm2vjjdwQ0gXahLnhp+ilVS7aSbys+VlOc5cAWEXboOzh95re1ztHlFwn kZOwdqoaWZehR0+/D27EHq8teXlWkOi613BLXgclooiInsZBJeJ4B+4paP/uNfLsXNYl YVJ1gNwUnJrVKz0osUbLnwVNo3Uj+LaInztBwFdCMAzlT7d/7Ax2Ht/Upz2hhNbA/Hfs u11Ej/F+i/pfgM5FdTaU/iE42xwLPBrciqee6TwGUSMI+NdEid9vCkbP9MJA1lxn4Tbd M1hfRSqTSAAAJ8oI8vdk1gEQoq3AqFY4swPEIl4Was46V7i0rkvGKFr/Bj3m+yJ2nkil 5hXQ== X-Gm-Message-State: AGRZ1gL4D8hmLcwfaalAUSK7aId2Ebd0uXGsdU70vDQWLqNgfWK/yLcV zCS/8rVTGmB6SVqwMwehIJXMWw== X-Google-Smtp-Source: AJdET5d5ztHbcTJ2vUNT99ityKfRrsUiIytQWJRDchjAhrPpXRV7WQcjFT5Vghvum7CCNzvQP6iCcw== X-Received: by 2002:a19:6514:: with SMTP id z20mr18280841lfb.31.1543326060270; Tue, 27 Nov 2018 05:41:00 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id w9sm591436lfc.66.2018.11.27.05.40.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 05:40:59 -0800 (PST) From: Linus Walleij To: Thierry Reding , dri-devel@lists.freedesktop.org Subject: [PATCH v3] drm/panel: Set max rate for Ilitek ILI9881C Date: Tue, 27 Nov 2018 14:40:57 +0100 Message-Id: <20181127134057.15659-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 Acked-by: Thierry Reding --- ChangeLov v2->v3: - Fix up the HS speed to 275 MHz, as the speed is double data rate. 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 3ad4a46c4e94..8c00193c2400 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -465,6 +465,21 @@ 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 per lane for RGB888. As this is 4 bits at + * the time, at double data rate the maximum HS frequency should + * be: + * 550/4 * 2 = 275 MHz. + */ + dsi->hs_rate = 275000000; + /* + * 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); }