~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/pcmcia/soc_common.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #include <pcmcia/ss.h>
  3 
  4 struct module;
  5 struct cpufreq_freqs;
  6 
  7 struct soc_pcmcia_regulator {
  8         struct regulator        *reg;
  9         bool                    on;
 10 };
 11 
 12 struct pcmcia_state {
 13   unsigned detect: 1,
 14             ready: 1,
 15              bvd1: 1,
 16              bvd2: 1,
 17            wrprot: 1,
 18             vs_3v: 1,
 19             vs_Xv: 1;
 20 };
 21 
 22 /*
 23  * This structure encapsulates per-socket state which we might need to
 24  * use when responding to a Card Services query of some kind.
 25  */
 26 struct soc_pcmcia_socket {
 27         struct pcmcia_socket    socket;
 28 
 29         /*
 30          * Info from low level handler
 31          */
 32         unsigned int            nr;
 33         struct clk              *clk;
 34 
 35         /*
 36          * Core PCMCIA state
 37          */
 38         const struct pcmcia_low_level *ops;
 39 
 40         unsigned int            status;
 41         socket_state_t          cs_state;
 42 
 43         unsigned short          spd_io[MAX_IO_WIN];
 44         unsigned short          spd_mem[MAX_WIN];
 45         unsigned short          spd_attr[MAX_WIN];
 46 
 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;
 52 
 53         struct {
 54                 int             gpio;
 55                 struct gpio_desc *desc;
 56                 unsigned int    irq;
 57                 const char      *name;
 58         } stat[6];
 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 */
 65 
 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;
 70 
 71         unsigned int            irq_state;
 72 
 73 #ifdef CONFIG_CPU_FREQ
 74         struct notifier_block   cpufreq_nb;
 75 #endif
 76         struct timer_list       poll_timer;
 77         struct list_head        node;
 78         void *driver_data;
 79 };
 80 
 81 
 82 struct pcmcia_low_level {
 83         struct module *owner;
 84 
 85         /* first socket in system */
 86         int first;
 87         /* nr of sockets */
 88         int nr;
 89 
 90         int (*hw_init)(struct soc_pcmcia_socket *);
 91         void (*hw_shutdown)(struct soc_pcmcia_socket *);
 92 
 93         void (*socket_state)(struct soc_pcmcia_socket *, struct pcmcia_state *);
 94         int (*configure_socket)(struct soc_pcmcia_socket *, const socket_state_t *);
 95 
 96         /*
 97          * Enable card status IRQs on (re-)initialisation.  This can
 98          * be called at initialisation, power management event, or
 99          * pcmcia event.
100          */
101         void (*socket_init)(struct soc_pcmcia_socket *);
102 
103         /*
104          * Disable card status IRQs and PCMCIA bus on suspend.
105          */
106         void (*socket_suspend)(struct soc_pcmcia_socket *);
107 
108         /*
109          * Hardware specific timing routines.
110          * If provided, the get_timing routine overrides the SOC default.
111          */
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 *);
115 
116 #ifdef CONFIG_CPU_FREQ
117         /*
118          * CPUFREQ support.
119          */
120         int (*frequency_change)(struct soc_pcmcia_socket *, unsigned long, struct cpufreq_freqs *);
121 #endif
122 };
123 
124 
125 
126 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php