lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 5 Oct 2010 13:42:41 -0700
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Igor Grinberg <grinberg@...pulab.co.il>,
	Marek Vasut <marek.vasut@...il.com>,
	linux-arm-kernel@...ts.infradead.org, vapier@...too.org,
	khilman@...prootsystems.com, linux-kernel@...r.kernel.org,
	pavel@....cz, linux-input@...r.kernel.org, eric.y.miao@...il.com,
	akpm@...ux-foundation.org
Subject: Re: [PATCH v2] Input: Make ADS7846 independent on regulator

On Tue, Oct 05, 2010 at 08:35:08PM +0100, Alan Cox wrote:

> > If the board doesn't use regulators you can just disable the regulator
> > API at which point it compiles out into stubs which report success -
> > this has been the case from day one.  There's only an issue if the board
> > has a regulator configuration which is partially visible to software.

> Which is quite likely on anything complex and means that hardcoding
> regulator assumptions is bad.

When I say "partially visible" I mean where we can't say what's there -
we can cope fine with stuff that isn't software controllable.  The issue
is that we can't automatically discover the system configuration.

> I actually see two ways of attacking that, one is that the dummy
> regulator *and* the compiled in regulator system have a standard
> regulator value that can be passed which means "report success, move
> along nothing to see" that could be passed into drivers, the other is to
> not stick the stuff in drivers.

> I suspect the former may be cleaner ?

I'm afraid I'm having a hard time parsing what you're saying here (what
would a "regulator value" be?), but I suspect that you're trying to
suggest something fairly close to what is already implemented.

The model the regulator API has is that neither the driver for the
regulator nor the driver for the consumer should know anything about the
particular board, with the consumers just requesting the supplies the
device has.  A separate piece of board-specific configuration code
provides a table mapping the physical regulators in the system to the
supplies on the individual chips.  There is an option, currently Kconfig
only, which causes the regulator API to provide a do-nothing dummy
regulator if an attempt is made to request a supply that doesn't exist.
I *think* this dummy regulator corresponds to what you're suggesting
above but like I say I'm having a hard time parsing it.

If the regulator API is compiled out then any attempt to get, enable or
disable a regulator just unconditionally reports success.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ