All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH WIP] ARM: kirkwood: covert orion-spi to fdt.
Date: Tue, 28 Feb 2012 16:07:26 +0000	[thread overview]
Message-ID: <201202281607.27027.arnd@arndb.de> (raw)
In-Reply-To: <20120228152553.GZ23524@titan.lakedaemon.net>

On Tuesday 28 February 2012, Jason wrote:
> On Tue, Feb 28, 2012 at 07:39:24AM +0000, Arnd Bergmann wrote:
> > Same thing here:
> > 
> > 	if (of_find_property(spi->master->dev.of_node, "spi-clock-fix", NULL) ||
> > 		(orion_spi->spi_info && orion_spi->spi_info->enable_clock_fix))
> 
> Also, should this be "mv,spi-clock-fix" like I've seen for some ti
> custom dt bindings?

I'm never sure about this either. Maybe Grant can comment on this.

> > > +#ifdef CONFIG_OF
> > > +	orion_spi_wq = create_singlethread_workqueue(
> > > +				orion_spi_driver.driver.name);
> > > +	if (orion_spi_wq == NULL)
> > > +		return -ENOMEM;
> > > +#endif
> > 
> > This seems wrong: why do you have to create the workqueue again here?
> 
> Gah!  Originally, I was trying to mirror spi-tegra.c, which uses
> module_platform_driver().  So, I was moving code out of orion_spi_init()
> into orion_spi_probe() and setting .probe = orion_spi_probe().  I forgot
> to undo this when I backed away from that approach (to get it working
> first).
> 
> Should I go ahead and convert it to module_platform_driver()?

You can do that if you like, but it's not required here. If you do,
best send that conversion as a separate patch in a series before this
one.

> > > +
> > > +	spi->max_speed = DIV_ROUND_UP(tclk, 4);
> > > +	spi->min_speed = DIV_ROUND_UP(tclk, 30);
> > > +#else
> > >  	spi->spi_info = spi_info;
> > >  
> > >  	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> > >  	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> > > +#endif
> > 
> > Same code as above? Just find the clock frequency once and store it in  
> > spi->tclk.
> 
> Do you mean spi_info->tclk?  If so, spi_info is NULL when using device
> tree because orion_spi_init() in plat-orion/common.c never gets called,
> so the platform data isn't set.

I meant you should add a new "tclk" member to struct orion_spi and set
that to spi_info->tclk or the value from the device tree.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Jason <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH WIP] ARM: kirkwood: covert orion-spi to fdt.
Date: Tue, 28 Feb 2012 16:07:26 +0000	[thread overview]
Message-ID: <201202281607.27027.arnd@arndb.de> (raw)
In-Reply-To: <20120228152553.GZ23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>

On Tuesday 28 February 2012, Jason wrote:
> On Tue, Feb 28, 2012 at 07:39:24AM +0000, Arnd Bergmann wrote:
> > Same thing here:
> > 
> > 	if (of_find_property(spi->master->dev.of_node, "spi-clock-fix", NULL) ||
> > 		(orion_spi->spi_info && orion_spi->spi_info->enable_clock_fix))
> 
> Also, should this be "mv,spi-clock-fix" like I've seen for some ti
> custom dt bindings?

I'm never sure about this either. Maybe Grant can comment on this.

> > > +#ifdef CONFIG_OF
> > > +	orion_spi_wq = create_singlethread_workqueue(
> > > +				orion_spi_driver.driver.name);
> > > +	if (orion_spi_wq == NULL)
> > > +		return -ENOMEM;
> > > +#endif
> > 
> > This seems wrong: why do you have to create the workqueue again here?
> 
> Gah!  Originally, I was trying to mirror spi-tegra.c, which uses
> module_platform_driver().  So, I was moving code out of orion_spi_init()
> into orion_spi_probe() and setting .probe = orion_spi_probe().  I forgot
> to undo this when I backed away from that approach (to get it working
> first).
> 
> Should I go ahead and convert it to module_platform_driver()?

You can do that if you like, but it's not required here. If you do,
best send that conversion as a separate patch in a series before this
one.

> > > +
> > > +	spi->max_speed = DIV_ROUND_UP(tclk, 4);
> > > +	spi->min_speed = DIV_ROUND_UP(tclk, 30);
> > > +#else
> > >  	spi->spi_info = spi_info;
> > >  
> > >  	spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4);
> > >  	spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30);
> > > +#endif
> > 
> > Same code as above? Just find the clock frequency once and store it in  
> > spi->tclk.
> 
> Do you mean spi_info->tclk?  If so, spi_info is NULL when using device
> tree because orion_spi_init() in plat-orion/common.c never gets called,
> so the platform data isn't set.

I meant you should add a new "tclk" member to struct orion_spi and set
that to spi_info->tclk or the value from the device tree.

	Arnd

  reply	other threads:[~2012-02-28 16:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-27 22:31 [PATCH WIP] ARM: kirkwood: covert orion-spi to fdt Jason Cooper
2012-02-27 22:31 ` Jason Cooper
2012-02-28  7:39 ` Arnd Bergmann
2012-02-28  7:39   ` Arnd Bergmann
2012-02-28 15:25   ` Jason
2012-02-28 15:25     ` Jason
2012-02-28 16:07     ` Arnd Bergmann [this message]
2012-02-28 16:07       ` Arnd Bergmann
2012-02-28 18:43 ` [PATCH v2] " Jason Cooper
2012-02-28 18:43   ` Jason Cooper
2012-02-28 19:22   ` Arnd Bergmann
2012-02-28 19:22     ` Arnd Bergmann
2012-02-28 19:35 ` [PATCH v3] " Jason Cooper
2012-02-28 19:35   ` Jason Cooper
  -- strict thread matches above, loose matches on Subject: below --
2012-02-28  9:40 [PATCH WIP] " Andrew Lunn
2012-02-28 10:04 ` Arnd Bergmann
2012-02-28 10:04   ` Arnd Bergmann
2012-02-28 15:06   ` Jason
2012-02-28 15:06     ` Jason

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=201202281607.27027.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.