From patchwork Mon Mar 11 13:36:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 154 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1EA1C3F087 for ; Mon, 11 Mar 2019 14:37:34 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id u8sf6169412pfm.6 for ; Mon, 11 Mar 2019 06:37:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552311453; cv=pass; d=google.com; s=arc-20160816; b=qGJdGewdjNGaVz2xvpwFf6hUsIJ8mvIoF3BcIniFPznagpP+xrv4fMlu/1j/BMrLwM RIfl234X4H2Y6RdfEP2OpCHMW87K3txv25uJmyVoykAszWjf25ne5f2HbWoGNgLYcUp3 pWj9v2bvD+07xwq7Z7ZyJclWn9JAa5IwOZtUEBEKkciEhN1WxY/u3QiUpHwzs8JtZRhe vF0ES2CNPAPxDbYi2pXssUdQX4rzNRL0+fd2g53InnCV1unKFq7HNeafguzhvG1+ggQI KwtBy9u6cbPVbQ+kdZUa3CTUjkfRc1xtCMpNq1/sEz20Ur1RVJw4MrwcJ8wudtL7W1aV 7wPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GNF3hxcXsrb+U/ZiZmA/xe9bBSh1b8SwF9KNsTfZ5XU=; b=wyt4tB0Jef1f7LcZ4XY3bMpNTsvrOJBrJEaGIjn8h5WIl1rgsaRBfaOqd/NYKZ7kdJ R+pzxjqd3qDEXgALjMxIaEDDcRSOgYcm6S5P0sKVxrSxd4rUv4j1rmD861wQa78Qf8dI FeznNxRiBxakv4hsyZsGMFMoK8YjJyrXT6SPV6tmsH2GrXfE624dUxm3C5tzUH5u5Mjd 6xyU2HHsRBzdGUBjeY+9LPkg4WFfVHA/wOtmfq5YkNckhjyp36vXqkp3lQe2870y0G1p ZKn6bH4dC+ME6yyJdjg/sNSwrb/WzJg3FTltsEeIhYkvXIZKBmGJC38kgjfE9s3R0F73 c8mQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MmxC2i8x; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=GNF3hxcXsrb+U/ZiZmA/xe9bBSh1b8SwF9KNsTfZ5XU=; b=Vtjs12WKEmDR6KO5kNbg+McPoGkBk8pi6xnknPxfCK+ci9Tei39BFlJfRobd4AQkFl c8kgiWNwldEO8kWMsZH1llViw+zs8XP5HJrHIPuFuk4SA9ehytQemiTEVlzi5oUIqYTS HTYr1ArruX1mF+FeFSZ4gOajSnD9voNWFf94s= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=GNF3hxcXsrb+U/ZiZmA/xe9bBSh1b8SwF9KNsTfZ5XU=; b=LfYXaDxIssy0rlTNBNTxYevzCkZNlVd48728jHcyCJJ2A1hBv/L6DISsoFWuob/+6w kbq7CgXio7t+v6h0nM1mowSFqy6xbzsKnRYG6XbKEGEMPo2le5qrqJ3zjCIWo2/Y3E5j CFNByUFnxfWk9docGxKotI8MJc3/5fU/rbLVy1vRKA+a9ZAbgSHJV/ch9PnDlX+9Noy+ gFpCZZ338cFTWX825QbCOXlziXAd4V7RMQ0xQLti1eKMBG4Ep9TclD5uEtK26jiQ2ADr wdECG6i+xernqNmf9EJlAhTOfelijzTcmPdlOOMI14ASGgNRPnvkFt2jb63mgyWVlHOG kAAg== X-Gm-Message-State: APjAAAWZVveol7HxQmgUGq+kCO7uWPWjH/05npVCqD0A+FtcSeevi0hP yrsYYWXNoMpYyrYowtlffOaV6Mj3 X-Google-Smtp-Source: APXvYqwttXlHWTJfEOTS/31cS9C+Pd7qs9NuiM8liDbmuLxJ30aSuwm62FJp39XVmWNLRBNJLsnwsw== X-Received: by 2002:a62:e417:: with SMTP id r23mr12269872pfh.64.1552311452873; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6257:: with SMTP id q23ls3958446pgv.6.gmail; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) X-Received: by 2002:a62:4815:: with SMTP id v21mr32485901pfa.167.1552311452272; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552311452; cv=none; d=google.com; s=arc-20160816; b=K2pNFeQYjA/veBcNOu04ifnw4aqMN8QUu/rhYemrSkmjW9k2oXsPT+PwdJHKPq+CNI 6vMr0KUU8SGYZ7HFVqi4ARwHTUw91XZpQrqcLHUx7wXM5IUyqF6tkl49YuGb4eEH8bla kOSfvvYB6XNxdRjawJwhv9UGmoiREH6IlgdaGkLe5+a9lzIMlhSl8tlpW3sXYev74Mj8 k5G3WvYvPCesJEIFKjLCvnOPHQWdU6zzvQ7poMYoSy2wGBUQ+qPRK2BABuHlBgNsgr2X JnUPMHcOzj5W7LHnJdt4w+xVHesdeF0V8NV9YjxjyTWYMyWqCcjeFCdxlCCh5uFeX9pE 7N6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ptl+5hneR2t7UWZEtSZkUl01CD0BP2fXJcHeyJDA6xo=; b=YJZlnldABQcH6gCqqHYDzHQdPpXdSCfY6XwpFTAB0zcmfq5ByTa57IOrmlK5bRLd37 Q5nDVclK9kbh47IQpJtKyFpaTNFHl4cI5WVRLHAdyPZ8BYSZKe+nOBCU7l9QivWiaiLE 1PfmPaRvirC68RsFnpnYx76svNMjt503Vcr+ZW/h7W7gxDyw1R0uVYhw/Ac/iz+EreIR T9E7YGQW2APhuWzHZGt9URTL9p8WnThSobNsE/3ILuSDZfoGxwfsA7YnPnMxEQhk0XFE l1SPgsnYsu5uxpjEXCEF3Okfr2EWK8u3NmhfXetUFDCTQ+jUxL0j+roMeYr5mHMtjKVG QeKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MmxC2i8x; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v71sor8225232pgd.13.2019.03.11.06.37.32 for (Google Transport Security); Mon, 11 Mar 2019 06:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a65:44cb:: with SMTP id g11mr30386292pgs.29.1552311452012; Mon, 11 Mar 2019 06:37:32 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:31 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v8 04/15] drm/sun4i: dsi: Probe tcon0 during dsi_bind Date: Mon, 11 Mar 2019 19:06:26 +0530 Message-Id: <20190311133637.18334-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190311133637.18334-1-jagan@amarulasolutions.com> References: <20190311133637.18334-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MmxC2i8x; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Probe tcon0 during dsi_bind, so-that the tcon attributes like divider value, clock rate can get whenever it need. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 8d6292c0158b..a8d3df0ea8f5 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1045,6 +1045,7 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, struct drm_device *drm = data; struct sun4i_drv *drv = drm->dev_private; struct sun6i_dsi *dsi = dev_get_drvdata(dev); + struct sun4i_tcon *tcon0 = sun4i_get_tcon0(drm); int ret; if (!dsi->panel) @@ -1052,6 +1053,11 @@ static int sun6i_dsi_bind(struct device *dev, struct device *master, dsi->drv = drv; + if (!tcon0) + return -EINVAL; + + dsi->tcon = tcon0; + drm_encoder_helper_add(&dsi->encoder, &sun6i_dsi_enc_helper_funcs); ret = drm_encoder_init(drm, diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 5c3ad5be0690..20516f7ab179 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -28,6 +28,7 @@ struct sun6i_dsi { struct device *dev; struct sun4i_drv *drv; + struct sun4i_tcon *tcon; struct mipi_dsi_device *device; struct drm_panel *panel; };