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