Lines Matching refs:pld
65 struct kempld_device_data *pld; member
92 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_process() local
93 u8 stat = kempld_read8(pld, KEMPLD_I2C_STAT); in kempld_i2c_process()
103 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_IACK); in kempld_i2c_process()
112 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_STOP); in kempld_i2c_process()
135 kempld_write8(pld, KEMPLD_I2C_DATA, addr); in kempld_i2c_process()
136 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_START); in kempld_i2c_process()
143 kempld_write8(pld, KEMPLD_I2C_DATA, i2c->msg->addr & 0xff); in kempld_i2c_process()
144 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_WRITE); in kempld_i2c_process()
155 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_STOP); in kempld_i2c_process()
159 msg->buf[i2c->pos++] = kempld_read8(pld, KEMPLD_I2C_DATA); in kempld_i2c_process()
178 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_STOP); in kempld_i2c_process()
184 kempld_write8(pld, KEMPLD_I2C_CMD, i2c->pos == (msg->len - 1) ? in kempld_i2c_process()
187 kempld_write8(pld, KEMPLD_I2C_DATA, msg->buf[i2c->pos++]); in kempld_i2c_process()
188 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_WRITE); in kempld_i2c_process()
198 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_xfer() local
209 kempld_get_mutex(pld); in kempld_i2c_xfer()
211 kempld_release_mutex(pld); in kempld_i2c_xfer()
232 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_device_init() local
240 ctrl = kempld_read8(pld, KEMPLD_I2C_CTRL); in kempld_i2c_device_init()
242 kempld_write8(pld, KEMPLD_I2C_CTRL, ctrl); in kempld_i2c_device_init()
247 if (pld->info.spec_major == 1) in kempld_i2c_device_init()
248 prescale = pld->pld_clock / (bus_frequency * 5) - 1000; in kempld_i2c_device_init()
250 prescale = pld->pld_clock / (bus_frequency * 4) - 3000; in kempld_i2c_device_init()
260 kempld_write8(pld, KEMPLD_I2C_PRELOW, prescale_corr & 0xff); in kempld_i2c_device_init()
261 kempld_write8(pld, KEMPLD_I2C_PREHIGH, prescale_corr >> 8); in kempld_i2c_device_init()
264 cfg = kempld_read8(pld, KEMPLD_CFG); in kempld_i2c_device_init()
269 kempld_write8(pld, KEMPLD_CFG, cfg); in kempld_i2c_device_init()
272 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_IACK); in kempld_i2c_device_init()
274 kempld_write8(pld, KEMPLD_I2C_CTRL, ctrl); in kempld_i2c_device_init()
276 stat = kempld_read8(pld, KEMPLD_I2C_STAT); in kempld_i2c_device_init()
278 kempld_write8(pld, KEMPLD_I2C_CMD, I2C_CMD_STOP); in kempld_i2c_device_init()
300 struct kempld_device_data *pld = dev_get_drvdata(pdev->dev.parent); in kempld_i2c_probe() local
309 i2c->pld = pld; in kempld_i2c_probe()
316 kempld_get_mutex(pld); in kempld_i2c_probe()
317 ctrl = kempld_read8(pld, KEMPLD_I2C_CTRL); in kempld_i2c_probe()
323 kempld_release_mutex(pld); in kempld_i2c_probe()
341 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_remove() local
344 kempld_get_mutex(pld); in kempld_i2c_remove()
350 ctrl = kempld_read8(pld, KEMPLD_I2C_CTRL); in kempld_i2c_remove()
352 kempld_write8(pld, KEMPLD_I2C_CTRL, ctrl); in kempld_i2c_remove()
354 kempld_release_mutex(pld); in kempld_i2c_remove()
365 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_suspend() local
368 kempld_get_mutex(pld); in kempld_i2c_suspend()
369 ctrl = kempld_read8(pld, KEMPLD_I2C_CTRL); in kempld_i2c_suspend()
371 kempld_write8(pld, KEMPLD_I2C_CTRL, ctrl); in kempld_i2c_suspend()
372 kempld_release_mutex(pld); in kempld_i2c_suspend()
380 struct kempld_device_data *pld = i2c->pld; in kempld_i2c_resume() local
382 kempld_get_mutex(pld); in kempld_i2c_resume()
384 kempld_release_mutex(pld); in kempld_i2c_resume()