From patchwork Mon Mar 11 13:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 159 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DBBE03F087 for ; Mon, 11 Mar 2019 14:38:01 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id y8sf5882929pgk.2 for ; Mon, 11 Mar 2019 06:38:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1552311480; cv=pass; d=google.com; s=arc-20160816; b=0htIJFsfeBD8oTluutiiIfrvM6eWuaInvR/fAkIs20BVPrL6Rdn8+ZD2bJcf4bnbEJ D/+GoOLF58fDQ3JJDNJJnd149VchBJ2PvBl8HIkK6IMnMOlTlk+PxSsMFh9VMaY/JIh3 v4QClSxp4CHAbKxtYx8X1ZsY2XWXdmeCpSWWTxZIiwTW0hRnC7vPs5Ka8A17yPRByNNC QCwI16Iugj+eQhVft937DYIdllrFVlapMLbOWbbwz1RwkfSrNsRmfXUF3Gk0H55EmWrD F0s8F3IZtbBoGNbBlNYdLug/rhNtMxn23QbrNP7tttrNB0JTtYw4GpMyhWAmz8MQrOf8 wN9g== 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=iXK/kylCAqUIkqc/GbLqIrlwyvwr/a/oyog7bzqN1JI=; b=fCu5MrZFKH//apcpcXuwmL3iZ/EYCz8Cw1aAKV9A2bjyN7VCeKr2TpgTQH73t+ORmT nh+2umuMrCsXXutI9Dwjn7/GKSuAijBkGkWO++K5i+UgUrwWqPJzpMDaQDSGsdr0/wZA 2EZR7ovSdGE+XPFC+k+pfXJvQvdAZggsSXxT0remIphXq9apaZR2Y2+czxWXKRJWNXkN aU3o3D73zYRGjCEkNItgCwtd0yVTQJM82sSvuhkuhoMLwLqbBoGyPrQUka5RlhPAUiGK DUvar17dpBAGVtAUd1LeAblKfQ9F2aLSj5O9m87jON8Alm15gDN1xJnzaMc8xc8gu7tW 5AKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e0qXwrwY; 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=iXK/kylCAqUIkqc/GbLqIrlwyvwr/a/oyog7bzqN1JI=; b=PQPEGholLtVDtX1r+rY9tThIriVApnTNJcxYFtYdiwgiPq7NTdYKeOOgNpmDtlty3M oXih2M2sJXXs1QtbglOnJ8k+5+AZX9qAALwMbSx0Vp3cL1TqrqTiarqZbfmjkvRjxreE IBkFgRTucd9TlKhs+1gRDJD5svLbPzJF/szLQ= 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=iXK/kylCAqUIkqc/GbLqIrlwyvwr/a/oyog7bzqN1JI=; b=uJL+4fg6IO5edKGD+8vWvkF105YLgYwmcOo/EC3NW9gesrJythAb7i9DMfELWxDF6Y LFIs3SwycNSj1XD2ySvX1HxUyipxnagh7uWRFNcsoSF9xCTE+Af6+xIz5QfG8E2Uftrh MXyT1ZS5eTS4wsYz70V//X6NevOMX0AWjTniPhLf3GnwYw+oAcAgh+xSWVMjYMDqRRiC 5q56pKKD3/QaOw/qHPmuwdSzCC9rCyGwWyPazTUb4jKwen165ANt1s/a8na5Qy6hrrIF ZtNB9YII4PgfG7zjCH/gaxSe7V/ReVnZfEZ+fnH6/3sI1WKcjOjyy4wLLC95LswRDn/O cnHw== X-Gm-Message-State: APjAAAV5mrBK7JUf9qtVKx/ooQZkbTWkLqJcLcx7qNxfR4ZB9Z4zjVJc iHBBMmvOQxQ/4igvG7ScKoJooRNh X-Google-Smtp-Source: APXvYqyI1YsXN2qRdnJkKWroy4tJW4RLmXg933hurFYYSQxVQAZ3vrVasKlDyEN5v81d/ynzsnBvLQ== X-Received: by 2002:a62:5304:: with SMTP id h4mr12201789pfb.38.1552311480756; Mon, 11 Mar 2019 06:38:00 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:282b:: with SMTP id e40ls8835203plb.6.gmail; Mon, 11 Mar 2019 06:38:00 -0700 (PDT) X-Received: by 2002:a17:902:b617:: with SMTP id b23mr6104984pls.200.1552311480497; Mon, 11 Mar 2019 06:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552311480; cv=none; d=google.com; s=arc-20160816; b=KXPUIG3dDbpECg2vFPAm1UdmdEyb0XDNL1Tp+4yI2o+xsRNCxONUJUmU5dXaz9Nkje qXRuKFYJP+NYq30LzrTa4fgamAm2KNYwPjtwDOgAxBBGDd0xvt8SQ2j30l60mjDh/vk+ GRngqU2ZqCM5LHPRo4ncbnDaQygQSjSfZGpecdH/bEkm8sM9p5Dnva35Gpi/Wp2GxKUt oxWie3QxNFXVAC0Q3S+RY+wIma5MX/XHKY8+XFGIO4UZDntd+9KUxSBGrTK0iUoIC9NX uwUZ1u39PuFfTCX3HIISBnGJbzdY47mYyb1mUe4tJ2QGnl24nUwILg1yDrbiyOFtMpMU iT6g== 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=TF5z7mL3PH3afkXmJ7BvBklURV/GryvaXbr0ZQUzq4M=; b=NBwBfCUt2xkrkC7A39HcZ///3gPH7brI54CpOIjxMXZqKJ9v2Qezt3rIqbRaYKu9ZC nDSjZVcv+9nfgNYoCR3YnVWGJbHrqt1VyrIQEwfp5PZIvU6Fnu7aIlDG4CtxA+1Xk31X 4nH1nnN1ky/Tsfg8O3hkoyQODNstnwp/Sy9L80Z/ljFd0d7nImFL7lnQPzWHToAVNJ6X /qSTfWGNi/DchYX66kxltqFn6TlVUmMOVqHagSmUyXacv33C6YB/4FUqRs8NhkIdiwdj GO3mKVm7Oi+Jp4f6YH/GxnqgC5hQMlhkIJ7m/V1NcBbv7xPy5T6aF5TCJSH0gJttLY7F w6CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=e0qXwrwY; 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 h1sor8534047plh.28.2019.03.11.06.38.00 for (Google Transport Security); Mon, 11 Mar 2019 06:38:00 -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:a17:902:8602:: with SMTP id f2mr34360179plo.263.1552311480178; Mon, 11 Mar 2019 06:38:00 -0700 (PDT) Received: from localhost.localdomain ([183.82.224.199]) by smtp.gmail.com with ESMTPSA id s79sm9960397pfa.61.2019.03.11.06.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Mar 2019 06:37:59 -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 09/15] drm/sun4i: sun6i_mipi_dsi: Add has_mod_clk quirk Date: Mon, 11 Mar 2019 19:06:31 +0530 Message-Id: <20190311133637.18334-10-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=e0qXwrwY; 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: , As per the user manual, look like mod clock is not mandatory for all Allwinner MIPI DSI controllers, it is connected to CLK_DSI_SCLK for A31 and not available in A64. So add has_mod_clk quirk and process the clk accordingly. Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 14 ++++++++++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 388e1161974c..f42ea806f6c8 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -1134,6 +1134,12 @@ static int sun6i_dsi_probe(struct platform_device *pdev) return PTR_ERR(base); } + dsi->regulator = devm_regulator_get(dev, "vcc-dsi"); + if (IS_ERR(dsi->regulator)) { + dev_err(dev, "Couldn't get VCC-DSI supply\n"); + return PTR_ERR(dsi->regulator); + } + dsi->regs = devm_regmap_init_mmio_clk(dev, "bus", base, &sun6i_dsi_regmap_config); if (IS_ERR(dsi->regs)) { @@ -1207,6 +1213,13 @@ static int sun6i_dsi_remove(struct platform_device *pdev) static int __maybe_unused sun6i_dsi_runtime_resume(struct device *dev) { struct sun6i_dsi *dsi = dev_get_drvdata(dev); + int err; + + err = regulator_enable(dsi->regulator); + if (err) { + dev_err(dsi->dev, "failed to enable VCC-DSI supply: %d\n", err); + return err; + } reset_control_deassert(dsi->reset); clk_prepare_enable(dsi->mod_clk); @@ -1239,6 +1252,7 @@ static int __maybe_unused sun6i_dsi_runtime_suspend(struct device *dev) clk_disable_unprepare(dsi->mod_clk); reset_control_assert(dsi->reset); + regulator_disable(dsi->regulator); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index 747c451a9a20..c570f2b3868f 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -13,6 +13,8 @@ #include #include +#include + struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; @@ -21,6 +23,7 @@ struct sun6i_dsi { struct clk *bus_clk; struct clk *mod_clk; struct regmap *regs; + struct regulator *regulator; struct reset_control *reset; struct phy *dphy;