9 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13 #include <linux/pci.h>
18 #define NR_VX855_GPI 14
19 #define NR_VX855_GPO 13
20 #define NR_VX855_GPIO 15
22 #define VX855_GPI(n) (n)
23 #define VX855_GPO(n) (NR_VX855_GPI + (n))
24 #define VX855_GPIO(n) (NR_VX855_GPI + NR_VX855_GPO + (n))
38 #define VX855_GENL_PURPOSE_OUTPUT 0x44c
39 #define VX855_GPI_STATUS_CHG 0x450
40 #define VX855_GPI_SCI_SMI 0x452
41 #define BIT_GPIO12 0x40
43 #define PREFIX "OLPC DCON:"
45 static void dcon_clear_irq(
void)
51 static int dcon_was_irq(
void)
62 static int dcon_init_xo_1_5(
struct dcon_priv *dcon)
71 pr_err(
"cannot find VX855 PCI ID\n");
75 pci_read_config_byte(pdev, 0x95, &tmp);
76 pci_write_config_byte(pdev, 0x95, tmp|0x0c);
79 pci_read_config_byte(pdev, 0xe3, &tmp);
80 pci_write_config_byte(pdev, 0xe3, tmp | 0x04);
83 pci_read_config_byte(pdev, 0xe4, &tmp);
84 pci_write_config_byte(pdev, 0xe4, tmp|0x08);
88 pci_read_config_byte(pdev, 0xe1, &tmp);
89 pci_write_config_byte(pdev, 0xe1, tmp & ~
BIT_GPIO12);
90 pci_read_config_byte(pdev, 0xe0, &tmp);
91 pci_write_config_byte(pdev, 0xe0, tmp & ~
BIT_GPIO12);
109 pr_err(
"DCON (IRQ%d) allocation failed\n", irq);
116 static void set_i2c_line(
int sda,
int scl)
119 unsigned int port = 0x26;
142 static void dcon_wiggle_xo_1_5(
void)
155 for (x = 0; x < 16; x++) {
167 static void dcon_set_dconload_xo_1_5(
int val)
172 static int dcon_read_status_xo_1_5(
u8 *
status)
187 .init = dcon_init_xo_1_5,
188 .bus_stabilize_wiggle = dcon_wiggle_xo_1_5,
189 .set_dconload = dcon_set_dconload_xo_1_5,
190 .read_status = dcon_read_status_xo_1_5,