Commit Graph

13 Commits

Author SHA1 Message Date
Uwe Kleine-König 9816d85923 mfd: Switch i2c drivers back to use .probe()
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230515182752.10050-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
2023-06-15 09:19:37 +01:00
Uwe Kleine-König 4a36fb2672 mfd: as3711: Convert to i2c's .probe_new()
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221118224540.619276-420-uwe@kleine-koenig.org
2022-12-07 13:27:20 +00:00
Thomas Gleixner aecd8454c0 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 312
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the version 2 of the gnu general public
  license as published by the free software foundation

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 3 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Armijn Hemel <armijn@tjaldur.nl>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000434.524820338@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:37:04 +02:00
Paul Gortmaker 1e89d90746 mfd: as3711: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_AS3711
drivers/mfd/Kconfig:    bool "AMS AS3711"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-02-01 08:21:13 +00:00
Laxman Dewangan 9c9983267d mfd: as3711: Use devm_mfd_add_devices() for mfd_device registration
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-04-19 07:54:50 +01:00
Maciej S. Szmigiero e9b7ba7954 mfd: as3711: Set regmap config reg counts properly
Regmap config max_register field should contain number of
device last register, however num_reg_defaults_raw field
should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value,
fix this by introducing separate defines for max register
number and total count of registers.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-03-16 08:50:34 +00:00
Lee Jones ae487ae2ac mfd: as3711: Repair OOM and 'line over 80 chars' formatting warnings
WARNING: Possible unnecessary 'out of memory' message
+               if (!pdata) {
+                       dev_err(&client->dev, "Failed to allocate pdata\n");

WARNING: Possible unnecessary 'out of memory' message
+       if (!as3711) {
+               dev_err(&client->dev, "Memory allocation failed\n");

WARNING: line over 80 characters
+               dev_err(&client->dev, "regmap initialization failed: %d\n", ret);

WARNING: line over 80 characters
+       /* We can reuse as3711_subdevs[], it will be copied in mfd_add_devices() */

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].platform_data = &pdata->regulator;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_REGULATOR].pdata_size = sizeof(pdata->regulator);

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].platform_data = &pdata->backlight;

WARNING: line over 80 characters
+               as3711_subdevs[AS3711_BACKLIGHT].pdata_size = sizeof(pdata->backlight);

total: 0 errors, 8 warnings, 236 lines checked

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-01-14 08:43:59 +00:00
Krzysztof Kozlowski 0e777366fb mfd: Drop owner assignment from i2c_drivers
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11 15:08:48 +01:00
Krzysztof Kozlowski 445603030c mfd: as3711: Make of_device_id array const
Array of struct of_device_id may be be const as expected by
of_match_table field.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03 08:11:38 +01:00
Sachin Kamat 0af6f271d0 mfd: as3711: Include linux/of.h header
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid breakage in the future.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-10-23 16:22:03 +01:00
Jingoo Han 334a41ce9b mfd: Use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-07-31 13:01:29 +01:00
Guennadi Liakhovetski 64710af3e2 mfd: as3711: Add OF support
Add Flat Device Tree support to the AS3711 MFD driver. This patch just
allows to bind the driver to I2C devices, instantiated from the DT.
DT support for AS3711 cell drivers will be added in separate drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-05 11:20:14 +02:00
Guennadi Liakhovetski acad189b08 mfd: Add an AS3711 PMIC MFD driver
AS3711 is a PMIC with multiple DCDC and LDO power supplies, GPIOs, an RTC,
a battery charger and a general purpose ADC. This patch adds support for
the MFD with support for a regulator driver and a backlight driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-23 12:09:19 +01:00