From patchwork Sat Oct 25 13:28:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5151811 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00120C11AC for ; Sat, 25 Oct 2014 18:51:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 130222024F for ; Sat, 25 Oct 2014 18:51:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97BBC201C0 for ; Sat, 25 Oct 2014 18:51:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751908AbaJYSvw (ORCPT ); Sat, 25 Oct 2014 14:51:52 -0400 Received: from mail-qa0-f51.google.com ([209.85.216.51]:39230 "EHLO mail-qa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbaJYSvv (ORCPT ); Sat, 25 Oct 2014 14:51:51 -0400 Received: by mail-qa0-f51.google.com with SMTP id f12so371149qad.10 for ; Sat, 25 Oct 2014 11:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=mfypH/PlBDCIJMk3PDrF59Sbrqxn1CRIMqp7g7kz0MQ=; b=mrzRzHK+Q2JlA4bJwTfn0t2r/+T4yc7uvV3YDOGyaipNlsg13BDKWtOCT01gWyCekf AurWILbrIqk/It/Y/bLmZma7I5XY0ZqBtvEDJjS1bF+HhUHHyU5PUSuU+wQHzxPxs/7z D4ScEBjY6ECoxalbeyN6+29AvyMtf5f08CIX1OwKAGjfOtfK1HTdQySTU0XzwA8yh79t TWqcXdDn1GZsCtFNK6efhgvzMS96bjhbBRqgXu7LL5PB8/B/QrnzKFbk0vfZciY6/3Td UuBECjPueGVbcs0H1TvU05gOnmcUYJtNFQVhOHoQ5nZwjBMULCsoooFJFb8igIz26p4l jm0Q== X-Received: by 10.224.36.200 with SMTP id u8mr15026651qad.47.1414243748795; Sat, 25 Oct 2014 06:29:08 -0700 (PDT) Received: from localhost.localdomain ([187.66.157.81]) by mx.google.com with ESMTPSA id v4sm6659975qag.23.2014.10.25.06.29.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Oct 2014 06:29:07 -0700 (PDT) From: Fabio Estevam To: tomi.valkeinen@ti.com Cc: shawn.guo@linaro.org, linux-fbdev@vger.kernel.org, Fabio Estevam Subject: [PATCH] fbdev: mxsfb: Add support for mx6sl and mx6sx Date: Sat, 25 Oct 2014 11:28:47 -0200 Message-Id: <1414243727-23447-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam mx6sl and mx6sx share the same LCD controller as mx23 and mx28. Add support for it. The basic difference is the number of clocks that are required: - mx23/mx28: only one clock - mx6sl: two clocks - mx6sx: three clocks Signed-off-by: Fabio Estevam --- Changes since RFC: - Simplified the clock handling as suggested by Tomi drivers/video/fbdev/Kconfig | 2 +- drivers/video/fbdev/mxsfb.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index c7bf606..025b439 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -2425,7 +2425,7 @@ config FB_JZ4740 config FB_MXS tristate "MXS LCD framebuffer support" - depends on FB && ARCH_MXS + depends on FB && (ARCH_MXS || ARCH_MXC) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index accf48a2..f8ac4a4 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c @@ -172,6 +172,8 @@ struct mxsfb_info { struct fb_info fb_info; struct platform_device *pdev; struct clk *clk; + struct clk *clk_axi; + struct clk *clk_disp_axi; void __iomem *base; /* registers */ unsigned allocated_size; int enabled; @@ -331,6 +333,11 @@ static void mxsfb_enable_controller(struct fb_info *fb_info) } } + if (host->clk_axi) + clk_prepare_enable(host->clk_axi); + + if (host->clk_disp_axi) + clk_prepare_enable(host->clk_disp_axi); clk_prepare_enable(host->clk); clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); @@ -374,6 +381,10 @@ static void mxsfb_disable_controller(struct fb_info *fb_info) writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4); clk_disable_unprepare(host->clk); + if (host->clk_disp_axi) + clk_disable_unprepare(host->clk_disp_axi); + if (host->clk_axi) + clk_disable_unprepare(host->clk_axi); host->enabled = 0; @@ -867,6 +878,14 @@ static int mxsfb_probe(struct platform_device *pdev) goto fb_release; } + host->clk_axi = devm_clk_get(&host->pdev->dev, "axi"); + if (IS_ERR(host->clk_axi)) + host->clk_axi = NULL; + + host->clk_disp_axi = devm_clk_get(&host->pdev->dev, "disp_axi"); + if (IS_ERR(host->clk_disp_axi)) + host->clk_disp_axi = NULL; + host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd"); if (IS_ERR(host->reg_lcd)) host->reg_lcd = NULL;