Re: [PATCH v2] i2c: bcm2835: Model Divider in CCF

Annaliese McDermond
2019-05-29T03:01:56Z

> On May 28, 2019, at 12:52 AM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
>
> Hi Annaliese,
>
> thank you for mention that we have multiple I2C interfaces.
>
> On 08.05.19 09:12, Annaliese McDermond wrote:
>> +
>> +static struct clk *bcm2835_i2c_register_div(struct device *dev,
>> + const char *mclk_name,
>> + struct bcm2835_i2c_dev *i2c_dev)
>> +{
>> + struct clk_init_data init;
>> + struct clk_bcm2835_i2c *priv;
>> + const char *devname = dev_name(dev);
>> +
>> + init.ops = &clk_bcm2835_i2c_ops;
>> + init.name = "bcm2835-i2c";
>
> Does this work intentionally in case i2c-0 and i2c-1 are used at the
> same time?

It should work fine. The clocks are all registered separately and passed
the pointer to the struct device for the interface. This keeps it
accessing the correct registers and such.

> Please also check the output of /sys/kernel/debug/clk/clk_summary

They’ll come up with the same name in the current code in the debug
output. I agree this is mildly confusing and I’ll spin another version
of the patch to give them unique clock names in clk_summary.

> Regards
> Stefan
>

--
Annaliese McDermonod
nh6z@nh6z.net