-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlnZ4T0ACgkQONu9yGCS aT6X/xAAo5OSIR5UYr3cowfCPu1jcKtmTOvNX5/7caO0VD/0TTEeTUGbJ+QlAJ1K rZSQLY3wVMT6tdUKqgjayJooAeUBk7wind6VOM44lWRZyztmvEAX9p/ippbu0LmD YCk+lfh/ZZGl9smu8o619PiTiAhMy7jUHbQAY1FVfn9Io3V/y4TmXAD6MrSkFZtW LaodzMU3jGWnyW/Jb9X5KTuKT89tF8pBwneyhMOGkrG6x4MDkfaMZYuULT9g1Y3m LccWR3SJAHumM/PgvbvhYSqVwRIqqvDDoz+e25CjCVxyypq3jHng6IZyfj6CI/9O MHP/AUjOH5yQPHGw4B31ukbwdRBCf4E9bwIvd6jphOxOM8qZAvBoNKQ4taUYLPAw YQHFYQ6Sfne07eqcxnM5MyBAQ2eR40OEG+K3bP8JOkYVh1aS+2/Dz+rjZSbMR+lJ w7ON24179fQ2tKpsZGNoggvcBSpLimUNqDUmkOKnIEjwuG+jI+7GG+5SY3bDsR3d FvIxevhh9Qc1mc6OpZxqy/yvs/HUdtFu16Yx109aVnMKHLaSlvvCaCWbfGkfVgEN skt8L+JHxigfJP4xZhR0WYA20uTlXVTqQEmH2um+ZSUNj2z6O1U8UF3b2xtFUvvh 0E2oJtY1/L4NqmWKHenjBSDxRPXa4TtCUX/ytplKitUkvGYNMZA= =GZkt -----END PGP SIGNATURE----- Merge 4.9.54 into android-4.9 Changes in 4.9.54 drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define drm: bridge: add DT bindings for TI ths8135 GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next drm/i915: Fix the overlay frontbuffer tracking ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime clk: sunxi-ng: fix PLL_CPUX adjusting on H3 RDS: RDMA: Fix the composite message user notification ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes MIPS: Ensure bss section ends on a long-aligned address MIPS: ralink: Fix a typo in the pinmux setup. MIPS: ralink: Fix incorrect assignment on ralink_soc power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error scsi: be2iscsi: Add checks to validate CID alloc/free ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event igb: re-assign hw address pointer on reset after PCI error extcon: axp288: Use vbus-valid instead of -present to determine cable presence reset: ti_syscon: fix a ti_syscon_reset_status issue sh_eth: use correct name for ECMR_MPDE bit clk/axs10x: Clear init field in driver probe usb: make the MTK XHCI driver compile for older MIPS SoCs hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes iio: adc: imx25-gcq: Fix module autoload iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications iio: adc: hx711: Add DT binding for avia,hx711 IB/rxe: Add a runtime check in alloc_index() IB/rxe: Fix a MR reference leak in check_rkey() ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM drm/i915/psr: disable psr2 for resolution greater than 32X20 serial: 8250: moxa: Store num_ports in brd tty: goldfish: Fix a parameter of a call to free_irq serial: 8250_port: Remove dangerous pr_debug() IB/ipoib: Fix deadlock over vlan_mutex IB/ipoib: rtnl_unlock can not come after free_netdev IB/ipoib: Replace list_del of the neigh->list with list_del_init arm: dts: mt2701: Add subsystem clock controller device nodes drm/amdkfd: fix improper return value on error USB: serial: mos7720: fix control-message error handling USB: serial: mos7840: fix control-message error handling sfc: get PIO buffer size from the NIC partitions/efi: Fix integer overflow in GPT size calculation ASoC: dapm: handle probe deferrals audit: log 32-bit socketcalls ath10k: prevent sta pointer rcu violation spi: pxa2xx: Add support for Intel Gemini Lake iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' usb: chipidea: vbus event may exist before starting gadget rtl8xxxu: Add additional USB IDs for rtl8192eu devices ASoC: dapm: fix some pointer error handling drm: mali-dp: Fix destination size handling when rotating drm: mali-dp: Fix transposed horizontal/vertical flip HID: wacom: release the resources before leaving despite devm MIPS: Lantiq: Fix another request_mem_region() return code check mips: ath79: clock:- Unmap region obtained by of_iomap lkdtm: Fix Oops when unloading the module net: core: Prevent from dereferencing null pointer when releasing SKB net/packet: check length in getsockopt() called with PACKET_HDRLEN team: fix memory leaks usb: plusb: Add support for PL-27A1 udp: disable inner UDP checksum offloads in IPsec case net: dsa: b53: Include IMP/CPU port in dumb forwarding mode qed: Fix possible system hang in the dcbnl-getdcbx() path. mmc: sdio: fix alignment issue in struct sdio_func bridge: netlink: register netdevice before executing changelink Btrfs: fix segmentation fault when doing dio read Btrfs: fix potential use-after-free for cloned bio sata_via: Enable hotplug only on VT6421 hugetlbfs: initialize shared policy as part of inode allocation kasan: do not sanitize kexec purgatory drivers/rapidio/devices/tsi721.c: make module parameter variable name unique netfilter: invoke synchronize_rcu after set the _hook_ to NULL MIPS: IRQ Stack: Unwind IRQ stack onto task stack iommu/exynos: Block SYSMMU while invalidating FLPD cache exynos-gsc: Do not swap cb/cr for semi planar formats MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs nvme-rdma: handle cpu unplug when re-establishing the controller netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max parisc: perf: Fix potential NULL pointer dereference nfs: make nfs4_cb_sv_ops static ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set() x86/acpi: Restore the order of CPU IDs iommu/io-pgtable-arm: Check for leaf entry before dereferencing it mm/cgroup: avoid panic when init with low memory rds: ib: add error handle md/raid10: submit bio directly to replacement disk netfilter: nf_tables: set pktinfo->thoff at AH header if found i2c: meson: fix wrong variable usage in meson_i2c_put_data xfs: remove kmem_zalloc_greedy ASoC: wm_adsp: Return an error on write to a disabled volatile control libata: transport: Remove circular dependency at free time ARM: dts: BCM5301X: Fix memory start address tools/power turbostat: bugfix: GFXMHz column not changing IB/qib: fix false-postive maybe-uninitialized warning ARM: remove duplicate 'const' annotations' ASoC: rt5514: fix gcc-7 warning ASoC: rt5659: drop double const ASoC: rt5660: remove double const ALSA: au88x0: avoid theoretical uninitialized access ttpci: address stringop overflow warning s390/mm: make pmdp_invalidate() do invalidation only Linux 4.9.54 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
172 lines
5.1 KiB
C
172 lines
5.1 KiB
C
/*
|
|
* include/linux/mmc/sdio_func.h
|
|
*
|
|
* Copyright 2007-2008 Pierre Ossman
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
* your option) any later version.
|
|
*/
|
|
|
|
#ifndef LINUX_MMC_SDIO_FUNC_H
|
|
#define LINUX_MMC_SDIO_FUNC_H
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
#include <linux/mmc/pm.h>
|
|
|
|
struct mmc_card;
|
|
struct sdio_func;
|
|
|
|
typedef void (sdio_irq_handler_t)(struct sdio_func *);
|
|
|
|
/*
|
|
* Structure used to hold embedded SDIO device data from platform layer
|
|
*/
|
|
struct sdio_embedded_func {
|
|
uint8_t f_class;
|
|
uint32_t f_maxblksize;
|
|
};
|
|
|
|
/*
|
|
* SDIO function CIS tuple (unknown to the core)
|
|
*/
|
|
struct sdio_func_tuple {
|
|
struct sdio_func_tuple *next;
|
|
unsigned char code;
|
|
unsigned char size;
|
|
unsigned char data[0];
|
|
};
|
|
|
|
/*
|
|
* SDIO function devices
|
|
*/
|
|
struct sdio_func {
|
|
struct mmc_card *card; /* the card this device belongs to */
|
|
struct device dev; /* the device */
|
|
sdio_irq_handler_t *irq_handler; /* IRQ callback */
|
|
unsigned int num; /* function number */
|
|
|
|
unsigned char class; /* standard interface class */
|
|
unsigned short vendor; /* vendor id */
|
|
unsigned short device; /* device id */
|
|
|
|
unsigned max_blksize; /* maximum block size */
|
|
unsigned cur_blksize; /* current block size */
|
|
|
|
unsigned enable_timeout; /* max enable timeout in msec */
|
|
|
|
unsigned int state; /* function state */
|
|
#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
|
|
|
|
u8 *tmpbuf; /* DMA:able scratch buffer */
|
|
|
|
unsigned num_info; /* number of info strings */
|
|
const char **info; /* info strings */
|
|
|
|
struct sdio_func_tuple *tuples;
|
|
};
|
|
|
|
#define sdio_func_present(f) ((f)->state & SDIO_STATE_PRESENT)
|
|
|
|
#define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT)
|
|
|
|
#define sdio_func_id(f) (dev_name(&(f)->dev))
|
|
|
|
#define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev)
|
|
#define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d)
|
|
#define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev)
|
|
|
|
/*
|
|
* SDIO function device driver
|
|
*/
|
|
struct sdio_driver {
|
|
char *name;
|
|
const struct sdio_device_id *id_table;
|
|
|
|
int (*probe)(struct sdio_func *, const struct sdio_device_id *);
|
|
void (*remove)(struct sdio_func *);
|
|
|
|
struct device_driver drv;
|
|
};
|
|
|
|
/**
|
|
* SDIO_DEVICE - macro used to describe a specific SDIO device
|
|
* @vend: the 16 bit manufacturer code
|
|
* @dev: the 16 bit function id
|
|
*
|
|
* This macro is used to create a struct sdio_device_id that matches a
|
|
* specific device. The class field will be set to SDIO_ANY_ID.
|
|
*/
|
|
#define SDIO_DEVICE(vend,dev) \
|
|
.class = SDIO_ANY_ID, \
|
|
.vendor = (vend), .device = (dev)
|
|
|
|
/**
|
|
* SDIO_DEVICE_CLASS - macro used to describe a specific SDIO device class
|
|
* @dev_class: the 8 bit standard interface code
|
|
*
|
|
* This macro is used to create a struct sdio_device_id that matches a
|
|
* specific standard SDIO function type. The vendor and device fields will
|
|
* be set to SDIO_ANY_ID.
|
|
*/
|
|
#define SDIO_DEVICE_CLASS(dev_class) \
|
|
.class = (dev_class), \
|
|
.vendor = SDIO_ANY_ID, .device = SDIO_ANY_ID
|
|
|
|
extern int sdio_register_driver(struct sdio_driver *);
|
|
extern void sdio_unregister_driver(struct sdio_driver *);
|
|
|
|
/*
|
|
* SDIO I/O operations
|
|
*/
|
|
extern void sdio_claim_host(struct sdio_func *func);
|
|
extern void sdio_release_host(struct sdio_func *func);
|
|
|
|
extern int sdio_enable_func(struct sdio_func *func);
|
|
extern int sdio_disable_func(struct sdio_func *func);
|
|
|
|
extern int sdio_set_block_size(struct sdio_func *func, unsigned blksz);
|
|
|
|
extern int sdio_claim_irq(struct sdio_func *func, sdio_irq_handler_t *handler);
|
|
extern int sdio_release_irq(struct sdio_func *func);
|
|
|
|
extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz);
|
|
|
|
extern u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret);
|
|
extern u8 sdio_readb_ext(struct sdio_func *func, unsigned int addr, int *err_ret,
|
|
unsigned in);
|
|
extern u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret);
|
|
extern u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret);
|
|
|
|
extern int sdio_memcpy_fromio(struct sdio_func *func, void *dst,
|
|
unsigned int addr, int count);
|
|
extern int sdio_readsb(struct sdio_func *func, void *dst,
|
|
unsigned int addr, int count);
|
|
|
|
extern void sdio_writeb(struct sdio_func *func, u8 b,
|
|
unsigned int addr, int *err_ret);
|
|
extern void sdio_writew(struct sdio_func *func, u16 b,
|
|
unsigned int addr, int *err_ret);
|
|
extern void sdio_writel(struct sdio_func *func, u32 b,
|
|
unsigned int addr, int *err_ret);
|
|
|
|
extern u8 sdio_writeb_readb(struct sdio_func *func, u8 write_byte,
|
|
unsigned int addr, int *err_ret);
|
|
|
|
extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr,
|
|
void *src, int count);
|
|
extern int sdio_writesb(struct sdio_func *func, unsigned int addr,
|
|
void *src, int count);
|
|
|
|
extern unsigned char sdio_f0_readb(struct sdio_func *func,
|
|
unsigned int addr, int *err_ret);
|
|
extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
|
|
unsigned int addr, int *err_ret);
|
|
|
|
extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
|
|
extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
|
|
|
|
#endif /* LINUX_MMC_SDIO_FUNC_H */
|