regulator: add support for regulators on the ab8500 MFD
PATCH v3 1/2 regulator: add support for regulators on the ab8500 MFD
---
CHANGELOG
v2 -> v3
- replaced dev_dbg calls with dev_err.
v1 -> v2
- Fixed comments from Mark
drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/ab8500.c | 427 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 436 insertions(+), 0 deletions(-) create mode 100644 drivers/regulator/ab8500.c
drivers/regulator/Kconfig +8 -0
@@ -221,5 +221,13 @@ config REGULATOR_AD5398 help This driver supports AD5398 and AD5821 current regulator chips. If building into module, its name is ad5398.ko. + +config REGULATOR_AB8500 + bool "ST-Ericsson AB8500 Power Regulators" + depends on AB8500_CORE + help + This driver supports the regulators found on the ST-Ericsson mixed + signal AB8500 PMIC + endif
drivers/regulator/Makefile +1 -0
@@ -34,5 +34,6 @@ obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o +obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
drivers/regulator/ab8500.c new file +427 -0
427 lines not on this page · raw message
Signature · 1 line
1.7.0
Quoted 1 line
From [email protected] Sun Jun 6 12:36:48 2010
From: [email protected] ()
Date: Sun, 06 Jun 2010 16:36:48 -0000
Subject: No subject
Message-ID: <[email protected]>
of road to cover though, let's see if I can figure it out.
The way I read the code I still have to provide some kind of dummychip on the bus in order to perform a loopback test on a bus with no devices connected, am I right?
Yours,
Linus Walleij
Quoted 1 line
From [email protected] Sun Jun 6 12:36:48 2010
From: [email protected] ()
Date: Sun, 06 Jun 2010 16:36:48 -0000
Subject: No subject
Message-ID: <[email protected]>
boot up time. This because it will improve the start up time of your final kernel _and_ your boot loader as well if you use kexec.
Cheers,
/ magnus
Quoted 1 line
From [email protected] Sun Jun 6 12:36:48 2010
From: [email protected] ()
Date: Sun, 06 Jun 2010 16:36:48 -0000
Subject: No subject
Message-ID: <[email protected]>
usage scenarios better or worse. This results in higher or lower memory fragmentation. System use cases are something that kernel or drivers are definitely not aware, so only user space can tune this parameter to get the best possible system behavior.
Quoted 12 lines
We can always add more complex scenarios later, but for an initial version I'd keep it simple.
Quoted 9 lines
(quoted diff) +9
-0+ + 2. CMA allows a run-time configuration of the memory regions it + will use to allocate chunks of memory from. The set of memory + regions is given on command line so it can be easily changed + without the need for recompiling the kernel. + + Each region has it's own size, alignment demand, a start + address (physical address where it should be placed) and an + allocator algorithm assigned to the region.
Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ + This means that there can be different algorithms running at + the same time, if different devices on the platform have + distinct memory usage characteristics and different algorithm + match those the best way.Seems overengineering to me. Just ensure that the code can be extended later to such hypothetical scenarios. They are hypothetical, right?
Not really. Having the possibility to reconfigure memory configuration without kernel recompilation is very handy when one is tuning the configuration for the specific use case.
Quoted 14 lines
Review
Quoted 13 lines
(quoted diff) +13
-0+ 3. When requesting memory, devices have to introduce themselves. + This way CMA knows who the memory is allocated for. This + allows for the system architect to specify which memory regions + each device should use. + + 3a. Devices can also specify a "kind" of memory they want. + This makes it possible to configure the system in such + a way, that a single device may get memory from different + memory regions, depending on the "kind" of memory it + requested. For example, a video codec driver might want to + allocate some shared buffers from the first memory bank and + the other from the second to get the highest possible + memory throughput.
Quoted 4 lines
Not sure I understand this. Isn't this just two regions, one for each memory bank,
and the driver requests some buffers from one region and some from the other?
Right.
Quoted 1 line
Not sure how a 'kind of memory' features in this.
This 'kind' is a just cookie or a label used by the driver to distinguish requests for both memory banks. This functionality is essential for our hardware (just for hardware video codec we have 3 'kinds' of memory: memory bank A, memory bank B and special region for the firmware).
Quoted 9 lines
Review
Quoted 7 lines
(quoted diff) +7
-0+ 4. For greater flexibility and extensibility, the framework allows + device drivers to register private regions of reserved memory + which then may be used only by them. + + As an effect, if a driver would not use the rest of the CMA + interface, it can still use CMA allocators and other + mechanisms.Why would you? Is there an actual driver that will need this?
This feature has been added after posting v1 of this rfc/patch. Jonathan Corbet suggested in <http://article.gmane.org/gmane.linux.kernel.mm/50689>
that viafb driver might register its own private memory and use cma just as an allocator. IMHO this is a good idea, this way we might remove a bunch of custom allocators from the drivers (yes, there are such all over the kernel).
Quoted 9 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ 4a. Early in boot process, device drivers can also request the + CMA framework to a reserve a region of memory for them + which then will be used as a private region. + + This way, drivers do not need to directly call bootmem, + memblock or similar early allocator but merely register an + early region and the framework will handle the rest + including choosing the right early allocator.
Quoted 8 lines
The whole concept of private regions seems unnecessary to me.
<big snip>
It looks to me as if you tried to think of all possible hypothetical situations
and write a framework for that. Of course, you may know more than I do, and some of these situations actually happen.
Not exactly. We tried to design a solution that would cover all requirements for OUR (quite specific) embedded hardware. However we didn't want to tie it only to our platform. We just generalized most of our requirements so they can be reused for other systems.
Quoted 3 lines
The basic design ideas are solid, I think. But you should get rid of all the fancy features and go back to basics. We can always add those features later should that become necessary. But removing features is much, much
harder.
Well, please keep in mind that we cannot remove features that are essential for our solution. We know that a simple framework have some advantages (well, the most important one is the fact that it is easy to understand), but making it too simple would render it useless from our point of view (if it would not provide functionality required by our drivers and hardware).
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center