Commit Graph

2181 Commits

Author SHA1 Message Date
Linus Torvalds
4251c2a670 Most of this is cleaning up various driver sysfs permissions so we can
re-add the perm check (we unified the module param and sysfs checks, but
 the module ones were stronger so we weakened them temporarily).
 
 Param parsing gets documented, and also "--" now forces args to be
 handed to init (and ignored by the kernel).
 
 Module NX/RO protections get tightened: we now set them before calling
 parse_args().
 
 Cheers,
 Rusty.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTl+oJAAoJENkgDmzRrbjxtUEP/jIXml01jE2HquOJ/DfrCJOt
 ry5L5Iy8wVBRotTszrXqlD6+W8fLYsEdhM65Wof1H7X1qjaulqYZmrL7bQn4rIGN
 YPUmO5rOzECeAPNW5+e2JLnR4bmS99gVcWzJFCHUBd7Z8ceKaoIk7/XvUg6Mdjg7
 v0kJ5X+U9da2sVYYcZ71euth4ADLFDRNRexA1mPI6mKzJLOBgfvCBWZnkFVdBcjd
 VmL6ceFo/yP9Ed4pgG/4uXq1dZ4ZttpjPusDmNcjq+snOzsQb4tW+KB2Pr6iTwQy
 TDt7lQm5+xfUXgUG/S5L6PYn10P44Voo7AEJa+QK5YPSOY/eRVA0h4/ayP0vqDaJ
 LpZjqXbW77G4yOgEV9KRFLLXiFXykTh2TyCPYL5G2XVXQp1OmViu2f21JWJLFLgL
 mqOXYWdowOGVOOoTgwxIdxczCFCATJUaU5Ig6ay8C02E2mCwIV+IaGSdpsCiyjz/
 dNNumMxWg0NMo/c0YG4K3Ake6ZaGrwbnuJYijaEj6mgpifhh7k4yhFciXGLpkLnS
 Yuo4ORO0GX34z1+bX0iwrgMGPdy7+BnbXsDdWJsbsnwnKKes/Sp44fNl4lPwdM3n
 siaPsxmfAtl9EGqbkU1Fk+x5+X/Lv2I/7/nX5n53520RLkJJpbeMDfHUqpbrqeUN
 JNUTOZ9o72EqDVKnn175
 =IxSN
 -----END PGP SIGNATURE-----

Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module updates from Rusty Russell:
 "Most of this is cleaning up various driver sysfs permissions so we can
  re-add the perm check (we unified the module param and sysfs checks,
  but the module ones were stronger so we weakened them temporarily).

  Param parsing gets documented, and also "--" now forces args to be
  handed to init (and ignored by the kernel).

  Module NX/RO protections get tightened: we now set them before calling
  parse_args()"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: set nx before marking module MODULE_STATE_COMING.
  samples/kobject/: avoid world-writable sysfs files.
  drivers/hid/hid-picolcd_fb: avoid world-writable sysfs files.
  drivers/staging/speakup/: avoid world-writable sysfs files.
  drivers/regulator/virtual: avoid world-writable sysfs files.
  drivers/scsi/pm8001/pm8001_ctl.c: avoid world-writable sysfs files.
  drivers/hid/hid-lg4ff.c: avoid world-writable sysfs files.
  drivers/video/fbdev/sm501fb.c: avoid world-writable sysfs files.
  drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
  speakup: fix incorrect perms on speakup_acntsa.c
  cpumask.h: silence warning with -Wsign-compare
  Documentation: Update kernel-parameters.tx
  param: hand arguments after -- straight to init
  modpost: Fix resource leak in read_dump()
2014-06-11 16:09:14 -07:00
Linus Torvalds
312c76f1a3 regulator: Updates for v3.16
The bulk of the changes for this release are a few new drivers however
 there are a couple of noticable core changes and the usual stream of
 cleanups and fixes:
 
  - Move disable of unused regulators later in init so it comes after
    deferred probe has iterated making startup smoother.
  - Fixes reference counting of the DT nodes for constraints from Charles
    Keepax.  This has little practical impact since all real users of
    the regulator bindings use FDT which doesn't need the reference
    counting.
  - Lots of cleanups, especially to the Samsung drivers.
  - Support for Linear Technologies LTC3589, Texas Instruments TPS658640
    and X-Powers AXP20x.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTjaRuAAoJELSic+t+oim96AAP/jNtqLoBLIz6Idwg29Jd3Gj+
 X3R+5NfuS0kccvKvIbHmKygwJ6hY9anBsKQ28AH6VUAgcUqrPnWiRyl4iZAyMSQZ
 bweQ1QSAIxjAD9J+hMSMU65h3pKh7t6k20dumEUOJZ/ZuPmYj5aks3dy+DKSIkF2
 GDG1SVonxheuhUbxEPnXlz5pSnFtERQQMGPdYzk3RxqdeDeVr6Oanlxuo/IKagPP
 vm6BFFutEcSk4KpkEQF+iGxIDTzTFGjMe2TzDu1ubxsxcL+5sNh8rkN9rbqQ0fdo
 fGMZuo9AXEPXNDwY6ug0Mxoqhg0vrf8NSnEWjM6zQJELKH6H4KMhwAGjstCDkFer
 rsuZXeIM1Mk1wrPP6QWLvHVqwS9GUXki82ZgUpDOn61HpRLUu6bKY8eWoq3UM79S
 qiRoNSW7eggI0/71IrzumWWE8HEufEJEgGNAqwFPkBywCg+biXjkHlcXdyBMCpqy
 kUev0QVJb3FHBnyIdMAVm8hrreejh+frl2Nc+aIEhYZxc3idvVqKl1lvjbObt6PM
 FK52n8c/WlQxLZ8+isv0b1+pwT6QHeLzBvBA8mE6+Mn4vLzQKT4nofQU4PSASRSM
 UqkaSMhaaJ4WRXlNdhkp721EbRAltrTwzjMS/7lTTZRyN9g9ODOhDnzRT2f3J8F1
 JYS22jFTL5ywNR6GFcq0
 =JrfM
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into next

Pull regulator updates from Mark Brown:
 "The bulk of the changes for this release are a few new drivers however
  there are a couple of noticable core changes and the usual stream of
  cleanups and fixes:

   - move disable of unused regulators later in init so it comes after
     deferred probe has iterated making startup smoother.
   - fixes to reference counting of the DT nodes for constraints from
     Charles Keepax.  This has little practical impact since all real
     users of the regulator bindings use FDT which doesn't need the
     reference counting.
   - lots of cleanups, especially to the Samsung drivers.
   - support for Linear Technologies LTC3589, Texas Instruments
     TPS658640 and X-Powers AXP20x"

* tag 'regulator-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (64 commits)
  regulator: pbias: remove unnecessary OOM messages
  regulator: max8649: remove unnecessary OOM messages
  regulator: core: Fix the init of DT defined fixed regulators
  regulator: core: Disable unused regulators after deferred probing is done
  regulator: Don't disable unused regulators we don't have permission for
  regulator: axp20x: Use regulator_map_voltage_ascend for LDO4
  regulator: use of_property_read_{bool|u32}()
  regulator: Fix regulator_get_{optional,exclusive}() documentation
  regulators: Add definition of regulator_set_voltage_time() for !CONFIG_REGULATOR
  regulator: arizona-ldo1: add missing #include
  regulator: pfuze100: Support enable/disable for fixed regulator
  regulator: ltc3589: Remove ltc3589_list_voltage_fixed function
  regulator: ltc3589: Fix module dependency
  regulator: tps6586x: Remove unused to_tps6586x_dev() function
  regulator: tps65218: Convert to use regulator_set_voltage_time_sel
  regulator: tps6586x: Add support for the TPS658640
  regulator: tps6586x: Prepare supporting fixed regulators
  regulator: pfuze100: Don't allocate an invalid gpio
  regulator: pfuze100: Support SWB enable/disable
  regulator: fixed: use of_property_read_{bool|u32}()
  ...
2014-06-03 11:44:48 -07:00
Linus Torvalds
4046136afb Char / misc driver patches for 3.16-rc1
Here is the big char / misc driver updates for 3.16-rc1.
 
 Lots of different driver updates for a variety of different drivers and
 minor driver subsystems.
 
 All have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iEYEABECAAYFAlONWI8ACgkQMUfUDdst+ykvQACdGxTChdEU7edElDAXeelVmu8v
 D1UAoLDvqwUsN7t5v+WG2wkOvhf5MEA7
 =tVMP
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc into next

Pull char/misc driver patches from Greg KH:
 "Here is the big char / misc driver update for 3.16-rc1.

  Lots of different driver updates for a variety of different drivers
  and minor driver subsystems.

  All have been in linux-next with no reported issues"

* tag 'char-misc-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (79 commits)
  hv: use correct order when freeing monitor_pages
  spmi: of: fixup generic SPMI devicetree binding example
  applicom: dereferencing NULL on error path
  misc: genwqe: fix uninitialized return value in genwqe_free_sync_sgl()
  miscdevice.h: Simple syntax fix to make pointers consistent.
  MAINTAINERS: Add miscdevice.h to file list for char/misc drivers.
  mcb: Add support for shared PCI IRQs
  drivers: Remove duplicate conditionally included subdirs
  misc: atmel_pwm: only build for supported platforms
  mei: me: move probe quirk to cfg structure
  mei: add per device configuration
  mei: me: read H_CSR after asserting reset
  mei: me: drop harmful wait optimization
  mei: me: fix hw ready reset flow
  mei: fix memory leak of mei_clients array
  uio: fix vma io range check in mmap
  drivers: uio_dmem_genirq: Fix memory leak in uio_dmem_genirq_probe()
  w1: do not unlock unheld list_mutex in __w1_remove_master_device()
  w1: optional bundling of netlink kernel replies
  connector: allow multiple messages to be sent in one packet
  ...
2014-06-03 08:06:56 -07:00
Mark Brown
978371cbab Merge remote-tracking branch 'regulator/topic/tps6586x' into regulator-next 2014-06-02 17:08:14 +01:00
Mark Brown
b58e917bf9 Merge remote-tracking branches 'regulator/topic/s5m8767', 'regulator/topic/stub', 'regulator/topic/tps65090', 'regulator/topic/tps65217' and 'regulator/topic/tps65218' into regulator-next 2014-06-02 17:08:12 +01:00
Mark Brown
4c04ef25b8 Merge remote-tracking branches 'regulator/topic/palmas', 'regulator/topic/pbias', 'regulator/topic/pfuze100', 'regulator/topic/s2mpa01' and 'regulator/topic/s2mps11' into regulator-next 2014-06-02 17:08:08 +01:00
Mark Brown
2c7a6a3547 Merge remote-tracking branches 'regulator/topic/fixed', 'regulator/topic/id-const', 'regulator/topic/ltc3589', 'regulator/topic/max8649' and 'regulator/topic/of' into regulator-next 2014-06-02 17:08:05 +01:00
Mark Brown
8ff15e0909 Merge remote-tracking branches 'regulator/topic/arizona', 'regulator/topic/axp20' and 'regulator/topic/bcm590xx' into regulator-next 2014-06-02 17:08:03 +01:00
Mark Brown
42398dbdea Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2014-06-02 17:08:02 +01:00
Mark Brown
dc49f3d5eb Merge remote-tracking branch 'regulator/topic/constraints' into regulator-next 2014-06-02 17:08:01 +01:00
Mark Brown
277b1be9d4 Merge remote-tracking branch 'regulator/fix/s2mpa01' into regulator-linus 2014-06-02 17:07:59 +01:00
Jingoo Han
0ee42bb1f8 regulator: pbias: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-02 15:14:51 +01:00
Jingoo Han
6e27e99613 regulator: max8649: remove unnecessary OOM messages
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-02 15:12:16 +01:00
Alban Bedel
064d5cd110 regulator: core: Fix the init of DT defined fixed regulators
When a regulator is defined using DT and it has a single voltage the
regulator init always tries to apply this voltage. However it fails if
the regulator isn't settable because it is using an internal low level
function. To overcome this we now first query the regulator and only
set it if needed.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 19:19:43 +01:00
Saravana Kannan
fd482a3e3e regulator: core: Disable unused regulators after deferred probing is done
regulator_init_complete does a scan of regulators which dont have
always-on or consumers are automatically disabled as being unused.
However, with deferred probing, late_initcall() is too soon to
declare a regulator as unused as the regulator itself might not
have registered due to defferal - Example: A regulator deffered due
to i2bus not available which in turn is deffered due to pinctrl
availability.

Since deferred probing is done in late_initcall(), do the cleanup of
unused regulators by regulator_init_complete in late_initcall_sync
instead of late_initcall.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[nm@ti.com: minor rewording]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 19:16:12 +01:00
Mark Brown
e953583456 regulator: Don't disable unused regulators we don't have permission for
In the spirit of conservatism that governs our general approach to
permissions it is better if we don't touch regulators we weren't explicitly
given permissions to control. This avoids the need to explicitly specify
unknown regulators in DT as always on, if a regulator is not otherwise
involved in software control it can be omitted from the DT.

Regulators explicitly given constraints in DT still need to have an always
on constraint specified as before.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 19:16:11 +01:00
Axel Lin
b88703567b regulator: axp20x: Use regulator_map_voltage_ascend for LDO4
The voltages in axp20x_ldo4_data table are in ascendant order, so use
regulator_map_voltage_ascend.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 13:42:42 +01:00
Sergei Shtylyov
1e050eabb6 regulator: use of_property_read_{bool|u32}()
Use more compact of_property_read_{bool|u32}() calls instead of the
of_{find|get}_property() calls in of_get_regulation_constraints() where
possible (note that of_property_read_{bool|u32}() were already used to read
some properties).

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-01 11:56:23 +01:00
Stephen Boyd
69c3f7239e regulator: Fix regulator_get_{optional,exclusive}() documentation
regulator_get_optional() doesn't hold an exclusive reference to
the regulator. Fix the documentation and reword the exclusive
documentation to fix the grammatical error "this reference is
held".

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-28 21:25:24 +01:00
Arnd Bergmann
7b22b9a5ab regulator: arizona-ldo1: add missing #include
commit 2cce4be9e6 "regulator: arizona-ldo1: Add processing of init_data
from device tree" added a call to of_get_child_by_name() but
did not add an #include to the header file declaring that function.

I got a build error when doing randconfig testing on this, which
is fixed by this patch to include of.h.

drivers/regulator/arizona-ldo1.c:192:2: error: implicit declaration of function 'of_get_child_by_name' [-Werror=implicit-function-declaration]
drivers/regulator/arizona-ldo1.c:193:2: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
drivers/regulator/arizona-ldo1.c:213:2: error: implicit declaration of function 'of_node_put' [-Werror=implicit-function-declaration]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-27 20:52:42 +01:00
Axel Lin
ab3ca774a2 regulator: pfuze100: Support enable/disable for fixed regulator
Current code has .enable_reg and .enable_mask settings, but the implementation
for corresponding callbacks are missing. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Robin Gong <b38343@freescale.com>
Acked-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-27 12:25:57 +01:00
Axel Lin
c0c14e6af9 regulator: ltc3589: Remove ltc3589_list_voltage_fixed function
When fixed_uV is set and n_voltage is 1, regulator core will return
rdev->desc->fixed_uV in regulator_get_voltage() and regulator_list_voltage().

Rename ltc3589_standby_regulator_ops to ltc3589_fixed_standby_regulator_ops,
this makes the code clear that the ops is for fixed voltage regulator.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-27 12:06:35 +01:00
Axel Lin
ac1d686846 regulator: ltc3589: Fix module dependency
Make this driver depend on I2C and select REGMAP_I2C to fix build failure.
Also allows this driver to be built as module.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-27 12:06:32 +01:00
Axel Lin
ae8b70c9d8 regulator: tps6586x: Remove unused to_tps6586x_dev() function
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-27 12:04:39 +01:00
Axel Lin
5ab9be4274 regulator: tps65218: Convert to use regulator_set_voltage_time_sel
Use regulator_set_voltage_time_sel() instead of open-coded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 17:03:06 +01:00
Alban Bedel
6c46ccc8bb regulator: tps6586x: Add support for the TPS658640
The TPS658640 has a different set of output voltage for most LDO and
the RTC LDO isn't settable. This chip also report 2 different version
ID, as the datasheet doesn't list the possible values the second ID
has simply been named TPS658640v2.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 16:48:02 +01:00
Alban Bedel
ad0b40fee4 regulator: tps6586x: Prepare supporting fixed regulators
Add the required definitions and macros to allow easily adding fixed
regulators. This required for the TPS658640 that doesn't allow setting
the LDO_RTC output voltage.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 16:47:40 +01:00
Sean Cross
fe788b0955 regulator: pfuze100: Don't allocate an invalid gpio
Previously, the PFUZE100 would try to allocate gpio0 io0 because
config.ena_gpio defaults to 0, which can be a valid GPIO.  To prevent this
from happening, set this parameter to -EINVAL.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 16:45:23 +01:00
Sean Cross
a6dcf9782f regulator: pfuze100: Support SWB enable/disable
The SWB regulators have the ability to be turned on and off.  Add
enable/disable support for these regulators.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 16:45:16 +01:00
Sergei Shtylyov
4127f696f9 regulator: fixed: use of_property_read_{bool|u32}()
Use more compact of_property_read_{bool|u32}() calls instead of the
of_{find|get}_property() calls.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 16:19:36 +01:00
Philipp Zabel
3eb2c7ecb7 regulator: Add LTC3589 support
This patch adds support for the Linear Technology LTC3589, LTC3589-1,
and LTC3589-2 8-output I2C voltage regulator ICs.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 15:54:57 +01:00
Krzysztof Kozlowski
112da5cb43 regulator: s2mpa01: Use correct register for buck1 ramp delay
Fix the register for ramp delay of buck1 regulator. Buck1 and buck6
share the field (offset 4) in ramp delay register S2MPA01_REG_RAMP2.

The driver used the same register and field for ramp delay of buck3 and
buck1. This lead to updating of ramp delay of buck3 when setting buck1
and actually the ramp delay of buck1 was never set.

Fixes: f187927146 ("regulator: Add support for S2MPA01 regulator")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: <stable@vger.kernel.org>
2014-05-26 15:39:12 +01:00
Axel Lin
366986274c regulator: core: Use map_voltage_linear_range by default for list_voltage_linear_range
Use map_voltage_linear_range() if list_voltage_linear_range() is in use and
nothing is set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-26 14:36:55 +01:00
Lee Jones
9f8c0fe954 regulator: Constify the pointer to alias name array
Toughen-up checks for read-only regulator names.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-23 18:55:23 +01:00
Keerthy
dbabd624d4 regulator: palmas: Reemove open coded functions with helper functions
Reemove open coded functions with helper functions.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22 11:32:12 +01:00
Matt Porter
c6466950e9 regulator: bcm590xx: Add support for regulators on secondary I2C slave
The bcm590xx MFD driver now exposes a secondary regmap descriptor
making the registers for regulators on the secondary I2C slave address
available.  Add support for GPLDO1-6 and VBUS regulators found within
this register range.

Signed-off-by: Matt Porter <mporter@linaro.org>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-05-21 10:40:16 +01:00
Greg Kroah-Hartman
6a57bad6e7 Update extcon for v3.16
This patchset add resource-managed functions to automatically control the memory
 and unregistration operation of extcon. Also, This series support new MAX77836
 extcon device driver on existing MAX14577 device because existed a little
 difference between MAX77836 and MAX14577. Finally, Fix minor issue of extcon
 driver.
 
 Detailed description for patchset:
 1. Add resource-managed functions
 - Add resource-managed functions to automatically free the memory of extcon
 structure and to control unregistration behavior as following. This new devm_*
 functions applied all of extcon drivers in drivers/extcon/.
 : devm_extcon_dev_register/unregister()
 : devm_extcon_dev_allocate/free()
 : extcon_dev_allocate/free() for devm_extcon_dev_allocate/free()
 
 2. Add new MAX77836 extcon device
 - Support MAX77836 device on existing MAX14577 device driver using
 different compatible string. This patchset has dependency on MFD/
 Regulator/Extcon. So, Lee Jones(MFD Maintainer) created Immutable
 branch between MFD and Extcon due for v3.16 merge-window and then
 I merged this patchset from MFD git repo[1] to Extcon git repo.
 : [1] git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
   (branch: ib-mfd-extcon-3.16)
 
 3. Fix minor issue of extcon driver
 - extcon-palmas driver
 : Fix issue of extcon device name for probe
 - extcon-max14577
 : Fix probe failure about handling wrong return value.
 : Properly Handle return value of regmap_irq_get_virq function.
 - extcon-max8997/max77693 driver
 : Fix NULL pointer exception on missing pdata
 
 4. Code clean for extcon driver
 - extcon-max8997/max77693
 : Use power efficient workqueue for delayed cable detection
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTepzmAAoJEJzN3yze689TSHMP/2l/pzI1IVqEQIzDnf6ga9AT
 rHo7kdLya+TxLBggasj21N9jprI3145bkWBL00EcnZkqrav7ctnU71347u7wkMzg
 pREYwK0OZAeF33rjbCrCPVrUL55XuTzipf4phtcKDSxmbFh/OdRZe4/vOEo0mBxE
 kTKb0zaePz0jeCur/ajxnZ1E/2DkKTsvUyiYSUYQ1FAjY4RvKkW/3qDYXqMetoYZ
 7sJdH5cpbsdGdQj74axuFWqvnINH1i9LY2gGw30tLKa7D15r72wBfA9HuRB/P5XB
 prvVb19wYLgkfxevZenvDjmyqeMUkFnk2a25Ntd3xndeaBJSCIM9y9tXxtz/fWyq
 ZPgsE0ma/E2PkKt4c4/mg1BzAGyL8lXU0SEivp03iLV3ByK2rmug7NdwG0Tw0/iE
 rcx3cdr7QvK4wSgaOt2Hcv+QLqXDZ7onrt3fhx+eHyD5X1ThRCCKbdr+H08eWnqw
 zGJQ6Ru4nrzZ1NS8bJuAjpKLfWwEWhN1QwvJ/Aw13yP/CIRtWgik+m1cUVTZriJL
 rlcdKJHbs8lGw07oROurmcEcKCBdr8HDZ4Ajht4qv7LQnYZK4q1N7xbbaI1tqTjb
 CawoA2ZfZMjNPkt97wwYselL2eRHVEHg5AwhzhVVPzbf/GxGU3GR2NLUeJBzbTaQ
 TtZbRo8l8GRGT5dGp86J
 =7wRd
 -----END PGP SIGNATURE-----

Merge tag 'extcon-next-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon for v3.16

This patchset add resource-managed functions to automatically control the memory
and unregistration operation of extcon. Also, This series support new MAX77836
extcon device driver on existing MAX14577 device because existed a little
difference between MAX77836 and MAX14577. Finally, Fix minor issue of extcon
driver.

Detailed description for patchset:
1. Add resource-managed functions
- Add resource-managed functions to automatically free the memory of extcon
structure and to control unregistration behavior as following. This new devm_*
functions applied all of extcon drivers in drivers/extcon/.
: devm_extcon_dev_register/unregister()
: devm_extcon_dev_allocate/free()
: extcon_dev_allocate/free() for devm_extcon_dev_allocate/free()

2. Add new MAX77836 extcon device
- Support MAX77836 device on existing MAX14577 device driver using
different compatible string. This patchset has dependency on MFD/
Regulator/Extcon. So, Lee Jones(MFD Maintainer) created Immutable
branch between MFD and Extcon due for v3.16 merge-window and then
I merged this patchset from MFD git repo[1] to Extcon git repo.
: [1] git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
  (branch: ib-mfd-extcon-3.16)

3. Fix minor issue of extcon driver
- extcon-palmas driver
: Fix issue of extcon device name for probe
- extcon-max14577
: Fix probe failure about handling wrong return value.
: Properly Handle return value of regmap_irq_get_virq function.
- extcon-max8997/max77693 driver
: Fix NULL pointer exception on missing pdata

4. Code clean for extcon driver
- extcon-max8997/max77693
: Use power efficient workqueue for delayed cable detection
2014-05-20 09:44:38 +09:00
Boris BREZILLON
a6016c523e regulator: AXP20x: fix wrong call to of_find_node_by_name
The of_find_node_by_name function will search for a DT node named
"regulators" after the provided np node, but will not ensure that this node
is a child of np.
This might result in retrieving a "regulators" node that is not related to
the axp20x PMIC.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:40:06 +01:00
Krzysztof Kozlowski
0608032a90 regulator: s2mpa01: Use rdev_get_id() to access id of regulator
Use regulator API rdev_get_id() to access id of regulator.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-17 14:30:06 +01:00
Krzysztof Kozlowski
b203e0dfe1 regulator: s2mps11: Fix accidental enable of buck6 ramp delay
S2MPS11 supports enabling/disabling ramp delay only for buck[2346].
Other bucks have ramp delay enabled always.

However the bit shift for enabling buck6 ramp delay in register is equal
to 0. When ramp delay was set for the bucks unsupporting enable/disable
(buck[15789] and buck10), the ramp delay for buck6 was also enabled.

Fixes: b96244fad9 ("regulator: s2mps11: Don't check enable_shift before setting enable ramp rate")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-17 14:29:26 +01:00
Krzysztof Kozlowski
51e2fc0a25 regulator: s2mpa01: Fix accidental enable of buck4 ramp delay
S2MPA01 supports enabling/disabling ramp delay only for buck[1234].
Other bucks have ramp delay enabled always.

However the bit shift for enabling buck4 ramp delay in register is equal
to 0. When ramp delay was set for the bucks unsupporting enable/disable
(buck[56789] and buck10), the ramp delay for buck4 was also enabled.

Fixes: f7b1a8dc1c ("regulator: s2mpa01: Don't check enable_shift before setting enable ramp rate")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-17 14:28:09 +01:00
Pawel Moll
3b9334ac83 mfd: vexpress: Convert custom func API to regmap
Components of the Versatile Express platform (configuration
microcontrollers on motherboard and daughterboards in particular)
talk to each other over a custom configuration bus. They
provide miscellaneous functions (from clock generator control
to energy sensors) which are represented as platform devices
(and Device Tree nodes). The transactions on the bus can
be generated by different "bridges" in the system, some
of which are universal for the whole platform (for the price
of high transfer latencies), others restricted to a subsystem
(but much faster).

Until now drivers for such functions were using custom "func"
API, which is being replaced in this patch by regmap calls.
This required:

* a rework (and move to drivers/bus directory, as suggested
  by Samuel and Arnd) of the config bus core, which is much
  simpler now and uses device model infrastructure (class)
  to keep track of the bridges; non-DT case (soon to be
  retired anyway) is simply covered by a special device
  registration function

* the new config-bus driver also takes over device population,
  so there is no need for special matching table for
  of_platform_populate nor "simple-bus" hack in the arm64
  model dtsi file (relevant bindings documentation has
  been updated); this allows all the vexpress devices
  fit into normal device model, making it possible
  to remove plenty of early inits and other hacks in
  the near future

* adaptation of the syscfg bridge implementation in the
  sysreg driver, again making it much simpler; there is
  a special case of the "energy" function spanning two
  registers, where they should be both defined in the tree
  now, but backward compatibility is maintained in the code

* modification of the relevant drivers:

  * hwmon - just a straight-forward API change
  * power/reset driver - API change
  * regulator - API change plus error handling
    simplification
  * osc clock driver - this one required larger rework
    in order to turn in into a standard platform driver

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Mike Turquette <mturquette@linaro.org>
2014-05-15 17:02:18 +01:00
Rusty Russell
71e06af26c drivers/regulator/virtual: avoid world-writable sysfs files.
In line with practice for module parameters, we're adding a build-time
check that sysfs files aren't world-writable.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-05-14 10:53:55 +09:30
Charles Keepax
6f1c9c57b4 regulator: arizona-micsupp: Add missing #include
of.h is presently being included through asm-generic/gpio.h so will not
be included on some architectures, causing implicit declaration errors
for of_get_child_by_name, of_parse_phandle and of_node_put.

This patch adds the direct include that should be there.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:16:51 +01:00
Jingoo Han
cfe6e3334e regulator: max8952: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:56:47 +01:00
Jingoo Han
1439afd8db regulator: vexpress: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:56:25 +01:00
Jingoo Han
a74cf0c207 regulator: st-pwm: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:56:09 +01:00
Jingoo Han
2449df9f90 regulator: palmas: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:55:41 +01:00
Jingoo Han
a799baab12 regulator: anatop: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:55:41 +01:00
Doug Anderson
c122c5b682 regulator: tps65090: Fix tps65090 crash on Tegra Dalmore
The patch (60e91b5 regulator: tps65090: Allow setting the overcurrent
wait time) introduced a crash on Tegra Dalmore.  On Dalmore the device
tree doesn't have an entry for all of the FETs so it leaves tps_pdata
NULL in some cases.  Add a check for NULL like the rest of the code
does.

Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:33:30 -07:00