Lines Matching refs:socket

166 #define ti_sysctl(socket)	((socket)->private[0])  argument
167 #define ti_cardctl(socket) ((socket)->private[1]) argument
168 #define ti_devctl(socket) ((socket)->private[2]) argument
169 #define ti_diag(socket) ((socket)->private[3]) argument
170 #define ti_mfunc(socket) ((socket)->private[4]) argument
171 #define ene_test_c9(socket) ((socket)->private[5]) argument
176 static void ti_save_state(struct yenta_socket *socket) in ti_save_state() argument
178 ti_sysctl(socket) = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti_save_state()
179 ti_mfunc(socket) = config_readl(socket, TI122X_MFUNC); in ti_save_state()
180 ti_cardctl(socket) = config_readb(socket, TI113X_CARD_CONTROL); in ti_save_state()
181 ti_devctl(socket) = config_readb(socket, TI113X_DEVICE_CONTROL); in ti_save_state()
182 ti_diag(socket) = config_readb(socket, TI1250_DIAGNOSTIC); in ti_save_state()
184 if (socket->dev->vendor == PCI_VENDOR_ID_ENE) in ti_save_state()
185 ene_test_c9(socket) = config_readb(socket, ENE_TEST_C9); in ti_save_state()
188 static void ti_restore_state(struct yenta_socket *socket) in ti_restore_state() argument
190 config_writel(socket, TI113X_SYSTEM_CONTROL, ti_sysctl(socket)); in ti_restore_state()
191 config_writel(socket, TI122X_MFUNC, ti_mfunc(socket)); in ti_restore_state()
192 config_writeb(socket, TI113X_CARD_CONTROL, ti_cardctl(socket)); in ti_restore_state()
193 config_writeb(socket, TI113X_DEVICE_CONTROL, ti_devctl(socket)); in ti_restore_state()
194 config_writeb(socket, TI1250_DIAGNOSTIC, ti_diag(socket)); in ti_restore_state()
196 if (socket->dev->vendor == PCI_VENDOR_ID_ENE) in ti_restore_state()
197 config_writeb(socket, ENE_TEST_C9, ene_test_c9(socket)); in ti_restore_state()
207 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); in ti_zoom_video() local
211 reg = config_readb(socket, TI113X_CARD_CONTROL); in ti_zoom_video()
217 config_writeb(socket, TI113X_CARD_CONTROL, reg); in ti_zoom_video()
231 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); in ti1250_zoom_video() local
237 reg = config_readb(socket, TI1250_MULTIMEDIA_CTL); in ti1250_zoom_video()
240 if(PCI_FUNC(socket->dev->devfn)==1) in ti1250_zoom_video()
256 config_writeb(socket, TI1250_MULTIMEDIA_CTL, reg); in ti1250_zoom_video()
259 static void ti_set_zv(struct yenta_socket *socket) in ti_set_zv() argument
261 if(socket->dev->vendor == PCI_VENDOR_ID_TI) in ti_set_zv()
263 switch(socket->dev->device) in ti_set_zv()
270 socket->socket.zoom_video = ti_zoom_video; in ti_set_zv()
276 socket->socket.zoom_video = ti1250_zoom_video; in ti_set_zv()
294 static int ti_init(struct yenta_socket *socket) in ti_init() argument
296 u8 new, reg = exca_readb(socket, I365_INTCTL); in ti_init()
299 if (socket->dev->irq) in ti_init()
302 exca_writeb(socket, I365_INTCTL, new); in ti_init()
306 static int ti_override(struct yenta_socket *socket) in ti_override() argument
308 u8 new, reg = exca_readb(socket, I365_INTCTL); in ti_override()
312 exca_writeb(socket, I365_INTCTL, new); in ti_override()
314 ti_set_zv(socket); in ti_override()
319 static void ti113x_use_isa_irq(struct yenta_socket *socket) in ti113x_use_isa_irq() argument
329 isa_irq_mask = yenta_probe_irq(socket, isa_interrupts); in ti113x_use_isa_irq()
336 socket->cb_irq = isa_irq; in ti113x_use_isa_irq()
338 exca_writeb(socket, I365_CSCINT, (isa_irq << 4)); in ti113x_use_isa_irq()
340 intctl = exca_readb(socket, I365_INTCTL); in ti113x_use_isa_irq()
342 exca_writeb(socket, I365_INTCTL, intctl); in ti113x_use_isa_irq()
344 dev_info(&socket->dev->dev, in ti113x_use_isa_irq()
349 static int ti113x_override(struct yenta_socket *socket) in ti113x_override() argument
353 cardctl = config_readb(socket, TI113X_CARD_CONTROL); in ti113x_override()
355 if (socket->dev->irq) in ti113x_override()
358 ti113x_use_isa_irq(socket); in ti113x_override()
360 config_writeb(socket, TI113X_CARD_CONTROL, cardctl); in ti113x_override()
362 return ti_override(socket); in ti113x_override()
367 static void ti12xx_irqroute_func0(struct yenta_socket *socket) in ti12xx_irqroute_func0() argument
373 mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); in ti12xx_irqroute_func0()
374 devctl = config_readb(socket, TI113X_DEVICE_CONTROL); in ti12xx_irqroute_func0()
375 dev_info(&socket->dev->dev, "TI: mfunc 0x%08x, devctl 0x%02x\n", in ti12xx_irqroute_func0()
379 ti_init(socket); in ti12xx_irqroute_func0()
382 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func0()
390 dev_info(&socket->dev->dev, in ti12xx_irqroute_func0()
395 switch (socket->dev->device) { in ti12xx_irqroute_func0()
411 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func0()
413 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func0()
415 dev_info(&socket->dev->dev, in ti12xx_irqroute_func0()
423 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func0()
431 dev_info(&socket->dev->dev, in ti12xx_irqroute_func0()
435 config_writeb(socket, TI113X_DEVICE_CONTROL, devctl); in ti12xx_irqroute_func0()
439 switch (socket->dev->device) { in ti12xx_irqroute_func0()
445 gpio3 = gpio3_old = config_readb(socket, TI1250_GPIO3_CONTROL); in ti12xx_irqroute_func0()
448 config_writeb(socket, TI1250_GPIO3_CONTROL, gpio3); in ti12xx_irqroute_func0()
456 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func0()
460 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func0()
463 dev_info(&socket->dev->dev, "TI: parallel PCI interrupts ok\n"); in ti12xx_irqroute_func0()
467 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func0()
469 config_writeb(socket, TI1250_GPIO3_CONTROL, gpio3_old); in ti12xx_irqroute_func0()
474 socket->cb_irq = 0; in ti12xx_irqroute_func0()
475 dev_info(&socket->dev->dev, in ti12xx_irqroute_func0()
482 static int ti12xx_align_irqs(struct yenta_socket *socket, int *old_irq) in ti12xx_align_irqs() argument
487 func0 = pci_get_slot(socket->dev->bus, socket->dev->devfn & ~0x07); in ti12xx_align_irqs()
492 *old_irq = socket->cb_irq; in ti12xx_align_irqs()
493 socket->cb_irq = socket->dev->irq = func0->irq; in ti12xx_align_irqs()
505 static int ti12xx_tie_interrupts(struct yenta_socket *socket, int *old_irq) in ti12xx_tie_interrupts() argument
510 sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_tie_interrupts()
515 ret = ti12xx_align_irqs(socket, old_irq); in ti12xx_tie_interrupts()
521 config_writel(socket, TI113X_SYSTEM_CONTROL, sysctl); in ti12xx_tie_interrupts()
527 static void ti12xx_untie_interrupts(struct yenta_socket *socket, int old_irq) in ti12xx_untie_interrupts() argument
529 u32 sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_untie_interrupts()
531 config_writel(socket, TI113X_SYSTEM_CONTROL, sysctl); in ti12xx_untie_interrupts()
533 socket->cb_irq = socket->dev->irq = old_irq; in ti12xx_untie_interrupts()
541 static void ti12xx_irqroute_func1(struct yenta_socket *socket) in ti12xx_irqroute_func1() argument
546 mfunc = mfunc_old = config_readl(socket, TI122X_MFUNC); in ti12xx_irqroute_func1()
547 devctl = config_readb(socket, TI113X_DEVICE_CONTROL); in ti12xx_irqroute_func1()
548 dev_info(&socket->dev->dev, "TI: mfunc 0x%08x, devctl 0x%02x\n", in ti12xx_irqroute_func1()
552 sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_irqroute_func1()
554 ti12xx_align_irqs(socket, NULL); in ti12xx_irqroute_func1()
557 ti_init(socket); in ti12xx_irqroute_func1()
560 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func1()
568 dev_info(&socket->dev->dev, in ti12xx_irqroute_func1()
575 if (ti12xx_tie_interrupts(socket, &old_irq)) { in ti12xx_irqroute_func1()
576 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func1()
578 dev_info(&socket->dev->dev, in ti12xx_irqroute_func1()
583 ti12xx_untie_interrupts(socket, old_irq); in ti12xx_irqroute_func1()
590 switch (socket->dev->device) { in ti12xx_irqroute_func1()
612 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func1()
614 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func1()
616 dev_info(&socket->dev->dev, in ti12xx_irqroute_func1()
622 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_irqroute_func1()
629 if (ti12xx_tie_interrupts(socket, &old_irq)) { in ti12xx_irqroute_func1()
630 pci_irq_status = yenta_probe_cb_irq(socket); in ti12xx_irqroute_func1()
632 dev_info(&socket->dev->dev, in ti12xx_irqroute_func1()
637 ti12xx_untie_interrupts(socket, old_irq); in ti12xx_irqroute_func1()
643 socket->cb_irq = 0; in ti12xx_irqroute_func1()
644 dev_info(&socket->dev->dev, in ti12xx_irqroute_func1()
651 static int ti12xx_2nd_slot_empty(struct yenta_socket *socket) in ti12xx_2nd_slot_empty() argument
661 switch (socket->dev->device) { in ti12xx_2nd_slot_empty()
694 sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_2nd_slot_empty()
706 devfn = socket->dev->devfn & ~0x07; in ti12xx_2nd_slot_empty()
707 func = pci_get_slot(socket->dev->bus, in ti12xx_2nd_slot_empty()
708 (socket->dev->devfn & 0x07) ? devfn : devfn | 0x01); in ti12xx_2nd_slot_empty()
718 if (socket->dev->device != func->device) in ti12xx_2nd_slot_empty()
726 yenta_get_status(&slot2->socket, &state); in ti12xx_2nd_slot_empty()
746 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); in ti12xx_power_hook() local
754 devctl = config_readb(socket, TI113X_DEVICE_CONTROL); in ti12xx_power_hook()
755 sysctl = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_power_hook()
756 mfunc = config_readl(socket, TI122X_MFUNC); in ti12xx_power_hook()
766 (pwr_irqs_off || ti12xx_2nd_slot_empty(socket))) { in ti12xx_power_hook()
767 switch (socket->dev->device) { in ti12xx_power_hook()
789 if ((PCI_FUNC(socket->dev->devfn) == 0) || in ti12xx_power_hook()
791 (pwr_irqs_off || ti12xx_2nd_slot_empty(socket)))) { in ti12xx_power_hook()
793 switch (socket->dev->device) { in ti12xx_power_hook()
799 gpio3 = config_readb(socket, TI1250_GPIO3_CONTROL); in ti12xx_power_hook()
804 config_writeb(socket, TI1250_GPIO3_CONTROL, gpio3); in ti12xx_power_hook()
813 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_power_hook()
816 switch (socket->dev->device) { in ti12xx_power_hook()
825 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_power_hook()
835 config_writel(socket, TI122X_MFUNC, mfunc); in ti12xx_power_hook()
842 static int ti12xx_override(struct yenta_socket *socket) in ti12xx_override() argument
847 val_orig = val = config_readl(socket, TI113X_SYSTEM_CONTROL); in ti12xx_override()
848 if (disable_clkrun && PCI_FUNC(socket->dev->devfn) == 0) { in ti12xx_override()
849 dev_info(&socket->dev->dev, "Disabling CLKRUN feature\n"); in ti12xx_override()
853 dev_info(&socket->dev->dev, in ti12xx_override()
858 config_writel(socket, TI113X_SYSTEM_CONTROL, val); in ti12xx_override()
864 val = config_readb(socket, TI1250_DIAGNOSTIC); in ti12xx_override()
865 dev_info(&socket->dev->dev, "Using %s to route CSC interrupts to PCI\n", in ti12xx_override()
867 dev_info(&socket->dev->dev, "Routing CardBus interrupts to %s\n", in ti12xx_override()
871 if (PCI_FUNC(socket->dev->devfn) == 0) in ti12xx_override()
872 ti12xx_irqroute_func0(socket); in ti12xx_override()
874 ti12xx_irqroute_func1(socket); in ti12xx_override()
877 socket->socket.power_hook = ti12xx_power_hook; in ti12xx_override()
879 return ti_override(socket); in ti12xx_override()
883 static int ti1250_override(struct yenta_socket *socket) in ti1250_override() argument
887 old = config_readb(socket, TI1250_DIAGNOSTIC); in ti1250_override()
889 if (socket->cb_irq) in ti1250_override()
893 dev_info(&socket->dev->dev, in ti1250_override()
896 config_writeb(socket, TI1250_DIAGNOSTIC, diag); in ti1250_override()
899 return ti12xx_override(socket); in ti1250_override()
938 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); in ene_tune_bridge() local
949 test_c9 = old_c9 = config_readb(socket, ENE_TEST_C9); in ene_tune_bridge()
960 dev_info(&socket->dev->dev, in ene_tune_bridge()
963 config_writeb(socket, ENE_TEST_C9, test_c9); in ene_tune_bridge()
966 static int ene_override(struct yenta_socket *socket) in ene_override() argument
969 socket->socket.tune_bridge = ene_tune_bridge; in ene_override()
971 return ti1250_override(socket); in ene_override()