Lines Matching +full:i2c +full:- +full:isp

1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/i2c.h>
31 MODULE_DEVICE_TABLE(i2c, isp1301_id);
41 static int __isp1301_write(struct isp1301 *isp, u8 reg, u8 value, u8 clear) in __isp1301_write() argument
43 return i2c_smbus_write_byte_data(isp->client, reg | clear, value); in __isp1301_write()
46 static int isp1301_write(struct isp1301 *isp, u8 reg, u8 value) in isp1301_write() argument
48 return __isp1301_write(isp, reg, value, 0); in isp1301_write()
51 static int isp1301_clear(struct isp1301 *isp, u8 reg, u8 value) in isp1301_clear() argument
53 return __isp1301_write(isp, reg, value, ISP1301_I2C_REG_CLEAR_ADDR); in isp1301_clear()
58 struct isp1301 *isp = phy_to_isp(phy); in isp1301_phy_init() local
61 isp1301_clear(isp, ISP1301_I2C_MODE_CONTROL_1, MC1_UART_EN); in isp1301_phy_init()
62 isp1301_clear(isp, ISP1301_I2C_MODE_CONTROL_1, ~MC1_SPEED_REG); in isp1301_phy_init()
63 isp1301_write(isp, ISP1301_I2C_MODE_CONTROL_1, MC1_SPEED_REG); in isp1301_phy_init()
64 isp1301_clear(isp, ISP1301_I2C_MODE_CONTROL_2, ~0); in isp1301_phy_init()
65 isp1301_write(isp, ISP1301_I2C_MODE_CONTROL_2, (MC2_BI_DI | MC2_PSW_EN in isp1301_phy_init()
68 isp1301_clear(isp, ISP1301_I2C_OTG_CONTROL_1, ~0); in isp1301_phy_init()
69 isp1301_write(isp, ISP1301_I2C_MODE_CONTROL_1, MC1_DAT_SE0); in isp1301_phy_init()
70 isp1301_write(isp, ISP1301_I2C_OTG_CONTROL_1, (OTG1_DM_PULLDOWN in isp1301_phy_init()
72 isp1301_clear(isp, ISP1301_I2C_OTG_CONTROL_1, (OTG1_DM_PULLUP in isp1301_phy_init()
76 isp1301_clear(isp, ISP1301_I2C_INTERRUPT_LATCH, ~0); in isp1301_phy_init()
77 isp1301_clear(isp, ISP1301_I2C_INTERRUPT_FALLING, ~0); in isp1301_phy_init()
78 isp1301_clear(isp, ISP1301_I2C_INTERRUPT_RISING, ~0); in isp1301_phy_init()
85 struct isp1301 *isp = phy_to_isp(phy); in isp1301_phy_set_vbus() local
88 isp1301_write(isp, ISP1301_I2C_OTG_CONTROL_1, OTG1_VBUS_DRV); in isp1301_phy_set_vbus()
90 isp1301_clear(isp, ISP1301_I2C_OTG_CONTROL_1, OTG1_VBUS_DRV); in isp1301_phy_set_vbus()
97 struct isp1301 *isp; in isp1301_probe() local
100 isp = devm_kzalloc(&client->dev, sizeof(*isp), GFP_KERNEL); in isp1301_probe()
101 if (!isp) in isp1301_probe()
102 return -ENOMEM; in isp1301_probe()
104 isp->client = client; in isp1301_probe()
105 mutex_init(&isp->mutex); in isp1301_probe()
107 phy = &isp->phy; in isp1301_probe()
108 phy->dev = &client->dev; in isp1301_probe()
109 phy->label = DRV_NAME; in isp1301_probe()
110 phy->init = isp1301_phy_init; in isp1301_probe()
111 phy->set_vbus = isp1301_phy_set_vbus; in isp1301_probe()
112 phy->type = USB_PHY_TYPE_USB2; in isp1301_probe()
114 i2c_set_clientdata(client, isp); in isp1301_probe()
124 struct isp1301 *isp = i2c_get_clientdata(client); in isp1301_remove() local
126 usb_remove_phy(&isp->phy); in isp1301_remove()
146 /* reference of ISP1301 I2C node via DT */ in isp1301_get_client()
151 /* non-DT: only one ISP1301 chip supported */ in isp1301_get_client()