mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
i2c: designware_i2c: Support ACPI table generation
Update the PCI driver to generate ACPI information so that Linux has the full information about each I2C bus. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> [bmeng: Correct one typo in dw_i2c_gen_speed_config() comments] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -205,6 +205,7 @@ struct dw_i2c {
|
||||
#if CONFIG_IS_ENABLED(CLK)
|
||||
struct clk clk;
|
||||
#endif
|
||||
struct dw_i2c_speed_config config;
|
||||
};
|
||||
|
||||
extern const struct dm_i2c_ops designware_i2c_ops;
|
||||
@@ -213,4 +214,18 @@ int designware_i2c_probe(struct udevice *bus);
|
||||
int designware_i2c_remove(struct udevice *dev);
|
||||
int designware_i2c_ofdata_to_platdata(struct udevice *bus);
|
||||
|
||||
/**
|
||||
* dw_i2c_gen_speed_config() - Calculate config info from requested speed
|
||||
*
|
||||
* Calculate the speed config from the given @speed_hz and return it so that
|
||||
* it can be incorporated in ACPI tables
|
||||
*
|
||||
* @dev: I2C bus to check
|
||||
* @speed_hz: Requested speed in Hz
|
||||
* @config: Returns config to use for that speed
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int dw_i2c_gen_speed_config(const struct udevice *dev, int speed_hz,
|
||||
struct dw_i2c_speed_config *config);
|
||||
|
||||
#endif /* __DW_I2C_H_ */
|
||||
|
Reference in New Issue
Block a user