* [PATCH 1/2] spi: spidev: Add device tree bindings
[not found] ` <1348836616-29783-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2012-09-28 12:50 ` Maxime Ripard
0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2012-09-28 12:50 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
shawn.guo-QSEj5FYQhm4dnm+yROfE0A
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
brian-ZKiFAVwZFM2FeswfMrDH8w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
This will allow to probe spidev from device tree
Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/spi/spidev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 830adbe..8ae0660 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -31,6 +31,8 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
@@ -642,10 +644,18 @@ static int __devexit spidev_remove(struct spi_device *spi)
return 0;
}
+static const struct of_device_id spidev_dt_ids[] = {
+ { .compatible = "linux,spidev" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, spidev_dt_ids);
+
static struct spi_driver spidev_spi_driver = {
.driver = {
.name = "spidev",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(spidev_dt_ids),
},
.probe = spidev_probe,
.remove = __devexit_p(spidev_remove),
--
1.7.9.5
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 1/2] spi: spidev: Add device tree bindings
[not found] ` <1350568768-4374-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2012-10-18 13:59 ` Maxime Ripard
[not found] ` <1350568768-4374-2-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2012-10-18 13:59 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ,
shawn.guo-QSEj5FYQhm4dnm+yROfE0A
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
brian-ZKiFAVwZFM2FeswfMrDH8w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
This will allow to probe spidev from device tree
Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/spi/spidev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 830adbe..8ae0660 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -31,6 +31,8 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
@@ -642,10 +644,18 @@ static int __devexit spidev_remove(struct spi_device *spi)
return 0;
}
+static const struct of_device_id spidev_dt_ids[] = {
+ { .compatible = "linux,spidev" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, spidev_dt_ids);
+
static struct spi_driver spidev_spi_driver = {
.driver = {
.name = "spidev",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(spidev_dt_ids),
},
.probe = spidev_probe,
.remove = __devexit_p(spidev_remove),
--
1.7.9.5
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] spi: spidev: Add device tree bindings
[not found] ` <1350568768-4374-2-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2012-10-19 8:28 ` Shawn Guo
0 siblings, 0 replies; 9+ messages in thread
From: Shawn Guo @ 2012-10-19 8:28 UTC (permalink / raw)
To: Maxime Ripard
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Mark Brown,
brian-ZKiFAVwZFM2FeswfMrDH8w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Mark is maintaining spi subsystem recently as Grant has been off line
for a while.
Shawn
On Thu, Oct 18, 2012 at 03:59:27PM +0200, Maxime Ripard wrote:
> This will allow to probe spidev from device tree
>
> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> drivers/spi/spidev.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> index 830adbe..8ae0660 100644
> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -31,6 +31,8 @@
> #include <linux/mutex.h>
> #include <linux/slab.h>
> #include <linux/compat.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
>
> #include <linux/spi/spi.h>
> #include <linux/spi/spidev.h>
> @@ -642,10 +644,18 @@ static int __devexit spidev_remove(struct spi_device *spi)
> return 0;
> }
>
> +static const struct of_device_id spidev_dt_ids[] = {
> + { .compatible = "linux,spidev" },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, spidev_dt_ids);
> +
> static struct spi_driver spidev_spi_driver = {
> .driver = {
> .name = "spidev",
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(spidev_dt_ids),
> },
> .probe = spidev_probe,
> .remove = __devexit_p(spidev_remove),
> --
> 1.7.9.5
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
^ permalink raw reply [flat|nested] 9+ messages in thread
* [RESEND][PATCH 0/2] Add spidev to the CFA-10049
@ 2012-10-26 8:07 Maxime Ripard
[not found] ` <1351238873-25230-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2012-10-26 8:07 UTC (permalink / raw)
To: Mark Brown, Shawn Guo
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Lilly
Hi everyone,
This patchset probes spidev on the SSP3 bus where on the CFA-10049 there is
a DAC.
It first adds the dt bindings for the spidev driver, and the proper node in
the CFA-10049 device tree file.
Maxime
Maxime Ripard (2):
spi: spidev: Add device tree bindings
ARM: dts: cfa10049: Add spidev to drive the DAC on SSP3
arch/arm/boot/dts/imx28-cfa10049.dts | 6 ++++++
drivers/spi/spidev.c | 10 ++++++++++
2 files changed, 16 insertions(+)
--
1.7.9.5
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] spi: spidev: Add device tree bindings
[not found] ` <1351238873-25230-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2012-10-26 8:07 ` Maxime Ripard
2012-10-27 22:19 ` Mark Brown
2012-10-26 8:07 ` [PATCH 2/2] ARM: dts: cfa10049: Add spidev to drive the DAC on SSP3 Maxime Ripard
1 sibling, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2012-10-26 8:07 UTC (permalink / raw)
To: Mark Brown, Shawn Guo
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Lilly
This will allow to probe spidev from device tree
Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
drivers/spi/spidev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 830adbe..8ae0660 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -31,6 +31,8 @@
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
@@ -642,10 +644,18 @@ static int __devexit spidev_remove(struct spi_device *spi)
return 0;
}
+static const struct of_device_id spidev_dt_ids[] = {
+ { .compatible = "linux,spidev" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, spidev_dt_ids);
+
static struct spi_driver spidev_spi_driver = {
.driver = {
.name = "spidev",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(spidev_dt_ids),
},
.probe = spidev_probe,
.remove = __devexit_p(spidev_remove),
--
1.7.9.5
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] ARM: dts: cfa10049: Add spidev to drive the DAC on SSP3
[not found] ` <1351238873-25230-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2012-10-26 8:07 ` [PATCH 1/2] spi: spidev: Add device tree bindings Maxime Ripard
@ 2012-10-26 8:07 ` Maxime Ripard
1 sibling, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2012-10-26 8:07 UTC (permalink / raw)
To: Mark Brown, Shawn Guo
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Lilly
Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
---
arch/arm/boot/dts/imx28-cfa10049.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index 05c892e..d91d16c 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -29,6 +29,7 @@
0x01c1 /* MX28_PAD_GPMI_RESETN__SSP3_CMD */
0x0111 /* MX28_PAD_GPMI_CE1N__SSP3_D3 */
0x01a2 /* MX28_PAD_GPMI_ALE__SSP3_D4 */
+ 0x01b2 /* MX28_PAD_GPMI_CLE__SSP3_D5 */
>;
fsl,drive-strength = <1>;
fsl,voltage = <1>;
@@ -60,6 +61,11 @@
spi-max-frequency = <100000>;
};
+ spidev: spidev@2 {
+ compatible = "linux,spidev";
+ reg = <2>;
+ spi-max-frequency = <100000>;
+ };
};
};
--
1.7.9.5
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] spi: spidev: Add device tree bindings
2012-10-26 8:07 ` [PATCH 1/2] spi: spidev: Add device tree bindings Maxime Ripard
@ 2012-10-27 22:19 ` Mark Brown
[not found] ` <20121027221955.GO4564-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2012-10-27 22:19 UTC (permalink / raw)
To: Maxime Ripard; +Cc: spi-devel-general, Shawn Guo, linux-arm-kernel, Brian Lilly
[-- Attachment #1.1: Type: text/plain, Size: 714 bytes --]
On Fri, Oct 26, 2012 at 10:07:52AM +0200, Maxime Ripard wrote:
> This will allow to probe spidev from device tree
So, this isn't really something we should have in DT in this format -
the fact that we happen to control some device from userspace isn't a
generic property of the board really, we may end up changing our minds
on Linux too. The most obvious thing for this seems to be to add the
specific devices to spidev as the OF bindings rather than just register
as some non-specific "spidev" so we can change our minds later about how
to handle the devices. Not sure that's urgently tasteful but it does
mean we move the "we handle this in userspace" bit out of the .dts into
the kernel which seems better.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] spi: spidev: Add device tree bindings
[not found] ` <20121027221955.GO4564-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2012-10-29 15:26 ` Maxime Ripard
2012-10-29 16:10 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2012-10-29 15:26 UTC (permalink / raw)
To: Mark Brown
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Shawn Guo,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Brian Lilly
Hi Mark,
Le 28/10/2012 00:19, Mark Brown a écrit :
> On Fri, Oct 26, 2012 at 10:07:52AM +0200, Maxime Ripard wrote:
>> This will allow to probe spidev from device tree
>
> So, this isn't really something we should have in DT in this format
> - the fact that we happen to control some device from userspace
> isn't a generic property of the board really, we may end up
> changing our minds on Linux too. The most obvious thing for this
> seems to be to add the specific devices to spidev as the OF
> bindings rather than just register as some non-specific "spidev" so
> we can change our minds later about how to handle the devices. Not
> sure that's urgently tasteful but it does mean we move the "we
> handle this in userspace" bit out of the .dts into the kernel which
> seems better.
Ok, so I guess that leaves us with 2 choices here:
* Declare the device in the dt as you would have with any other
driver, with its own compatible string, and we add this compatible
string to the spidev dt ids array. It allows to use the existing
code and thus doesn't require any effort at all, but it will
generate a lot of noise for the spidev driver, since all of us will
need to add its compatible string to spidev.
* Rework the spidev code so that it behaves mostly like i2c-dev, that
is you have an instance of it for every device enumerated in the dt,
regardless of wether it has a driver loaded or not. If the
userspace opens the device file corresponding to a device already
attached to a driver, you return EBUSY, and that's it. I guess it
would be the cleaner solution, since you only select spidev in
configuration, but it definitely requires way more development than
the first one.
What's your views on this?
Did you have in mind another solution?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] spi: spidev: Add device tree bindings
2012-10-29 15:26 ` Maxime Ripard
@ 2012-10-29 16:10 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2012-10-29 16:10 UTC (permalink / raw)
To: Maxime Ripard; +Cc: spi-devel-general, Shawn Guo, linux-arm-kernel, Brian Lilly
[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]
On Mon, Oct 29, 2012 at 04:26:11PM +0100, Maxime Ripard wrote:
> Ok, so I guess that leaves us with 2 choices here:
> * Declare the device in the dt as you would have with any other
> driver, with its own compatible string, and we add this compatible
> string to the spidev dt ids array. It allows to use the existing
> code and thus doesn't require any effort at all, but it will
> generate a lot of noise for the spidev driver, since all of us will
> need to add its compatible string to spidev.
> * Rework the spidev code so that it behaves mostly like i2c-dev, that
> is you have an instance of it for every device enumerated in the dt,
> regardless of wether it has a driver loaded or not. If the
> userspace opens the device file corresponding to a device already
> attached to a driver, you return EBUSY, and that's it. I guess it
> would be the cleaner solution, since you only select spidev in
> configuration, but it definitely requires way more development than
> the first one.
> What's your views on this?
> Did you have in mind another solution?
I think either solution is good, obviously Grant's more the expert here.
Adding the IDs is obviously simpler and doesn't preclude later doing the
i2c-dev style thing so short term I'd probably add the IDs to get things
going and punt on the difficult stuff for the time being but YMMV.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-10-29 16:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-26 8:07 [RESEND][PATCH 0/2] Add spidev to the CFA-10049 Maxime Ripard
[not found] ` <1351238873-25230-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2012-10-26 8:07 ` [PATCH 1/2] spi: spidev: Add device tree bindings Maxime Ripard
2012-10-27 22:19 ` Mark Brown
[not found] ` <20121027221955.GO4564-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-10-29 15:26 ` Maxime Ripard
2012-10-29 16:10 ` Mark Brown
2012-10-26 8:07 ` [PATCH 2/2] ARM: dts: cfa10049: Add spidev to drive the DAC on SSP3 Maxime Ripard
-- strict thread matches above, loose matches on Subject: below --
2012-10-18 13:59 [RESEND][PATCH 0/2] Add spidev to the CFA-10049 Maxime Ripard
[not found] ` <1350568768-4374-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2012-10-18 13:59 ` [PATCH 1/2] spi: spidev: Add device tree bindings Maxime Ripard
[not found] ` <1350568768-4374-2-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2012-10-19 8:28 ` Shawn Guo
2012-09-28 12:50 [PATCH 0/2] Add spidev to the CFA-10049 Maxime Ripard
[not found] ` <1348836616-29783-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2012-09-28 12:50 ` [PATCH 1/2] spi: spidev: Add device tree bindings Maxime Ripard
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).