devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
To: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
	Sergei Shtylyov
	<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>,
	khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>,
	Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v5 2/5] ARM: davinci: da8xx: Add CFGCHIP syscon platform declaration.
Date: Wed, 22 Jun 2016 12:03:10 -0500	[thread overview]
Message-ID: <576AC4CE.1070506@lechnology.com> (raw)
In-Reply-To: <5745893C.5040603-l0cyMroinI0@public.gmane.org>

 From b0ae5eeba849b49f82980218a374c6d3f06487b8 Mon Sep 17 00:00:00 2001
From: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
Date: Thu, 24 Mar 2016 01:38:54 -0500
Subject: [PATCH] ARM: davinci: da8xx: Add CFGCHIP syscon platform 
declaration.

The CFGCHIP registers are used by a number of devices, so using a syscon
device to share them. The first consumer of this will by the phy-da8xx-usb
driver.

Signed-off-by: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
---

the id of syscon is changed from 0 to -1.

  arch/arm/mach-davinci/board-da830-evm.c     |  4 ++++
  arch/arm/mach-davinci/board-da850-evm.c     |  4 ++++
  arch/arm/mach-davinci/board-mityomapl138.c  |  4 ++++
  arch/arm/mach-davinci/board-omapl138-hawk.c |  4 ++++
  arch/arm/mach-davinci/devices-da8xx.c       | 28 
++++++++++++++++++++++++++++
  arch/arm/mach-davinci/include/mach/da8xx.h  |  2 ++
  6 files changed, 46 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c 
b/arch/arm/mach-davinci/board-da830-evm.c
index 605d444..3051cb6 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -586,6 +586,10 @@ static __init void da830_evm_init(void)
  	struct davinci_soc_info *soc_info = &davinci_soc_info;
  	int ret;

+	ret = da8xx_register_cfgchip();
+	if (ret)
+		pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
  	ret = da830_register_gpio();
  	if (ret)
  		pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
b/arch/arm/mach-davinci/board-da850-evm.c
index 8e4539f..ec5cb10 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1345,6 +1345,10 @@ static __init void da850_evm_init(void)
  {
  	int ret;

+	ret = da8xx_register_cfgchip();
+	if (ret)
+		pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
  	ret = da850_register_gpio();
  	if (ret)
  		pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c 
b/arch/arm/mach-davinci/board-mityomapl138.c
index bc4e63f..1a6d430 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -514,6 +514,10 @@ static void __init mityomapl138_init(void)
  {
  	int ret;

+	ret = da8xx_register_cfgchip();
+	if (ret)
+		pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
  	/* for now, no special EDMA channels are reserved */
  	ret = da850_register_edma(NULL);
  	if (ret)
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c 
b/arch/arm/mach-davinci/board-omapl138-hawk.c
index d4930b6..8691a25 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -294,6 +294,10 @@ static __init void omapl138_hawk_init(void)
  {
  	int ret;

+	ret = da8xx_register_cfgchip();
+	if (ret)
+		pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
+
  	ret = da850_register_gpio();
  	if (ret)
  		pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
diff --git a/arch/arm/mach-davinci/devices-da8xx.c 
b/arch/arm/mach-davinci/devices-da8xx.c
index 725e693..bf5f145 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -11,6 +11,7 @@
   * (at your option) any later version.
   */
  #include <linux/init.h>
+#include <linux/platform_data/syscon.h>
  #include <linux/platform_device.h>
  #include <linux/dma-contiguous.h>
  #include <linux/serial_8250.h>
@@ -1109,3 +1110,30 @@ int __init da850_register_sata(unsigned long 
refclkpn)
  	return platform_device_register(&da850_sata_device);
  }
  #endif
+
+static struct syscon_platform_data da8xx_cfgchip_platform_data = {
+	.label	= "cfgchip",
+};
+
+static struct resource da8xx_cfgchip_resources[] = {
+	{
+		.start	= DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP0_REG,
+		.end	= DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP4_REG + 3,
+		.flags	= IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device da8xx_cfgchip_device = {
+	.name	= "syscon",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &da8xx_cfgchip_platform_data,
+	},
+	.num_resources	= ARRAY_SIZE(da8xx_cfgchip_resources),
+	.resource	= da8xx_cfgchip_resources,
+};
+
+int __init da8xx_register_cfgchip(void)
+{
+	return platform_device_register(&da8xx_cfgchip_device);
+}
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h 
b/arch/arm/mach-davinci/include/mach/da8xx.h
index c367530..c32444b 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -61,6 +61,7 @@ extern unsigned int da850_max_speed;
  #define DA8XX_CFGCHIP1_REG	0x180
  #define DA8XX_CFGCHIP2_REG	0x184
  #define DA8XX_CFGCHIP3_REG	0x188
+#define DA8XX_CFGCHIP4_REG	0x18c

  #define DA8XX_SYSCFG1_BASE	(IO_PHYS + 0x22C000)
  #define DA8XX_SYSCFG1_VIRT(x)	(da8xx_syscfg1_base + (x))
@@ -116,6 +117,7 @@ void da8xx_rproc_reserve_cma(void);
  int da8xx_register_rproc(void);
  int da850_register_gpio(void);
  int da830_register_gpio(void);
+int da8xx_register_cfgchip(void);

  extern struct platform_device da8xx_serial_device[];
  extern struct emac_platform_data da8xx_emac_pdata;
-- 
2.7.4


--
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

  parent reply	other threads:[~2016-06-22 17:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 23:46 [PATCH v5 0/5] da8xx USB PHY platform devices and clocks (was "da8xx UBS clocks") David Lechner
2016-05-09 23:46 ` [PATCH v5 2/5] ARM: davinci: da8xx: Add CFGCHIP syscon platform declaration David Lechner
2016-05-10 11:26   ` Sergei Shtylyov
2016-05-10 16:44     ` David Lechner
2016-05-25 11:15       ` Sekhar Nori
     [not found]         ` <5745893C.5040603-l0cyMroinI0@public.gmane.org>
2016-06-22 17:03           ` David Lechner [this message]
2016-06-22 17:07           ` David Lechner
     [not found]             ` <576AC5CD.2010107-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
2016-06-24  6:15               ` Sekhar Nori
     [not found]                 ` <576CCFE9.7020005-l0cyMroinI0@public.gmane.org>
2016-06-24 16:00                   ` David Lechner
     [not found] ` <1462837612-7803-1-git-send-email-david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
2016-05-09 23:46   ` [PATCH v5 1/5] ARM: davinci: da8xx: add usb phy clocks David Lechner
2016-05-09 23:46   ` [PATCH v5 3/5] ARM: davinci: da8xx: Add USB PHY platform declaration David Lechner
2016-05-10 11:24     ` Sergei Shtylyov
     [not found]       ` <01040628-8116-f0db-dc20-f511f6d3a2b0-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-06-22 17:08         ` David Lechner
2016-05-09 23:46   ` [PATCH v5 4/5] ARM: DTS: da850: Add cfgchip syscon node David Lechner
2016-05-09 23:46   ` [PATCH v5 5/5] ARM: DTS: da850: Add usb phy node David Lechner
2016-05-23 15:14 ` [PATCH v5 0/5] da8xx USB PHY platform devices and clocks (was "da8xx UBS clocks") David Lechner
2016-05-25 11:18   ` Sekhar Nori
2016-08-12 21:24     ` Kevin Hilman
2016-08-17  9:35       ` Kishon Vijay Abraham I
     [not found]         ` <57B42FD3.50004-l0cyMroinI0@public.gmane.org>
2016-08-19 16:40           ` Kevin Hilman
2016-08-19 16:50             ` David Lechner

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=576AC4CE.1070506@lechnology.com \
    --to=david-nq/r/kbu++upp/zk7jdf2g@public.gmane.org \
    --cc=b-liu-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@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).