* [PATCH] [spi_mpc83xx] Always enable legacy support.
@ 2009-07-01 19:16 Joakim Tjernlund
2009-07-01 21:12 ` Anton Vorontsov
0 siblings, 1 reply; 3+ messages in thread
From: Joakim Tjernlund @ 2009-07-01 19:16 UTC (permalink / raw)
To: avorontsov, linuxppc-dev; +Cc: Joakim Tjernlund
There are out of tree boards that need this legacy support too.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
I hope this is OK. I just discovered that spi didn't work for
me in 2.6.30 and I have no time to work on coverting my boards.
I don't have a clue either on how to do that, any pointers
how to add a few spidev devices via OF?
drivers/spi/spi_mpc83xx.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index f4573a9..d167577 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -882,7 +882,6 @@ static struct of_platform_driver of_mpc83xx_spi_driver = {
.remove = __devexit_p(of_mpc83xx_spi_remove),
};
-#ifdef CONFIG_MPC832x_RDB
/*
* XXX XXX XXX
* This is "legacy" platform driver, was used by the MPC8323E-RDB boards
@@ -941,10 +940,6 @@ static void __exit legacy_driver_unregister(void)
return;
platform_driver_unregister(&mpc83xx_spi_driver);
}
-#else
-static void __init legacy_driver_register(void) {}
-static void __exit legacy_driver_unregister(void) {}
-#endif /* CONFIG_MPC832x_RDB */
static int __init mpc83xx_spi_init(void)
{
--
1.6.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [spi_mpc83xx] Always enable legacy support.
2009-07-01 19:16 [PATCH] [spi_mpc83xx] Always enable legacy support Joakim Tjernlund
@ 2009-07-01 21:12 ` Anton Vorontsov
2009-07-02 6:18 ` Joakim Tjernlund
0 siblings, 1 reply; 3+ messages in thread
From: Anton Vorontsov @ 2009-07-01 21:12 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: linuxppc-dev
On Wed, Jul 01, 2009 at 09:16:12PM +0200, Joakim Tjernlund wrote:
> There are out of tree boards that need this legacy support too.
Heh.
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
> I hope this is OK. I just discovered that spi didn't work for
> me in 2.6.30 and I have no time to work on coverting my boards.
I'd convert them for you if they were in-tree. :-) But I don't
think that moving the kernel backwards because of out-of-tree
boards is a good thing.
> I don't have a clue either on how to do that, any pointers
> how to add a few spidev devices via OF?
Something like this will work:
spi@4c0 {
#address-cells = <1>;
#size-cells = <0>;
cell-index = <0>;
compatible = "fsl,spi";
reg = <0x4c0 0x40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
/* provide chip-selects here */
gpios = <&qe_pio_d 13 0 /* CS0 */
&qe_pio_d 14 0>; /* CS1 */
mode = "cpu-qe";
device@0 {
compatible = "spidev";
reg = <0>; /* CS0*/
spi-max-frequency = <50000000>;
};
device@0 {
compatible = "spidev";
reg = <1>; /* CS1 */
spi-max-frequency = <50000000>;
};
};
You can look at arch/powerpc/boot/dts/mpc832x_rdb.dts as an
example.
Note that "spidev" isn't correct compatible entry to use,
but it's quick and dirty solution. A proper solution is to
add a proper compatible entry into the device-tree, and
add "spidev" alias into drivers/of/base.c:of_modalias_table.
> drivers/spi/spi_mpc83xx.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
> index f4573a9..d167577 100644
> --- a/drivers/spi/spi_mpc83xx.c
> +++ b/drivers/spi/spi_mpc83xx.c
> @@ -882,7 +882,6 @@ static struct of_platform_driver of_mpc83xx_spi_driver = {
> .remove = __devexit_p(of_mpc83xx_spi_remove),
> };
>
> -#ifdef CONFIG_MPC832x_RDB
> /*
> * XXX XXX XXX
> * This is "legacy" platform driver, was used by the MPC8323E-RDB boards
> @@ -941,10 +940,6 @@ static void __exit legacy_driver_unregister(void)
> return;
> platform_driver_unregister(&mpc83xx_spi_driver);
> }
> -#else
> -static void __init legacy_driver_register(void) {}
> -static void __exit legacy_driver_unregister(void) {}
> -#endif /* CONFIG_MPC832x_RDB */
>
> static int __init mpc83xx_spi_init(void)
> {
> --
> 1.6.2.3
>
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [spi_mpc83xx] Always enable legacy support.
2009-07-01 21:12 ` Anton Vorontsov
@ 2009-07-02 6:18 ` Joakim Tjernlund
0 siblings, 0 replies; 3+ messages in thread
From: Joakim Tjernlund @ 2009-07-02 6:18 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev
Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 01/07/2009 23:12:12:
>
> On Wed, Jul 01, 2009 at 09:16:12PM +0200, Joakim Tjernlund wrote:
> > There are out of tree boards that need this legacy support too.
>
> Heh.
>
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> > ---
> > I hope this is OK. I just discovered that spi didn't work for
> > me in 2.6.30 and I have no time to work on coverting my boards.
>
> I'd convert them for you if they were in-tree. :-) But I don't
> think that moving the kernel backwards because of out-of-tree
> boards is a good thing.
:), but allowing out-of-tree boards one or two kernel releases to catch up
with a legacy printout would have been nice.
>
> > I don't have a clue either on how to do that, any pointers
> > how to add a few spidev devices via OF?
>
> Something like this will work:
>
> spi@4c0 {
> #address-cells = <1>;
> #size-cells = <0>;
> cell-index = <0>;
> compatible = "fsl,spi";
> reg = <0x4c0 0x40>;
> interrupts = <2>;
> interrupt-parent = <&qeic>;
> /* provide chip-selects here */
> gpios = <&qe_pio_d 13 0 /* CS0 */
> &qe_pio_d 14 0>; /* CS1 */
> mode = "cpu-qe";
>
> device@0 {
> compatible = "spidev";
> reg = <0>; /* CS0*/
> spi-max-frequency = <50000000>;
> };
>
> device@0 {
> compatible = "spidev";
> reg = <1>; /* CS1 */
> spi-max-frequency = <50000000>;
> };
> };
>
> You can look at arch/powerpc/boot/dts/mpc832x_rdb.dts as an
> example.
>
> Note that "spidev" isn't correct compatible entry to use,
> but it's quick and dirty solution. A proper solution is to
> add a proper compatible entry into the device-tree, and
> add "spidev" alias into drivers/of/base.c:of_modalias_table.
Thanks
Jocke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-02 6:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 19:16 [PATCH] [spi_mpc83xx] Always enable legacy support Joakim Tjernlund
2009-07-01 21:12 ` Anton Vorontsov
2009-07-02 6:18 ` Joakim Tjernlund
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).