Current code is using devm_regulator_register(), so we don't need to store *rdev
in struct lp872x for clean up.
Also clean up lp872x_probe() a bit to remove unnecessary goto and num_regulators
variable.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Regulator drivers should not be specifying constraints since the valid
configurations depend on how the device is used in a given system, there
is no way to know if a configuration is safe for a given board.
Signed-off-by: Mark Brown <[email protected]>
Propagate the error values returned by the function instead.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Fix a warning below.
drivers/regulator/lp872x.c:910:33: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
And checkpatch warnings are fixed.
WARNING: space prohibited before semicolon
Signed-off-by: Milo Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch enables the DT structure of the LP8720 and LP8725 device.
The LP872x platform data is generated when the device tree is configured.
Even if the platform data is NULL, it is no issue at all because the driver is
configured with the default mode.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
There is only one user calling _rdev_to_offset() function.
Remove _rdev_to_offset() makes the code simpler.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.
Signed-off-by: Bill Pemberton <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.
Signed-off-by: Bill Pemberton <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The lp872x_check_dvs_validity() is used for checking DVS platform data.
If the DVS platform data is not defined, return as error code.
Now, this is unnecessary because the default DVS mode is set in this case.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The lp872x_set_dvs() is used for changing the DVS pin state.
This function works only when the DVS platform data is defined.
So don't assume that DVS data is always valid.
In case the platform data is not defined, the DVS data is set to NULL
for skipping the DVS pin control.
DVS selection and GPIO pin number are used for the LP872x DVS pin control.
For better readability, DVS selection argument is added in lp872x_set_dvs().
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The platform specific configuration(general_config) is optional.
However, the DVS settings should be configured explicitly while
loading the driver.
This patch enables configuring the default DVS mode even though
the platform data is not defined.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The lp872x driver has the DVS platform data which select the register address
of the BUCK voltage.
This patch enables updating the default DVS mode when the DVS platform data
is not defined.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch enables registering the regulator driver even though
the regulator_init_data is not defined in the platform side.
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Pass regulator id rahter than the index to lp872x_find_regulator_init_data(),
then the code can be simpler.
We can also get max_regulators by lp->num_regulators.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Milo(Woogyom) Kim <[email protected]>
Tested-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Use err log rather than warning message when the platform data is NULL
Signed-off-by: Milo(Woogyom) Kim <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Return -EINVAL if pdata is NULL, otherwise we have NULL dereference bug.
This patch also moves the code checking pdata earlier in lp872x_probe.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>