Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-19 Thread Heiko Schocher
Hello Philip, On 18.10.23 18:10, Simon Glass wrote: > Hi Philip, > > On Wed, 18 Oct 2023 at 05:00, Philip Oberfichtner > wrote: >> >> Hi Heiko, >> >> On Wed, Oct 18, 2023 at 06:31:57AM +0200, Heiko Schocher wrote: >> > [...] >> > >> > May Philip can use uclass_get_device_by_

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-18 Thread Simon Glass
Hi Philip, On Wed, 18 Oct 2023 at 05:00, Philip Oberfichtner wrote: > > Hi Heiko, > > On Wed, Oct 18, 2023 at 06:31:57AM +0200, Heiko Schocher wrote: > > [...] > > > > May Philip can use uclass_get_device_by_phandle and try a list of > > possible UCLASS candidates, like UCLASS_RTC, UCLASS_I2C_EEP

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-18 Thread Philip Oberfichtner
Hi Heiko, On Wed, Oct 18, 2023 at 06:31:57AM +0200, Heiko Schocher wrote: > [...] > > May Philip can use uclass_get_device_by_phandle and try a list of > possible UCLASS candidates, like UCLASS_RTC, UCLASS_I2C_EEPROM, > UCLASS_POWER,... and if found, check if parent is UCLASS_I2C... > > may not

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-17 Thread Heiko Schocher
Hello Simon, On 18.10.23 05:33, Simon Glass wrote: > Hi Philip, > > On Tue, 17 Oct 2023 at 06:57, Philip Oberfichtner wrote: >> >> Hi Simon, >> >> maybe you can give me a hint on how to implement this cleanly in driver >> model? >> >> To sum it up, I'd like to have a phandle pointing to *any* I2

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-17 Thread Simon Glass
Hi Philip, On Tue, 17 Oct 2023 at 06:57, Philip Oberfichtner wrote: > > Hi Simon, > > maybe you can give me a hint on how to implement this cleanly in driver > model? > > To sum it up, I'd like to have a phandle pointing to *any* I2C device, > not knowing which UCLASS actually fits. Then the devi

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-17 Thread Philip Oberfichtner
Hi Simon, maybe you can give me a hint on how to implement this cleanly in driver model? To sum it up, I'd like to have a phandle pointing to *any* I2C device, not knowing which UCLASS actually fits. Then the device and the parent bus should be probed/prepared such that dm_i2c_read() can be used.

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-13 Thread Philip Oberfichtner
Hello Heiko, On Fri, Oct 13, 2023 at 01:28:47PM +0200, Heiko Schocher wrote: > [...] > > > > bootcount { > > compatible = "u-boot,bootcount-i2c"; > > i2c-bus = <&i2c1>; > > address = <0x52>; > > Hmm.. do we really need this here with DTS. Why not using a p

Re: [PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-13 Thread Heiko Schocher
Hello Philip, On 13.10.23 11:43, Philip Richard Oberfichtner wrote: > This adds a generic I2C bootcounter adhering to driver model to replace > the previously removed legacy implementation. > > There is no change in functionality, it can be used on any I2C device. > The device tree configuration

[PATCH 2/2] bootcount: Add driver model I2C driver

2023-10-13 Thread Philip Richard Oberfichtner
This adds a generic I2C bootcounter adhering to driver model to replace the previously removed legacy implementation. There is no change in functionality, it can be used on any I2C device. The device tree configuration may look like this for example: bootcount { compatible