blob: c2303c3e4803577d4d0b2fb7533e4ddb1638a0e7 [file] [log] [blame]
Srinidhi Kasagare208c442010-02-01 14:58:22 +01001/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2, as
6 * published by the Free Software Foundation.
7 */
Alessandro Rubiniaf97bac2012-06-11 22:56:26 +02008#ifndef __PDATA_I2C_NOMADIK_H
9#define __PDATA_I2C_NOMADIK_H
Srinidhi Kasagare208c442010-02-01 14:58:22 +010010
11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
Linus Walleij2320f502011-05-13 12:29:20 +020014 I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */
Srinidhi Kasagare208c442010-02-01 14:58:22 +010015 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
Srinidhi Kasagare208c442010-02-01 14:58:22 +010016};
17
18/**
19 * struct nmk_i2c_controller - client specific controller configuration
20 * @clk_freq: clock frequency for the operation mode
21 * @slsu: Slave data setup time in ns.
22 * The needed setup time for three modes of operation
23 * are 250ns, 100ns and 10ns respectively thus leading
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes
Virupax Sadashivpetimath97727602011-05-13 12:29:12 +020027 * @timeout Slave response timeout(ms)
Srinidhi Kasagare208c442010-02-01 14:58:22 +010028 * @sm: speed mode
29 */
30struct nmk_i2c_controller {
31 unsigned long clk_freq;
32 unsigned short slsu;
Virupax Sadashivpetimath97727602011-05-13 12:29:12 +020033 unsigned char tft;
34 unsigned char rft;
35 int timeout;
Srinidhi Kasagare208c442010-02-01 14:58:22 +010036 enum i2c_freq_mode sm;
37};
38
Alessandro Rubiniaf97bac2012-06-11 22:56:26 +020039#endif /* __PDATA_I2C_NOMADIK_H */