Lines Matching refs:chan
44 struct i810fb_i2c_chan *chan = data; in i810i2c_setscl() local
45 struct i810fb_par *par = chan->par; in i810i2c_setscl()
49 i810_writel(mmio, chan->ddc_base, SCL_DIR_MASK | SCL_VAL_MASK); in i810i2c_setscl()
51 i810_writel(mmio, chan->ddc_base, SCL_DIR | SCL_DIR_MASK | SCL_VAL_MASK); in i810i2c_setscl()
52 i810_readl(mmio, chan->ddc_base); /* flush posted write */ in i810i2c_setscl()
57 struct i810fb_i2c_chan *chan = data; in i810i2c_setsda() local
58 struct i810fb_par *par = chan->par; in i810i2c_setsda()
62 i810_writel(mmio, chan->ddc_base, SDA_DIR_MASK | SDA_VAL_MASK); in i810i2c_setsda()
64 i810_writel(mmio, chan->ddc_base, SDA_DIR | SDA_DIR_MASK | SDA_VAL_MASK); in i810i2c_setsda()
65 i810_readl(mmio, chan->ddc_base); /* flush posted write */ in i810i2c_setsda()
70 struct i810fb_i2c_chan *chan = data; in i810i2c_getscl() local
71 struct i810fb_par *par = chan->par; in i810i2c_getscl()
74 i810_writel(mmio, chan->ddc_base, SCL_DIR_MASK); in i810i2c_getscl()
75 i810_writel(mmio, chan->ddc_base, 0); in i810i2c_getscl()
76 return ((i810_readl(mmio, chan->ddc_base) & SCL_VAL_IN) != 0); in i810i2c_getscl()
81 struct i810fb_i2c_chan *chan = data; in i810i2c_getsda() local
82 struct i810fb_par *par = chan->par; in i810i2c_getsda()
85 i810_writel(mmio, chan->ddc_base, SDA_DIR_MASK); in i810i2c_getsda()
86 i810_writel(mmio, chan->ddc_base, 0); in i810i2c_getsda()
87 return ((i810_readl(mmio, chan->ddc_base) & SDA_VAL_IN) != 0); in i810i2c_getsda()
90 static int i810_setup_i2c_bus(struct i810fb_i2c_chan *chan, const char *name) in i810_setup_i2c_bus() argument
94 strcpy(chan->adapter.name, name); in i810_setup_i2c_bus()
95 chan->adapter.owner = THIS_MODULE; in i810_setup_i2c_bus()
96 chan->adapter.algo_data = &chan->algo; in i810_setup_i2c_bus()
97 chan->adapter.dev.parent = &chan->par->dev->dev; in i810_setup_i2c_bus()
98 chan->algo.setsda = i810i2c_setsda; in i810_setup_i2c_bus()
99 chan->algo.setscl = i810i2c_setscl; in i810_setup_i2c_bus()
100 chan->algo.getsda = i810i2c_getsda; in i810_setup_i2c_bus()
101 chan->algo.getscl = i810i2c_getscl; in i810_setup_i2c_bus()
102 chan->algo.udelay = 10; in i810_setup_i2c_bus()
103 chan->algo.timeout = (HZ/2); in i810_setup_i2c_bus()
104 chan->algo.data = chan; in i810_setup_i2c_bus()
106 i2c_set_adapdata(&chan->adapter, chan); in i810_setup_i2c_bus()
109 chan->algo.setsda(chan, 1); in i810_setup_i2c_bus()
110 chan->algo.setscl(chan, 1); in i810_setup_i2c_bus()
113 rc = i2c_bit_add_bus(&chan->adapter); in i810_setup_i2c_bus()
116 dev_dbg(&chan->par->dev->dev, "I2C bus %s registered.\n",name); in i810_setup_i2c_bus()
118 dev_warn(&chan->par->dev->dev, "Failed to register I2C bus " in i810_setup_i2c_bus()
120 chan->par = NULL; in i810_setup_i2c_bus()
128 par->chan[0].par = par; in i810_create_i2c_busses()
129 par->chan[1].par = par; in i810_create_i2c_busses()
130 par->chan[2].par = par; in i810_create_i2c_busses()
132 par->chan[0].ddc_base = GPIOA; in i810_create_i2c_busses()
133 i810_setup_i2c_bus(&par->chan[0], "I810-DDC"); in i810_create_i2c_busses()
134 par->chan[1].ddc_base = GPIOB; in i810_create_i2c_busses()
135 i810_setup_i2c_bus(&par->chan[1], "I810-I2C"); in i810_create_i2c_busses()
136 par->chan[2].ddc_base = GPIOC; in i810_create_i2c_busses()
137 i810_setup_i2c_bus(&par->chan[2], "I810-GPIOC"); in i810_create_i2c_busses()
142 if (par->chan[0].par) in i810_delete_i2c_busses()
143 i2c_del_adapter(&par->chan[0].adapter); in i810_delete_i2c_busses()
144 par->chan[0].par = NULL; in i810_delete_i2c_busses()
146 if (par->chan[1].par) in i810_delete_i2c_busses()
147 i2c_del_adapter(&par->chan[1].adapter); in i810_delete_i2c_busses()
148 par->chan[1].par = NULL; in i810_delete_i2c_busses()
150 if (par->chan[2].par) in i810_delete_i2c_busses()
151 i2c_del_adapter(&par->chan[2].adapter); in i810_delete_i2c_busses()
152 par->chan[2].par = NULL; in i810_delete_i2c_busses()
162 edid = fb_ddc_read(&par->chan[conn].adapter); in i810_probe_i2c_connector()