[PATCH 2/2] gpio: vf610: Use PTR_ERR_OR_ZERO() in vf610_gpio_probe()

2019-04-28 Thread Andrey Smirnov
Simplify error checking code by replacing multiple ERR macros with a call to PTR_ERR_OR_ZERO. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Chris Healy Cc: linux-g...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers

[PATCH v2 2/3] power: supply: Add driver for Microchip UCS1002

2019-04-28 Thread Andrey Smirnov
: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Fabio Estevam Cc: Guenter Roeck Cc: Sebastian Reichel Cc: linux-kernel@vger.kernel.org Cc: linux...@vger.kernel.org --- drivers/power/supply/Kconfig | 9 + drivers/power/supply/Makefile| 1 + drivers/power/supply

Re: [PATCH 2/3] power: supply: Add driver for Microchip UCS1002

2019-04-28 Thread Andrey Smirnov
On Fri, Apr 26, 2019 at 7:43 AM Lucas Stach wrote: > > Hi Andrey, > > Am Mittwoch, den 17.04.2019, 01:44 -0700 schrieb Andrey Smirnov: > > Add driver for Microchip UCS1002 Programmable USB Port Power > > Controller with Charger Emulation. The driver exposed a power supp

Re: [PATCH 2/3] power: supply: Add driver for Microchip UCS1002

2019-04-26 Thread Andrey Smirnov
s://lkml.org/lkml/2016/3/14/233 I probably won't change the version numbering of the series at this point, but I'll definitely add the link above to the cover letter. > > Missatge de Andrey Smirnov del dia dc., 17 > d’abr. 2019 a les 10:46: > > > > Add d

Re: [PATCH 2/3] power: supply: Add driver for Microchip UCS1002

2019-04-26 Thread Andrey Smirnov
On Fri, Apr 26, 2019 at 9:10 AM Guenter Roeck wrote: > > On Wed, Apr 17, 2019 at 01:44:56AM -0700, Andrey Smirnov wrote: > > Add driver for Microchip UCS1002 Programmable USB Port Power > > Controller with Charger Emulation. The driver exposed a power supply > > device to

[PATCH v2] power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG

2019-04-24 Thread Andrey Smirnov
ent for a new device, generating the next syslog entry Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported in https://bugs.freedesktop.org/show_bug.cgi?id=76886 but only former seems to have been fixed. Drop debug prints as it was done in I2C subsystem to resolve the issue. Signed-of

[PATCH v5 11/12] thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()

2019-04-23 Thread Andrey Smirnov
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux

[PATCH v5 08/12] thermal: qoriq: Convert driver to use regmap API

2019-04-23 Thread Andrey Smirnov
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov Reviewed

[PATCH v5 12/12] thermal: qoriq: Add hwmon support

2019-04-23 Thread Andrey Smirnov
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux

[PATCH v5 07/12] thermal: qoriq: Convert driver to use devm_ioremap()

2019-04-23 Thread Andrey Smirnov
Convert driver to use devm_ioremap() to simplify memory deallocation and error handling code. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus

[PATCH v5 06/12] thermal: qoriq: Pass data to qoriq_tmu_calibration() directly

2019-04-23 Thread Andrey Smirnov
sequently would be able to drop the "err_iomap" error path. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@

[PATCH v5 10/12] thermal: qoriq: Do not report invalid temperature reading

2019-04-23 Thread Andrey Smirnov
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Va

[PATCH v5 09/12] thermal: qoriq: Enable all sensors before registering them

2019-04-23 Thread Andrey Smirnov
, for the sake of simplicity, change the code to do just that. Signed-off-by: Andrey Smirnov Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kerne

[PATCH v5 01/12] thermal: qoriq: Remove unnecessary DT node is NULL check

2019-04-23 Thread Andrey Smirnov
It's impossible to use this driver outside of Device Tree, so if the probe function is called, the dev.of_node is guaranteed to not be NULL and guarding against that is pointless. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc:

[PATCH v5 03/12] thermal: qoriq: Don't store struct thermal_zone_device reference

2019-04-23 Thread Andrey Smirnov
Struct thermal_zone_device reference stored as sensor's private data isn't really used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Ang

[PATCH v5 05/12] thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly

2019-04-23 Thread Andrey Smirnov
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a paltform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc

[PATCH v5 04/12] thermal: qoriq: Drop per-sensor data

2019-04-23 Thread Andrey Smirnov
Now that driver is converted to use get_temp_id() instead of get_temp() we no longer need per sensor data. Drop all of the code related to it. Signed-off-by: Andrey Smirnov Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie

[PATCH v5 02/12] thermal: qoriq: Add local struct device pointer

2019-04-23 Thread Andrey Smirnov
Use a local "struct device *dev" for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com

[PATCH v5 00/12] QorIQ TMU multi-sensor and HWMON support

2019-04-23 Thread Andrey Smirnov
Everyone: This series contains patches adding support for HWMON integration, bug fixes and general improvements (hopefully) for TMU driver I made while working on it on i.MX8MQ. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v4] - Collected Tested-by from Lucas

Re: [PATCH] power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG

2019-04-18 Thread Andrey Smirnov
On Wed, Apr 17, 2019 at 7:35 PM Sebastian Reichel wrote: > > Hi, > > On Fri, Apr 05, 2019 at 12:30:20AM -0700, Andrey Smirnov wrote: > > Fix a similar endless event loop as was done in commit 8dcf32175b4e > > ("i2c: prevent endless uevent loop with CONFIG_I2C_DEBUG_

Re: [PATCH v4 09/12] thermal: qoriq: Enable all sensors before registering them

2019-04-18 Thread Andrey Smirnov
On Tue, Apr 16, 2019 at 10:09 AM Daniel Lezcano wrote: > > On 13/04/2019 10:27, Andrey Smirnov wrote: > > Tmu_get_temp will get called as a part of sensor registration via > > devm_thermal_zone_of_sensor_register(). To prevent it from retruning > > bogus data we need to

[PATCH 0/3] Driver for UCS1002

2019-04-17 Thread Andrey Smirnov
Everyone: This small series adds a driver for UCS1002 Programmable USB Port Power Controller with Charger Emulation. See [page] for product page and [datasheet] for device dataseet. Hopefully each individual patch is self explanatory. Feedback is welcome! Thanks, Andrey Smirnov [page] https

[PATCH 2/3] power: supply: Add driver for Microchip UCS1002

2019-04-17 Thread Andrey Smirnov
Add driver for Microchip UCS1002 Programmable USB Port Power Controller with Charger Emulation. The driver exposed a power supply device to control/monitor various parameter of the device as well as a regulator to allow controlling VBUS line. Signed-off-by: Andrey Smirnov Cc: Chris Health Cc

[PATCH 1/3] power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant

2019-04-17 Thread Andrey Smirnov
Add POWER_SUPPLY_HEALTH_OVERCURRENT constant in order to allow singalling overcurrent condition via power supply health information. Signed-off-by: Andrey Smirnov Cc: Chris Health Cc: Lucas Stach Cc: Fabio Estevam Cc: Guenter Roeck Cc: Sebastian Reichel Cc: linux-kernel@vger.kernel.org Cc

[PATCH 3/3] dt-bindings: power: supply: Add bindings for Microchip UCS1002

2019-04-17 Thread Andrey Smirnov
Add bindings for Microchip UCS1002 Programmable USB Port Power Controller with Charger Emulation. Signed-off-by: Andrey Smirnov Cc: Chris Health Cc: Lucas Stach Cc: Fabio Estevam Cc: Guenter Roeck Cc: Rob Herring Cc: devicet...@vger.kernel.org Cc: Sebastian Reichel Cc: linux-kernel

[PATCH v4 02/11] PCI: imx6: Drop imx6_pcie_wait_for_link()

2019-04-14 Thread Andrey Smirnov
ned-off-by: Andrey Smirnov Suggested-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org Cc: linux-...@vger.kernel.org --- drivers/pci/controller/dwc/pci-imx6.c | 19 ++- 1 file changed, 2 insertions(+), 17

[PATCH v4 05/11] PCI: dwc: imx6: Share PHY debug register definitions

2019-04-14 Thread Andrey Smirnov
Both pcie-designware.c and pci-imx6.c contain custom definitions for PHY debug registers R0/R1 and on top of that there's already a definition for R0 in pcie-designware.h. Move all of the definitions to pcie-designware.h. No functional change intended. Signed-off-by: Andrey Smirnov Review

[PATCH v4 03/11] PCI: imx6: Return -ETIMEOUT from imx6_pcie_wait_for_speed_change()

2019-04-14 Thread Andrey Smirnov
Change error code from EINVAL to ETIMEDOUT in imx6_pcie_wait_for_speed_change() since that error code seems more appropriate. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org Cc

[PATCH v4 08/11] PCI: imx6: Simplify pcie_phy_poll_ack()

2019-04-14 Thread Andrey Smirnov
Simplify pcie_phy_poll_ack() by incorporating shifting into constant definition and convert the code to use 'bool'. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org

[PATCH v4 06/11] PCI: imx6: Make use of BIT() in constant definitions

2019-04-14 Thread Andrey Smirnov
Avoid using explicit left shifts and convert various definitions to use BIT() instead. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org Cc: linux

[PATCH v4 09/11] PCI: imx6: Restrict PHY register data to 16-bit

2019-04-14 Thread Andrey Smirnov
PHY registers on i.MX6 are 16-bit wide, so we can get rid of explicit masking if we restrict pcie_phy_read/pcie_phy_write to use 'u16' instead of 'int'. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjor

[PATCH v4 04/11] PCI: imx6: Remove PCIE_PL_PFLR_* constants

2019-04-14 Thread Andrey Smirnov
Code using these constants was removed in commit a71280722eeb ("PCI: imx6: Remove LTSSM disable workaround"). No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: li

[PATCH v4 01/11] PCI: imx6: Simplify imx7d_pcie_wait_for_phy_pll_lock()

2019-04-14 Thread Andrey Smirnov
Make use of regmap_read_poll_timeout() to simplify imx7d_pcie_wait_for_phy_pll_lock(). No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org Cc: linux

[PATCH v4 07/11] PCI: imx6: Simplify bit operations in PHY functions

2019-04-14 Thread Andrey Smirnov
Simplify the code by incorporating left shifts into constant defnitions as well as using FIELD_PREP/GENMASK. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel

[PATCH v4 11/11] PCI: imx6: Use usleep_range() in imx6_pcie_enable_ref_clk()

2019-04-14 Thread Andrey Smirnov
imx6_pcie_enable_ref_clk() is never called in atomic context, so there's no need to use udelay(). Replace it with usleep_range(). Signed-off-by: Andrey Smirnov Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Chris Healy Cc: Lucas Stach Cc: linux-kernel@vger.kernel.org Cc:

[PATCH v4 10/11] PCI: imx6: Use flags to indicate support for suspend

2019-04-14 Thread Andrey Smirnov
Now that driver data has flags variable that can be used to indicate quirks/features supported we can switch the code to use it instead of having a special function that does so based on variant alone. No functional change intended. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Cc

[PATCH v4 00/11] i.MX6, DesignWare PCI improvements

2019-04-14 Thread Andrey Smirnov
ch is self-explanatory. I tested this series on i.MX6Q, i.MX7D and i.MX8MQ. Feedback is welcome! Thanks, Andrey Smirnov Chagnes since [v3]: - Collected Reviewed-by from Lucas for most of the patches - Converted "PCI: imx6: Replace calls to udelay() with usleep_range()"

Re: [PATCH v3 02/11] PCI: imx6: Remove redundant debug tracing

2019-04-14 Thread Andrey Smirnov
On Fri, Apr 12, 2019 at 8:53 AM Lucas Stach wrote: > > Am Sonntag, den 31.03.2019, 21:25 -0700 schrieb Andrey Smirnov: > > All calls to imx6_pcie_wait_for_link() share the same error path and > > the state of PHY debug registers will already be printed there. > > With

Re: [PATCH v3 08/11] PCI: imx6: Simplify pcie_phy_poll_ack()

2019-04-14 Thread Andrey Smirnov
On Fri, Apr 12, 2019 at 9:12 AM Lucas Stach wrote: > > Am Sonntag, den 31.03.2019, 21:25 -0700 schrieb Andrey Smirnov: > > Simplify pcie_phy_poll_ack() by incorporating shifting into constant > > definition and convert the code to use 'bool'. No functional chang

[PATCH 2/2] ARM: dts: vf610-zii-dev-rev-b: Specify CS as GPIO_ACTIVE_LOW in spi0

2019-04-14 Thread Andrey Smirnov
Specify CS as GPIO_ACTIVE_LOW in spi0 to fix the following warning: m25p128@0 enforce active low on chipselect handle Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: linux-kernel@vger.kernel.org --- arch/arm/boot/dts/vf610-zii-dev-rev-b.dts

[PATCH v2 5/6] iio: imx7d_adc: Simplify imx7d_adc_remove() with imx7d_adc_suspend()

2019-04-14 Thread Andrey Smirnov
Since imx7d_adc_remove() does exactly the same thing as imx7d_adc_suspend() we can use the latter together with devm_add_action_or_reset() to simplify the former. Rename imx7d_adc_suspend() to imx7d_adc_disable() for clarity while at it. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc

[PATCH v2 4/6] iio: imx7d_adc: Simplify imx7d_adc_probe() with imx7d_adc_resume()

2019-04-14 Thread Andrey Smirnov
Initialization sequence performed in imx7d_adc_resume() is exactly the same as the one being done in imx7d_adc_probe(). Make use of the former in the latter to avoid code duplication. Rename imx7d_adc_resume() to imx7d_adc_enable() for clarity while at it. Signed-off-by: Andrey Smirnov Cc

[PATCH 1/2] ARM: dts: vf610-zii-dev: Mark i2c0 SCL as GPIO_OPEN_DRAIN

2019-04-14 Thread Andrey Smirnov
Mark i2c0 SCL as GPIO_OPEN_DRAIN to fix the following warning: gpio-36 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: linux-kernel@vger.kernel.org --- arch/arm

[PATCH v2 2/6] iio: imx7d_adc: Replace pr_err with dev_err

2019-04-14 Thread Andrey Smirnov
Replace combination of pr_err()/dev_name() with an equivalent call for dev_err(). Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH v2 3/6] iio: imx7d_adc: Use devm_platform_ioremap_resource()

2019-04-14 Thread Andrey Smirnov
Use devm_platform_ioremap_resource() to be able to drop a bit of explicit boilerplate code. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH v2 0/6] i.MX7D ADC improvements

2019-04-14 Thread Andrey Smirnov
Everyone: This series is a number of small improvements I made to i.MX7D ADC driver. Hopefully each patch is self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Changes [v1]: - Renamed imx7d_adc_resume() to imx7d_adc_enable() - Renamed imx7d_adc_suspend() to

[PATCH v2 6/6] iio: imx7d_adc: Use devm_iio_device_register()

2019-04-14 Thread Andrey Smirnov
Use devm_iio_device_register() and drop imx7d_adc_remove(). Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/iio/adc/imx7d_adc.c

[PATCH v2 1/6] iio: imx7d_adc: Add local struct device pointer in imx7d_adc_probe()

2019-04-14 Thread Andrey Smirnov
Use a local "struct device *dev" in imx7d_adc_probe() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: li

[PATCH v3 1/4] dt-bindings: iio: imx7d-adc: Add #io-channel-cells to required

2019-04-14 Thread Andrey Smirnov
Add #io-channel-cells to list of required properties. Needed to be able to reference that node by phandle. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Rob Herring Cc: linux-kernel@vger.kernel.org Cc: devicet...@vger.kernel.org

[PATCH v3 2/4] ARM: dts: imx7s: Specify #io-channel-cells in ADC nodes

2019-04-14 Thread Andrey Smirnov
Specify #io-channel-cells in ADC nodes. Needed to be able to reference them by phandle. Signed-off-by: Andrey Smirnov Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Rob Herring Cc: linux-kernel@vger.kernel.org Cc: devicet...@vger.kernel.org --- arch/arm/boot/dts

[PATCH v3 4/4] ARM: dts: Add support for ZII i.MX7 RPU2 board

2019-04-14 Thread Andrey Smirnov
Add support for ZII's i.MX7 based Remote Peripheral Unit 2 (RPU2) board. Signed-off-by: Andrey Smirnov Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Rob Herring Cc: linux-kernel@vger.kernel.org Cc: devicet...@vger.kernel.org --- Ch

[PATCH v3 3/4] dt-bindings: arm: fsl: Add support for ZII i.MX7 RPU2 board

2019-04-14 Thread Andrey Smirnov
Add support for ZII i.MX7 RPU2 board. Signed-off-by: Andrey Smirnov Reviewed-by: Rob Herring Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Rob Herring Cc: linux-kernel@vger.kernel.org Cc: devicet...@vger.kernel.org --- Documentation/devicetree/bindings/arm/fsl.yaml

Re: [PATCH 5/6] iio: imx7d_adc: Use imx7d_adc_resume() in imx7d_adc_probe()

2019-04-13 Thread Andrey Smirnov
On Sun, Apr 7, 2019 at 4:15 AM Jonathan Cameron wrote: > > On Wed, 3 Apr 2019 00:03:24 -0700 > Andrey Smirnov wrote: > > > Initialization sequence performed in imx7d_adc_resume() is exactley > > the same as what's being done in imx7d_adc_probe(). Make use of th

Re: [PATCH 3/6] iio: imx7d_adc: Use devm_iio_device_register()

2019-04-13 Thread Andrey Smirnov
On Sun, Apr 7, 2019 at 4:07 AM Jonathan Cameron wrote: > > On Wed, 3 Apr 2019 00:03:22 -0700 > Andrey Smirnov wrote: > > > Use devm_iio_device_register() and drop explicit call to > > iio_device_unregister(). > > > > Signed-off-by: Andrey Smirnov >

[PATCH v4 07/12] thermal: qoriq: Convert driver to use devm_ioremap()

2019-04-13 Thread Andrey Smirnov
Convert driver to use devm_ioremap() to simplify memory deallocation and error handling code. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux

[PATCH v4 03/12] thermal: qoriq: Don't store struct thermal_zone_device reference

2019-04-13 Thread Andrey Smirnov
Struct thermal_zone_device reference stored as sensor's private data isn't really used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism)

[PATCH v4 04/12] thermal: qoriq: Drop per-sensor data

2019-04-13 Thread Andrey Smirnov
Now that driver is converted to use get_temp_id() instead of get_temp() we no longer need per sensor data. Drop all of the code related to it. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux

[PATCH v4 05/12] thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directly

2019-04-13 Thread Andrey Smirnov
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a paltform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo

[PATCH v4 08/12] thermal: qoriq: Convert driver to use regmap API

2019-04-13 Thread Andrey Smirnov
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov Cc: Chris

[PATCH v4 09/12] thermal: qoriq: Enable all sensors before registering them

2019-04-13 Thread Andrey Smirnov
, for the sake of simplicity, change the code to do just that. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/th

[PATCH v4 06/12] thermal: qoriq: Pass data to qoriq_tmu_calibration() directly

2019-04-13 Thread Andrey Smirnov
sequently would be able to drop the "err_iomap" error path. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel

[PATCH v4 10/12] thermal: qoriq: Do not report invalid temperature reading

2019-04-13 Thread Andrey Smirnov
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism)

[PATCH v4 11/12] thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()

2019-04-13 Thread Andrey Smirnov
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH v4 12/12] thermal: qoriq: Add hwmon support

2019-04-13 Thread Andrey Smirnov
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.kernel.org Cc: linux-kernel

[PATCH v4 02/12] thermal: qoriq: Add local struct device pointer

2019-04-13 Thread Andrey Smirnov
Use a local "struct device *dev" for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-...@nxp.com Cc: linux...@vger.ker

[PATCH v4 00/12] QorIQ TMU multi-sensor and HWMON support

2019-04-13 Thread Andrey Smirnov
Everyone: This series contains patches adding support for HWMON integration, bug fixes and general improvements (hopefully) for TMU driver I made while working on it on i.MX8MQ. Feedback is welcome! Thanks, Andrey Smirnov Changes since [v3] - Series reabse on top of [rfc] - Fixed

[PATCH v4 01/12] thermal: qoriq: Remove unnecessary DT node is NULL check

2019-04-13 Thread Andrey Smirnov
It's impossible to use this driver outside of Device Tree, so if the probe function is called, the dev.of_node is guaranteed to not be NULL and guarding against that is pointless. Drop it. Signed-off-by: Andrey Smirnov Acked-by: Daniel Lezcano Cc: Chris Healy Cc: Lucas Stach Cc: Ed

Re: [PATCH RFC 1/2] thermal/drivers/of: Add a get_temp_id callback function

2019-04-13 Thread Andrey Smirnov
ent with the registering function. > Tested both patches on i.MX8MQ, seem to work as expected. Tested-by: Andrey Smirnov Thanks, Andrey Smirnov

Re: [PATCH v3 13/13] thermal: qoriq: Add hwmon support

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 2:12 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Expose thermal readings as a HWMON device, so that it could be > > accessed using lm-sensors. > > > > Signed-off-by: Andrey Smirnov > > Cc: Chris Healy &g

Re: [PATCH v3 11/13] thermal: qoriq: Do not report invalid temperature reading

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 2:05 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Before returning measured temperature data to upper layer we need to > > make sure that the reading was marked as "valid" to avoid reporting > > bogus data. &

Re: [PATCH v3 09/13] thermal: qoriq: Convert driver to use regmap API

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 1:47 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Convert driver to use regmap API, drop custom LE/BE IO helpers and > > simplify bit manipulation using regmap_update_bits(). This also allows > > us to convert some re

Re: [PATCH v3 08/13] thermal: qoriq: Convert driver to use devm_ioremap()

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 1:23 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Convert driver to use devm_ioremap() to simplify memory deallocation > > and error handling code. No functional change intended. > > > > Signed-off-by: Andre

Re: [PATCH v3 07/13] thermal: qoriq: Pass data to qoriq_tmu_calibration() directly

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 1:12 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > We can simplify error cleanup code if instead of passing a "struct > > platform_device *" to qoriq_tmu_calibration() and deriving a bunch of > > pointe

Re: [PATCH v3 05/13] thermal: qoriq: Embed per-sensor data into struct qoriq_tmu_data

2019-04-05 Thread Andrey Smirnov
On Thu, Apr 4, 2019 at 12:57 AM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Embed per-sensor data into struct qoriq_tmu_data so we can drop the > > code allocating it. This also allows us to get rid of per-sensor back > > reference to struct

Re: [PATCH v3 04/13] thermal: qoriq: Add local struct qoriq_sensor pointer

2019-04-05 Thread Andrey Smirnov
On Wed, Apr 3, 2019 at 8:28 PM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > Add local struct qoriq_sensor pointer in qoriq_tmu_register_tmu_zone() > > for brevity. > > > > Signed-off-by: Andrey Smirnov > > Cc: Chris Healy &g

Re: [PATCH v3 01/13] thermal: qoriq: Remove unnecessary DT node is NULL check

2019-04-05 Thread Andrey Smirnov
On Wed, Apr 3, 2019 at 8:21 PM Daniel Lezcano wrote: > > On 01/04/2019 06:14, Andrey Smirnov wrote: > > This driver is meant to be used with Device Tree and there's no > > use-case where device's DT node is going to be NULL. Remove code > > protecting against

[PATCH v5 2/5] arm64: dts: imx8mq: Add a node for SRC IP block

2019-04-05 Thread Andrey Smirnov
Add a node for reset controller IP block found on i.MX8MQ. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-...@

[PATCH v5 0/5] PCIE support for i.MX8MQ (DT changes)

2019-04-05 Thread Andrey Smirnov
- Dropped unsupported IRQ from PCIe nodes (a leftover from vendor tree) - Added "pcie_aux" clock and moved clock configuration to board file since "pcie_bus" clock is now board specific Thanks, Andrey Smirnov [v1] https://lore.kernel.org/lkml/20190131204333.318

[PATCH v5 4/5] arm64: dts: imx8mq: Add nodes for PCIe IP blocks

2019-04-05 Thread Andrey Smirnov
Add nodes for two PCIe controllers found on i.MX8MQ. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-...@nxp.com Cc:

[PATCH v5 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible

2019-04-05 Thread Andrey Smirnov
Mark iomuxc_gpr as compatible with "fsl,imx6q-iomuxc-gpr" in order for to allow i.MX6 PCIe driver to use it. Signed-off-by: Andrey Smirnov Acked-by: Lucas Stach Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc:

[PATCH v5 5/5] arm64: dts: imx8mq-evk: Enable PCIE0 interface

2019-04-05 Thread Andrey Smirnov
Enable PCIE0 interface connected to BCM4356 WiFi/Bluetooth module. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-.

[PATCH v5 3/5] arm64: dts: imx8mq: Combine PCIE power domains

2019-04-05 Thread Andrey Smirnov
pgc_pcie' power domain. Signed-off-by: Andrey Smirnov Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Cc: Shawn Guo Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-...@nxp.com Cc: linux-arm-ker...@lists.

[PATCH] power: supply: sysfs: prevent endless uevent loop with CONFIG_POWER_SUPPLY_DEBUG

2019-04-05 Thread Andrey Smirnov
ent for a new device, generating the next syslog entry Both CONFIG_I2C_DEBUG_CORE and CONFIG_POWER_SUPPLY_DEBUG were reported in https://bugs.freedesktop.org/show_bug.cgi?id=76886 but only former seems to have been fixed. Change debug prints to use pr_debug insted to resolve the issue. Signed-off-by

[PATCH 3/6] iio: imx7d_adc: Use devm_iio_device_register()

2019-04-03 Thread Andrey Smirnov
Use devm_iio_device_register() and drop explicit call to iio_device_unregister(). Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 6/6] iio: imx7d_adc: Drop imx7d_adc_remove()

2019-04-03 Thread Andrey Smirnov
Since imx7d_adc_remove() does exactly the same thing as imx7d_adc_suspend() we can use the latter together with devm_add_action_or_reset() to get rid of the former. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc

[PATCH 5/6] iio: imx7d_adc: Use imx7d_adc_resume() in imx7d_adc_probe()

2019-04-03 Thread Andrey Smirnov
Initialization sequence performed in imx7d_adc_resume() is exactley the same as what's being done in imx7d_adc_probe(). Make use of the former in the latter to avoid code duplication. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc:

[PATCH 4/6] iio: imx7d_adc: Use devm_platform_ioremap_resource()

2019-04-03 Thread Andrey Smirnov
Use devm_platform_ioremap_resource() to be able to drop a bit of explicit boilerplate code. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 2/6] iio: imx7d_adc: Replace pr_err with dev_err

2019-04-03 Thread Andrey Smirnov
Replace combination of pr_err()/dev_name() with an equivalent call for dev_err(). Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

[PATCH 1/6] iio: imx7d_adc: Add local struct device pointer in imx7d_adc_probe()

2019-04-03 Thread Andrey Smirnov
Use a local "struct device *dev" in imx7d_adc_probe() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Jonathan Cameron Cc: Hartmut Knaack Cc: Lars-Peter Clausen Cc: Peter Meerwald-Stadler Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: li

[PATCH 0/6] i.MX7D ADC improvements

2019-04-03 Thread Andrey Smirnov
Everyone: This series is a number of small improvements I made to i.MX7D ADC driver. Hopefully each patch is self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (6): iio: imx7d_adc: Add local struct device pointer in imx7d_adc_probe() iio: imx7d_adc: Replace pr_err

[PATCH 01/12] spi: gpio: Drop unused spi_to_pdata()

2019-04-02 Thread Andrey Smirnov
Spi_to_pdata() is not used anywhere in the code. Drop it. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/spi/spi-gpio.c b

[PATCH 06/12] spi: gpio: Don't request CS GPIO in DT use-case

2019-04-02 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 134 ++--- 1 file changed, 59 insertions(+), 75 deletions(-) diff --git a/drivers/spi/spi-gpio.c b/drive

[PATCH 08/12] spi: gpio: Drop mflags argument from spi_gpio_request()

2019-04-02 Thread Andrey Smirnov
The logic of setting mflags in spi_gpio_request() is very simple and there isn't much benefit in having it in that function. Move all of that code outside into spi_gpio_probe() in order to simplify things. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc:

[PATCH 03/12] spi: gpio: Add local struct spi_bitbang pointer in spi_gpio_probe()

2019-04-02 Thread Andrey Smirnov
Use a local "struct spi_bitbang *bb" in spi_gpio_probe() for brevity. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 27 ++---

[PATCH 05/12] spi: gpio: Drop unused pdata copy in struct spi_gpio

2019-04-02 Thread Andrey Smirnov
Drop unused pdata copy in struct spi_gpio. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/spi

[PATCH 10/12] spi: gpio: Make sure spi_master_put() is called in every error path

2019-04-02 Thread Andrey Smirnov
There's a number of failure paths in spi_gpio_probe() that do not call spi_master_put() potentially leaking memory. Fix this problem by registering a cleanup funciont via devm_add_action_or_reset() right after SPI controller is allocated. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc:

[PATCH 11/12] spi: bitbang: Introduce spi_bitbang_init()

2019-04-02 Thread Andrey Smirnov
Move all of the code doing struct spi_bitbang initialization, so that it can be paired with devm_spi_register_master() in order to avoid having to call spi_bitbang_stop() explicitly. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel

[PATCH 09/12] spi: gpio: Drop unused pdev field in struct spi_gpio

2019-04-02 Thread Andrey Smirnov
There's no code using 'pdev' field in struct spi_gpio. Drop it. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/s

[PATCH 07/12] spi: Don't call spi_get_gpio_descs() before device name is set

2019-04-02 Thread Andrey Smirnov
spi0 CS1) out lo gpio-41 (|spi0 CS0) out lo ACTIVE LOW gpio-42 (|miso) in hi gpio-43 (|mosi) in lo gpio-44 (|sck ) out lo Signed-off-by: Andrey

[PATCH 04/12] spi: gpio: Simplify SPI_MASTER_NO_TX check in spi_gpio_probe()

2019-04-02 Thread Andrey Smirnov
Swap branches of the if statement in order to simplify it's logical condition being checked. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Mark Brown Cc: Chris Healy Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/spi/spi-gpio.c

<    1   2   3   4   5   6   7   8   9   10   >