xref: /linux/drivers/i2c/busses/i2c-ccgx-ucsi.c (revision 24168c5e6dfbdd5b414f048f47f75d64533296ca)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Instantiate UCSI device for Cypress CCGx Type-C controller.
4  * Derived from i2c-designware-pcidrv.c and i2c-nvidia-gpu.c.
5  */
6 
7 #include <linux/i2c.h>
8 #include <linux/export.h>
9 #include <linux/module.h>
10 #include <linux/string.h>
11 
12 #include "i2c-ccgx-ucsi.h"
13 
14 struct software_node;
15 
16 struct i2c_client *i2c_new_ccgx_ucsi(struct i2c_adapter *adapter, int irq,
17 				     const struct software_node *swnode)
18 {
19 	struct i2c_board_info info = {};
20 
21 	strscpy(info.type, "ccgx-ucsi", sizeof(info.type));
22 	info.addr = 0x08;
23 	info.irq = irq;
24 	info.swnode = swnode;
25 
26 	return i2c_new_client_device(adapter, &info);
27 }
28 EXPORT_SYMBOL_GPL(i2c_new_ccgx_ucsi);
29 
30 MODULE_LICENSE("GPL");
31