| 123456789101112131415161718192021222324252627282930313233 |
- /* Polled Synopsys DesignWare APB I2C master. Used by the Braswell LPSS
- * controllers, in particular the one the HID-over-I2C touchpad sits on. */
- #ifndef I2C_H
- #define I2C_H
- /* Probe and initialize the controller at a physical MMIO base. Returns 0
- * when the DesignWare component type matches. */
- int i2c_dw_init(unsigned int base);
- /* True when the controller at base looks like a DesignWare I2C block. */
- int i2c_dw_present(unsigned int base);
- /* TX_ABRT_SOURCE of the last failed transfer (0 = timeout, not a NAK). */
- extern unsigned int i2c_last_abort;
- /* Raw component-type / reset-release access for the LPSS scan. */
- unsigned int i2c_dw_comp_type(unsigned int base);
- void i2c_dw_reset_release(unsigned int base);
- /* Sunrise Point-LP only: enable the LPSS functional clock gate and set
- * the fractional divider (0x200). The BIOS leaves it off for unused
- * LPSS blocks; the register file still answers, but the I2C FSM does not
- * drive the bus. */
- void i2c_dw_clock_spt(unsigned int base);
- /* One-line controller register dump for the seriallog. */
- void i2c_dw_dump(unsigned int base);
- /* Combined write + repeated-start read, the form HID-over-I2C uses for
- * register-addressed transfers. Either buffer may be empty. */
- int i2c_dw_transfer(unsigned int base, unsigned int addr,
- const unsigned char *wr, unsigned int wrlen,
- unsigned char *rd, unsigned int rdlen);
- #endif
|