* [PATCH] i2c: i2c-sh_mobile device tree support @ 2012-03-30 8:44 Magnus Damm 2012-03-30 8:47 ` Paul Mundt 2012-04-19 7:33 ` Wolfram Sang 0 siblings, 2 replies; 7+ messages in thread From: Magnus Damm @ 2012-03-30 8:44 UTC (permalink / raw) To: linux-i2c Cc: arnd, linux-sh, w.sang, rjw, lethal, ben-linux, khali, Magnus Damm From: Magnus Damm <damm@opensource.se> This patch enables DT support for the IIC driver used on SH-based SoCs such as sh7722 and sh7724 among others as well as SH-Mobile SoCs such as sh7367, sh7377, sh7372, sh73a0 and r8a7740. Tested with out-of-tree DT support code on the sh7372 Mackerel board. Signed-off-by: Magnus Damm <damm@opensource.se> --- drivers/i2c/busses/i2c-sh_mobile.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- 0001/drivers/i2c/busses/i2c-sh_mobile.c +++ work/drivers/i2c/busses/i2c-sh_mobile.c 2012-03-29 14:39:42.000000000 +0900 @@ -27,6 +27,7 @@ #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/i2c.h> +#include <linux/of_i2c.h> #include <linux/err.h> #include <linux/pm_runtime.h> #include <linux/clk.h> @@ -653,6 +654,7 @@ static int sh_mobile_i2c_probe(struct pl adap->dev.parent = &dev->dev; adap->retries = 5; adap->nr = dev->id; + adap->dev.of_node = dev->dev.of_node; strlcpy(adap->name, dev->name, sizeof(adap->name)); @@ -667,6 +669,8 @@ static int sh_mobile_i2c_probe(struct pl dev_info(&dev->dev, "I2C adapter %d with bus speed %lu Hz\n", adap->nr, pd->bus_speed); + + of_i2c_register_devices(adap); return 0; err_all: @@ -710,11 +714,18 @@ static const struct dev_pm_ops sh_mobile .runtime_resume = sh_mobile_i2c_runtime_nop, }; +static const struct of_device_id sh_mobile_i2c_dt_ids[] __devinitconst = { + { .compatible = "renesas,rmobile-iic", }, + {}, +}; +MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids); + static struct platform_driver sh_mobile_i2c_driver = { .driver = { .name = "i2c-sh_mobile", .owner = THIS_MODULE, .pm = &sh_mobile_i2c_dev_pm_ops, + .of_match_table = sh_mobile_i2c_dt_ids, }, .probe = sh_mobile_i2c_probe, .remove = sh_mobile_i2c_remove, ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: i2c-sh_mobile device tree support 2012-03-30 8:44 [PATCH] i2c: i2c-sh_mobile device tree support Magnus Damm @ 2012-03-30 8:47 ` Paul Mundt [not found] ` <20120330084744.GF26543-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org> 2012-04-19 7:33 ` Wolfram Sang 1 sibling, 1 reply; 7+ messages in thread From: Paul Mundt @ 2012-03-30 8:47 UTC (permalink / raw) To: Magnus Damm; +Cc: linux-i2c, arnd, linux-sh, w.sang, rjw, ben-linux, khali On Fri, Mar 30, 2012 at 05:44:02PM +0900, Magnus Damm wrote: > +static const struct of_device_id sh_mobile_i2c_dt_ids[] __devinitconst = { > + { .compatible = "renesas,rmobile-iic", }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids); > + Given that this block predates R-Mobile, using the rmobile naming here is pretty dubious. I suppose you can have it as an alias, though. ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20120330084744.GF26543-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>]
* Re: [PATCH] i2c: i2c-sh_mobile device tree support [not found] ` <20120330084744.GF26543-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org> @ 2012-03-30 8:53 ` Magnus Damm 2012-03-30 9:03 ` Paul Mundt 0 siblings, 1 reply; 7+ messages in thread From: Magnus Damm @ 2012-03-30 8:53 UTC (permalink / raw) To: Paul Mundt Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4, linux-sh-u79uwXL29TY76Z2rM5mHXA, w.sang-bIcnvbaLZ9MEGnE8C9+IrQ, rjw-KKrjLPT3xs0, ben-linux-elnMNo+KYs3YtjvyW6yDsg, khali-PUYAD+kWke1g9hUCZPvPmw On Fri, Mar 30, 2012 at 5:47 PM, Paul Mundt <lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org> wrote: > On Fri, Mar 30, 2012 at 05:44:02PM +0900, Magnus Damm wrote: >> +static const struct of_device_id sh_mobile_i2c_dt_ids[] __devinitconst = { >> + { .compatible = "renesas,rmobile-iic", }, >> + {}, >> +}; >> +MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids); >> + > Given that this block predates R-Mobile, using the rmobile naming here is > pretty dubious. I suppose you can have it as an alias, though. Sure, but creating new code based an old naming conventions seem rather odd too. Of course, if you think it is cramping your SH device tree style then we can easily add a "renesas-shmobile-iic" entry as well. Cheers, / magnus ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: i2c-sh_mobile device tree support 2012-03-30 8:53 ` Magnus Damm @ 2012-03-30 9:03 ` Paul Mundt 2012-04-18 14:08 ` Wolfram Sang 0 siblings, 1 reply; 7+ messages in thread From: Paul Mundt @ 2012-03-30 9:03 UTC (permalink / raw) To: Magnus Damm; +Cc: linux-i2c, arnd, linux-sh, w.sang, rjw, ben-linux, khali On Fri, Mar 30, 2012 at 05:53:35PM +0900, Magnus Damm wrote: > On Fri, Mar 30, 2012 at 5:47 PM, Paul Mundt <lethal@linux-sh.org> wrote: > > On Fri, Mar 30, 2012 at 05:44:02PM +0900, Magnus Damm wrote: > >> +static const struct of_device_id sh_mobile_i2c_dt_ids[] __devinitconst = { > >> + ? ? { .compatible = "renesas,rmobile-iic", }, > >> + ? ? {}, > >> +}; > >> +MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids); > >> + > > Given that this block predates R-Mobile, using the rmobile naming here is > > pretty dubious. I suppose you can have it as an alias, though. > > Sure, but creating new code based an old naming conventions seem rather > odd too. > Devices should be named what they are, not what the marketing people tell you they should be. Retroactively attempting to label parts that pre-date rmobile as being rmobile-related is non-sensical. The driver itself you'll note is not called i2c-rmobile for precisely this reason. Furthermore, there are also ARM-based SH-Mobile parts that pre-date the R-Mobile line that also use this driver, so it's hardly an architecture issue. > Of course, if you think it is cramping your SH device tree style then > we can easily add a "renesas-shmobile-iic" entry as well. > I obviously don't mind if you wish to use the rmobile naming convention going forward, as the new parts have obviously dropped with the shmobile naming convention, and it's likely you'll even be able to infer different capabilities between rmobile vs shmobile. That's not sufficient cause to prefer one over the other though, so you're still going to have to keep things balanced. Simply having two aliases seems to me to be the easiest solution. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: i2c-sh_mobile device tree support 2012-03-30 9:03 ` Paul Mundt @ 2012-04-18 14:08 ` Wolfram Sang [not found] ` <20120418140839.GD19220-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Wolfram Sang @ 2012-04-18 14:08 UTC (permalink / raw) To: Paul Mundt; +Cc: Magnus Damm, linux-i2c, arnd, linux-sh, rjw, ben-linux, khali [-- Attachment #1: Type: text/plain, Size: 919 bytes --] Hi Paul, > > Of course, if you think it is cramping your SH device tree style then > > we can easily add a "renesas-shmobile-iic" entry as well. > > > I obviously don't mind if you wish to use the rmobile naming convention > going forward, as the new parts have obviously dropped with the shmobile > naming convention, and it's likely you'll even be able to infer different > capabilities between rmobile vs shmobile. That's not sufficient cause to > prefer one over the other though, so you're still going to have to keep > things balanced. Simply having two aliases seems to me to be the easiest > solution. "alias" is a second compatible entry here? Is it okay if this is added with a seperate patch when needed? Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20120418140839.GD19220-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>]
* Re: [PATCH] i2c: i2c-sh_mobile device tree support [not found] ` <20120418140839.GD19220-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> @ 2012-04-19 1:41 ` Paul Mundt 0 siblings, 0 replies; 7+ messages in thread From: Paul Mundt @ 2012-04-19 1:41 UTC (permalink / raw) To: Wolfram Sang Cc: Magnus Damm, linux-i2c-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4, linux-sh-u79uwXL29TY76Z2rM5mHXA, rjw-KKrjLPT3xs0, ben-linux-elnMNo+KYs3YtjvyW6yDsg, khali-PUYAD+kWke1g9hUCZPvPmw On Wed, Apr 18, 2012 at 04:08:39PM +0200, Wolfram Sang wrote: > Hi Paul, > > > > Of course, if you think it is cramping your SH device tree style then > > > we can easily add a "renesas-shmobile-iic" entry as well. > > > > > I obviously don't mind if you wish to use the rmobile naming convention > > going forward, as the new parts have obviously dropped with the shmobile > > naming convention, and it's likely you'll even be able to infer different > > capabilities between rmobile vs shmobile. That's not sufficient cause to > > prefer one over the other though, so you're still going to have to keep > > things balanced. Simply having two aliases seems to me to be the easiest > > solution. > > "alias" is a second compatible entry here? Is it okay if this is added > with a seperate patch when needed? > Yes, that's fine. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] i2c: i2c-sh_mobile device tree support 2012-03-30 8:44 [PATCH] i2c: i2c-sh_mobile device tree support Magnus Damm 2012-03-30 8:47 ` Paul Mundt @ 2012-04-19 7:33 ` Wolfram Sang 1 sibling, 0 replies; 7+ messages in thread From: Wolfram Sang @ 2012-04-19 7:33 UTC (permalink / raw) To: Magnus Damm Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4, linux-sh-u79uwXL29TY76Z2rM5mHXA, rjw-KKrjLPT3xs0, lethal-M7jkjyW5wf5g9hUCZPvPmw, ben-linux-elnMNo+KYs3YtjvyW6yDsg, khali-PUYAD+kWke1g9hUCZPvPmw [-- Attachment #1: Type: text/plain, Size: 674 bytes --] On Fri, Mar 30, 2012 at 05:44:02PM +0900, Magnus Damm wrote: > From: Magnus Damm <damm-yzvPICuk2ACczHhG9Qg4qA@public.gmane.org> > > This patch enables DT support for the IIC driver > used on SH-based SoCs such as sh7722 and sh7724 > among others as well as SH-Mobile SoCs such as > sh7367, sh7377, sh7372, sh73a0 and r8a7740. > > Tested with out-of-tree DT support code on the > sh7372 Mackerel board. > > Signed-off-by: Magnus Damm <damm-yzvPICuk2ACczHhG9Qg4qA@public.gmane.org> Applied to next. -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-19 7:33 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-03-30 8:44 [PATCH] i2c: i2c-sh_mobile device tree support Magnus Damm 2012-03-30 8:47 ` Paul Mundt [not found] ` <20120330084744.GF26543-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org> 2012-03-30 8:53 ` Magnus Damm 2012-03-30 9:03 ` Paul Mundt 2012-04-18 14:08 ` Wolfram Sang [not found] ` <20120418140839.GD19220-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> 2012-04-19 1:41 ` Paul Mundt 2012-04-19 7:33 ` Wolfram Sang
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).