1 /* SPDX-License-Identifier: GPL-2.0 */
7 struct soc_pcmcia_regulator {
23 * This structure encapsulates per-socket state which we might need to
24 * use when responding to a Card Services query of some kind.
26 struct soc_pcmcia_socket {
27 struct pcmcia_socket socket;
30 * Info from low level handler
38 const struct pcmcia_low_level *ops;
41 socket_state_t cs_state;
43 unsigned short spd_io[MAX_IO_WIN];
44 unsigned short spd_mem[MAX_WIN];
45 unsigned short spd_attr[MAX_WIN];
47 struct resource res_skt;
48 struct resource res_io;
49 struct resource res_io_io;
50 struct resource res_mem;
51 struct resource res_attr;
55 struct gpio_desc *desc;
59 #define SOC_STAT_CD 0 /* Card detect */
60 #define SOC_STAT_BVD1 1 /* BATDEAD / IOSTSCHG */
61 #define SOC_STAT_BVD2 2 /* BATWARN / IOSPKR */
62 #define SOC_STAT_RDY 3 /* Ready / Interrupt */
63 #define SOC_STAT_VS1 4 /* Voltage sense 1 */
64 #define SOC_STAT_VS2 5 /* Voltage sense 2 */
66 struct gpio_desc *gpio_reset;
67 struct gpio_desc *gpio_bus_enable;
68 struct soc_pcmcia_regulator vcc;
69 struct soc_pcmcia_regulator vpp;
71 unsigned int irq_state;
73 #ifdef CONFIG_CPU_FREQ
74 struct notifier_block cpufreq_nb;
76 struct timer_list poll_timer;
77 struct list_head node;
82 struct pcmcia_low_level {
85 /* first socket in system */
90 int (*hw_init)(struct soc_pcmcia_socket *);
91 void (*hw_shutdown)(struct soc_pcmcia_socket *);
93 void (*socket_state)(struct soc_pcmcia_socket *, struct pcmcia_state *);
94 int (*configure_socket)(struct soc_pcmcia_socket *, const socket_state_t *);
97 * Enable card status IRQs on (re-)initialisation. This can
98 * be called at initialisation, power management event, or
101 void (*socket_init)(struct soc_pcmcia_socket *);
104 * Disable card status IRQs and PCMCIA bus on suspend.
106 void (*socket_suspend)(struct soc_pcmcia_socket *);
109 * Hardware specific timing routines.
110 * If provided, the get_timing routine overrides the SOC default.
112 unsigned int (*get_timing)(struct soc_pcmcia_socket *, unsigned int, unsigned int);
113 int (*set_timing)(struct soc_pcmcia_socket *);
114 int (*show_timing)(struct soc_pcmcia_socket *, char *);
116 #ifdef CONFIG_CPU_FREQ
120 int (*frequency_change)(struct soc_pcmcia_socket *, unsigned long, struct cpufreq_freqs *);