| .. | .. |
|---|
| 118 | 118 | static int thunder_i2c_smbus_setup_of(struct octeon_i2c *i2c, |
|---|
| 119 | 119 | struct device_node *node) |
|---|
| 120 | 120 | { |
|---|
| 121 | + struct i2c_client *ara; |
|---|
| 122 | + |
|---|
| 121 | 123 | if (!node) |
|---|
| 122 | 124 | return -EINVAL; |
|---|
| 123 | 125 | |
|---|
| .. | .. |
|---|
| 125 | 127 | if (!i2c->alert_data.irq) |
|---|
| 126 | 128 | return -EINVAL; |
|---|
| 127 | 129 | |
|---|
| 128 | | - i2c->ara = i2c_setup_smbus_alert(&i2c->adap, &i2c->alert_data); |
|---|
| 129 | | - if (!i2c->ara) |
|---|
| 130 | | - return -ENODEV; |
|---|
| 130 | + ara = i2c_new_smbus_alert_device(&i2c->adap, &i2c->alert_data); |
|---|
| 131 | + if (IS_ERR(ara)) |
|---|
| 132 | + return PTR_ERR(ara); |
|---|
| 133 | + |
|---|
| 134 | + i2c->ara = ara; |
|---|
| 135 | + |
|---|
| 131 | 136 | return 0; |
|---|
| 132 | 137 | } |
|---|
| 133 | 138 | |
|---|
| .. | .. |
|---|
| 178 | 183 | thunder_i2c_clock_enable(dev, i2c); |
|---|
| 179 | 184 | ret = device_property_read_u32(dev, "clock-frequency", &i2c->twsi_freq); |
|---|
| 180 | 185 | if (ret) |
|---|
| 181 | | - i2c->twsi_freq = 100000; |
|---|
| 186 | + i2c->twsi_freq = I2C_MAX_STANDARD_MODE_FREQ; |
|---|
| 182 | 187 | |
|---|
| 183 | 188 | init_waitqueue_head(&i2c->queue); |
|---|
| 184 | 189 | |
|---|
| .. | .. |
|---|
| 208 | 213 | i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info; |
|---|
| 209 | 214 | i2c->adap.dev.parent = dev; |
|---|
| 210 | 215 | i2c->adap.dev.of_node = pdev->dev.of_node; |
|---|
| 216 | + i2c->adap.dev.fwnode = dev->fwnode; |
|---|
| 211 | 217 | snprintf(i2c->adap.name, sizeof(i2c->adap.name), |
|---|
| 212 | 218 | "Cavium ThunderX i2c adapter at %s", dev_name(dev)); |
|---|
| 213 | 219 | i2c_set_adapdata(&i2c->adap, i2c); |
|---|