From: Jianwei Wang <b52261-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
airlied-cv59FeDIM0c@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Jason.Jin-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
Jianwei Wang <b52261-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Alison Wang <b18965-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Xiubo Li
<lixiubo-0p4V/sDNsUmm0O/7XYngnFaTQe2KTcn/@public.gmane.org>
Subject: [PATCH v3 2/4] arm/layerscape/ls1021a: DCU pixel clock control
Date: Thu, 26 Mar 2015 13:37:03 +0800 [thread overview]
Message-ID: <1427348225-40731-2-git-send-email-b52261@freescale.com> (raw)
In-Reply-To: <1427348225-40731-1-git-send-email-b52261-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Enable DCU pixel clock when platform devices initinalizing and
provide enable and disable pixel clock functions for drm driver
Signed-off-by: Alison Wang <b18965-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Signed-off-by: Xiubo Li <lixiubo-0p4V/sDNsUmm0O/7XYngnFaTQe2KTcn/@public.gmane.org>
Signed-off-by: Jianwei Wang <b52261-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
arch/arm/mach-imx/mach-ls1021a.c | 36 ++++++++++++++++++++++++++++++++++++
include/linux/fsl/dcu.h | 22 ++++++++++++++++++++++
2 files changed, 58 insertions(+)
create mode 100644 include/linux/fsl/dcu.h
diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
index b89c858..4fb346d 100644
--- a/arch/arm/mach-imx/mach-ls1021a.c
+++ b/arch/arm/mach-imx/mach-ls1021a.c
@@ -8,9 +8,44 @@
*/
#include <asm/mach/arch.h>
+#include <linux/of_platform.h>
+#include <linux/mfd/syscon.h>
+#include <linux/regmap.h>
+#include <linux/fsl/dcu.h>
#include "common.h"
+void dcu_pixclk_disable(void)
+{
+ struct regmap *scfg_regmap;
+
+ scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+ if (IS_ERR(scfg_regmap)) {
+ pr_err("No syscfg phandle specified\n");
+ return;
+ }
+
+ regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_DISABLE);
+}
+
+void dcu_pixclk_enable(void)
+{
+ struct regmap *scfg_regmap;
+
+ scfg_regmap = syscon_regmap_lookup_by_compatible("fsl,ls1021a-scfg");
+ if (IS_ERR(scfg_regmap)) {
+ pr_err("No syscfg phandle specified\n");
+ return;
+ }
+
+ regmap_write(scfg_regmap, SCFG_PIXCLKCR, PXCK_ENABLE);
+}
+
+static void __init ls1021a_init_machine(void)
+{
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ dcu_pixclk_enable();
+}
static const char * const ls1021a_dt_compat[] __initconst = {
"fsl,ls1021a",
NULL,
@@ -18,5 +53,6 @@ static const char * const ls1021a_dt_compat[] __initconst = {
DT_MACHINE_START(LS1021A, "Freescale LS1021A")
.smp = smp_ops(ls1021a_smp_ops),
+ .init_machine = ls1021a_init_machine,
.dt_compat = ls1021a_dt_compat,
MACHINE_END
diff --git a/include/linux/fsl/dcu.h b/include/linux/fsl/dcu.h
new file mode 100644
index 0000000..1873057
--- /dev/null
+++ b/include/linux/fsl/dcu.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2015 Freescale Semiconductor, Inc.
+ *
+ * Freescale DCU drm device driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __FSL_DCU_H__
+#define __FSL_DCU_H__
+
+#define SCFG_PIXCLKCR 0x28
+#define PXCK_ENABLE BIT(31)
+#define PXCK_DISABLE 0
+
+void dcu_pixclk_enable(void);
+void dcu_pixclk_disable(void);
+
+#endif /* __FSL_DCU_H__ */
--
2.1.0.27.g96db324
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-26 5:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 5:37 [PATCH v3 1/4] drm/layerscape: Add Freescale DCU DRM driver Jianwei Wang
[not found] ` <1427348225-40731-1-git-send-email-b52261-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-03-26 5:37 ` Jianwei Wang [this message]
2015-03-26 5:37 ` [PATCH v3 3/4] arm/dts/ls1021a: Add DCU dts node Jianwei Wang
2015-03-26 5:37 ` [PATCH v3 4/4] arm/dts/ls1021a: Add a TFT LCD panel dts node for DCU Jianwei Wang
2015-03-31 8:49 ` [PATCH v3 1/4] drm/layerscape: Add Freescale DCU DRM driver Stefan Agner
2015-04-07 6:44 ` Jianwei.Wang
2015-04-07 12:12 ` Stefan Agner
2015-04-08 7:17 ` Jianwei.Wang
[not found] ` <DM2PR0301MB1229B4047A8729044ECBD31E9FFC0-Cwg/PA1lyPmx7v2M3y/24ZwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-04-08 7:57 ` Stefan Agner
[not found] ` <5fb96f314b1a8c0ef58563c005a988ce-XLVq0VzYD2Y@public.gmane.org>
2015-04-15 10:00 ` Jianwei.Wang-KZfg59tc24xl57MIdRCFDg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427348225-40731-2-git-send-email-b52261@freescale.com \
--to=b52261-kzfg59tc24xl57midrcfdg@public.gmane.org \
--cc=Jason.Jin-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=b18965-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lixiubo-0p4V/sDNsUmm0O/7XYngnFaTQe2KTcn/@public.gmane.org \
--cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).