Re: [PATCH 2/4] i2c: at91: implement i2c bus recovery

2020-08-25 Thread Phil Reid
On 25/08/2020 21:28, Wolfram Sang wrote: Hi Phil, yes, this thread is old but a similar issue came up again... On Fri, Oct 25, 2019 at 09:14:00AM +0800, Phil Reid wrote: So at the beginning of a new transfer, we should check if SDA (or SCL?) is low and, if it's true, only then we s

Re: [PATCH 4.19 32/79] fpga: altera-ps-spi: Fix getting of optional confd gpio

2019-09-22 Thread Phil Reid
ev, "Not using confd gpio"); } /* Register manager with unique name */ Best regards, Pavel -- Regards Phil Reid

Re: [PATCH 4/4] iio: adc: ina2xx: Use label proper for device identification

2019-08-26 Thread Phil Reid
On 26/08/2019 02:07, Jonathan Cameron wrote: On Wed, 21 Aug 2019 11:12:00 +0200 Michal Simek wrote: On 21. 08. 19 4:11, Phil Reid wrote: On 20/08/2019 22:11, Michal Simek wrote: Add support for using label property for easier device identification via iio framework. Signed-off-by: Michal

Re: iio: Is storing output values to non volatile registers something we should do automatically or leave to userspace action. [was Re: [PATCH] iio: potentiometer: max5432: update the non-volatile pos

2019-08-22 Thread Phil Reid
On 19/08/2019 03:32, Jonathan Cameron wrote: On Mon, 12 Aug 2019 19:08:12 +0800 Phil Reid wrote: G'day Martin / Jonathan, On 12/08/2019 18:37, Martin Kaiser wrote: Hi Jonathan, Thus wrote Jonathan Cameron (ji...@kernel.org): The patch is fine, but I'm wondering about wheth

Re: [PATCH 4/4] iio: adc: ina2xx: Use label proper for device identification

2019-08-20 Thread Phil Reid
->dev); I like this personally. It'd be nice if it was a core function so it could be an opt in to any iio device. Don't know how well received that'd be thou. -- Regards Phil Reid

Re: [PATCH 2/4] iio: adc: ina2xx: Setup better name then simple ina2xx

2019-08-20 Thread Phil Reid
ndio_dev->setup_ops = &ina2xx_setup_ops; buffer = devm_iio_kfifo_allocate(&indio_dev->dev); -- Regards Phil Reid

Re: [PATCH 1/4] iio: adc: ina2xx: Define *device_node only once

2019-08-20 Thread Phil Reid
f_node; + indio_dev->dev.of_node = np; if (id->driver_data == ina226) { indio_dev->channels = ina226_channels; indio_dev->num_channels = ARRAY_SIZE(ina226_channels); -- Regards Phil Reid ElectroMagnetic Imaging Technology Pty Ltd Develop

Re: iio: Is storing output values to non volatile registers something we should do automatically or leave to userspace action. [was Re: [PATCH] iio: potentiometer: max5432: update the non-volatile pos

2019-08-12 Thread Phil Reid
some kind of policy on setting this would be nice. I personally think it's something that userspace should initiate via an explicit command. Writing the NV for the AD5272 is something I planned to add at some stage. But so far the default factory values have worked ok. It'd be nice for cross device consistency for any interface for this. -- Regards Phil Reid

Re: [PATCH v6 19/57] iio: Remove dev_err() usage after platform_get_irq()

2019-07-31 Thread Phil Reid
G'day Stephen, One comment below. On 31/07/2019 22:32, Stephen Boyd wrote: Quoting Phil Reid (2019-07-30 23:42:16) G'day Stephen, A comment unrelated to your change. On 31/07/2019 02:15, Stephen Boyd wrote: diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_a

Re: [PATCH v6 19/57] iio: Remove dev_err() usage after platform_get_irq()

2019-07-30 Thread Phil Reid
; 0) return -ENODEV; Should this be returning st->irq instead of -ENODEV? eg: platform_get_irq can return -EPROBE_DEFER Pattern is repeated in a number of other places. - } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); Regards Phil Reid

Re: [PATCH 1/2] [PATCH] gpio: Replace usage of bare 'unsigned' with 'unsigned int'

2019-07-21 Thread Phil Reid
7 @@ static int vprbrd_gpiob_direction_input(struct gpio_chip *chip, } static int vprbrd_gpiob_direction_output(struct gpio_chip *chip, - unsigned offset, int value) + unsigned int offset, int value) { int ret; struct vprbrd_gpio *gpio = gpiochip_get_data(chip); -- Regards Phil Reid

Re: [PATCH RFC] gpio: Add Virtual Aggregator GPIO Driver

2019-07-11 Thread Phil Reid
On 10/07/2019 18:21, Geert Uytterhoeven wrote: Hi Phil, On Wed, Jul 10, 2019 at 4:00 AM Phil Reid wrote: On 6/07/2019 00:05, Geert Uytterhoeven wrote: GPIO controllers are exported to userspace using /dev/gpiochip* character devices. Access control to these devices is provided by standard

Re: [PATCH 1/2] gpio: em: remove the gpiochip before removing the irq domain

2019-07-10 Thread Phil Reid
st struct of_device_id em_gio_dt_ids[] = { @@ -376,7 +376,6 @@ MODULE_DEVICE_TABLE(of, em_gio_dt_ids); static struct platform_driver em_gio_device_driver = { .probe = em_gio_probe, - .remove = em_gio_remove, .driver = { .name = "em_gio", .of_match_table = em_gio_dt_ids, -- Regards Phil Reid

Re: [PATCH RFC] gpio: Add Virtual Aggregator GPIO Driver

2019-07-09 Thread Phil Reid
d *data) +{ + struct gpio_virt_agg_entry *gva = p; + + platform_device_unregister(gva->pdev); + kfree(gva); + return 0; +} + +static void __exit gpio_virt_agg_exit(void) +{ + mutex_lock(&gpio_virt_agg_lock); + idr_for_each(&gpio_virt_agg_idr, gpio_virt_agg_idr_remove, NULL); + idr_destroy(&gpio_virt_agg_idr); + mutex_unlock(&gpio_virt_agg_lock); + + platform_driver_unregister(&gpio_virt_agg_driver); +} +module_exit(gpio_virt_agg_exit); + +MODULE_AUTHOR("Geert Uytterhoeven "); +MODULE_DESCRIPTION("GPIO Virtual Aggregator"); +MODULE_LICENSE("GPL v2"); -- Regards Phil Reid ElectroMagnetic Imaging Technology Pty Ltd Development of Geophysical Instrumentation & Software www.electromag.com.au 3 The Avenue, Midland WA 6056, AUSTRALIA Ph: +61 8 9250 8100 Fax: +61 8 9250 7100 Email: pr...@electromag.com.au

Re: [PATCH V4 2/2] iio: light: isl29018: add optional vdd/vdda regulator operation support

2018-12-10 Thread Phil Reid
On 11/12/2018 12:29 pm, Anson Huang wrote: G'day Anson, Just pulled up the datasheet for this chip. The absolute max for Vdda is speced as Vddd ±0.5 With a note that Vdda should be externally shorted to Vddd. The data sheet says vdda should be connected to vdd externally, then I think we shou

Re: [PATCH V4 2/2] iio: light: isl29018: add optional vdd/vdda regulator operation support

2018-12-10 Thread Phil Reid
G'day Anson, Just pulled up the datasheet for this chip. The absolute max for Vdda is speced as Vddd +/-0.5 With a note that Vdda should be externally shorted to Vddd. On 11/12/2018 11:43 am, Anson Huang wrote: Hi, Phil Best Regards! Anson Huang -Original Message- From: Phil

Re: [PATCH V4 2/2] iio: light: isl29018: add optional vdd/vdda regulator operation support

2018-12-10 Thread Phil Reid
On 11/12/2018 11:24 am, Anson Huang wrote: The light sensor's power supply could be controlled by regulator on some platforms, such as i.MX6Q-SABRESD board, the light sensor isl29023's power supply is controlled by a GPIO fixed regulator, need to make sure the regulator is enabled before any oper

Re: [PATCH V2] iio: magnetometer: mag3110: add optional vdd/vddio regulator operation support

2018-12-10 Thread Phil Reid
G'day Anson, On 10/12/2018 3:17 PM, Anson Huang wrote: The magnetometer's power supply could be controlled by regulator on some platforms, such as i.MX6Q-SABRESD board, the mag3110's power supply is controlled by a GPIO fixed regulator, need to make sure the regulator is enabled before any commu

Re: [PATCH v2] staging: iio: ad7816: Switch to the gpio descriptor interface

2018-10-18 Thread Phil Reid
ret); return ret; } - gpio_direction_input(chip->busy_pin); The busy pin doesn't exist on the ad7818. Which the driver claims to support in the id table: > static const struct spi_device_id ad7816_id[] = { >{ "ad7816", 0 }, >{ "ad7817", 0 }, >{ "ad7818", 0 }, >{} > }; See: https://www.analog.com/media/en/technical-documentation/data-sheets/AD7817_7818.pdf Page 9. indio_dev->name = spi_get_device_id(spi_dev)->name; indio_dev->dev.parent = &spi_dev->dev; Also should the pin names be documented in a device tree binding doc? -- Regards Phil Reid

Re: [PATCH v3 3/3] iio: magnetometer: Add driver support for PNI RM3100

2018-10-02 Thread Phil Reid
spi_driver(rm3100_driver); + +MODULE_AUTHOR("Song Qiang "); +MODULE_DESCRIPTION("PNI RM3100 3-axis magnetometer spi driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/iio/magnetometer/rm3100.h b/drivers/iio/magnetometer/rm3100.h new file mode 100644 index 000

Re: [PATCH 2/2] iio: magnetometer: Add driver support for PNI RM3100

2018-09-26 Thread Phil Reid
On 26/09/2018 4:09 PM, Song Qiang wrote: On Wed, Sep 26, 2018 at 10:30:34AM +0800, Phil Reid wrote: On 26/09/2018 9:49 AM, Song Qiang wrote: On Tue, Sep 25, 2018 at 10:36:54PM +0800, Phil Reid wrote: On 25/09/2018 9:30 PM, Jonathan Cameron wrote: +static irqreturn_t rm3100_trigger_handler

Re: [PATCH 2/2] iio: magnetometer: Add driver support for PNI RM3100

2018-09-25 Thread Phil Reid
On 26/09/2018 9:49 AM, Song Qiang wrote: On Tue, Sep 25, 2018 at 10:36:54PM +0800, Phil Reid wrote: On 25/09/2018 9:30 PM, Jonathan Cameron wrote: +static irqreturn_t rm3100_trigger_handler(int irq, void *p) +{ + struct iio_poll_func *pf = p; + struct iio_dev *indio_dev = pf

Re: [PATCH 2/2] iio: magnetometer: Add driver support for PNI RM3100

2018-09-25 Thread Phil Reid
get is a different buffer so should be ok. But that raises the question of does it need to be? 'buffer' could be 12 bytes long and just shuffle Z then Y. Do the unused bytes need to be zeroed? or does libiio mask them anyway? -- Regards Phil Reid

Re: [PATCH] iio: magnetometer: Add support for PNI RM3100 9-axis magnetometer

2018-09-20 Thread Phil Reid
+#define RM_W_REG_START RM_REG_POLL +#define RM_W_REG_END RM_REG_REV_ID +#define RM_R_REG_START RM_REG_POLL +#define RM_R_REG_END RM_REG_HSHAKE +#define RM_V_REG_START RM_REG_MX2 +#define RM_V_REG_END RM_REG_HSHAKE + +/* Built-In Self Test reigister. */ +#define RM_REG_BIST0x33 + +struct rm3100_data { + struct device *dev; + struct regmap *regmap; + struct completion measuring_done; + bool use_interrupt; + + int conversion_time; + + /* To protect consistency of every measurement and sampling +* frequency change operations. +*/ + struct mutex lock; +}; + +extern const struct regmap_access_table rm3100_readable_table; +extern const struct regmap_access_table rm3100_writable_table; +extern const struct regmap_access_table rm3100_volatile_table; + +int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq); +int rm3100_common_remove(struct device *dev); + +#endif /* RM3100_CORE_H */ -- Regards Phil Reid

Re: [PATCH] iio: magnetometer: Add support for PNI RM3100 9-axis magnetometer

2018-09-20 Thread Phil Reid
On 20/09/2018 9:13 PM, Song Qiang wrote: PNI RM3100 magnetometer is a high resolution, large signal immunity magnetometer, composed of 3 single sensors and a processing chip. PNI is currently not in the vendors list, so this is also adding it. In the subject: Isn't the RM3100 a 3axis mag. The

Re: [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO

2018-07-24 Thread Phil Reid
routed thru the SOC's fpga. In other hard configurations they may have a 'proper' GPIO available that needs to be OpenDrain. Disclaimer: I have zero experience with this core, I don't know how hard it is to modify or which versions are out there. -- Regards Phil Reid

Re: [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO

2018-07-15 Thread Phil Reid
On 14/07/2018 05:09, Wolfram Sang wrote: I2C is open drain, so set up the GPIO accordingly. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-designware-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c

Re: [PATCH v4 1/2] power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats

2018-06-10 Thread Phil Reid
. [1] http://www.ti.com/lit/er/sluu265a/sluu265a.pdf Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Acked-by: Rhyland Klein Reviewed-by: Phil Reid --- v2: * don't stub out POWER_SUPPLY_PROP_PRESENT from sbs_data[] * use if/else instead of switch/case v3: * pull 'retur

Re: [PATCH v3 1/2] power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats

2018-06-05 Thread Phil Reid
ti_battery_presence_and_health() return 0; } @@ -941,7 +976,10 @@ MODULE_DEVICE_TABLE(i2c, sbs_id); static const struct of_device_id sbs_dt_ids[] = { { .compatible = "sbs,sbs-battery" }, - { .compatible = "ti,bq20z75" }, + { + .compatible = "ti,bq20z75", + .data = (void *)SBS_FLAGS_TI_BQ20Z75, + }, { } }; MODULE_DEVICE_TABLE(of, sbs_dt_ids); -- Regards Phil Reid

Re: [PATCHv6] gpio: Remove VLA from gpiolib

2018-05-16 Thread Phil Reid
, +static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size, struct gpio_desc **desc_array, int *value_array) { /* GPIO can never have been requested */ WARN_ON(1); + return 0; } static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) G'day Laura, Looks good to me. Reviewed-by: Phil Reid -- Regards Phil Reid

Re: [PATCHv5] gpio: Remove VLA from gpiolib

2018-05-15 Thread Phil Reid
g. gpio-74x164 driven from spi-gpio, where I can extend the chain to increase the level of recursion arbitrarily). I think a config option for FASTPATH_NGPIO is preferable. As I've mentioned ARCH_NR_GPIOS is much greater than any chip->ngpio on my platform. It's at least one order of magnitude, almost 2. -- Regards Phil Reid

Re: [PATCHv5] gpio: Remove VLA from gpiolib

2018-04-15 Thread Phil Reid
On 16/04/2018 13:19, Phil Reid wrote: G'day Laura, One more comment. On 16/04/2018 12:41, Phil Reid wrote: G'day Laura, On 14/04/2018 05:24, Laura Abbott wrote: The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) to eventually turn on -Wvla

Re: [PATCHv5] gpio: Remove VLA from gpiolib

2018-04-15 Thread Phil Reid
G'day Laura, One more comment. On 16/04/2018 12:41, Phil Reid wrote: G'day Laura, On 14/04/2018 05:24, Laura Abbott wrote: The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) to eventually turn on -Wvla. Using a kmalloc array is the easy

Re: [PATCHv5] gpio: Remove VLA from gpiolib

2018-04-15 Thread Phil Reid
} -static inline void gpiod_set_raw_array_value_cansleep(unsigned int array_size, +static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size, struct gpio_desc **desc_array, int *value_array) { /* GPIO can never have been

Re: [PATCHv4] gpio: Remove VLA from gpiolib

2018-04-14 Thread Phil Reid
On 14/04/2018 05:10, Laura Abbott wrote: On 04/12/2018 05:39 PM, Phil Reid wrote: On 12/04/2018 16:38, Linus Walleij wrote: On Wed, Apr 11, 2018 at 3:03 AM, Laura Abbott wrote: The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) to eventually turn on

Re: [PATCHv4] gpio: Remove VLA from gpiolib

2018-04-12 Thread Phil Reid
er chip? From what I can understand of the code which is admittedly limited. -- Regards Phil Reid

Re: [PATCH v2] net: dsa: b53: Using sleep-able operations in b53_switch_reset_gpio

2018-04-11 Thread Phil Reid
value_cansleep(gpio, 1); + msleep(20); dev->current_page = 0xff; } FWIW: Reviewed-by: Phil Reid

Re: [PATCH] net: dsa: b53: Replace mdelay with msleep in b53_switch_reset_gpio

2018-04-10 Thread Phil Reid
50); + msleep(50); gpio_set_value(gpio, 1); - mdelay(20); + msleep(20); dev->current_page = 0xff; } Would that also imply gpio_set_value could be gpio_set_value_cansleep? -- Regards Phil Reid

Re: [PATCH v3] gpio: Remove VLA from stmpe driver

2018-03-28 Thread Phil Reid
os > MAX_GPIOS) { + dev_err(&pdev->dev, "Need to increase maximum GPIO number\n"); + return -EINVAL; + } + stmpe_gpio = kzalloc(sizeof(*stmpe_gpio), GFP_KERNEL); if (!stmpe_gpio) return -ENOMEM; FWIW Reviewed-by: Phil Reid -- Regards Phil Reid

Re: [PATCH 2/3] dt-bindings: iio: wrapper: add io-channel-unit-converter

2018-03-27 Thread Phil Reid
AC voltage to set output current is also a distinct possibility. -- Regards Phil Reid

Re: [PATCHv2 4/4] gpio: Remove VLA from stmpe driver

2018-03-22 Thread Phil Reid
On 23/03/2018 05:43, Laura Abbott wrote: On 03/18/2018 06:29 PM, Phil Reid wrote: On 16/03/2018 02:00, Laura Abbott wrote: The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) This patch replaces a VLA with an appropriate call to kmalloc_array. Signed

Re: [RESEND PATCH v1 6/6] i2c: i2c-stm32f7: Implement I2C recovery mechanism

2018-03-19 Thread Phil Reid
On 12/03/2018 18:53, Pierre-Yves MORDRET wrote: Feature prevents I2C lock-ups. Mechanism resets I2C state machine and releases SCL/SDA signals but preserves I2C registers. Signed-off-by: Pierre-Yves MORDRET --- Version history: v1: * Initial --- --- drivers/i2c/busses/i2c-stm3

Re: [PATCHv2 4/4] gpio: Remove VLA from stmpe driver

2018-03-18 Thread Phil Reid
rq(int irq, void *dev) } } + kfree(status); return IRQ_HANDLED; } -- Regards Phil Reid

Re: [PATCH 4/4] gpio: Remove VLA from stmpe driver

2018-03-13 Thread Phil Reid
On 14/03/2018 09:16, Laura Abbott wrote: On 03/13/2018 05:18 PM, Laura Abbott wrote: On 03/13/2018 02:13 AM, Phil Reid wrote: On 10/03/2018 08:10, Laura Abbott wrote: The new challenge is to remove VLAs from the kernel (see https://lkml.org/lkml/2018/3/7/621) This patch replaces a VLA with

Re: [PATCH 4/4] gpio: Remove VLA from stmpe driver

2018-03-13 Thread Phil Reid
status); return IRQ_HANDLED; } Doing this in an irq handler seems wrong. Perhaps better if a buffer is pre-allocated in stmpe_gpio -- Regards Phil Reid

Re: [PATCH 3/3] i2c: xlp9xx: Add support for SMBAlert

2018-03-06 Thread Phil Reid
) return err; + err = xlp9xx_i2c_smbus_setup(priv, pdev); + if (err) + dev_info(&pdev->dev, "No active SMBus alert %d\n", err); + platform_set_drvdata(pdev, priv); dev_dbg(&pdev->dev, "I2C bus:%d added\n", priv->adapter.nr); -- 2.1.4 -- Regards Phil Reid

Re: [PATCH v2] iio:dummy: Replace S_IWUSR by 0200

2018-02-22 Thread Phil Reid
I haven't studied up on it in great detail, but isn't there a more specific macro that doesn't need a permission argument at all? Probably thinking of IIO_DEVICE_ATTR_RO / IIO_DEVICE_ATTR_WO But they don't provide flexibility for the show / store method. -- Regards Phil Reid

Re: [PATCH 0/2] net: dsa: lan9303: check error value from devm_gpiod_get_optional()

2018-01-09 Thread Phil Reid
On 7/01/2018 00:54, Egil Hjelmeland wrote: Den 13. nov. 2017 09:07, skrev Phil Reid: Replaces Pan Bian patch "net: dsa: lan9303: correctly check return value of devm_gpiod_get_optional" Errors need to be prograted back from probe. Note: I have only compile tested the code as I don&

Re: [PATCH] pinctrl: mcp23s08: fix irq setup order

2018-01-07 Thread Phil Reid
hip_add_data() calls. But should probably go into stable if it is the fix. -- Regards Phil Reid

Re: [PATCH v4] iio : Add cm3218 smbus ara and acpi support

2017-11-26 Thread Phil Reid
On 25/11/2017 21:57, Jonathan Cameron wrote: On Tue, 21 Nov 2017 09:22:16 +0800 Phil Reid wrote: On 20/11/2017 18:57, Mika Westerberg wrote: +Jarkko On Sun, Nov 19, 2017 at 04:35:51PM +, Jonathan Cameron wrote: On Thu, 2 Nov 2017 16:04:07 +0100 Wolfram Sang wrote: On Thu, Nov 02

Re: [PATCH v4] iio : Add cm3218 smbus ara and acpi support

2017-11-20 Thread Phil Reid
going to notifiy the cm3218 driver. Are there more than one alert/ara capable devices on the bus? Perhaps a workaround in this case is if that acpi entry is defined the cm3218 driver handles that ara request directly to clear the interrupt. -- Regards Phil Reid

[PATCH 2/2] net: dsa: lan9303: check error value from devm_gpiod_get_optional()

2017-11-13 Thread Phil Reid
devm_gpiod_get_optional() can return an error in addition to a NULL ptr. Check for error and propagate that to the probe function. Check return value in probe. This will now handle EPROBE_DEFER for the reset gpio. Signed-off-by: Phil Reid --- drivers/net/dsa/lan9303-core.c | 13 ++--- 1

[PATCH 1/2] net: dsa: lan9303: make lan9303_handle_reset() a void function

2017-11-13 Thread Phil Reid
lan9303_handle_reset never returns anything other than success. So there's not need for it to return an error code. Signed-off-by: Phil Reid --- drivers/net/dsa/lan9303-core.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/dr

[PATCH 0/2] net: dsa: lan9303: check error value from devm_gpiod_get_optional()

2017-11-13 Thread Phil Reid
Replaces Pan Bian patch "net: dsa: lan9303: correctly check return value of devm_gpiod_get_optional" Errors need to be prograted back from probe. Note: I have only compile tested the code as I don't have the hardware. Phil Reid (2): net: dsa: lan9303: make lan9303_handle

Re: [PATCH] net: dsa: lan9303: correctly check return value of devm_gpiod_get_optional

2017-11-12 Thread Phil Reid
ecks lan9303_handle_reset() return value. Probably should be checking lan9303_probe_reset_gpio() instead. -- Regards Phil Reid

Re: [PATCH v4] iio : Add cm3218 smbus ara and acpi support

2017-11-02 Thread Phil Reid
/msg191947.html Cleans up the smbus_alert driver a bit. note: alert_edge_triggered was removed. And for OF systems core creates the ara device. -- Regards Phil Reid

Re: [PATCH] i2c-designware: add i2c gpio recovery option

2017-05-11 Thread Phil Reid
rn an invalid gpio number when desc == null I don't know what the intents are, so don't know if its a "bug" or by design. -- Regards Phil Reid

Re: [PATCH] i2c-designware: add i2c gpio recovery option

2017-05-10 Thread Phil Reid
G'day Andy, Thanks for the review. On 10/05/2017 21:13, Andy Shevchenko wrote: On Wed, 2017-05-10 at 13:57 +0200, Tim Sander wrote: This patch contains much input from Phil Reid and has been tested on Intel/Altera Cyclone V SOC Hardware with Altera GPIO's for the SCL and SDA GP

Re: RFC: i2c designware gpio recovery

2017-05-10 Thread Phil Reid
, rinfo->sda_gpio); return 0; }; A small modification to the i2c-core could be done in i2c_init_recovery to allow: rinfo->recover_bus == i2c_generic_scl_recovery when scl_gpio is also set and fallback to using the core set / get scl / sda calls Which would remove the need f

Re: RFC: i2c designware gpio recovery

2017-05-02 Thread Phil Reid
G'day Tim, On 1/05/2017 21:31, Tim Sander wrote: Good Day Phil Am Montag, 1. Mai 2017, 09:57:35 CEST schrieb Phil Reid: So i took a look into the device tree file socfpga.dtsi and found that the reset lines where not defined (although available in the corresponding reset manager). Is th

Re: RFC: i2c designware gpio recovery

2017-04-30 Thread Phil Reid
7 @@ static int i2c_generic_recovery(struct i2c_adapter *adap) ndelay(RECOVERY_NDELAY); } + dev_err(&adap->dev,"recovery cycle\n"); if (bri->unprepare_recovery) bri->unprepare_recovery(adap); @@ -839,10 +843,12 @@ int i2c_generic_gpio_recovery(struct i2c_adapter *adap) { int ret; + ret = i2c_get_gpios_for_recovery(adap); if (ret) return ret; + dev_err(&adap->dev,"i2c_generic_gpio_recovery have gpios\n"); ret = i2c_generic_recovery(adap); i2c_put_gpios_for_recovery(adap); -- Regards Phil Reid

Re: RFC: i2c designware gpio recovery

2017-04-30 Thread Phil Reid
t;disabled"; @@ -673,6 +676,7 @@ #size-cells = <0>; compatible = "snps,designware-i2c"; reg = <0xffc07000 0x1000>; + resets = <&rst I2C3_RESET>; clocks

[PATCH v2 1/1] gpio: altera: Use handle_level_irq when configured as a level_high

2017-02-19 Thread Phil Reid
before the irq was disabled as faulty. handle_level_irq should be used in this situation instead of handle_simple_irq. In gpiochip_irqchip_add set default handler to handle_bad_irq as per Documentation/gpio/driver.txt. Then set the correct handler in the set_type callback. Signed-off-by: Phil Reid

Re: [PATCH 1/1] gpio: altera: Use handle_level_irq when configured as a level_high

2017-02-17 Thread Phil Reid
On 17/02/2017 17:23, Andy Shevchenko wrote: On Fri, Feb 17, 2017 at 11:12 AM, Phil Reid wrote: When a threaded irq handler is chained attached to one of the gpio pins when configure for level irq the altera_gpio_irq_leveL_high_handler does not mask the interrupt while being handled by the

[PATCH 1/1] gpio: altera: Use handle_level_irq when configured as a level_high

2017-02-17 Thread Phil Reid
before the irq was disabled as faulty. It looks like handle_level_irq should be used in this situation instead of handle_simple_irq. Signed-off-by: Phil Reid --- drivers/gpio/gpio-altera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-altera.c b/drivers

Re: [PATCH v2] stmmac: CSR clock configuration fix

2016-12-22 Thread Phil Reid
G'day Joao, On 23/12/2016 01:06, Joao Pinto wrote: Às 4:57 PM de 12/22/2016, Phil Reid escreveu: On 22/12/2016 23:47, Joao Pinto wrote: Hello Phil, Às 3:42 PM de 12/22/2016, Phil Reid escreveu: G'day Joao, On 22/12/2016 20:38, Joao Pinto wrote: When testing stmmac with my QoS

Re: [PATCH v2] stmmac: CSR clock configuration fix

2016-12-22 Thread Phil Reid
On 22/12/2016 23:47, Joao Pinto wrote: Hello Phil, Às 3:42 PM de 12/22/2016, Phil Reid escreveu: G'day Joao, On 22/12/2016 20:38, Joao Pinto wrote: When testing stmmac with my QoS reference design I checked a problem in the CSR clock configuration that was impossibilitating th

Re: [PATCH v2] stmmac: CSR clock configuration fix

2016-12-22 Thread Phil Reid
r_mask) - << priv->hw->mii.clk_csr_shift); + value |= (priv->clk_csr << priv->hw->mii.clk_csr_shift) + & priv->hw->mii.clk_csr_mask; if (priv->plat->has_gmac4) value |= MII_GMAC4_WRITE; -- Regards Phil Reid

Re: [PATCH 2/2] power: supply: add sbs-charger driver

2016-11-22 Thread Phil Reid
On 23/11/2016 09:06, Phil Reid wrote: G'day Nicola, On 22/11/2016 02:04, Nicola Saenz Julienne wrote: This adds support for sbs-charger compilant chips as defined here: http://sbs-forum.org/specs/sbc110.pdf You may want to look at the series: power: supply: sbs-manager add driver.

Re: [PATCH 2/2] power: supply: add sbs-charger driver

2016-11-22 Thread Phil Reid
{ .compatible = "sbs,sbs-charger" }, + { }, +}; +MODULE_DEVICE_TABLE(of, sbs_dt_ids); +#endif + +static const struct i2c_device_id sbs_id[] = { + { "sbs-charger", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, sbs_id); + +static struct i2c_driver sbs_driver = { + .probe

Re: [PATCH] power: supply: sbs-battery: simplify DT parsing

2016-09-19 Thread Phil Reid
{ .probe = sbs_probe, .remove = sbs_remove, .id_table = sbs_id, .driver = { .name = "sbs-battery", - .of_match_table = of_match_ptr(sbs_dt_ids), + .of_match_table = sbs_dt_ids, .pm = SBS_PM_OPS, }, }; Also sbs_external_power_changed is still referencing chip->pdata->poll_retry_count. Which I think will result in null pointer dereference now. -- Regards Phil Reid

Re: [PATCH] gpio: pca953x: initialize ret to zero to avoid returning garbage

2016-09-12 Thread Phil Reid
f-by: Colin Ian King Patch applied. G'day Linus, I believe this does the same as Arnd Bergmanns patch from 26 Aug. [PATCH 1/5] gpio: pca954x: fix undefined error code from remove IMO Colin's is the cleaner solution. Arnd's could be removed. -- Regards Phil Reid

Re: [PATCH 1/5] gpio: pca954x: fix undefined error code from remove

2016-08-26 Thread Phil Reid
ulator and enable it") Cc: Phil Reid --- Cc: Linus Walleij Cc: Alexandre Courbot Cc: linux-g...@vger.kernel.org drivers/gpio/gpio-pca953x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index cbe2824461eb..b9d31d737dbf

Re: [RFC PATCH 1/1] i2c: i2c-mux-pca954x: Add interrupt controller support.

2016-08-01 Thread Phil Reid
On 1/08/2016 16:22, Peter Rosin wrote: On 2016-08-01 08:25, Phil Reid wrote: On 29/07/2016 13:48, Peter Rosin wrote: Ok, I think I get the problem, but I too am at a loss and see no elegant solution. One sad thing about your workaround is that it is not working at all unless there is an irq

Re: [RFC PATCH 1/1] i2c: i2c-mux-pca954x: Add interrupt controller support.

2016-07-31 Thread Phil Reid
On 29/07/2016 13:48, Peter Rosin wrote: On 2016-07-28 04:44, Phil Reid wrote: G'day Peter, Thanks for the feedback. +linux-kernel@vger.kernel.org On 27/07/2016 13:32, Peter Rosin wrote: On 2016-07-27 05:05, Phil Reid wrote: +static void pca954x_irq_mask(struct irq_data *

Re: [RFC PATCH 1/1] i2c: i2c-mux-pca954x: Add interrupt controller support.

2016-07-27 Thread Phil Reid
G'day Peter, Thanks for the feedback. +linux-kernel@vger.kernel.org On 27/07/2016 13:32, Peter Rosin wrote: On 2016-07-27 05:05, Phil Reid wrote: The pca9543 can aggregate multiple interrupts from each i2c bus. However it provides no ability to mask interrupts on each channel. So if on

Re: [PATCHv2] backlight: pwm_bl: disable PWM when 'duty_cycle' is zero

2016-06-19 Thread Phil Reid
y_cycle 0 100 PWM active with 100% duty cycle (constant HIGH) 1 99 PWM active with near full duty cycle ... 991 PWM active with near ZERO duty cycle 1000 PWM disabled => constant LOW pwm_backlight_power_off() disables the regulator. So the supply to Backlight disappears, regardless of constant low... -- Regards Phil Reid

Re: [PATCH v2] gpio: pca953x: Use correct u16 value for register word write

2016-03-30 Thread Phil Reid
On 30/03/2016 2:49 PM, Yong Li wrote: The current implementation only uses the first byte in val, the second byte is always 0. Change it to use cpu_to_le16 to write the two bytes into the register Signed-off-by: Yong Li Reviewed-by: Phil Reid --- drivers/gpio/gpio-pca953x.c | 3 ++- 1

Re: [PATCH] gpio: pca953x: Use correct u16 value for register word write

2016-03-29 Thread Phil Reid
u16 *) val)) -- Regards Phil Reid

Re: [PATCH] gpio: pca953x: Use correct u16 value for register word write

2016-03-29 Thread Phil Reid
here's also get_unaligned_le* get_unaligned_be* -- Regards Phil Reid

Re: [PATCH] gpio: pca953x: Use correct u16 value for register word write

2016-03-29 Thread Phil Reid
reg << 1, *(u16 *)val); I don't think this is safe for systems that don't support unaligned memory access. break; case PCA957X_TYPE: ret = i2c_smbus_write_byte_data(chip->client, reg << 1, -- Regards Phil Reid

Re: [PATCH] gpio: 74x164: Implement gpiochip.set_multiple()

2016-03-14 Thread Phil Reid
On 14/03/2016 11:19 PM, Geert Uytterhoeven wrote: This allows to set multiple outputs using a single SPI transfer. Signed-off-by: Geert Uytterhoeven Reviewed-by: Phil Reid I do have a general question about GPIO drivers. pca953x does not update the cached data unless the write operation

Re: [PATCH] gpio: pca953x: Fix pca953x_gpio_set_multiple() on 64-bit

2016-03-12 Thread Phil Reid
set_multiple to allow multiple bits to be set in one write.") Signed-off-by: Geert Uytterhoeven Acked-by: Phil Reid --- Untested, found by code inspection. This bug was introduced in v4.5-rc1, but unless Linus (the other one ;-) will make a v4.5-rc8, it's probably too late