Message ID | 20181210084111.6938-2-tudor.ambarus@microchip.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | i2c: enable buses to save their clock frequency in adapter | expand |
Hi Tudor,
thanks for your patience! Now that the at91 refactoring for the I2C
slave support is merged, we can keep going forward with your patches. As
I told you personally, I am positive in general about this change.
> + u32 bus_freq_hz;
Why not unsigned int?
I also think we should have accessor functions for this new member. They
will be very simple currently because we don't really support changing
the bus frequency at runtime. However, I can see that it could be added
somewhen on top of this change, and then we need to extend the accessor
functions with some locking.
For now, I think this can be solved with simple policy: The value has to
be set before calling i2c_add_adapter(). Also, we should define that '0'
means 'value not set'.
So far about my thoughts. Any more comments from the list are welcome!
Thanks,
Wolfram
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 65b4eaed1d96..f238da204c49 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -677,6 +677,7 @@ struct i2c_adapter { struct rt_mutex bus_lock; struct rt_mutex mux_lock; + u32 bus_freq_hz; int timeout; /* in jiffies */ int retries; struct device dev; /* the adapter device */