xref: /linux/drivers/gpu/drm/xe/xe_amc.h (revision f43fa4b8522ba6038b77e86e5f0d94be35effcde)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _XE_AMC_H_
3 #define _XE_AMC_H_
4 
5 #include <linux/i2c.h>
6 
7 #include "xe_device.h"
8 
9 struct xe_i2c;
10 
11 static inline struct xe_device *i2c_adapter_to_xe_device(struct i2c_adapter *adapter)
12 {
13 	return kdev_to_xe_device(adapter->dev.parent->parent);
14 }
15 
16 static inline struct xe_device *i2c_client_to_xe_device(struct i2c_client *client)
17 {
18 	return i2c_adapter_to_xe_device(client->adapter);
19 }
20 
21 int xe_amc_init(struct xe_i2c *i2c);
22 void xe_amc_exit(struct xe_i2c *i2c);
23 void xe_amc_handle_alert(struct xe_i2c *i2c);
24 
25 #endif /* _XE_AMC_H_ */
26