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: 152129 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1280738ljp; Tue, 27 Nov 2018 05:41:04 -0800 (PST) X-Google-Smtp-Source: AJdET5fRzdmCt9xUl+aKJ/ugbQcpahGV2B+X0mhelEKdd30ahmuGI4qhJjimkBekl9+08ajIXP6Q X-Received: by 2002:a62:a99:: with SMTP id 25mr32402022pfk.121.1543326064223; Tue, 27 Nov 2018 05:41:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543326064; cv=none; d=google.com; s=arc-20160816; b=u110exDzYtXmVwbwOuB7oZEi6VEZFINkxsRcSxCPCxyy+jQIP4/HE9+pjM9cbZoslc GNCgeAny6iWjrabCeR+XAIziniDY7cwb77APJhSFNQWRk02vNbyf9soDS4R5cdMvuilE dhm/jl4sBc5Bbq5I7PZJV0J4cz4LB09QrW9yAbHHB59DcZVAobmEtXayZlbqcHEtiV/9 cEeooxKEz5Mrhod29fuvkMDAzG5qapT9zNfFWjOaBKc7hHVoRhDpJglJnB1w7rdktRP8 sjUgwSrJHXZVEThPvCvgBbrI3z8YSTXTRjON5Cs9gWM86qQmvYt13UoaMggMQqeNQibe /x3g== 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=rEXMLVHcr129BAMMeG9Zi1gaW93I03TqJWQSkzHYmGc=; b=hBdTZyHL4DJSUFlSBewQ1hu4Qp4ybvyYnOrvR33vFNdJVEfFB/HqmhkVYbJ4VbFRKH QysB9yW4Pp3OLHlkWPEvF7PDcbAd2nj0Ky+zsbwL4mRLTElaj8II9h9QVznKC25JG06u djhJURnQJ5MGW0gxgT8wBwcrUcyEsTcn2ZIITF74ASeSLSUVQhgEF6uWKNEwJEMEoLUi Ax725kzZ+wvQ9E1stpjP9oCq5pSojCjORb+HIyMGYsS+dutRW83czHtkdbhqDYUYjshu cScO1BUhEN46bZykj9VmdIlHZ4aUo9Q4xx16kGTVoZlrMvtFIXulxyXqibRAAuWkOfnE acgg== 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 a3si3792615pga.297.2018.11.27.05.41.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 05:41:04 -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 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-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" 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); }