All of lore.kernel.org
 help / color / mirror / Atom feed
* Driver lis3lv02d_i2c not working on Nokia RX-51
@ 2013-02-16 23:46 Pali Rohár
  2013-02-17 16:25 ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Pali Rohár @ 2013-02-16 23:46 UTC (permalink / raw)
  To: Mark Brown
  Cc: Eric Piel, Ilkka Koskinen, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 666 bytes --]

Hello,

Accelerometer driver lis3lv02d_i2c not working on Nokia RX-51 
with linux kernel 3.8-rc3. Probing for i2c device failing.

I tried to compile older version and it working without problem. 
Then I bisected commit which broke support for RX-51.

That commit is ec400c9fab99d16a491cea17d27d0c6a5780b97c
"lis3lv02d: make regulator API usage unconditional"

CCing everybody who signed off that commit. When I reverted that 
commit on top of 3.8-rc3, lis3lv02d working without problem.

It looks like driver is trying to use some regulator, but there 
is nothing defined for RX-51.

Any idea what to do?

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-02-16 23:46 Driver lis3lv02d_i2c not working on Nokia RX-51 Pali Rohár
@ 2013-02-17 16:25 ` Mark Brown
  2013-02-17 16:40   ` Pali Rohár
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-02-17 16:25 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Eric Piel, Ilkka Koskinen, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]

On Sun, Feb 17, 2013 at 12:46:25AM +0100, Pali Rohár wrote:

> Accelerometer driver lis3lv02d_i2c not working on Nokia RX-51 
> with linux kernel 3.8-rc3. Probing for i2c device failing.

> I tried to compile older version and it working without problem. 
> Then I bisected commit which broke support for RX-51.

> That commit is ec400c9fab99d16a491cea17d27d0c6a5780b97c
> "lis3lv02d: make regulator API usage unconditional"

> CCing everybody who signed off that commit. When I reverted that 
> commit on top of 3.8-rc3, lis3lv02d working without problem.

> It looks like driver is trying to use some regulator, but there 
> is nothing defined for RX-51.

> Any idea what to do?

It would be helpful to provide some more detailed information on the
problem you are seeing than "the probe is failing".  Are there any error
messages or other indications as to where in the probe the error occurs?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-02-17 16:25 ` Mark Brown
@ 2013-02-17 16:40   ` Pali Rohár
  2013-02-17 18:17     ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Pali Rohár @ 2013-02-17 16:40 UTC (permalink / raw)
  To: Mark Brown; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1754 bytes --]

On Sunday 17 February 2013 17:25:24 Mark Brown wrote:
> On Sun, Feb 17, 2013 at 12:46:25AM +0100, Pali Rohár wrote:
> > Accelerometer driver lis3lv02d_i2c not working on Nokia
> > RX-51 with linux kernel 3.8-rc3. Probing for i2c device
> > failing.
> > 
> > I tried to compile older version and it working without
> > problem. Then I bisected commit which broke support for
> > RX-51.
> > 
> > That commit is ec400c9fab99d16a491cea17d27d0c6a5780b97c
> > "lis3lv02d: make regulator API usage unconditional"
> > 
> > CCing everybody who signed off that commit. When I reverted
> > that commit on top of 3.8-rc3, lis3lv02d working without
> > problem.
> > 
> > It looks like driver is trying to use some regulator, but
> > there is nothing defined for RX-51.
> > 
> > Any idea what to do?
> 
> It would be helpful to provide some more detailed information
> on the problem you are seeing than "the probe is failing". 
> Are there any error messages or other indications as to where
> in the probe the error occurs?

I booted kernel without reverted that commit and here is dmesg output:

$ dmesg | grep lis3
[  110.454345] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
[  110.457397] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
[  111.507415] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
[  111.510528] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
[  126.720458] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
[  126.728149] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
[  135.842803] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
[  135.856292] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-02-17 16:40   ` Pali Rohár
@ 2013-02-17 18:17     ` Mark Brown
  2013-03-24 14:50       ` Pali Rohár
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-02-17 18:17 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]

On Sun, Feb 17, 2013 at 05:40:41PM +0100, Pali Rohár wrote:

> $ dmesg | grep lis3
> [  110.454345] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
> [  110.457397] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
> [  111.507415] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
> [  111.510528] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
> [  126.720458] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
> [  126.728149] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral
> [  135.842803] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
> [  135.856292] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral

This just looks like a basic error in the board hookup - the supplies
are not mapped for the device.  Add the supply mappings and you should
be fine.  This should have been done when the device was added, the
commit doing that looks like it was never tested in mainline as the
driver problem was fixed in October 2011 but the RX51 didn't start using
the device until May 2012.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-02-17 18:17     ` Mark Brown
@ 2013-03-24 14:50       ` Pali Rohár
  2013-03-24 21:21         ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Pali Rohár @ 2013-03-24 14:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1429 bytes --]

On Sunday 17 February 2013 19:17:59 Mark Brown wrote:
> On Sun, Feb 17, 2013 at 05:40:41PM +0100, Pali Rohár wrote:
> > $ dmesg | grep lis3
> > [  110.454345] lis3lv02d_i2c 3-001d: Failed to get supply
> > 'Vdd': -517 [  110.457397] i2c 3-001d: Driver lis3lv02d_i2c
> > requests probe deferral [  111.507415] lis3lv02d_i2c
> > 3-001d: Failed to get supply 'Vdd': -517 [  111.510528] i2c
> > 3-001d: Driver lis3lv02d_i2c requests probe deferral [ 
> > 126.720458] lis3lv02d_i2c 3-001d: Failed to get supply
> > 'Vdd': -517 [  126.728149] i2c 3-001d: Driver lis3lv02d_i2c
> > requests probe deferral [  135.842803] lis3lv02d_i2c
> > 3-001d: Failed to get supply 'Vdd': -517 [  135.856292] i2c
> > 3-001d: Driver lis3lv02d_i2c requests probe deferral
> 
> This just looks like a basic error in the board hookup - the
> supplies are not mapped for the device.  Add the supply
> mappings and you should be fine.  This should have been done
> when the device was added, the commit doing that looks like
> it was never tested in mainline as the driver problem was
> fixed in October 2011 but the RX51 didn't start using the
> device until May 2012.

There is no regulator 'Vdd' supply in board rx51 files. Can you 
look at code how it can be fixed? 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/mach-omap2/board-rx51-peripherals.c#n86

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 14:50       ` Pali Rohár
@ 2013-03-24 21:21         ` Mark Brown
  2013-03-24 21:27           ` Pali Rohár
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-03-24 21:21 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

On Sun, Mar 24, 2013 at 03:50:42PM +0100, Pali Rohár wrote:

> There is no regulator 'Vdd' supply in board rx51 files. Can you 
> look at code how it can be fixed? 

You need to look at the schematics rather than the code here - the code
just needs to say what regulator supplies Vdd on the device.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 21:21         ` Mark Brown
@ 2013-03-24 21:27           ` Pali Rohár
  2013-03-24 22:14             ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Pali Rohár @ 2013-03-24 21:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 495 bytes --]

On Sunday 24 March 2013 22:21:49 Mark Brown wrote:
> On Sun, Mar 24, 2013 at 03:50:42PM +0100, Pali Rohár wrote:
> > There is no regulator 'Vdd' supply in board rx51 files. Can
> > you look at code how it can be fixed?
> 
> You need to look at the schematics rather than the code here -
> the code just needs to say what regulator supplies Vdd on the
> device.

This is problem, there is no info about regulator supplies for 
this device...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 21:27           ` Pali Rohár
@ 2013-03-24 22:14             ` Mark Brown
  2013-03-24 22:44               ` Pali Rohár
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-03-24 22:14 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 583 bytes --]

On Sun, Mar 24, 2013 at 10:27:32PM +0100, Pali Rohár wrote:
> On Sunday 24 March 2013 22:21:49 Mark Brown wrote:

> > You need to look at the schematics rather than the code here -
> > the code just needs to say what regulator supplies Vdd on the
> > device.

> This is problem, there is no info about regulator supplies for 
> this device...

Well, you should seek support from the board vendor then.  Or try
things like continuity tests (the regulator will have external
components, most likely there's at least a decoupling cap you can probe
at the device end too).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 22:14             ` Mark Brown
@ 2013-03-24 22:44               ` Pali Rohár
  2013-03-24 23:04                 ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Pali Rohár @ 2013-03-24 22:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1215 bytes --]

On Sunday 24 March 2013 23:14:46 Mark Brown wrote:
> On Sun, Mar 24, 2013 at 10:27:32PM +0100, Pali Rohár wrote:
> > On Sunday 24 March 2013 22:21:49 Mark Brown wrote:
> > > You need to look at the schematics rather than the code
> > > here - the code just needs to say what regulator supplies
> > > Vdd on the device.
> > 
> > This is problem, there is no info about regulator supplies
> > for this device...
> 
> Well, you should seek support from the board vendor then. 

Not possible. Nokia is already using Windows Phones and life 
cycle for Nokia N900 phone is at the end. And Nokia never 
released any HW documentations to community...

> Or try things like continuity tests (the regulator will have
> external components, most likely there's at least a
> decoupling cap you can probe at the device end too).

Disassembling this mobile phone is not simple and I dubt that it 
will help me...

Another question: what was reason for that commit 
ec400c9fab99d16a491cea17d27d0c6a5780b97c
"lis3lv02d: make regulator API usage unconditional" ?

I think that for N900 support is reverting above commit needed, I 
do not see other solution...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 22:44               ` Pali Rohár
@ 2013-03-24 23:04                 ` Mark Brown
  2013-03-26 15:02                   ` Pali Rohár
  0 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-03-24 23:04 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

On Sun, Mar 24, 2013 at 11:44:59PM +0100, Pali Rohár wrote:
> On Sunday 24 March 2013 23:14:46 Mark Brown wrote:

> > Well, you should seek support from the board vendor then. 

> Not possible. Nokia is already using Windows Phones and life 
> cycle for Nokia N900 phone is at the end. And Nokia never 
> released any HW documentations to community...

There may well still be people with the required information, though in
general this sort of thing is always going to be a hazard when working
on undocumented hardware.

> Another question: what was reason for that commit 
> ec400c9fab99d16a491cea17d27d0c6a5780b97c
> "lis3lv02d: make regulator API usage unconditional" ?

Failing to provide power to a device is typically a very serious
problem for device operation but the code that was there handles such
errors by ignoring them.  This isn't a robust way forwards and such code
should never have been merged in the first place, as the changelog says
the regulator core provides a number of facilities for stubbing itself
out when it is not required which boards should use.

Handling the possibility that supplies may not be there not only creates
needless repetitive complexity in device drivers but also decreases the
robustness of the system since error handling for access to powered down
devices often isn't very pretty and other drivers or the core may
disrupt the operation of the device by for example powering it down due
to not thinking it's in use.

> I think that for N900 support is reverting above commit needed, I 
> do not see other solution...

If you're convinced that the regulator is kept on for some reason you
could always just provide a fake supply, though obviously it would be
better to hook up the real regulator since this may break if at some
point the kernel decides that whatever is actually providing the supply
is unused and can be turned off.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-24 23:04                 ` Mark Brown
@ 2013-03-26 15:02                   ` Pali Rohár
  2013-03-26 15:44                     ` Mark Brown
  2013-03-26 20:53                     ` Aaro Koskinen
  0 siblings, 2 replies; 17+ messages in thread
From: Pali Rohár @ 2013-03-26 15:02 UTC (permalink / raw)
  To: Mark Brown
  Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel,
	Aaro Koskinen, Tony Lindgren

[-- Attachment #1: Type: Text/Plain, Size: 2385 bytes --]

On Monday 25 March 2013 00:04:37 Mark Brown wrote:
> On Sun, Mar 24, 2013 at 11:44:59PM +0100, Pali Rohár wrote:
> > On Sunday 24 March 2013 23:14:46 Mark Brown wrote:
> > > Well, you should seek support from the board vendor then.
> > 
> > Not possible. Nokia is already using Windows Phones and life
> > cycle for Nokia N900 phone is at the end. And Nokia never
> > released any HW documentations to community...
> 
> There may well still be people with the required information,
> though in general this sort of thing is always going to be a
> hazard when working on undocumented hardware.
> 
> > Another question: what was reason for that commit
> > ec400c9fab99d16a491cea17d27d0c6a5780b97c
> > "lis3lv02d: make regulator API usage unconditional" ?
> 
> Failing to provide power to a device is typically a very
> serious problem for device operation but the code that was
> there handles such errors by ignoring them.  This isn't a
> robust way forwards and such code should never have been
> merged in the first place, as the changelog says the
> regulator core provides a number of facilities for stubbing
> itself out when it is not required which boards should use.
> 
> Handling the possibility that supplies may not be there not
> only creates needless repetitive complexity in device drivers
> but also decreases the robustness of the system since error
> handling for access to powered down devices often isn't very
> pretty and other drivers or the core may disrupt the
> operation of the device by for example powering it down due
> to not thinking it's in use.
> 
> > I think that for N900 support is reverting above commit
> > needed, I do not see other solution...
> 
> If you're convinced that the regulator is kept on for some
> reason you could always just provide a fake supply, though
> obviously it would be better to hook up the real regulator
> since this may break if at some point the kernel decides that
> whatever is actually providing the supply is unused and can
> be turned off.

CCing Aaro and Tony. Look at this thread on: 
https://lkml.org/lkml/2013/2/16/152

What do you think how to fix this problem? I do not know about any 
HW regulator for n900 accelerometer and possible solutions could 
be revert that commit or adding fake regulator to board code...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 15:02                   ` Pali Rohár
@ 2013-03-26 15:44                     ` Mark Brown
  2013-03-26 16:08                       ` Linus Torvalds
  2013-03-26 20:53                     ` Aaro Koskinen
  1 sibling, 1 reply; 17+ messages in thread
From: Mark Brown @ 2013-03-26 15:44 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Eric Piel, Andrew Morton, Linus Torvalds, linux-kernel,
	Aaro Koskinen, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

On Tue, Mar 26, 2013 at 04:02:39PM +0100, Pali Rohár wrote:

> What do you think how to fix this problem? I do not know about any 
> HW regulator for n900 accelerometer and possible solutions could 
> be revert that commit or adding fake regulator to board code...

Reverting the fix is not an option, this is a clear bug in the platform.

There will be a regulator here, the device needs power.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 15:44                     ` Mark Brown
@ 2013-03-26 16:08                       ` Linus Torvalds
  2013-03-26 17:08                         ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2013-03-26 16:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: Pali Rohár, Eric Piel, Andrew Morton,
	Linux Kernel Mailing List, Aaro Koskinen, Tony Lindgren

On Tue, Mar 26, 2013 at 8:44 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Tue, Mar 26, 2013 at 04:02:39PM +0100, Pali Rohár wrote:
>
>> What do you think how to fix this problem? I do not know about any
>> HW regulator for n900 accelerometer and possible solutions could
>> be revert that commit or adding fake regulator to board code...
>
> Reverting the fix is not an option, this is a clear bug in the platform.
>
> There will be a regulator here, the device needs power.

Bullshit.

This is a regression, and it needs to be fixed. The "device needs
power" crap is just that - crap. Nobody cares. OF COURSE all devices
need power, but that is totally irrelevant for a driver. The SSD in my
system "needs power", but I have absolutely zero regulator information
for it NOR DO I F*CKING NEED ANY!

Claiming that we need to know the power regulator for an accelerometer
is total utter idiocy and crap.

I'm going to revert that commit unless you can fix it some other way
(dummy regulators when you can't find a real one or whatever). The
notion that you have to have regulator information in order to use
some random device is insanity. I don't understand how you can even
start to make excuses like that. It's so obviously bogus that it's not
even funny.

Why do I have to explain the "no regressions" to long-time kernel
maintainers EVERY SINGLE RELEASE? What the f*ck is *wrong* with you
people? Seriously?

          Linus

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 16:08                       ` Linus Torvalds
@ 2013-03-26 17:08                         ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2013-03-26 17:08 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Pali Rohár, Eric Piel, Andrew Morton,
	Linux Kernel Mailing List, Aaro Koskinen, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]

On Tue, Mar 26, 2013 at 09:08:08AM -0700, Linus Torvalds wrote:

> This is a regression, and it needs to be fixed. The "device needs

This isn't a regression, the commit they're complaining about (ec400c)
was added in October 2011 with a note about all the in-tree users having
been looked after and then the commit adding the registration of the
device (3b511201) was added in May 2012 - the device has just never,
ever worked in mainline on this board as far as I can tell.  It's not
like this was even two commits going in in the same release cycle.

As far as I can tell what's happened here is that someone got round to
testing what was sent upstream for the board and noticed that it never
worked.

> power" crap is just that - crap. Nobody cares. OF COURSE all devices
> need power, but that is totally irrelevant for a driver. The SSD in my
> system "needs power", but I have absolutely zero regulator information
> for it NOR DO I F*CKING NEED ANY!

Right, and this is why the core provides facilities for stubbing things
out.  There's no point in every single driver going and implementing the
same code for handling this stuff, it's repetitive at best.

> I'm going to revert that commit unless you can fix it some other way
> (dummy regulators when you can't find a real one or whatever). The

That's pretty much what I'm telling them to do - put the stub regulators
in if they don't know how things are connected on their board (there's
helpers to make this easier).

There is also an existing Kconfig option to just stub out any missing
regulator which people can use but it's not recommended for production
since it confuses things that may really have optional supplies and want
to handle that.

> notion that you have to have regulator information in order to use
> some random device is insanity. I don't understand how you can even
> start to make excuses like that. It's so obviously bogus that it's not
> even funny.

There's definitely room for improving the stubs, I would like to see
something which lets boards say "these specific regulators are mapped,
these supplies don't exist and stub anything else out with a dummy", but
users like rx51 should be well enough catered for at the minute.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 15:02                   ` Pali Rohár
  2013-03-26 15:44                     ` Mark Brown
@ 2013-03-26 20:53                     ` Aaro Koskinen
  2013-03-26 21:19                       ` Mark Brown
  2013-03-28 14:11                       ` Pali Rohár
  1 sibling, 2 replies; 17+ messages in thread
From: Aaro Koskinen @ 2013-03-26 20:53 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Mark Brown, Eric Piel, Andrew Morton, Linus Torvalds,
	linux-kernel, Tony Lindgren

Hi,

On Tue, Mar 26, 2013 at 04:02:39PM +0100, Pali Rohár wrote:
> CCing Aaro and Tony. Look at this thread on: 
> https://lkml.org/lkml/2013/2/16/152
> 
> What do you think how to fix this problem? I do not know about any 
> HW regulator for n900 accelerometer and possible solutions could 
> be revert that commit or adding fake regulator to board code...

I think the following should work:

...

From: Aaro Koskinen <aaro.koskinen@iki.fi>
Date: Tue, 26 Mar 2013 21:34:22 +0200
Subject: [PATCH] OMAP: RX-51: add missing regulator supply definitions for lis3lv02d

Add missing regulator definitions for lis3lv02d accelerometer. Fixes
the following probe issue:

[   57.737518] lis3lv02d_i2c 3-001d: Failed to get supply 'Vdd': -517
[   57.747100] i2c 3-001d: Driver lis3lv02d_i2c requests probe deferral

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 3a077df..1a88467 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -547,12 +547,16 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {
 	REGULATOR_SUPPLY("DVDD", "2-0019"),
 	/* Si4713 IO supply */
 	REGULATOR_SUPPLY("vio", "2-0063"),
+	/* lis3lv02d */
+	REGULATOR_SUPPLY("Vdd_IO", "3-001d"),
 };
 
 static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
 	REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
 	/* Si4713 supply */
 	REGULATOR_SUPPLY("vdd", "2-0063"),
+	/* lis3lv02d */
+	REGULATOR_SUPPLY("Vdd", "3-001d"),
 };
 
 static struct regulator_init_data rx51_vaux1 = {
-- 
1.7.10.4

A.

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 20:53                     ` Aaro Koskinen
@ 2013-03-26 21:19                       ` Mark Brown
  2013-03-28 14:11                       ` Pali Rohár
  1 sibling, 0 replies; 17+ messages in thread
From: Mark Brown @ 2013-03-26 21:19 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Pali Rohár, Eric Piel, Andrew Morton, Linus Torvalds,
	linux-kernel, Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

On Tue, Mar 26, 2013 at 10:53:19PM +0200, Aaro Koskinen wrote:

> From: Aaro Koskinen <aaro.koskinen@iki.fi>
> Date: Tue, 26 Mar 2013 21:34:22 +0200
> Subject: [PATCH] OMAP: RX-51: add missing regulator supply definitions for lis3lv02d
> 
> Add missing regulator definitions for lis3lv02d accelerometer. Fixes
> the following probe issue:

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

This is exactly the sort of thing I'd expect to see the board doing.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Driver lis3lv02d_i2c not working on Nokia RX-51
  2013-03-26 20:53                     ` Aaro Koskinen
  2013-03-26 21:19                       ` Mark Brown
@ 2013-03-28 14:11                       ` Pali Rohár
  1 sibling, 0 replies; 17+ messages in thread
From: Pali Rohár @ 2013-03-28 14:11 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Mark Brown, Eric Piel, Andrew Morton, Linus Torvalds,
	linux-kernel, Tony Lindgren

[-- Attachment #1: Type: Text/Plain, Size: 2749 bytes --]

On Tuesday 26 March 2013 21:53:19 Aaro Koskinen wrote:
> Hi,
> 
> On Tue, Mar 26, 2013 at 04:02:39PM +0100, Pali Rohár wrote:
> > CCing Aaro and Tony. Look at this thread on:
> > https://lkml.org/lkml/2013/2/16/152
> > 
> > What do you think how to fix this problem? I do not know
> > about any HW regulator for n900 accelerometer and possible
> > solutions could be revert that commit or adding fake
> > regulator to board code...
> 
> I think the following should work:
> 
> ...
> 
> From: Aaro Koskinen <aaro.koskinen@iki.fi>
> Date: Tue, 26 Mar 2013 21:34:22 +0200
> Subject: [PATCH] OMAP: RX-51: add missing regulator supply
> definitions for lis3lv02d
> 
> Add missing regulator definitions for lis3lv02d accelerometer.
> Fixes the following probe issue:
> 
> [   57.737518] lis3lv02d_i2c 3-001d: Failed to get supply
> 'Vdd': -517 [   57.747100] i2c 3-001d: Driver lis3lv02d_i2c
> requests probe deferral
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
>  arch/arm/mach-omap2/board-rx51-peripherals.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c
> b/arch/arm/mach-omap2/board-rx51-peripherals.c index
> 3a077df..1a88467 100644
> --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> @@ -547,12 +547,16 @@ static struct regulator_consumer_supply
> rx51_vio_supplies[] = { REGULATOR_SUPPLY("DVDD", "2-0019"),
>  	/* Si4713 IO supply */
>  	REGULATOR_SUPPLY("vio", "2-0063"),
> +	/* lis3lv02d */
> +	REGULATOR_SUPPLY("Vdd_IO", "3-001d"),
>  };
> 
>  static struct regulator_consumer_supply
> rx51_vaux1_consumers[] = { REGULATOR_SUPPLY("vdds_sdi",
> "omapdss"),
>  	/* Si4713 supply */
>  	REGULATOR_SUPPLY("vdd", "2-0063"),
> +	/* lis3lv02d */
> +	REGULATOR_SUPPLY("Vdd", "3-001d"),
>  };
> 
>  static struct regulator_init_data rx51_vaux1 = {

Hi, on #maemo IRC channel we have found some accelerometer 
regulators and I wrote this patch which is working fine with 3.8:

@@ -728,12 +730,16 @@ static struct regulator_consumer_supply 
rx51_vio_supplies[] = {
 	REGULATOR_SUPPLY("DVDD", "2-0019"),
 	/* Si4713 IO supply */
 	REGULATOR_SUPPLY("vio", "2-0063"),
+	/* lis3lv02d IO supply */
+	REGULATOR_SUPPLY("Vdd_IO", "3-001d"),
 };
 
 static struct regulator_consumer_supply rx51_vaux1_consumers[] = 
{
 	REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
 	/* Si4713 supply */
 	REGULATOR_SUPPLY("vdd", "2-0063"),
+	/* lis3lv02d supply */
+	REGULATOR_SUPPLY("Vdd", "3-001d"),
 };
 
 static struct regulator_init_data rx51_vaux1 = {

Now I see that patch is same as Aaro's :-) so please include it.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-03-28 14:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-16 23:46 Driver lis3lv02d_i2c not working on Nokia RX-51 Pali Rohár
2013-02-17 16:25 ` Mark Brown
2013-02-17 16:40   ` Pali Rohár
2013-02-17 18:17     ` Mark Brown
2013-03-24 14:50       ` Pali Rohár
2013-03-24 21:21         ` Mark Brown
2013-03-24 21:27           ` Pali Rohár
2013-03-24 22:14             ` Mark Brown
2013-03-24 22:44               ` Pali Rohár
2013-03-24 23:04                 ` Mark Brown
2013-03-26 15:02                   ` Pali Rohár
2013-03-26 15:44                     ` Mark Brown
2013-03-26 16:08                       ` Linus Torvalds
2013-03-26 17:08                         ` Mark Brown
2013-03-26 20:53                     ` Aaro Koskinen
2013-03-26 21:19                       ` Mark Brown
2013-03-28 14:11                       ` Pali Rohár

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.