Lines Matching refs:chan

30 	struct nvidia_i2c_chan *chan = data;  in nvidia_gpio_setscl()  local
31 struct nvidia_par *par = chan->par; in nvidia_gpio_setscl()
34 val = NVReadCrtc(par, chan->ddc_base + 1) & 0xf0; in nvidia_gpio_setscl()
41 NVWriteCrtc(par, chan->ddc_base + 1, val | 0x01); in nvidia_gpio_setscl()
46 struct nvidia_i2c_chan *chan = data; in nvidia_gpio_setsda() local
47 struct nvidia_par *par = chan->par; in nvidia_gpio_setsda()
50 val = NVReadCrtc(par, chan->ddc_base + 1) & 0xf0; in nvidia_gpio_setsda()
57 NVWriteCrtc(par, chan->ddc_base + 1, val | 0x01); in nvidia_gpio_setsda()
62 struct nvidia_i2c_chan *chan = data; in nvidia_gpio_getscl() local
63 struct nvidia_par *par = chan->par; in nvidia_gpio_getscl()
66 if (NVReadCrtc(par, chan->ddc_base) & 0x04) in nvidia_gpio_getscl()
74 struct nvidia_i2c_chan *chan = data; in nvidia_gpio_getsda() local
75 struct nvidia_par *par = chan->par; in nvidia_gpio_getsda()
78 if (NVReadCrtc(par, chan->ddc_base) & 0x08) in nvidia_gpio_getsda()
84 static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name, in nvidia_setup_i2c_bus() argument
89 strcpy(chan->adapter.name, name); in nvidia_setup_i2c_bus()
90 chan->adapter.owner = THIS_MODULE; in nvidia_setup_i2c_bus()
91 chan->adapter.class = i2c_class; in nvidia_setup_i2c_bus()
92 chan->adapter.algo_data = &chan->algo; in nvidia_setup_i2c_bus()
93 chan->adapter.dev.parent = &chan->par->pci_dev->dev; in nvidia_setup_i2c_bus()
94 chan->algo.setsda = nvidia_gpio_setsda; in nvidia_setup_i2c_bus()
95 chan->algo.setscl = nvidia_gpio_setscl; in nvidia_setup_i2c_bus()
96 chan->algo.getsda = nvidia_gpio_getsda; in nvidia_setup_i2c_bus()
97 chan->algo.getscl = nvidia_gpio_getscl; in nvidia_setup_i2c_bus()
98 chan->algo.udelay = 40; in nvidia_setup_i2c_bus()
99 chan->algo.timeout = msecs_to_jiffies(2); in nvidia_setup_i2c_bus()
100 chan->algo.data = chan; in nvidia_setup_i2c_bus()
102 i2c_set_adapdata(&chan->adapter, chan); in nvidia_setup_i2c_bus()
105 nvidia_gpio_setsda(chan, 1); in nvidia_setup_i2c_bus()
106 nvidia_gpio_setscl(chan, 1); in nvidia_setup_i2c_bus()
109 rc = i2c_bit_add_bus(&chan->adapter); in nvidia_setup_i2c_bus()
111 dev_dbg(&chan->par->pci_dev->dev, in nvidia_setup_i2c_bus()
114 dev_warn(&chan->par->pci_dev->dev, in nvidia_setup_i2c_bus()
116 chan->par = NULL; in nvidia_setup_i2c_bus()
124 par->chan[0].par = par; in nvidia_create_i2c_busses()
125 par->chan[1].par = par; in nvidia_create_i2c_busses()
126 par->chan[2].par = par; in nvidia_create_i2c_busses()
128 par->chan[0].ddc_base = (par->reverse_i2c) ? 0x36 : 0x3e; in nvidia_create_i2c_busses()
129 nvidia_setup_i2c_bus(&par->chan[0], "nvidia #0", in nvidia_create_i2c_busses()
132 par->chan[1].ddc_base = (par->reverse_i2c) ? 0x3e : 0x36; in nvidia_create_i2c_busses()
133 nvidia_setup_i2c_bus(&par->chan[1], "nvidia #1", in nvidia_create_i2c_busses()
136 par->chan[2].ddc_base = 0x50; in nvidia_create_i2c_busses()
137 nvidia_setup_i2c_bus(&par->chan[2], "nvidia #2", 0); in nvidia_create_i2c_busses()
145 if (!par->chan[i].par) in nvidia_delete_i2c_busses()
147 i2c_del_adapter(&par->chan[i].adapter); in nvidia_delete_i2c_busses()
148 par->chan[i].par = NULL; in nvidia_delete_i2c_busses()
157 if (par->chan[conn - 1].par) in nvidia_probe_i2c_connector()
158 edid = fb_ddc_read(&par->chan[conn - 1].adapter); in nvidia_probe_i2c_connector()