/* * ds.h -- 16-bit PCMCIA core support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * . Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * (C) 1999 David A. Hinds * (C) 2003 - 2008 Dominik Brodowski */ #ifndef _LINUX_DS_H #define _LINUX_DS_H #ifdef __KERNEL__ #include #endif #include #ifdef __KERNEL__ #include #include #include #include /* * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus * a.k.a. PCI drivers */ struct pcmcia_socket; struct pcmcia_device; struct config_t; struct net_device; /* dynamic device IDs for PCMCIA device drivers. See * Documentation/pcmcia/driver.txt for details. */ struct pcmcia_dynids { struct mutex lock; struct list_head list; }; struct pcmcia_driver { const char *name; int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); int (*suspend) (struct pcmcia_device *dev); int (*resume) (struct pcmcia_device *dev); struct module *owner; const struct pcmcia_device_id *id_table; struct device_driver drv; struct pcmcia_dynids dynids; }; /* driver registration */ int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); /** * module_pcmcia_driver() - Helper macro for registering a pcmcia driver * @__pcmcia_driver: pcmcia_driver struct * * Helper macro for pcmcia drivers which do not do anything special in module * init/exit. This eliminates a lot of boilerplate. Each module may only use * this macro once, and calling it replaces module_init() and module_exit(). */ #define module_pcmcia_driver(__pcmcia_driver) \ module_driver(__pcmcia_driver, pcmcia_register_driver, \ pcmcia_unregister_driver) /* for struct resource * array embedded in struct pcmcia_device */ enum { PCMCIA_IOPORT_0, PCMCIA_IOPORT_1, PCMCIA_IOMEM_0, PCMCIA_IOMEM_1, PCMCIA_IOMEM_2, PCMCIA_IOMEM_3, PCMCIA_NUM_RESOURCES, }; struct pcmcia_device { /* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */ struct pcmcia_socket *socket; char *devname; u8 device_no; /* the hardware "function" device; certain subdevices can * share one hardware "function" device. */ u8 func; struct config_t *function_config; struct list_head socket_device_list; /* device setup */ unsigned int irq; struct resource *resource[PCMCIA_NUM_RESOURCES]; resource_size_t card_addr; /* for the 1st IOMEM resource */ unsigned int vpp; unsigned int config_flags; /* CONF_ENABLE_ flags below */ unsigned int config_base; unsigned int config_index; unsigned int config_regs; /* PRESENT_ flags below */ unsigned int io_lines; /* number of I/O lines */ /* Is the device suspended? */ u16 suspended:1; /* Flags whether io, irq, win configurations were * requested, and whether the configuration is "locked" */ u16 _irq:1; u16 _io:1; u16 _win:4; u16 _locked:1; /* Flag whether a "fuzzy" func_id based match is * allowed. */ u16 allow_func_id_match:1; /* information about this device */ u16 has_manf_id:1; u16 has_card_id:1; u16 has_func_id:1; u16 reserved:4; u8 func_id; u16 manf_id; u16 card_id; char *prod_id[4]; u64 dma_mask; struct device dev; /* data private to drivers */ void *priv; unsigned int open; }; #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) /* * CIS access. * * Please use the following functions to access CIS tuples: * - pcmcia_get_tuple() * - pcmcia_loop_tuple() * - pcmcia_get_mac_from_cis() * * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface * might change in future. */ /* get the very first CIS entry of type @code. Note that buf is pointer * to u8 *buf; and that you need to kfree(buf) afterwards. */ size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code, u8 **buf); /* loop over CIS entries */ int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code, int (*loop_tuple) (struct pcmcia_device *p_dev, tuple_t *tuple, void *priv_data), void *priv_data); /* get the MAC address from CISTPL_FUNCE */ int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev); /* parse a tuple_t */ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); /* loop CIS entries for valid configuration */ int pcmcia_loop_config(struct pcmcia_device *p_dev, int (*conf_check) (struct pcmcia_device *p_dev, void *priv_data), void *priv_data); /* is the device still there? */ struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *p_dev); /* low-level interface reset */ int pcmcia_reset_card(struct pcmcia_socket *skt); /* CIS config */ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val); int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val); /* device configuration */ int pcmcia_request_io(struct pcmcia_device *p_dev); int __must_check __pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, irq_handler_t handler); static inline __must_check __deprecated int pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, irq_handler_t handler) { return __pcmcia_request_exclusive_irq(p_dev, handler); } int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, irq_handler_t handler); int pcmcia_enable_device(struct pcmcia_device *p_dev); int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res, unsigned int speed); int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res); int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res, unsigned int offset); int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp); int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev); void pcmcia_disable_device(struct pcmcia_device *p_dev); /* IO ports */ #define IO_DATA_PATH_WIDTH 0x18 #define IO_DATA_PATH_WIDTH_8 0x00 #define IO_DATA_PATH_WIDTH_16 0x08 #define IO_DATA_PATH_WIDTH_AUTO 0x10 /* IO memory */ #define WIN_MEMORY_TYPE_CM 0x00 /* default */ #define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */ #define WIN_DATA_WIDTH_8 0x00 /* default */ #define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */ #define WIN_ENABLE 0x01 /* MAP_ACTIVE */ #define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */ #define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | MAP_USE_WAIT */ #define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]: 0x04 -> 0 0x08 -> 1 0x0c -> 2 0x10 -> 3 */ /* config_reg{ister}s present for this PCMCIA device */ #define PRESENT_OPTION 0x001 #define PRESENT_STATUS 0x002 #define PRESENT_PIN_REPLACE 0x004 #define PRESENT_COPY 0x008 #define PRESENT_EXT_STATUS 0x010 #define PRESENT_IOBASE_0 0x020 #define PRESENT_IOBASE_1 0x040 #define PRESENT_IOBASE_2 0x080 #define PRESENT_IOBASE_3 0x100 #define PRESENT_IOSIZE 0x200 /* flags to be passed to pcmcia_enable_device() */ #define CONF_ENABLE_IRQ 0x0001 #define CONF_ENABLE_SPKR 0x0002 #define CONF_ENABLE_PULSE_IRQ 0x0004 #define CONF_ENABLE_ESR 0x0008 #define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ * (CONF_ENABLE_IRQ) in use */ #define CONF_ENABLE_ZVCARD 0x0020 /* flags used by pcmcia_loop_config() autoconfiguration */ #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */ #define CONF_AUTO_SET_VPP 0x0200 /* set Vpp? */ #define CONF_AUTO_AUDIO 0x0400 /* enable audio line? */ #define CONF_AUTO_SET_IO 0x0800 /* set ->resource[0,1] */ #define CONF_AUTO_SET_IOMEM 0x1000 /* set ->resource[2] */ #endif /* __KERNEL__ */ #endif /* _LINUX_DS_H */ e297da'>logplain -rw-r--r--bcm2835-aux.h635logplain -rw-r--r--bcm2835.h1962logplain -rw-r--r--berlin2.h1034logplain -rw-r--r--berlin2q.h695logplain -rw-r--r--clps711x-clock.h718logplain -rw-r--r--efm32-cmu.h1112logplain -rw-r--r--exynos-audss-clk.h597logplain -rw-r--r--exynos3250.h9083logplain -rw-r--r--exynos4.h8284logplain -rw-r--r--exynos4415.h9828logplain -rw-r--r--exynos5250.h4616logplain -rw-r--r--exynos5260-clk.h14876logplain -rw-r--r--exynos5410.h1689logplain -rw-r--r--exynos5420.h6857logplain -rw-r--r--exynos5433.h45372logplain -rw-r--r--exynos5440.h1141logplain -rw-r--r--exynos7-clk.h5281logplain -rw-r--r--gxbb-aoclkc.h2866logplain -rw-r--r--gxbb-clkc.h592logplain -rw-r--r--hi3516cv300-clock.h1668logplain -rw-r--r--hi3519-clock.h1328logplain -rw-r--r--hi3620-clock.h4496logplain -rw-r--r--hi6220-clock.h4508logplain -rw-r--r--hip04-clock.h1137logplain -rw-r--r--histb-clock.h2012logplain -rw-r--r--hix5hd2-clock.h2415logplain -rw-r--r--imx1-clock.h1055logplain -rw-r--r--imx21-clock.h2461logplain -rw-r--r--imx27-clock.h3494logplain -rw-r--r--imx5-clock.h7212logplain -rw-r--r--imx6qdl-clock.h9593logplain -rw-r--r--imx6sl-clock.h5849logplain -rw-r--r--imx6sx-clock.h9099logplain -rw-r--r--imx6ul-clock.h8203logplain -rw-r--r--imx7d-clock.h15974logplain -rw-r--r--jz4740-cgu.h1028logplain -rw-r--r--jz4780-cgu.h2470logplain -rw-r--r--lpc18xx-ccu.h2134logplain -rw-r--r--lpc18xx-cgu.h1142logplain -rw-r--r--lpc32xx-clock.h1633logplain -rw-r--r--lsi,axm5516-clks.h974logplain -rw-r--r--marvell,mmp2.h2022logplain -rw-r--r--marvell,pxa168.h1654logplain -rw-r--r--marvell,pxa1928.h1535logplain -rw-r--r--marvell,pxa910.h1598logplain -rw-r--r--maxim,max77620.h632logplain -rw-r--r--maxim,max77686.h648logplain -rw-r--r--maxim,max77802.h630logplain -rw-r--r--meson8b-clkc.h523logplain -rw-r--r--microchip,pic32-clock.h1150logplain -rw-r--r--mpc512x-clock.h2236logplain -rw-r--r--mt2701-clk.h13832logplain -rw-r--r--mt8135-clk.h5641logplain -rw-r--r--mt8173-clk.h9293logplain -rw-r--r--oxsemi,ox810se.h1002logplain -rw-r--r--oxsemi,ox820.h1203logplain -rw-r--r--pistachio-clk.h4863logplain -rw-r--r--pxa-clock.h1715logplain -rw-r--r--qcom,gcc-apq8084.h12872logplain -rw-r--r--qcom,gcc-ipq4019.h5423logplain -rw-r--r--qcom,gcc-ipq806x.h8574logplain -rw-r--r--qcom,gcc-mdm9615.h9497logplain -rw-r--r--qcom,gcc-msm8660.h7932logplain -rw-r--r--qcom,gcc-msm8916.h6190logplain -rw-r--r--qcom,gcc-msm8960.h9342logplain -rw-r--r--qcom,gcc-msm8974.h12340logplain -rw-r--r--qcom,gcc-msm8994.h4858logplain -rw-r--r--qcom,gcc-msm8996.h12575logplain -rw-r--r--qcom,lcc-ipq806x.h899logplain -rw-r--r--qcom,lcc-mdm9615.h1701logplain -rw-r--r--qcom,lcc-msm8960.h1616logplain -rw-r--r--qcom,mmcc-apq8084.h5722logplain -rw-r--r--qcom,mmcc-msm8960.h4109logplain -rw-r--r--qcom,mmcc-msm8974.h5223logplain -rw-r--r--qcom,mmcc-msm8996.h9403logplain -rw-r--r--qcom,rpmcc.h2101logplain -rw-r--r--r7s72100-clock.h1218logplain -rw-r--r--r8a73a4-clock.h1596logplain -rw-r--r--r8a7740-clock.h1992logplain -rw-r--r--r8a7743-cpg-mssr.h1269logplain -rw-r--r--r8a7745-cpg-mssr.h1298logplain -rw-r--r--r8a7778-clock.h1855logplain -rw-r--r--r8a7779-clock.h1647logplain -rw-r--r--r8a7790-clock.h4367logplain -rw-r--r--r8a7791-clock.h4388logplain -rw-r--r--r8a7792-clock.h2562logplain -rw-r--r--r8a7793-clock.h4561logplain -rw-r--r--r8a7794-clock.h3679logplain -rw-r--r--r8a7795-cpg-mssr.h1890logplain -rw-r--r--r8a7796-cpg-mssr.h2066logplain -rw-r--r--renesas-cpg-mssr.h542logplain -rw-r--r--rk1108-cru.h6605logplain -rw-r--r--rk3036-cru.h4584logplain -rw-r--r--rk3066a-cru.h1068logplain -rw-r--r--rk3188-cru-common.h6105logplain -rw-r--r--rk3188-cru.h1435logplain