platform/kernel/linux-rpi.git
3 years agoiio: dac: dac5571: Support powerdown for multi-channel
Vincent Whitchurch [Tue, 4 Aug 2020 09:31:38 +0000 (11:31 +0200)]
iio: dac: dac5571: Support powerdown for multi-channel

The driver currently only allows channel 0 to be powered down but the
multi-channel variants of the hardware allow each channel to be powered
down separately and with separate power down modes.  Add support for
this.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Acked-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: humidity: Add TI HDC20x0 support
Eugene Zaikonnikov [Fri, 7 Aug 2020 14:38:53 +0000 (16:38 +0200)]
dt-bindings: iio: humidity: Add TI HDC20x0 support

Add device tree bindings for HDC2010/HDC2080 family of humidity and
temperature sensors.

Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: humidity: Add TI HDC20x0 support
Eugene Zaikonnikov [Fri, 7 Aug 2020 14:17:55 +0000 (16:17 +0200)]
iio: humidity: Add TI HDC20x0 support

Add driver support for HDC2010/2080 series devices and sysfs
documentation for their heater element.

HDC2010 is an integrated high-accuracy humidity and temperature sensor
with very low power consumption. The device includes a resistive heating
element. The temperature range is -40C to 125C with 0.2C
accuracy. Humidity measurement is 0 to 100% with 2% RH accuracy.

Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use irq trigger flags from firmware
Stephen Boyd [Mon, 3 Aug 2020 23:58:15 +0000 (17:58 -0600)]
iio: sx9310: Use irq trigger flags from firmware

We shouldn't need to set default irq trigger flags here as the firmware
should have properly indicated the trigger type, i.e. level low, in the
DT or ACPI tables.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Enable vdd and svdd regulators at probe
Stephen Boyd [Mon, 3 Aug 2020 23:58:14 +0000 (17:58 -0600)]
iio: sx9310: Enable vdd and svdd regulators at probe

Enable the main power supply (vdd) and digital IO power supply (svdd)
during probe so that the i2c communication and device works properly on
boards that aggressively power gate these supplies.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Drop channel_users[]
Stephen Boyd [Mon, 3 Aug 2020 23:58:13 +0000 (17:58 -0600)]
iio: sx9310: Drop channel_users[]

This struct member isn't used. Drop it.

Fixes: 72ad02b15d63 ("iio: Add SEMTECH SX9310/9311 sensor driver")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Daniel Campello <campello@chromium.org>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Miscellaneous format fixes
Daniel Campello [Mon, 3 Aug 2020 23:58:12 +0000 (17:58 -0600)]
iio: sx9310: Miscellaneous format fixes

Miscellaneous format fixes throughout the whole file.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use variable to hold &client->dev
Daniel Campello [Mon, 3 Aug 2020 23:58:11 +0000 (17:58 -0600)]
iio: sx9310: Use variable to hold &client->dev

Improves readability by storing &client->dev in a local variable.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Simplify error return handling
Daniel Campello [Mon, 3 Aug 2020 23:58:10 +0000 (17:58 -0600)]
iio: sx9310: Simplify error return handling

Checks for non-zero return values to signal error conditions.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Update copyright
Daniel Campello [Mon, 3 Aug 2020 23:58:09 +0000 (17:58 -0600)]
iio: sx9310: Update copyright

Fixes wrong copyright year.

Signed-off-by: Daniel Campello <campello@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use regmap_read_poll_timeout() for compensation
Daniel Campello [Mon, 3 Aug 2020 23:58:08 +0000 (17:58 -0600)]
iio: sx9310: Use regmap_read_poll_timeout() for compensation

Simplify compensation stage by using regmap_read_poll_timeout().

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Use long instead of int for channel bitmaps
Daniel Campello [Mon, 3 Aug 2020 23:58:07 +0000 (17:58 -0600)]
iio: sx9310: Use long instead of int for channel bitmaps

Uses for_each_set_bit() macro to loop over channel bitmaps.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Fixes various memory handling
Daniel Campello [Mon, 3 Aug 2020 23:58:06 +0000 (17:58 -0600)]
iio: sx9310: Fixes various memory handling

Makes use __aligned(8) to ensure that the timestamp is correctly aligned
when we call io_push_to_buffers_with_timestamp().
Also makes use of sizeof() for regmap_bulk_read instead of static value.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Change from .probe to .probe_new
Daniel Campello [Mon, 3 Aug 2020 23:58:05 +0000 (17:58 -0600)]
iio: sx9310: Change from .probe to .probe_new

Uses .probe_new in place of .probe. Also uses device_get_match_data()
for whoami matching.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Remove acpi and of table macros
Daniel Campello [Mon, 3 Aug 2020 23:58:04 +0000 (17:58 -0600)]
iio: sx9310: Remove acpi and of table macros

Avoids unused warnings due to acpi/of table macros.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Fix irq handling
Daniel Campello [Mon, 3 Aug 2020 23:58:03 +0000 (17:58 -0600)]
iio: sx9310: Fix irq handling

Fixes enable/disable irq handling at various points. The driver needs to
only enable/disable irqs if there is an actual irq handler installed.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: sx9310: Update macros declarations
Daniel Campello [Mon, 3 Aug 2020 23:58:02 +0000 (17:58 -0600)]
iio: sx9310: Update macros declarations

Follows spec sheet for macro declarations.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: Add bindings for sx9310 sensor
Daniel Campello [Mon, 3 Aug 2020 23:58:01 +0000 (17:58 -0600)]
dt-bindings: iio: Add bindings for sx9310 sensor

Adds device tree bindings for sx9310 sensor.

Signed-off-by: Daniel Campello <campello@chromium.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Rob Herring <robh+dt@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
[swboyd@chromium.org: Add both regulators and make them optional]
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: maxim,max1118 yaml conversion
Jonathan Cameron [Sat, 1 Aug 2020 17:58:50 +0000 (18:58 +0100)]
dt-bindings: iio: adc: maxim,max1118 yaml conversion

Simple device with a simple conversion.  Special handling needed
for the max1118 which is the only supported part that has an external
reference voltage.

Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agoiio: light: as73211: New driver
Christian Eggers [Wed, 5 Aug 2020 05:57:44 +0000 (07:57 +0200)]
iio: light: as73211: New driver

Support for AMS AS73211 JENCOLOR(R) Digital XYZ Sensor.

This driver has no built-in trigger. In order for making triggered
measurements, an external (software) trigger driver like
iio-trig-hrtimer or iio-trig-sysfs is required.

The sensor supports single and continuous measurement modes. The latter
is not used by design as this would require tight timing synchronization
between hardware and driver without much benefit.

Datasheet: https://ams.com/documents/20143/36005/AS73211_DS000556_3-01.pdf
Signed-off-by: Christian Eggers <ceggers@arri.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: light: add AMS AS73211 support
Christian Eggers [Wed, 5 Aug 2020 05:57:43 +0000 (07:57 +0200)]
dt-bindings: iio: light: add AMS AS73211 support

Add DT bindings for AMS AS73211 XYZ True Color Sensor.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: iio: ad9834: Remove excess blank line
Calvin Glisson [Wed, 5 Aug 2020 22:23:00 +0000 (15:23 -0700)]
staging: iio: ad9834: Remove excess blank line

Remove excess blank line after variable declarations.
Improves code consistency and readability.
Change suggested by checkpatch.pl:

CHECK: Please don't use multiple blank lines

Signed-off-by: Calvin Glisson <taragaram@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoplatform_data: ad7793.h: drop a duplicated word
Randy Dunlap [Sun, 19 Jul 2020 00:30:40 +0000 (17:30 -0700)]
platform_data: ad7793.h: drop a duplicated word

Drop the repeated word "and" in a comment.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: adc: maxim,max9611 yaml conversions
Jonathan Cameron [Wed, 22 Jul 2020 17:12:24 +0000 (18:12 +0100)]
dt-bindings: iio: adc: maxim,max9611 yaml conversions

Straight forward conversion of this binding for this
current sense amplifier and ADC.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: iio: adc: maxim,max11100 yaml conversion
Jonathan Cameron [Wed, 22 Jul 2020 17:12:22 +0000 (18:12 +0100)]
dt-bindings: iio: adc: maxim,max11100 yaml conversion

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
3 years agodt-bindings: iio: gyro: Add DT binding doc for ADXRS290
Nishant Malpani [Sun, 26 Jul 2020 14:10:26 +0000 (19:40 +0530)]
dt-bindings: iio: gyro: Add DT binding doc for ADXRS290

Add devicetree binding document for ADXRS290, a dual-axis MEMS gyroscope.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: gyro: Add driver support for ADXRS290
Nishant Malpani [Sun, 26 Jul 2020 14:10:16 +0000 (19:40 +0530)]
iio: gyro: Add driver support for ADXRS290

ADXRS290 is a high performance MEMS pitch and roll (dual-axis in-plane)
angular rate sensor (gyroscope) designed for use in stabilization
applications. It also features an internal temperature sensor and
programmable high-pass and low-pass filters.

Add support for ADXRS290 in direct-access mode for now.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoStaging: iio: Fixed a punctuation and a spelling mistake.
Ankit Baluni [Wed, 29 Jul 2020 08:11:55 +0000 (13:41 +0530)]
Staging: iio: Fixed a punctuation and a spelling mistake.

Added a missing comma and changed 'it it useful' to 'it is useful'.

Signed-off-by: Ankit Baluni <b18007@students.iitmandi.ac.in>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: trigger: make stub functions static inline
Lars-Peter Clausen [Mon, 20 Jul 2020 13:51:33 +0000 (16:51 +0300)]
iio: trigger: make stub functions static inline

Make sure that the trigger function stubs are all static inline.
Otherwise we might see compiler warnings about declared but unused
functions.

Fixes 77712e5fbe2e4: ("Staging: iio: Staticise non-exported functions")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agodt-bindings: iio: chemical: add O2 EZO module documentation
Matt Ranostay [Mon, 20 Jul 2020 07:03:29 +0000 (00:03 -0700)]
dt-bindings: iio: chemical: add O2 EZO module documentation

Cc: devicetree@vger.kernel.org
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: Kconfig: ad8366: add entry for HMC1119 chip
Alexandru Ardelean [Mon, 20 Jul 2020 13:52:37 +0000 (16:52 +0300)]
iio: Kconfig: ad8366: add entry for HMC1119 chip

The change is mostly cosmetic. When looking into the menuconfig help of the
ad8366 driver, the HMC1119 chip should also show up (since the driver
supports it).

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adxl372_i2c: Add OF device ID table
Stefan Popa [Wed, 22 Jul 2020 07:30:03 +0000 (10:30 +0300)]
iio: adxl372_i2c: Add OF device ID table

The driver does not have a struct of_device_id table, but supported
devices are registered via Device Trees. This patch adds OF device ID
table.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: adxl372_spi: change indentation for of_table
Alexandru Ardelean [Wed, 22 Jul 2020 07:25:46 +0000 (10:25 +0300)]
iio: adxl372_spi: change indentation for of_table

The change is mostly stylistic. The table should be indented with tabs
instead of spaces.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: frequency: ad9523: convert rest of driver to device managed functions
Alexandru Ardelean [Wed, 22 Jul 2020 07:22:01 +0000 (10:22 +0300)]
iio: frequency: ad9523: convert rest of driver to device managed functions

The driver pretty much uses device managed functions. The only left-over is
the iio_device_register() function, which also requires an action-or-reset
hook to disable the regulator on the remove and error path.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: chemical: atlas-ezo-sensor: add support for O2 sensor
Matt Ranostay [Thu, 23 Jul 2020 06:29:44 +0000 (09:29 +0300)]
iio: chemical: atlas-ezo-sensor: add support for O2 sensor

Add support for the Atlas EZO O2 chemical sensor which required
some refactoring of the driver and parsing of i2c transfer.

Sensor data is converted by the scaling value from percent to
IIO_CONCENTRATION.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agoiio: add IIO_MOD_O2 modifier
Matt Ranostay [Thu, 23 Jul 2020 06:29:43 +0000 (09:29 +0300)]
iio: add IIO_MOD_O2 modifier

Add modifier IIO_MOD_O2 for O2 concentration reporting

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 years agostaging: hikey9xx: Kconfig: add regulator dependency
Mauro Carvalho Chehab [Tue, 18 Aug 2020 16:04:48 +0000 (18:04 +0200)]
staging: hikey9xx: Kconfig: add regulator dependency

The regulator driver needs it, as otherwise it will produce
errors when creating vmlinux.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/a287238bd0141aa68aae7d4cec4c1174a43b3e53.1597766680.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: emxx_udc: Allow for building on !ARM
Alex Dewar [Tue, 18 Aug 2020 15:11:29 +0000 (16:11 +0100)]
staging: emxx_udc: Allow for building on !ARM

Currently the module can only be test built on ARM, although it seems to
build fine on x86. Change this to allow for broader test coverage.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200818151133.583382-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMAINTAINERS: add an entry for HiSilicon 6421v600 drivers
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:58 +0000 (16:58 +0200)]
MAINTAINERS: add an entry for HiSilicon 6421v600 drivers

Add an entry for the SPMI, MFD and PMIC parts of the
HiSilicon 6421v600 support.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/14b009ef0255d61eeaf4273e9c36dafdb1e5e12f.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agodt: document HiSilicon SPMI controller and mfd/regulator properties
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:57 +0000 (16:58 +0200)]
dt: document HiSilicon SPMI controller and mfd/regulator properties

Add documentation for the properties needed by the HiSilicon
6421v600 driver, and by the SPMI controller used to access
the chipset.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/56c40a260bf31edf7049f50586c63ee0d06e02cb.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: Simplify the compatible string
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:56 +0000 (16:58 +0200)]
staging: mfd: hi6421-spmi-pmic: Simplify the compatible string

It is clear that this driver is for PMIC. So, get rid of
it at the compatible.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/12bdc9b4734e156098408d0d27256abdc91ac283.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: change compatible string
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:55 +0000 (16:58 +0200)]
staging: spmi: hisi-spmi-controller: change compatible string

Add the chipset name at the compatible string, as other
HiSilicon chipsets with SPMI bus might require something
different.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/f34062e82b5d5ee49aab4f9055b44e42e5023f0a.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: get rid of interrupt properties
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:54 +0000 (16:58 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of interrupt properties

Both irqnum and irqarray properties reflect the same thing:
the number of bits and bytes for interrupts at this
chipset. E. g.:

irqnum = 8 x irqarray

This can be seen by the way pending interrupts are handled:

/* During probe time */
pmic->irqs = devm_kzalloc(dev, pmic->irqnum * sizeof(int), GFP_KERNEL);

/* While handling IRQs */
for (i = 0; i < pmic->irqarray; i++) {
pending = hi6421_spmi_pmic_read(pmic, (i + pmic->irq_addr));
pending &= 0xff;

for_each_set_bit(offset, &pending, 8)
generic_handle_irq(pmic->irqs[offset + i * 8]);

}

Going further, there are some logic at the driver which assumes
that irqarray is 2:

/* solve powerkey order */
if ((i == HISI_IRQ_KEY_NUM) &&
    ((pending & HISI_IRQ_KEY_VALUE) == HISI_IRQ_KEY_VALUE)) {
generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_DOWN]);
generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_UP]);
pending &= (~HISI_IRQ_KEY_VALUE);
}

As HISI_IRQ_KEY_DOWN and HISI_IRQ_KEY_UP are fixed values
and don't depend on irqnum/irqarray.

The IRQ addr and mask addr seem to be also fixed, based on some
comments at the OF parsing code. So, get rid of them too,
removing the of parsing function completely.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/e231244e42cb5b56240705cac2f987e11a078038.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hikey9xx: fix Kconfig dependency chain
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:53 +0000 (16:58 +0200)]
staging: hikey9xx: fix Kconfig dependency chain

Both the SPMI controller and the SPMI PMIC driver
depends on the SPMI bus support.

The dependency for the regulator is also wrong:
it should depends on the SPMI version of the HiSilicon 6421,
and not on the normal one.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1b7e23500e7449593393115cc0954af441b0c730.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: hikey9xx: add a TODO list
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:11:00 +0000 (09:11 +0200)]
staging: hikey9xx: add a TODO list

Place the things that are needed to be able to move those
drivers out of staging.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/bf3ebe32125646e0a87a59280392e8c6fda08488.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: code cleanup
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:59 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: code cleanup

Do some code cleanup in order to make it cleaner for moving
it out of staging in the future.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/32fadb359c1817992af78052e2d9448b8c5fc61f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:58 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: add it to the building system

Change the binding logic to ensure that the PMIC SPMI
driver will run before the regulator code and add it to the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/2992dc49945dcfb07c4bd96fa5c288c4e679701a.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: fix some coding style issues
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:57 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: fix some coding style issues

Fix the remaining issues complained by checkpatch.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/af5101fa2ab1d267ac5ac22603f95c6065ac110f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: cleanup DT settings
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:56 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup DT settings

Currently, an array is used to store both vsel and enable
settings, mixing registers, masks and bit settings.

Change it in order to have one separate property for each.

This makes easier to understand the contents of the DT
file, and to describe it at the Documentation/.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/fd72215b0a7da55dd727c2d7bd01c047a46cdd2e.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: initialize ramp_delay
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:55 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: initialize ramp_delay

Without that, the regulator's core complains with:

       ldo17: ramp_delay not set

For now, use the enable time, as we don't have any datasheets from
this device.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/67df5456e4f23c88ab4fd9331eb8202c3952e5c5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: add a driver-specific debug macro
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:54 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: add a driver-specific debug macro

Using dev_dbg() is not too nice, as, instead of printing the
name of the regulator, it prints "regulator.<number>", making
harder to associate what is happening with each ldo line.

So, add a debug-specific macro, which will print the rdev's
name, just like the regulator core.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1690b8531b23910aa915bd2725410b926022c481.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: don't use usleep_range for off_on_delay
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:53 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: don't use usleep_range for off_on_delay

The regulator's core already handles it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4f17adca2b04c401e5de5556700638648ce25c0c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: convert to use get/set voltage_sel
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:52 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: convert to use get/set voltage_sel

As the supported LDOs on this driver are all using a selector,
change the implementation to use get_voltage_sel and
set_voltage_sel ops.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1cf4f26540e65ffbb561c7d52e53f6be5bd63ac4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: change namespace
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:51 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: change namespace

Rename the functions used internally inside the driver in
order for them to follow the driver's name.

While here, get rid of some unused definitions at the
header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5cda96baef9374a096a7a0c8f76f60491b0084c7.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: better handle modes
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:50 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: better handle modes

Instead of implementing a custom set of properties, set
valid_modes_mask based on having or not a mask for enabling
the eco_mode.

This makes the code clearer, and remove some uneeded props
from DT.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/0f4ac5a4167bbca428c8507b6992acd8b3ebabd1.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: use shorter names for OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:49 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: use shorter names for OF properties

Simplify the names of the OF properties, in order to make
them similar to other drivers and to make easier to understand
what each property means.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/98f66100263940901ba59ec187919e9cf5e64f31.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: cleanup debug messages
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:48 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup debug messages

- use dev_foo() instead of pr_foo();
- cleanup the messages, making them more standard and easier
  to understand.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/2d17e168031340da73e1bd1c826289ceba2dbe8f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: cleanup struct hisi_regulator
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:47 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup struct hisi_regulator

There are several fields on this struct that can be removed,
as they already exists at struct regulator_desc.

Remove them, cleaning up the code in the process.

While here, rename it to hi6421v600_regulator_info, in order
to better match the driver's name.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/648d48f11368a9869d760c2bd54bfbc3feb4f44c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: change the binding logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:46 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: change the binding logic

Change the binding logic to ensure that the PMIC SPMI
driver will run before the regulator code and add it to the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/aa40d443dfc6c8e69e4c36fa79d15459762924e4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: coding style fixups
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:45 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: coding style fixups

There are several issues on those drivers related to their
coding style. Solve most of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/9ea7fdc004c7c44ae513b6c8f6c4a4493dd1ac61.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: port it to upstream
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:44 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: port it to upstream

The driver was originally written for Kernel 4.9. It needs to
be ported to upstream:

- Got rid of timeval;
- Removed a bogus dependency;
- Did cleanups at the header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/9e34400d2cc15ef501a8478f69a95c9abc5c4d8d.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: hi6421v600-regulator: get rid of unused code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:43 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: get rid of unused code

Get rid of the sysfs code and other parts of the driver
which aren't needed upstream.

If needed later, this patch can be (partially?) reversed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/698b2c7bdc92e336d2559bc65415807499b0e3a8.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC
Mayulong [Mon, 17 Aug 2020 07:10:42 +0000 (09:10 +0200)]
staging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC

Add the regulator driver for the LDO lines provided by the
HiSilicon 6421v600 SPMI PMIC device.

[mchehab+huawei@kernel.org: keep just the regulator driver on this patch,
 renaming it to better fit at upstream namespace]

The compete patch is at:
https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/6e5f6a811edf77575ddaa84ab6542cc646024423.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: cleanup the code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:41 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup the code

There are several small cleanups that can be done in order to
make the code more prepared to be upstreamed.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/823792ba2f69e613629ab52a33e5728d54e2288b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:40 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: add it to the building system

Now that the driver is ready, place it at the build system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/952e11ea1a33beaf67d6dc355d5c0f99ab4fb964.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: fix some coding style issues
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:39 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: fix some coding style issues

Checkpatch complains about some minor issues inside this
driver that were not addressed by the previous patch.

Address them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/84b53d20632c84cc60b8dadfe937f3c54b355cef.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: change namespace on its functions
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:38 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: change namespace on its functions

Rename the functions used internally inside the driver in
order for them to follow the driver's name.

While here, get rid of some unused definitions at the
header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/bfa8bf33f71612b1511d73269ca242d0d4e70940.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: cleanup OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:37 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup OF properties

Simplify the names of the DT properties and do some cleanups,
in order to better document them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/24ffcd28a17ee7b0940d8aabef556d172d5feddf.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: get rid of unused OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:36 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of unused OF properties

There are several OF properties that aren't used by Hikey 970,
and some are not even used inside the driver.

So, drop them, as as this makes easier to document what's
actually used.

If latter needed, those could be re-added later.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/332f96c178b81bf1e9908a1da2127f043909ae0c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: change the binding logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:35 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: change the binding logic

Change the binding logic to ensure that the MFD driver
will be load after having the SPMI controller registered.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/eb50392ce68bb30f64c603572cdb9c91f93ea47b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: cleanup hi6421-spmi-pmic.h header
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:34 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup hi6421-spmi-pmic.h header

There are several external vars that are defined there, which
are not needed anymore.

Get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/3dbc3f3876275404153da52b84e5dcef09faf644.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: get rid of the static vars
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:33 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of the static vars

There are several static vars inside this driver.

Get rid of them.

While here, add a SPDX header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/19c497fc2bb1d3a95863d92cac89869d5abe3f2e.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: deal with non-static functions
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:32 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: deal with non-static functions

Several functions aren't used outside the mfd driver. So,
either remove or make them static.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d26323ab7be5b4efb73b1950b4daaa5959277449.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: hi6421-spmi-pmic: get rid of unused code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:31 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of unused code

There are some checks there which could make sense for
downstream builds, but doesn't make much sense for
upstream ones. They came from the official Hikey970 tree
from Linaro, but even there, the commented-out code is not
set via other Kconfig vars.

So, let's just get rid of that. If needed later, this
patch can be (partially?) reversed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/ecbef801f6c32ba0850ad9e5c534a4304807df3b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version
Mayulong [Mon, 17 Aug 2020 07:10:30 +0000 (09:10 +0200)]
staging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version

Add the PMIC SPMI driver for the HiSilicon 6421v600.

[mchehab+huawei@kernel.org: keep just the MFD driver on this patch,
 and renamed filenames to better match other upstream drivers]

 The compete patch is at:
https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4ffb2694244baa47387e39e2c5d71243242c1fc1.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: do some code cleanups
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:29 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: do some code cleanups

There are several minor things that can be cleanup in
order to make this driver more prepared for leaving staging.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1fa33567e21f95942d901a299d92e434d4a24b8f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:28 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: add it to the building system

Now that the driver was ported to upstream, add it as a
SPMI controller.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5315331cf048cc72844080e5e8668c0dbac48f1f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: fix the dev_foo() logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:27 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix the dev_foo() logic

Right now, driver is printing some messages as:

[   33.833026] (NULL device *): spmi_read_cmd: id:0 addr:0x17, read value: 00

This is because dev_foo() are not using a device with a name
set. Change the logic for it to print it right.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/f647600d6e709f3dc3f92a64f1788f739c924330.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: add debug when values are read/write
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:26 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: add debug when values are read/write

It is interesting to be able to check if the driver is doing
the right thing. So, add some debug macros to allow checking it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/11dc4583c41a9c5e2804114d6a7a87374d2a23b4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: use le32 macros where needed
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:25 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: use le32 macros where needed

Instead of manually using bswap_32(), just use the
le32 macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/927ac4f981649318dba399e46a1aa429c428cfa3.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: adjust whitespaces at defines
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:24 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: adjust whitespaces at defines

Some defines are not aligned with tab=8, which is the
style defined on Linux. Adjust them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4a3799b40379dbc3abcbd08827977247ccc26dcb.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: fix a typo
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:23 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix a typo

chanel -> channel

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/49798ac555d498c0fd489567643c619c625360f5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: fix it to probe successfully
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:22 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix it to probe successfully

Add a MODULE_DEVICE_TABLE() to the driver.

Also, the current logic calls platform_set_drvdata(pdev, NULL)
if the driver succeeds loading.

While here, remove the .owner, as it is not needed upstream
anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/122bd1c02f325094f4830ac79a86430fbe01e3d5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: hisi-spmi-controller: coding style fixup
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:21 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: coding style fixup

In order to prepare for upstream, fix most coding style issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/3cd60dd31e481a4f824f7085d70fc243ecbbb94f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: spmi: add Hikey 970 SPMI controller driver
Mayulong [Mon, 17 Aug 2020 07:10:20 +0000 (09:10 +0200)]
staging: spmi: add Hikey 970 SPMI controller driver

Add the SPMI controller code required to use the Kirin 970
SPMI bus.

[mchehab+huawei@kernel.org: added just the SPMI controller on this patch]

The complete patch is at:

https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/b4810f476e41e7de4efdf28b42472ae4ffe7defe.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: emxx_udc: Use standard BIT() macro
Alex Dewar [Tue, 18 Aug 2020 13:49:18 +0000 (14:49 +0100)]
staging: emxx_udc: Use standard BIT() macro

Currently emxx_udc.h defines bit values using local macros. Use the
standard one instead.

Also, combine bit values with bitwise-or rather than addition, as
suggested by Coccinelle.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200818134922.409195-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: fix a handful of spelling mistakes
Colin Ian King [Thu, 6 Aug 2020 10:47:01 +0000 (11:47 +0100)]
staging: wfx: fix a handful of spelling mistakes

There are various spelling mistakes in comments and error messages.
Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200806104701.46123-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove 5 GHz code
Michael Straube [Thu, 13 Aug 2020 06:50:53 +0000 (08:50 +0200)]
staging: rtl8723bs: remove 5 GHz code

According to the TODO 5 GHz code should be removed.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Remove code for channels > 14 from rtw_get_center_ch().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200813065053.13883-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192u: Do not use GFP_KERNEL in atomic context
Christophe JAILLET [Thu, 13 Aug 2020 17:34:58 +0000 (19:34 +0200)]
staging: rtl8192u: Do not use GFP_KERNEL in atomic context

'rtl8192_irq_rx_tasklet()' is a tasklet initialized in
'rtl8192_init_priv_task()'.
>From this function it is possible to allocate some memory with the
GFP_KERNEL flag, which is not allowed in the atomic context of a tasklet.

Use GFP_ATOMIC instead.

The call chain is:
  rtl8192_irq_rx_tasklet            (in r8192U_core.c)
    --> rtl8192_rx_nomal            (in r8192U_core.c)
      --> ieee80211_rx              (in ieee80211/ieee80211_rx.c)
        --> RxReorderIndicatePacket (in ieee80211/ieee80211_rx.c)

Fixes: 79a5ccd97209 ("staging: rtl8192u: fix large frame size compiler warning")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200813173458.758284-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unnecessary type cast of rtw_netdev_priv() result
Ivan Safonov [Sat, 15 Aug 2020 20:33:07 +0000 (23:33 +0300)]
staging: r8188eu: remove unnecessary type cast of rtw_netdev_priv() result

The type cast
padapter = (struct adapter *)rtw_netdev_priv(dev);
do nothing because type of rtw_netdev_priv() result
is (struct adapter *).

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200815203306.121039-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: greybus: Add identifier name to function definition argument
Asif Talybov [Sun, 16 Aug 2020 03:31:09 +0000 (10:31 +0700)]
staging: greybus: Add identifier name to function definition argument

WARNING: function definition argument 'struct gbphy_device *' should also
have an identifier name
+       int (*probe)(struct gbphy_device *,

WARNING: function definition argument 'struct gbphy_device *' should also
have an identifier name
+       void (*remove)(struct gbphy_device *);

Signed-off-by: Asif Talybov <talybov.asif@yandex.ru>
Link: https://lore.kernel.org/r/20200816033109.3930-1-talybov.asif@yandex.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoStaging: comedi: pcl726: fixed a spelling mistake
Lokesh Chebrolu [Fri, 7 Aug 2020 07:20:06 +0000 (12:50 +0530)]
Staging: comedi: pcl726: fixed a spelling mistake

Fixed a spelling mistake issue

Signed-off-by: Lokesh Chebrolu <lokeshch007@gmail.com>
Link: https://lore.kernel.org/r/1596784806-7130-1-git-send-email-lokeshch007@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wlan-ng: Remove repeated words in comments
Igor Matheus Andrade Torrente [Mon, 3 Aug 2020 02:20:22 +0000 (23:20 -0300)]
staging: wlan-ng: Remove repeated words in comments

Remove duplicate words in comments at prism2mib and prism2sta files.

Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Link: https://lore.kernel.org/r/20200803022022.501-1-igormtorrente@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: most: dim2: Add missing identifier name to function argument
Nícolas F. R. A. Prado [Sun, 2 Aug 2020 22:36:30 +0000 (22:36 +0000)]
staging: most: dim2: Add missing identifier name to function argument

A function definition argument should have an identifier name according
to checkpatch:

WARNING: function definition argument 'struct platform_device *' should
also have an identifier name

Name it pdev as that name is already used throughout the code.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com>
Link: https://lore.kernel.org/r/20200802223615.924307-1-nfraprado@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: os_dep: fix brace coding style issue in sdio_intf.c
Mohammed Rushad [Sun, 2 Aug 2020 19:09:24 +0000 (00:39 +0530)]
staging: rtl8723bs: os_dep: fix brace coding style issue in sdio_intf.c

This is a patch to the sdio_intf.c file that fixes up an incorrectly
placed brace found by the checkpatch.pl tool

Signed-off-by: Mohammed Rushad <mohammedrushad@gmail.com>
Link: https://lore.kernel.org/r/20200802190924.19964-1-mohammedrushad@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: wfx: clear alignment style issues
Tomer Samara [Sun, 2 Aug 2020 15:01:57 +0000 (18:01 +0300)]
staging: wfx: clear alignment style issues

  Clear checkpatch alignment style issues in debug.c.
  CHECK: Alignment should match open parenthesis

Signed-off-by: Tomer Samara <tomersamara98@gmail.com>
Link: https://lore.kernel.org/r/20200802150157.GA3052@tsnow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoStaging: rtl8192e: fix indent coding style issue in rtllib_tx.c
Mohammed Rushad [Sun, 2 Aug 2020 14:58:59 +0000 (20:28 +0530)]
Staging: rtl8192e: fix indent coding style issue in rtllib_tx.c

This is a patch to the rtllib_tx.c file that fixes fixes an improper
indent found by the checkpatch.pl tool

Signed-off-by: Mohammed Rushad <mohammedrushad@gmail.com>
Link: https://lore.kernel.org/r/20200802145859.14143-1-mohammedrushad@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: replace rtw_netdev_priv define with inline function
Ivan Safonov [Sun, 2 Aug 2020 12:42:50 +0000 (15:42 +0300)]
staging: rtl8723bs: replace rtw_netdev_priv define with inline function

The function guarantees type checking of arguments and return value.

Result of rtw_netdev_priv macro can be assigned to pointer
with incompatible type without warning. The function allow compiler
to perform this check.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200802124249.101341-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: ion: fix spelling mistake in function name "detatch" -> "detach"
Colin Ian King [Wed, 5 Aug 2020 11:26:55 +0000 (12:26 +0100)]
staging: ion: fix spelling mistake in function name "detatch" -> "detach"

There is a spelling mistake in the function name ion_dma_buf_detatch.
Fix it by removing the extraneous t.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Hridya Valsaraju <hridya@google.com>
Link: https://lore.kernel.org/r/20200805112655.17696-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoLinux 5.9-rc1
Linus Torvalds [Sun, 16 Aug 2020 20:04:57 +0000 (13:04 -0700)]
Linux 5.9-rc1