Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
1da177e4 LT |
2 | /* |
3 | * linux/drivers/pcmcia/sa1100_neponset.c | |
4 | * | |
5 | * Neponset PCMCIA specific routines | |
6 | */ | |
7 | #include <linux/module.h> | |
8 | #include <linux/kernel.h> | |
1da177e4 LT |
9 | #include <linux/device.h> |
10 | #include <linux/errno.h> | |
11 | #include <linux/init.h> | |
12 | ||
1da177e4 | 13 | #include <asm/mach-types.h> |
1da177e4 LT |
14 | |
15 | #include "sa1111_generic.h" | |
e2125d05 | 16 | #include "max1600.h" |
1da177e4 LT |
17 | |
18 | /* | |
19 | * Neponset uses the Maxim MAX1600, with the following connections: | |
20 | * | |
21 | * MAX1600 Neponset | |
22 | * | |
23 | * A0VCC SA-1111 GPIO A<1> | |
24 | * A1VCC SA-1111 GPIO A<0> | |
25 | * A0VPP CPLD NCR A0VPP | |
26 | * A1VPP CPLD NCR A1VPP | |
27 | * B0VCC SA-1111 GPIO A<2> | |
28 | * B1VCC SA-1111 GPIO A<3> | |
29 | * B0VPP ground (slot B is CF) | |
30 | * B1VPP ground (slot B is CF) | |
31 | * | |
32 | * VX VCC (5V) | |
33 | * VY VCC3_3 (3.3V) | |
34 | * 12INA 12V | |
35 | * 12INB ground (slot B is CF) | |
36 | * | |
37 | * The MAX1600 CODE pin is tied to ground, placing the device in | |
38 | * "Standard Intel code" mode. Refer to the Maxim data sheet for | |
39 | * the corresponding truth table. | |
40 | */ | |
e2125d05 | 41 | static int neponset_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
1da177e4 | 42 | { |
e2125d05 | 43 | struct max1600 *m; |
1da177e4 LT |
44 | int ret; |
45 | ||
e2125d05 RK |
46 | ret = max1600_init(skt->socket.dev.parent, &m, |
47 | skt->nr ? MAX1600_CHAN_B : MAX1600_CHAN_A, | |
48 | MAX1600_CODE_LOW); | |
49 | if (ret == 0) | |
50 | skt->driver_data = m; | |
1da177e4 | 51 | |
e2125d05 RK |
52 | return ret; |
53 | } | |
1da177e4 | 54 | |
e2125d05 RK |
55 | static int |
56 | neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) | |
57 | { | |
58 | struct max1600 *m = skt->driver_data; | |
59 | int ret; | |
1da177e4 LT |
60 | |
61 | ret = sa1111_pcmcia_configure_socket(skt, state); | |
e2125d05 RK |
62 | if (ret == 0) |
63 | ret = max1600_configure(m, state->Vcc, state->Vpp); | |
1da177e4 | 64 | |
65c77dca | 65 | return ret; |
1da177e4 LT |
66 | } |
67 | ||
1da177e4 LT |
68 | static struct pcmcia_low_level neponset_pcmcia_ops = { |
69 | .owner = THIS_MODULE, | |
e2125d05 | 70 | .hw_init = neponset_pcmcia_hw_init, |
1da177e4 | 71 | .configure_socket = neponset_pcmcia_configure_socket, |
701a5dc0 RKAL |
72 | .first = 0, |
73 | .nr = 2, | |
1da177e4 LT |
74 | }; |
75 | ||
b29cf62c | 76 | int pcmcia_neponset_init(struct sa1111_dev *sadev) |
1da177e4 | 77 | { |
3f8df892 RK |
78 | sa11xx_drv_pcmcia_ops(&neponset_pcmcia_ops); |
79 | return sa1111_pcmcia_add(sadev, &neponset_pcmcia_ops, | |
80 | sa11xx_drv_pcmcia_add_one); | |
1da177e4 | 81 | } |