diff options
Diffstat (limited to 'include')
48 files changed, 772 insertions, 1007 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f4d4120e5128..6f3c6ae4fe03 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -108,7 +108,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres #endif #ifndef __HAVE_ARCH_PAGE_CLEAR_DIRTY -#define page_clear_dirty(page) do { } while (0) +#define page_clear_dirty(page, mapped) do { } while (0) #endif #ifndef __HAVE_ARCH_PAGE_TEST_DIRTY diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 009b80e49f53..646b462d04df 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -115,7 +115,6 @@ struct request { void *elevator_private3; struct gendisk *rq_disk; - struct hd_struct *part; unsigned long start_time; #ifdef CONFIG_BLK_CGROUP unsigned long long start_time_ns; diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h index b3ef0c461578..e35071b1de0e 100644 --- a/include/linux/coda_fs_i.h +++ b/include/linux/coda_fs_i.h @@ -10,19 +10,24 @@ #include <linux/types.h> #include <linux/list.h> +#include <linux/spinlock.h> #include <linux/coda.h> /* * coda fs inode data + * c_lock protects accesses to c_flags, c_mapcount, c_cached_epoch, c_uid and + * c_cached_perm. + * vfs_inode is set only when the inode is created and never changes. + * c_fid is set when the inode is created and should be considered immutable. */ struct coda_inode_info { - struct CodaFid c_fid; /* Coda identifier */ - u_short c_flags; /* flags (see below) */ - struct list_head c_cilist; /* list of all coda inodes */ + struct CodaFid c_fid; /* Coda identifier */ + u_short c_flags; /* flags (see below) */ unsigned int c_mapcount; /* nr of times this inode is mapped */ unsigned int c_cached_epoch; /* epoch for cached permissions */ vuid_t c_uid; /* fsuid for cached permissions */ - unsigned int c_cached_perm; /* cached access permissions */ + unsigned int c_cached_perm; /* cached access permissions */ + spinlock_t c_lock; struct inode vfs_inode; }; diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index dcc228aa335a..2e914d0771b9 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -89,7 +89,11 @@ static __inline__ char *coda_i2s(struct inode *inode) /* this will not zap the inode away */ static __inline__ void coda_flag_inode(struct inode *inode, int flag) { - ITOC(inode)->c_flags |= flag; + struct coda_inode_info *cii = ITOC(inode); + + spin_lock(&cii->c_lock); + cii->c_flags |= flag; + spin_unlock(&cii->c_lock); } #endif diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 284b520934a0..72f2d2f0af91 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -8,6 +8,7 @@ #ifdef __KERNEL__ #include <linux/backing-dev.h> +#include <linux/mutex.h> struct kstatfs; @@ -20,6 +21,7 @@ struct venus_comm { int vc_inuse; struct super_block *vc_sb; struct backing_dev_info bdi; + struct mutex vc_mutex; }; @@ -63,7 +65,7 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid, int venus_access(struct super_block *sb, struct CodaFid *fid, int mask); int venus_pioctl(struct super_block *sb, struct CodaFid *fid, unsigned int cmd, struct PioctlData *data); -int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); +int coda_downcall(struct venus_comm *vcp, int opcode, union outputArgs *out); int venus_fsync(struct super_block *sb, struct CodaFid *fid); int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h index 7c930dba477c..5dd428532f79 100644 --- a/include/linux/davinci_emac.h +++ b/include/linux/davinci_emac.h @@ -14,16 +14,26 @@ #include <linux/if_ether.h> #include <linux/memory.h> +struct mdio_platform_data { + unsigned long bus_freq; +}; + struct emac_platform_data { char mac_addr[ETH_ALEN]; u32 ctrl_reg_offset; u32 ctrl_mod_reg_offset; u32 ctrl_ram_offset; u32 hw_ram_addr; - u32 mdio_reg_offset; u32 ctrl_ram_size; - u32 phy_mask; - u32 mdio_max_freq; + + /* + * phy_id can be one of the following: + * - NULL : use the first phy on the bus, + * - "" : force to 100/full, no mdio control + * - "<bus>:<addr>" : use the specified bus and phy + */ + const char *phy_id; + u8 rmii_en; u8 version; void (*interrupt_enable) (void); diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 80a0ece8f7e4..4fd978e7eb83 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -122,8 +122,6 @@ extern void elv_completed_request(struct request_queue *, struct request *); extern int elv_set_request(struct request_queue *, struct request *, gfp_t); extern void elv_put_request(struct request_queue *, struct request *); extern void elv_drain_elevator(struct request_queue *); -extern void elv_quiesce_start(struct request_queue *); -extern void elv_quiesce_end(struct request_queue *); /* * io scheduler registration diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 361d1cc288d0..b65a6f472775 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -53,9 +53,7 @@ struct gameport { #define to_gameport_port(d) container_of(d, struct gameport, dev) struct gameport_driver { - - void *private; - char *description; + const char *description; int (*connect)(struct gameport *, struct gameport_driver *drv); int (*reconnect)(struct gameport *); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 557c3927e70f..7a7b9c1644e4 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -140,7 +140,6 @@ struct disk_part_tbl { struct rcu_head rcu_head; int len; struct hd_struct __rcu *last_lookup; - struct gendisk *disk; struct hd_struct __rcu *part[]; }; diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h new file mode 100644 index 000000000000..096659169215 --- /dev/null +++ b/include/linux/gpio-fan.h @@ -0,0 +1,36 @@ +/* + * include/linux/gpio-fan.h + * + * Platform data structure for GPIO fan driver + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef __LINUX_GPIO_FAN_H +#define __LINUX_GPIO_FAN_H + +struct gpio_fan_alarm { + unsigned gpio; + unsigned active_low; +}; + +struct gpio_fan_speed { + int rpm; + int ctrl_val; +}; + +struct gpio_fan_platform_data { + int num_ctrl; + unsigned *ctrl; /* fan control GPIOs. */ + struct gpio_fan_alarm *alarm; /* fan alarm GPIO. */ + /* + * Speed conversion array: rpm from/to GPIO bit field. + * This array _must_ be sorted in ascending rpm order. + */ + int num_speed; + struct gpio_fan_speed *speed; +}; + +#endif /* __LINUX_GPIO_FAN_H */ diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 6de90bfc6acd..4793d8a7f480 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -553,8 +553,12 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); extern int twl4030_remove_script(u8 flags); struct twl4030_codec_audio_data { - unsigned int audio_mclk; + unsigned int audio_mclk; /* not used, will be removed */ + unsigned int digimic_delay; /* in ms */ unsigned int ramp_delay_value; + unsigned int offset_cncl_path; + unsigned int check_defaults:1; + unsigned int reset_registers:1; unsigned int hs_extmute:1; void (*set_hs_extmute)(int mute); }; diff --git a/include/linux/input.h b/include/linux/input.h index d6ae1761be97..51af441f3a21 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -34,7 +34,7 @@ struct input_event { * Protocol version. */ -#define EV_VERSION 0x010000 +#define EV_VERSION 0x010001 /* * IOCTLs (0x00 - 0x7f) @@ -56,25 +56,50 @@ struct input_absinfo { __s32 resolution; }; +/** + * struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls + * @scancode: scancode represented in machine-endian form. + * @len: length of the scancode that resides in @scancode buffer. + * @index: index in the keymap, may be used instead of scancode + * @flags: allows to specify how kernel should handle the request. For + * example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel + * should perform lookup in keymap by @index instead of @scancode + * @keycode: key code assigned to this scancode + * + * The structure is used to retrieve and modify keymap data. Users have + * option of performing lookup either by @scancode itself or by @index + * in keymap entry. EVIOCGKEYCODE will also return scancode or index + * (depending on which element was used to perform lookup). + */ +struct input_keymap_entry { +#define INPUT_KEYMAP_BY_INDEX (1 << 0) + __u8 flags; + __u8 len; + __u16 index; + __u32 keycode; + __u8 scancode[32]; +}; + #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ #define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */ #define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */ -#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */ -#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */ + +#define EVIOCGKEYCODE _IOR('E', 0x04, struct input_keymap_entry) /* get keycode */ +#define EVIOCSKEYCODE _IOW('E', 0x04, struct input_keymap_entry) /* set keycode */ #define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ #define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ #define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len) /* get unique identifier */ -#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ +#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global key state */ #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ -#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ -#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ +#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ +#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ #define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ #define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ @@ -1088,13 +1113,13 @@ struct input_mt_slot { * @keycodemax: size of keycode table * @keycodesize: size of elements in keycode table * @keycode: map of scancodes to keycodes for this device + * @getkeycode: optional legacy method to retrieve current keymap. * @setkeycode: optional method to alter current keymap, used to implement * sparse keymaps. If not supplied default mechanism will be used. * The method is being called while holding event_lock and thus must * not sleep - * @getkeycode: optional method to retrieve current keymap. If not supplied - * default mechanism will be used. The method is being called while - * holding event_lock and thus must not sleep + * @getkeycode_new: transition method + * @setkeycode_new: transition method * @ff: force feedback structure associated with the device if device * supports force feedback effects * @repeat_key: stores key code of the last key pressed; used to implement @@ -1168,10 +1193,16 @@ struct input_dev { unsigned int keycodemax; unsigned int keycodesize; void *keycode; + int (*setkeycode)(struct input_dev *dev, unsigned int scancode, unsigned int keycode); int (*getkeycode)(struct input_dev *dev, unsigned int scancode, unsigned int *keycode); + int (*setkeycode_new)(struct input_dev *dev, + const struct input_keymap_entry *ke, + unsigned int *old_keycode); + int (*getkeycode_new)(struct input_dev *dev, + struct input_keymap_entry *ke); struct ff_device *ff; @@ -1478,10 +1509,12 @@ INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz) INPUT_GENERATE_ABS_ACCESSORS(flat, flat) INPUT_GENERATE_ABS_ACCESSORS(res, resolution) -int input_get_keycode(struct input_dev *dev, - unsigned int scancode, unsigned int *keycode); +int input_scancode_to_scalar(const struct input_keymap_entry *ke, + unsigned int *scancode); + +int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke); int input_set_keycode(struct input_dev *dev, - unsigned int scancode, unsigned int keycode); + const struct input_keymap_entry *ke); extern struct class input_class; diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h new file mode 100644 index 000000000000..e470d387dd49 --- /dev/null +++ b/include/linux/input/bu21013.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) ST-Ericsson SA 2010 + * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson + * License terms:GNU General Public License (GPL) version 2 + */ + +#ifndef _BU21013_H +#define _BU21013_H + +/** + * struct bu21013_platform_device - Handle the platform data + * @cs_en: pointer to the cs enable function + * @cs_dis: pointer to the cs disable function + * @irq_read_val: pointer to read the pen irq value function + * @x_max_res: xmax resolution + * @y_max_res: ymax resolution + * @touch_x_max: touch x max + * @touch_y_max: touch y max + * @cs_pin: chip select pin + * @irq: irq pin + * @ext_clk: external clock flag + * @x_flip: x flip flag + * @y_flip: y flip flag + * @wakeup: wakeup flag + * + * This is used to handle the platform data + */ +struct bu21013_platform_device { + int (*cs_en)(int reset_pin); + int (*cs_dis)(int reset_pin); + int (*irq_read_val)(void); + int x_max_res; + int y_max_res; + int touch_x_max; + int touch_y_max; + unsigned int cs_pin; + unsigned int irq; + bool ext_clk; + bool x_flip; + bool y_flip; + bool wakeup; +}; + +#endif diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index 0e8a346424bb..d4292c8431e0 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h @@ -1,6 +1,52 @@ #ifndef __LIS3LV02D_H_ #define __LIS3LV02D_H_ +/** + * struct lis3lv02d_platform_data - lis3 chip family platform data + * @click_flags: Click detection unit configuration + * @click_thresh_x: Click detection unit x axis threshold + * @click_thresh_y: Click detection unit y axis threshold + * @click_thresh_z: Click detection unit z axis threshold + * @click_time_limit: Click detection unit time parameter + * @click_latency: Click detection unit latency parameter + * @click_window: Click detection unit window parameter + * @irq_cfg: On chip irq source and type configuration (click / + * data available / wake up, open drain, polarity) + * @irq_flags1: Additional irq triggering flags for irq channel 0 + * @irq_flags2: Additional irq triggering flags for irq channel 1 + * @duration1: Wake up unit 1 duration parameter + * @duration2: Wake up unit 2 duration parameter + * @wakeup_flags: Wake up unit 1 flags + * @wakeup_thresh: Wake up unit 1 threshold value + * @wakeup_flags2: Wake up unit 2 flags + * @wakeup_thresh2: Wake up unit 2 threshold value + * @hipass_ctrl: High pass filter control (enable / disable, cut off + * frequency) + * @axis_x: Sensor orientation remapping for x-axis + * @axis_y: Sensor orientation remapping for y-axis + * @axis_z: Sensor orientation remapping for z-axis + * @driver_features: Enable bits for different features. Disabled by default + * @default_rate: Default sampling rate. 0 means reset default + * @setup_resources: Interrupt line setup call back function + * @release_resources: Interrupt line release call back function + * @st_min_limits[3]: Selftest acceptance minimum values + * @st_max_limits[3]: Selftest acceptance maximum values + * @irq2: Irq line 2 number + * + * Platform data is used to setup the sensor chip. Meaning of the different + * chip features can be found from the data sheet. It is publicly available + * at www.st.com web pages. Currently the platform data is used + * only for the 8 bit device. The 8 bit device has two wake up / free fall + * detection units and click detection unit. There are plenty of ways to + * configure the chip which makes is quite hard to explain deeper meaning of + * the fields here. Behaviour of the detection blocks varies heavily depending + * on the configuration. For example, interrupt detection block can use high + * pass filtered data which makes it react to the changes in the acceleration. + * Irq_flags can be used to enable interrupt detection on the both edges. + * With proper chip configuration this produces interrupt when some trigger + * starts and when it goes away. + */ + struct lis3lv02d_platform_data { /* please note: the 'click' feature is only supported for * LIS[32]02DL variants of the chip and will be ignored for @@ -36,7 +82,10 @@ struct lis3lv02d_platform_data { #define LIS3_IRQ_OPEN_DRAIN (1 << 6) #define LIS3_IRQ_ACTIVE_LOW (1 << 7) unsigned char irq_cfg; - + unsigned char irq_flags1; /* Additional irq edge / level flags */ + unsigned char irq_flags2; /* Additional irq edge / level flags */ + unsigned char duration1; + unsigned char duration2; #define LIS3_WAKEUP_X_LO (1 << 0) #define LIS3_WAKEUP_X_HI (1 << 1) #define LIS3_WAKEUP_Y_LO (1 << 2) @@ -64,6 +113,10 @@ struct lis3lv02d_platform_data { s8 axis_x; s8 axis_y; s8 axis_z; +#define LIS3_USE_REGULATOR_CTRL 0x01 +#define LIS3_USE_BLOCK_READ 0x02 + u16 driver_features; + int default_rate; int (*setup_resources)(void); int (*release_resources)(void); /* Limits for selftest are specified in chip data sheet */ diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index d0edf7d823ae..a46e430d9622 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -360,10 +360,13 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); extern void put_nfs_open_context(struct nfs_open_context *ctx); extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); +extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); +extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); extern u64 nfs_compat_user_ino64(u64 fileid); extern void nfs_fattr_init(struct nfs_fattr *fattr); +extern unsigned long nfs_inc_attr_generation_counter(void); extern struct nfs_fattr *nfs_alloc_fattr(void); @@ -379,9 +382,12 @@ static inline void nfs_free_fhandle(const struct nfs_fh *fh) kfree(fh); } +/* + * linux/fs/nfs/nfsroot.c + */ +extern int nfs_root_data(char **root_device, char **root_data); /*__init*/ /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ extern __be32 root_nfs_parse_addr(char *name); /*__init*/ -extern unsigned long nfs_inc_attr_generation_counter(void); /* * linux/fs/nfs/file.c @@ -479,10 +485,10 @@ extern void nfs_release_automount_timer(void); /* * linux/fs/nfs/unlink.c */ -extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); extern void nfs_block_sillyrename(struct dentry *dentry); extern void nfs_unblock_sillyrename(struct dentry *dentry); +extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry); /* * linux/fs/nfs/write.c @@ -584,10 +590,6 @@ nfs_fileid_to_ino_t(u64 fileid) return ino; } -/* NFS root */ - -extern void * nfs_root_data(void); - #define nfs_wait_event(clnt, wq, condition) \ ({ \ int __retval = wait_event_killable(wq, condition); \ diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index c82ee7cd6288..5eef862ec187 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -124,6 +124,7 @@ struct nfs_server { struct nfs_fsid fsid; __u64 maxfilesize; /* maximum file size */ + struct timespec time_delta; /* smallest time granularity */ unsigned long mount_time; /* when this fs was mounted */ dev_t s_dev; /* superblock dev numbers */ diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h index 91a1c24e0cbf..e8352dc5afb5 100644 --- a/include/linux/nfs_idmap.h +++ b/include/linux/nfs_idmap.h @@ -66,13 +66,40 @@ struct idmap_msg { /* Forward declaration to make this header independent of others */ struct nfs_client; +#ifdef CONFIG_NFS_USE_NEW_IDMAPPER + +int nfs_idmap_init(void); +void nfs_idmap_quit(void); + +static inline int nfs_idmap_new(struct nfs_client *clp) +{ + return 0; +} + +static inline void nfs_idmap_delete(struct nfs_client *clp) +{ +} + +#else /* CONFIG_NFS_USE_NEW_IDMAPPER not set */ + +static inline int nfs_idmap_init(void) +{ + return 0; +} + +static inline void nfs_idmap_quit(void) +{ +} + int nfs_idmap_new(struct nfs_client *); void nfs_idmap_delete(struct nfs_client *); +#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */ + int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *); int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *); -int nfs_map_uid_to_name(struct nfs_client *, __u32, char *); -int nfs_map_gid_to_group(struct nfs_client *, __u32, char *); +int nfs_map_uid_to_name(struct nfs_client *, __u32, char *, size_t); +int nfs_map_gid_to_group(struct nfs_client *, __u32, char *, size_t); extern unsigned int nfs_idmap_cache_timeout; #endif /* __KERNEL__ */ diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 5d59ae861aa6..576bddd72e04 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h @@ -71,4 +71,7 @@ struct nfs_mount_data { #define NFS_MOUNT_NORESVPORT 0x40000 #define NFS_MOUNT_LEGACY_INTERFACE 0x80000 +#define NFS_MOUNT_LOCAL_FLOCK 0x100000 +#define NFS_MOUNT_LOCAL_FCNTL 0x200000 + #endif diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index fc461926c412..da7a1300dc60 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -112,6 +112,7 @@ struct nfs_fsinfo { __u32 wtmult; /* writes should be multiple of this */ __u32 dtpref; /* pref. readdir transfer size */ __u64 maxfilesize; + struct timespec time_delta; /* server time granularity */ __u32 lease_time; /* in seconds */ }; @@ -170,7 +171,7 @@ struct nfs4_sequence_args { struct nfs4_sequence_res { struct nfs4_session *sr_session; - u8 sr_slotid; /* slot used to send request */ + struct nfs4_slot *sr_slot; /* slot used to send request */ int sr_status; /* sequence operation status */ unsigned long sr_renewal_time; u32 sr_status_flags; @@ -400,6 +401,27 @@ struct nfs_removeres { }; /* + * Common arguments to the rename call + */ +struct nfs_renameargs { + const struct nfs_fh *old_dir; + const struct nfs_fh *new_dir; + const struct qstr *old_name; + const struct qstr *new_name; + const u32 *bitmask; + struct nfs4_sequence_args seq_args; +}; + +struct nfs_renameres { + const struct nfs_server *server; + struct nfs4_change_info old_cinfo; + struct nfs_fattr *old_fattr; + struct nfs4_change_info new_cinfo; + struct nfs_fattr *new_fattr; + struct nfs4_sequence_res seq_res; +}; + +/* * Argument struct for decode_entry function */ struct nfs_entry { @@ -434,15 +456,6 @@ struct nfs_createargs { struct iattr * sattr; }; -struct nfs_renameargs { - struct nfs_fh * fromfh; - const char * fromname; - unsigned int fromlen; - struct nfs_fh * tofh; - const char * toname; - unsigned int tolen; -}; - struct nfs_setattrargs { struct nfs_fh * fh; nfs4_stateid stateid; @@ -586,15 +599,6 @@ struct nfs3_mknodargs { dev_t rdev; }; -struct nfs3_renameargs { - struct nfs_fh * fromfh; - const char * fromname; - unsigned int fromlen; - struct nfs_fh * tofh; - const char * toname; - unsigned int tolen; -}; - struct nfs3_linkargs { struct nfs_fh * fromfh; struct nfs_fh * tofh; @@ -629,11 +633,6 @@ struct nfs3_readlinkargs { struct page ** pages; }; -struct nfs3_renameres { - struct nfs_fattr * fromattr; - struct nfs_fattr * toattr; -}; - struct nfs3_linkres { struct nfs_fattr * dir_attr; struct nfs_fattr * fattr; @@ -780,6 +779,7 @@ struct nfs4_readdir_arg { struct page ** pages; /* zero-copy data */ unsigned int pgbase; /* zero-copy data */ const u32 * bitmask; + int plus; struct nfs4_sequence_args seq_args; }; @@ -801,24 +801,6 @@ struct nfs4_readlink_res { struct nfs4_sequence_res seq_res; }; -struct nfs4_rename_arg { - const struct nfs_fh * old_dir; - const struct nfs_fh * new_dir; - const struct qstr * old_name; - const struct qstr * new_name; - const u32 * bitmask; - struct nfs4_sequence_args seq_args; -}; - -struct nfs4_rename_res { - const struct nfs_server * server; - struct nfs4_change_info old_cinfo; - struct nfs_fattr * old_fattr; - struct nfs4_change_info new_cinfo; - struct nfs_fattr * new_fattr; - struct nfs4_sequence_res seq_res; -}; - #define NFS4_SETCLIENTID_NAMELEN (127) struct nfs4_setclientid { const nfs4_verifier * sc_verifier; @@ -1032,19 +1014,21 @@ struct nfs_rpc_ops { int (*readlink)(struct inode *, struct page *, unsigned int, unsigned int); int (*create) (struct inode *, struct dentry *, - struct iattr *, int, struct nameidata *); + struct iattr *, int, struct nfs_open_context *); int (*remove) (struct inode *, struct qstr *); void (*unlink_setup) (struct rpc_message *, struct inode *dir); int (*unlink_done) (struct rpc_task *, struct inode *); int (*rename) (struct inode *, struct qstr *, struct inode *, struct qstr *); + void (*rename_setup) (struct rpc_message *msg, struct inode *dir); + int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); int (*link) (struct inode *, struct inode *, struct qstr *); int (*symlink) (struct inode *, struct dentry *, struct page *, unsigned int, struct iattr *); int (*mkdir) (struct inode *, struct dentry *, struct iattr *); int (*rmdir) (struct inode *, struct qstr *); int (*readdir) (struct dentry *, struct rpc_cred *, - u64, struct page *, unsigned int, int); + u64, struct page **, unsigned int, int); int (*mknod) (struct inode *, struct dentry *, struct iattr *, dev_t); int (*statfs) (struct nfs_server *, struct nfs_fh *, @@ -1054,7 +1038,7 @@ struct nfs_rpc_ops { int (*pathconf) (struct nfs_server *, struct nfs_fh *, struct nfs_pathconf *); int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); - __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); + __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus); void (*read_setup) (struct nfs_read_data *, struct rpc_message *); int (*read_done) (struct rpc_task *, struct nfs_read_data *); void (*write_setup) (struct nfs_write_data *, struct rpc_message *); @@ -1065,6 +1049,10 @@ struct nfs_rpc_ops { int (*lock_check_bounds)(const struct file_lock *); void (*clear_acl_cache)(struct inode *); void (*close_context)(struct nfs_open_context *ctx, int); + struct inode * (*open_context) (struct inode *dir, + struct nfs_open_context *ctx, + int open_flags, + struct iattr *iattr); }; /* diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 835f85ecd2de..975d347079d9 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -27,20 +27,19 @@ static inline int of_driver_match_device(const struct device *dev, extern struct platform_device *of_dev_get(struct platform_device *dev); extern void of_dev_put(struct platform_device *dev); +extern int of_device_add(struct platform_device *pdev); extern int of_device_register(struct platform_device *ofdev); extern void of_device_unregister(struct platform_device *ofdev); -extern void of_release_dev(struct device *dev); - -static inline void of_device_free(struct platform_device *dev) -{ - of_release_dev(&dev->dev); -} extern ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len); extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); +static inline void of_device_node_put(struct device *dev) +{ + of_node_put(dev->of_node); +} #else /* CONFIG_OF_DEVICE */ @@ -56,6 +55,8 @@ static inline int of_device_uevent(struct device *dev, return -ENODEV; } +static inline void of_device_node_put(struct device *dev) { } + #endif /* CONFIG_OF_DEVICE */ #endif /* _LINUX_OF_DEVICE_H */ diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 71e1a916d3fa..7bbf5b328438 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -72,7 +72,7 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name, unsigned long *size); extern int of_flat_dt_is_compatible(unsigned long node, const char *name); extern unsigned long of_get_flat_dt_root(void); -extern void early_init_dt_scan_chosen_arch(unsigned long node); + extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, int depth, void *data); extern void early_init_dt_check_for_initrd(unsigned long node); diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index 5929781c104d..109e013b1772 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -5,6 +5,7 @@ struct of_irq; #include <linux/types.h> #include <linux/errno.h> +#include <linux/irq.h> #include <linux/ioport.h> #include <linux/of.h> @@ -64,6 +65,9 @@ extern unsigned int irq_create_of_mapping(struct device_node *controller, unsigned int intsize); extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r); +extern int of_irq_count(struct device_node *dev); +extern int of_irq_to_resource_table(struct device_node *dev, + struct resource *res, int nr_irqs); #endif /* CONFIG_OF_IRQ */ #endif /* CONFIG_OF */ diff --git a/include/linux/of_pdt.h b/include/linux/of_pdt.h new file mode 100644 index 000000000000..c65a18a0cfdf --- /dev/null +++ b/include/linux/of_pdt.h @@ -0,0 +1,45 @@ +/* + * Definitions for building a device tree by calling into the + * Open Firmware PROM. + * + * Copyright (C) 2010 Andres Salomon <dilinger@queued.net> + * + * 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_OF_PDT_H +#define _LINUX_OF_PDT_H + +/* overridable operations for calling into the PROM */ +struct of_pdt_ops { + /* + * buf should be 32 bytes; return 0 on success. + * If prev is NULL, the first property will be returned. + */ + int (*nextprop)(phandle node, char *prev, char *buf); + + /* for both functions, return proplen on success; -1 on error */ + int (*getproplen)(phandle node, const char *prop); + int (*getproperty)(phandle node, const char *prop, char *buf, + int bufsize); + + /* phandles are 0 if no child or sibling exists */ + phandle (*getchild)(phandle parent); + phandle (*getsibling)(phandle node); + + /* return 0 on success; fill in 'len' with number of bytes in path */ + int (*pkg2path)(phandle node, char *buf, const int buflen, int *len); +}; + +extern void *prom_early_alloc(unsigned long size); + +/* for building the device tree */ +extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops); + +extern void (*of_pdt_build_more)(struct device_node *dp, + struct device_node ***nextp); + +#endif /* _LINUX_OF_PDT_H */ diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 6fa317801e1c..5f38c460367e 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -310,7 +310,7 @@ static inline void SetPageUptodate(struct page *page) { #ifdef CONFIG_S390 if (!test_and_set_bit(PG_uptodate, &page->flags)) - page_clear_dirty(page); + page_clear_dirty(page, 0); #else /* * Memory barrier must be issued before setting the PG_uptodate bit, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d278dd9cb765..b4c3d1b50037 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2268,6 +2268,13 @@ #define PCI_VENDOR_ID_SILAN 0x1904 +#define PCI_VENDOR_ID_RENESAS 0x1912 +#define PCI_DEVICE_ID_RENESAS_SH7781 0x0001 +#define PCI_DEVICE_ID_RENESAS_SH7780 0x0002 +#define PCI_DEVICE_ID_RENESAS_SH7763 0x0004 +#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 +#define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 + #define PCI_VENDOR_ID_TDI 0x192E #define PCI_DEVICE_ID_TDI_EHCI 0x0101 diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 99e5994e6f84..212eb4c67797 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -196,6 +196,9 @@ /* High Speed UART for Medfield */ #define PORT_MFD 95 +/* TI OMAP-UART */ +#define PORT_OMAP 96 + #ifdef __KERNEL__ #include <linux/compiler.h> diff --git a/include/linux/serio.h b/include/linux/serio.h index b5552568178d..e26f4788845f 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -41,7 +41,9 @@ struct serio { int (*start)(struct serio *); void (*stop)(struct serio *); - struct serio *parent, *child; + struct serio *parent; + struct list_head child_node; /* Entry in parent->children list */ + struct list_head children; unsigned int depth; /* level of nesting in serio hierarchy */ struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ @@ -54,10 +56,9 @@ struct serio { #define to_serio_port(d) container_of(d, struct serio, dev) struct serio_driver { - void *private; - char *description; + const char *description; - struct serio_device_id *id_table; + const struct serio_device_id *id_table; bool manual_bind; void (*write_wakeup)(struct serio *); @@ -197,5 +198,6 @@ static inline void serio_continue_rx(struct serio *serio) #define SERIO_W8001 0x39 #define SERIO_DYNAPRO 0x3a #define SERIO_HAMPSHIRE 0x3b +#define SERIO_PS2MULT 0x3c #endif diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 875ce50719a9..4dca992f3093 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h @@ -4,11 +4,20 @@ #include <linux/list.h> #include <linux/seq_file.h> #include <linux/cpufreq.h> +#include <linux/types.h> +#include <linux/kref.h> #include <linux/clk.h> #include <linux/err.h> struct clk; +struct clk_mapping { + phys_addr_t phys; + void __iomem *base; + unsigned long len; + struct kref ref; +}; + struct clk_ops { void (*init)(struct clk *clk); int (*enable)(struct clk *clk); @@ -21,9 +30,6 @@ struct clk_ops { struct clk { struct list_head node; - const char *name; - int id; - struct clk *parent; struct clk **parent_table; /* list of parents to */ unsigned short parent_num; /* choose between */ @@ -45,7 +51,9 @@ struct clk { unsigned long arch_flags; void *priv; struct dentry *dentry; + struct clk_mapping *mapping; struct cpufreq_frequency_table *freq_table; + unsigned int nr_freqs; }; #define CLK_ENABLE_ON_INIT (1 << 0) @@ -111,6 +119,9 @@ int clk_rate_table_find(struct clk *clk, struct cpufreq_frequency_table *freq_table, unsigned long rate); +long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, + unsigned int div_max, unsigned long rate); + #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ { \ .parent = _parent, \ diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 0d6cd38e673d..b4f183a31f13 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h @@ -20,6 +20,12 @@ struct intc_group { #define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } +struct intc_subgroup { + unsigned long reg, reg_width; + intc_enum parent_id; + intc_enum enum_ids[32]; +}; + struct intc_mask_reg { unsigned long set_reg, clr_reg, reg_width; intc_enum enum_ids[32]; @@ -69,9 +75,12 @@ struct intc_hw_desc { unsigned int nr_sense_regs; struct intc_mask_reg *ack_regs; unsigned int nr_ack_regs; + struct intc_subgroup *subgroups; + unsigned int nr_subgroups; }; -#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) +#define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) + #define INTC_HW_DESC(vectors, groups, mask_regs, \ prio_regs, sense_regs, ack_regs) \ { \ @@ -105,8 +114,11 @@ struct intc_desc symbol __initdata = { \ prio_regs, sense_regs, ack_regs), \ } -int __init register_intc_controller(struct intc_desc *desc); +int register_intc_controller(struct intc_desc *desc); +void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs); int intc_set_priority(unsigned int irq, unsigned int prio); +int intc_irq_lookup(const char *chipname, intc_enum enum_id); +void intc_finalize(void); #ifdef CONFIG_INTC_USERIMASK int register_intc_userimask(unsigned long addr); diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index 07c08af9f8f6..30cae70874f4 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h @@ -92,5 +92,6 @@ struct pinmux_info { }; int register_pinmux(struct pinmux_info *pip); +int unregister_pinmux(struct pinmux_info *pip); #endif /* __SH_PFC_H */ diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 85f38a63f098..c83df09a8e2b 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -137,7 +137,6 @@ int rpcb_register(u32, u32, int, unsigned short); int rpcb_v4_register(const u32 program, const u32 version, const struct sockaddr *address, const char *netid); -int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); void rpcb_getport_async(struct rpc_task *); void rpc_call_start(struct rpc_task *); diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 35cf2e8cd7c6..ab91d86565fd 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -108,6 +108,7 @@ void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, unsigned int); void xdr_inline_pages(struct xdr_buf *, unsigned int, struct page **, unsigned int, unsigned int); +void xdr_terminate_string(struct xdr_buf *, const u32); static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) { @@ -200,6 +201,7 @@ extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, unsigned int base, unsigned int len); extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); +extern __be32 *xdr_inline_peek(struct xdr_stream *xdr, size_t nbytes); extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); diff --git a/include/linux/wlp.h b/include/linux/wlp.h deleted file mode 100644 index c76fe2392506..000000000000 --- a/include/linux/wlp.h +++ /dev/null @@ -1,736 +0,0 @@ -/* - * WiMedia Logical Link Control Protocol (WLP) - * - * Copyright (C) 2005-2006 Intel Corporation - * Reinette Chatre <reinette.chatre@intel.com> - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. - * - * - * FIXME: docs - * - * - Does not (yet) include support for WLP control frames - * WLP Draft 0.99 [6.5]. - * - * A visual representation of the data structures. - * - * wssidB wssidB - * ^ ^ - * | | - * wssidA wssidA - * wlp interface { ^ ^ - * ... | | - * ... ... wssid wssid ... - * wlp --- ... | | - * }; neighbors --> neighbA --> neighbB - * ... - * wss - * ... - * eda cache --> neighborA --> neighborB --> neighborC ... - */ - -#ifndef __LINUX__WLP_H_ -#define __LINUX__WLP_H_ - -#include <linux/netdevice.h> -#include <linux/skbuff.h> -#include <linux/list.h> -#include <linux/uwb.h> - -/** - * WLP Protocol ID - * WLP Draft 0.99 [6.2] - * - * The MUX header for all WLP frames - */ -#define WLP_PROTOCOL_ID 0x0100 - -/** - * WLP Version - * WLP version placed in the association frames (WLP 0.99 [6.6]) - */ -#define WLP_VERSION 0x10 - -/** - * Bytes needed to print UUID as string - */ -#define WLP_WSS_UUID_STRSIZE 48 - -/** - * Bytes needed to print nonce as string - */ -#define WLP_WSS_NONCE_STRSIZE 48 - - -/** - * Size used for WLP name size - * - * The WSS name is set to 65 bytes, 1 byte larger than the maximum - * allowed by the WLP spec. This is to have a null terminated string - * for display to the user. A maximum of 64 bytes will still be used - * when placing the WSS name field in association frames. - */ -#define WLP_WSS_NAME_SIZE 65 - -/** - * Number of bytes added by WLP to data frame - * - * A data frame transmitted from a host will be placed in a Standard or - * Abbreviated WLP frame. These have an extra 4 bytes of header (struct - * wlp_frame_std_abbrv_hdr). - * When the stack sends this data frame for transmission it needs to ensure - * there is enough headroom for this header. - */ -#define WLP_DATA_HLEN 4 - -/** - * State of device regarding WLP Service Set - * - * WLP_WSS_STATE_NONE: the host does not participate in any WSS - * WLP_WSS_STATE_PART_ENROLLED: used as part of the enrollment sequence - * ("Partial Enroll"). This state is used to - * indicate the first part of enrollment that is - * unsecure. If the WSS is unsecure then the - * state will promptly go to WLP_WSS_STATE_ENROLLED, - * if the WSS is not secure then the enrollment - * procedure is a few more steps before we are - * enrolled. - * WLP_WSS_STATE_ENROLLED: the host is enrolled in a WSS - * WLP_WSS_STATE_ACTIVE: WSS is activated - * WLP_WSS_STATE_CONNECTED: host is connected to neighbor in WSS - * - */ -enum wlp_wss_state { - WLP_WSS_STATE_NONE = 0, - WLP_WSS_STATE_PART_ENROLLED, - WLP_WSS_STATE_ENROLLED, - WLP_WSS_STATE_ACTIVE, - WLP_WSS_STATE_CONNECTED, -}; - -/** - * WSS Secure status - * WLP 0.99 Table 6 - * - * Set to one if the WSS is secure, zero if it is not secure - */ -enum wlp_wss_sec_status { - WLP_WSS_UNSECURE = 0, - WLP_WSS_SECURE, -}; - -/** - * WLP frame type - * WLP Draft 0.99 [6.2 Table 1] - */ -enum wlp_frame_type { - WLP_FRAME_STANDARD = 0, - WLP_FRAME_ABBREVIATED, - WLP_FRAME_CONTROL, - WLP_FRAME_ASSOCIATION, -}; - -/** - * WLP Association Message Type - * WLP Draft 0.99 [6.6.1.2 Table 8] - */ -enum wlp_assoc_type { - WLP_ASSOC_D1 = 2, - WLP_ASSOC_D2 = 3, - WLP_ASSOC_M1 = 4, - WLP_ASSOC_M2 = 5, - WLP_ASSOC_M3 = 7, - WLP_ASSOC_M4 = 8, - WLP_ASSOC_M5 = 9, - WLP_ASSOC_M6 = 10, - WLP_ASSOC_M7 = 11, - WLP_ASSOC_M8 = 12, - WLP_ASSOC_F0 = 14, - WLP_ASSOC_E1 = 32, - WLP_ASSOC_E2 = 33, - WLP_ASSOC_C1 = 34, - WLP_ASSOC_C2 = 35, - WLP_ASSOC_C3 = 36, - WLP_ASSOC_C4 = 37, -}; - -/** - * WLP Attribute Type - * WLP Draft 0.99 [6.6.1 Table 6] - */ -enum wlp_attr_type { - WLP_ATTR_AUTH = 0x1005, /* Authenticator */ - WLP_ATTR_DEV_NAME = 0x1011, /* Device Name */ - WLP_ATTR_DEV_PWD_ID = 0x1012, /* Device Password ID */ - WLP_ATTR_E_HASH1 = 0x1014, /* E-Hash1 */ - WLP_ATTR_E_HASH2 = 0x1015, /* E-Hash2 */ - WLP_ATTR_E_SNONCE1 = 0x1016, /* E-SNonce1 */ - WLP_ATTR_E_SNONCE2 = 0x1017, /* E-SNonce2 */ - WLP_ATTR_ENCR_SET = 0x1018, /* Encrypted Settings */ - WLP_ATTR_ENRL_NONCE = 0x101A, /* Enrollee Nonce */ - WLP_ATTR_KEYWRAP_AUTH = 0x101E, /* Key Wrap Authenticator */ - WLP_ATTR_MANUF = 0x1021, /* Manufacturer */ - WLP_ATTR_MSG_TYPE = 0x1022, /* Message Type */ - WLP_ATTR_MODEL_NAME = 0x1023, /* Model Name */ - WLP_ATTR_MODEL_NR = 0x1024, /* Model Number */ - WLP_ATTR_PUB_KEY = 0x1032, /* Public Key */ - WLP_ATTR_REG_NONCE = 0x1039, /* Registrar Nonce */ - WLP_ATTR_R_HASH1 = 0x103D, /* R-Hash1 */ - WLP_ATTR_R_HASH2 = 0x103E, /* R-Hash2 */ - WLP_ATTR_R_SNONCE1 = 0x103F, /* R-SNonce1 */ - WLP_ATTR_R_SNONCE2 = 0x1040, /* R-SNonce2 */ - WLP_ATTR_SERIAL = 0x1042, /* Serial number */ - WLP_ATTR_UUID_E = 0x1047, /* UUID-E */ - WLP_ATTR_UUID_R = 0x1048, /* UUID-R */ - WLP_ATTR_PRI_DEV_TYPE = 0x1054, /* Primary Device Type */ - WLP_ATTR_SEC_DEV_TYPE = 0x1055, /* Secondary Device Type */ - WLP_ATTR_PORT_DEV = 0x1056, /* Portable Device */ - WLP_ATTR_APP_EXT = 0x1058, /* Application Extension */ - WLP_ATTR_WLP_VER = 0x2000, /* WLP Version */ - WLP_ATTR_WSSID = 0x2001, /* WSSID */ - WLP_ATTR_WSS_NAME = 0x2002, /* WSS Name */ - WLP_ATTR_WSS_SEC_STAT = 0x2003, /* WSS Secure Status */ - WLP_ATTR_WSS_BCAST = 0x2004, /* WSS Broadcast Address */ - WLP_ATTR_WSS_M_KEY = 0x2005, /* WSS Master Key */ - WLP_ATTR_ACC_ENRL = 0x2006, /* Accepting Enrollment */ - WLP_ATTR_WSS_INFO = 0x2007, /* WSS Information */ - WLP_ATTR_WSS_SEL_MTHD = 0x2008, /* WSS Selection Method */ - WLP_ATTR_ASSC_MTHD_LIST = 0x2009, /* Association Methods List */ - WLP_ATTR_SEL_ASSC_MTHD = 0x200A, /* Selected Association Method */ - WLP_ATTR_ENRL_HASH_COMM = 0x200B, /* Enrollee Hash Commitment */ - WLP_ATTR_WSS_TAG = 0x200C, /* WSS Tag */ - WLP_ATTR_WSS_VIRT = 0x200D, /* WSS Virtual EUI-48 */ - WLP_ATTR_WLP_ASSC_ERR = 0x200E, /* WLP Association Error */ - WLP_ATTR_VNDR_EXT = 0x200F, /* Vendor Extension */ -}; - -/** - * WLP Category ID of primary/secondary device - * WLP Draft 0.99 [6.6.1.8 Table 12] - */ -enum wlp_dev_category_id { - WLP_DEV_CAT_COMPUTER = 1, - WLP_DEV_CAT_INPUT, - WLP_DEV_CAT_PRINT_SCAN_FAX_COPIER, - WLP_DEV_CAT_CAMERA, - WLP_DEV_CAT_STORAGE, - WLP_DEV_CAT_INFRASTRUCTURE, - WLP_DEV_CAT_DISPLAY, - WLP_DEV_CAT_MULTIM, - WLP_DEV_CAT_GAMING, - WLP_DEV_CAT_TELEPHONE, - WLP_DEV_CAT_OTHER = 65535, -}; - -/** - * WLP WSS selection method - * WLP Draft 0.99 [6.6.1.6 Table 10] - */ -enum wlp_wss_sel_mthd { - WLP_WSS_ENRL_SELECT = 1, /* Enrollee selects */ - WLP_WSS_REG_SELECT, /* Registrar selects */ -}; - -/** - * WLP association error values - * WLP Draft 0.99 [6.6.1.5 Table 9] - */ -enum wlp_assc_error { - WLP_ASSOC_ERROR_NONE, - WLP_ASSOC_ERROR_AUTH, /* Authenticator Failure */ - WLP_ASSOC_ERROR_ROGUE, /* Rogue activity suspected */ - WLP_ASSOC_ERROR_BUSY, /* Device busy */ - WLP_ASSOC_ERROR_LOCK, /* Setup Locked */ - WLP_ASSOC_ERROR_NOT_READY, /* Registrar not ready */ - WLP_ASSOC_ERROR_INV, /* Invalid WSS selection */ - WLP_ASSOC_ERROR_MSG_TIME, /* Message timeout */ - WLP_ASSOC_ERROR_ENR_TIME, /* Enrollment session timeout */ - WLP_ASSOC_ERROR_PW, /* Device password invalid */ - WLP_ASSOC_ERROR_VER, /* Unsupported version */ - WLP_ASSOC_ERROR_INT, /* Internal error */ - WLP_ASSOC_ERROR_UNDEF, /* Undefined error */ - WLP_ASSOC_ERROR_NUM, /* Numeric comparison failure */ - WLP_ASSOC_ERROR_WAIT, /* Waiting for user input */ -}; - -/** - * WLP Parameters - * WLP 0.99 [7.7] - */ -enum wlp_parameters { - WLP_PER_MSG_TIMEOUT = 15, /* Seconds to wait for response to - association message. */ -}; - -/** - * WLP IE - * - * The WLP IE should be included in beacons by all devices. - * - * The driver can set only a few of the fields in this information element, - * most fields are managed by the device self. When the driver needs to set - * a field it will only provide values for the fields of interest, the rest - * will be filled with zeroes. The fields of interest are: - * - * Element ID - * Length - * Capabilities (only to include WSSID Hash list length) - * WSSID Hash List fields - * - * WLP 0.99 [6.7] - * - * Only the fields that will be used are detailed in this structure, rest - * are not detailed or marked as "notused". - */ -struct wlp_ie { - struct uwb_ie_hdr hdr; - __le16 capabilities; - __le16 cycle_param; - __le16 acw_anchor_addr; - u8 wssid_hash_list[]; -} __packed; - -static inline int wlp_ie_hash_length(struct wlp_ie *ie) -{ - return (le16_to_cpu(ie->capabilities) >> 12) & 0xf; -} - -static inline void wlp_ie_set_hash_length(struct wlp_ie *ie, int hash_length) -{ - u16 caps = le16_to_cpu(ie->capabilities); - caps = (caps & ~(0xf << 12)) | (hash_length << 12); - ie->capabilities = cpu_to_le16(caps); -} - -/** - * WLP nonce - * WLP Draft 0.99 [6.6.1 Table 6] - * - * A 128-bit random number often used (E-SNonce1, E-SNonce2, Enrollee - * Nonce, Registrar Nonce, R-SNonce1, R-SNonce2). It is passed to HW so - * it is packed. - */ -struct wlp_nonce { - u8 data[16]; -} __packed; - -/** - * WLP UUID - * WLP Draft 0.99 [6.6.1 Table 6] - * - * Universally Unique Identifier (UUID) encoded as an octet string in the - * order the octets are shown in string representation in RFC4122. A UUID - * is often used (UUID-E, UUID-R, WSSID). It is passed to HW so it is packed. - */ -struct wlp_uuid { - u8 data[16]; -} __packed; - - -/** - * Primary and secondary device type attributes - * WLP Draft 0.99 [6.6.1.8] - */ -struct wlp_dev_type { - enum wlp_dev_category_id category:16; - u8 OUI[3]; - u8 OUIsubdiv; - __le16 subID; -} __packed; - -/** - * WLP frame header - * WLP Draft 0.99 [6.2] - */ -struct wlp_frame_hdr { - __le16 mux_hdr; /* WLP_PROTOCOL_ID */ - enum wlp_frame_type type:8; -} __packed; - -/** - * WLP attribute field header - * WLP Draft 0.99 [6.6.1] - * - * Header of each attribute found in an association frame - */ -struct wlp_attr_hdr { - __le16 type; - __le16 length; -} __packed; - -/** - * Device information commonly used together - * - * Each of these device information elements has a specified range in which it - * should fit (WLP 0.99 [Table 6]). This range provided in the spec does not - * include the termination null '\0' character (when used in the - * association protocol the attribute fields are accompanied - * with a "length" field so the full range from the spec can be used for - * the value). We thus allocate an extra byte to be able to store a string - * of max length with a terminating '\0'. - */ -struct wlp_device_info { - char name[33]; - char model_name[33]; - char manufacturer[65]; - char model_nr[33]; - char serial[33]; - struct wlp_dev_type prim_dev_type; -}; - -/** - * Macros for the WLP attributes - * - * There are quite a few attributes (total is 43). The attribute layout can be - * in one of three categories: one value, an array, an enum forced to 8 bits. - * These macros help with their definitions. - */ -#define wlp_attr(type, name) \ -struct wlp_attr_##name { \ - struct wlp_attr_hdr hdr; \ - type name; \ -} __packed; - -#define wlp_attr_array(type, name) \ -struct wlp_attr_##name { \ - struct wlp_attr_hdr hdr; \ - type name[]; \ -} __packed; - -/** - * WLP association attribute fields - * WLP Draft 0.99 [6.6.1 Table 6] - * - * Attributes appear in same order as the Table in the spec - * FIXME Does not define all attributes yet - */ - -/* Device name: Friendly name of sending device */ -wlp_attr_array(u8, dev_name) - -/* Enrollee Nonce: Random number generated by enrollee for an enrollment - * session */ -wlp_attr(struct wlp_nonce, enonce) - -/* Manufacturer name: Name of manufacturer of the sending device */ -wlp_attr_array(u8, manufacturer) - -/* WLP Message Type */ -wlp_attr(u8, msg_type) - -/* WLP Model name: Model name of sending device */ -wlp_attr_array(u8, model_name) - -/* WLP Model number: Model number of sending device */ -wlp_attr_array(u8, model_nr) - -/* Registrar Nonce: Random number generated by registrar for an enrollment - * session */ -wlp_attr(struct wlp_nonce, rnonce) - -/* Serial number of device */ -wlp_attr_array(u8, serial) - -/* UUID of enrollee */ -wlp_attr(struct wlp_uuid, uuid_e) - -/* UUID of registrar */ -wlp_attr(struct wlp_uuid, uuid_r) - -/* WLP Primary device type */ -wlp_attr(struct wlp_dev_type, prim_dev_type) - -/* WLP Secondary device type */ -wlp_attr(struct wlp_dev_type, sec_dev_type) - -/* WLP protocol version */ -wlp_attr(u8, version) - -/* WLP service set identifier */ -wlp_attr(struct wlp_uuid, wssid) - -/* WLP WSS name */ -wlp_attr_array(u8, wss_name) - -/* WLP WSS Secure Status */ -wlp_attr(u8, wss_sec_status) - -/* WSS Broadcast Address */ -wlp_attr(struct uwb_mac_addr, wss_bcast) - -/* WLP Accepting Enrollment */ -wlp_attr(u8, accept_enrl) - -/** - * WSS information attributes - * WLP Draft 0.99 [6.6.3 Table 15] - */ -struct wlp_wss_info { - struct wlp_attr_wssid wssid; - struct wlp_attr_wss_name name; - struct wlp_attr_accept_enrl accept; - struct wlp_attr_wss_sec_status sec_stat; - struct wlp_attr_wss_bcast bcast; -} __packed; - -/* WLP WSS Information */ -wlp_attr_array(struct wlp_wss_info, wss_info) - -/* WLP WSS Selection method */ -wlp_attr(u8, wss_sel_mthd) - -/* WLP WSS tag */ -wlp_attr(u8, wss_tag) - -/* WSS Virtual Address */ -wlp_attr(struct uwb_mac_addr, wss_virt) - -/* WLP association error */ -wlp_attr(u8, wlp_assc_err) - -/** - * WLP standard and abbreviated frames - * - * WLP Draft 0.99 [6.3] and [6.4] - * - * The difference between the WLP standard frame and the WLP - * abbreviated frame is that the standard frame includes the src - * and dest addresses from the Ethernet header, the abbreviated frame does - * not. - * The src/dest (as well as the type/length and client data) are already - * defined as part of the Ethernet header, we do not do this here. - * From this perspective the standard and abbreviated frames appear the - * same - they will be treated differently though. - * - * The size of this header is also captured in WLP_DATA_HLEN to enable - * interfaces to prepare their headroom. - */ -struct wlp_frame_std_abbrv_hdr { - struct wlp_frame_hdr hdr; - u8 tag; -} __packed; - -/** - * WLP association frames - * - * WLP Draft 0.99 [6.6] - */ -struct wlp_frame_assoc { - struct wlp_frame_hdr hdr; - enum wlp_assoc_type type:8; - struct wlp_attr_version version; - struct wlp_attr_msg_type msg_type; - u8 attr[]; -} __packed; - -/* Ethernet to dev address mapping */ -struct wlp_eda { - spinlock_t lock; - struct list_head cache; /* Eth<->Dev Addr cache */ -}; - -/** - * WSS information temporary storage - * - * This information is only stored temporarily during discovery. It should - * not be stored unless the device is enrolled in the advertised WSS. This - * is done mainly because we follow the letter of the spec in this regard. - * See WLP 0.99 [7.2.3]. - * When the device does become enrolled in a WSS the WSS information will - * be stored as part of the more comprehensive struct wlp_wss. - */ -struct wlp_wss_tmp_info { - char name[WLP_WSS_NAME_SIZE]; - u8 accept_enroll; - u8 sec_status; - struct uwb_mac_addr bcast; -}; - -struct wlp_wssid_e { - struct list_head node; - struct wlp_uuid wssid; - struct wlp_wss_tmp_info *info; -}; - -/** - * A cache entry of WLP neighborhood - * - * @node: head of list is wlp->neighbors - * @wssid: list of wssids of this neighbor, element is wlp_wssid_e - * @info: temporary storage for information learned during discovery. This - * storage is used together with the wssid_e temporary storage - * during discovery. - */ -struct wlp_neighbor_e { - struct list_head node; - struct wlp_uuid uuid; - struct uwb_dev *uwb_dev; - struct list_head wssid; /* Elements are wlp_wssid_e */ - struct wlp_device_info *info; -}; - -struct wlp; -/** - * Information for an association session in progress. - * - * @exp_message: The type of the expected message. Both this message and a - * F0 message (which can be sent in response to any - * association frame) will be accepted as a valid message for - * this session. - * @cb: The function that will be called upon receipt of this - * message. - * @cb_priv: Private data of callback - * @data: Data used in association process (always a sk_buff?) - * @neighbor: Address of neighbor with which association session is in - * progress. - */ -struct wlp_session { - enum wlp_assoc_type exp_message; - void (*cb)(struct wlp *); - void *cb_priv; - void *data; - struct uwb_dev_addr neighbor_addr; -}; - -/** - * WLP Service Set - * - * @mutex: used to protect entire WSS structure. - * - * @name: The WSS name is set to 65 bytes, 1 byte larger than the maximum - * allowed by the WLP spec. This is to have a null terminated string - * for display to the user. A maximum of 64 bytes will still be used - * when placing the WSS name field in association frames. - * - * @accept_enroll: Accepting enrollment: Set to one if registrar is - * accepting enrollment in WSS, or zero otherwise. - * - * Global and local information for each WSS in which we are enrolled. - * WLP 0.99 Section 7.2.1 and Section 7.2.2 - */ -struct wlp_wss { - struct mutex mutex; - struct kobject kobj; - /* Global properties. */ - struct wlp_uuid wssid; - u8 hash; - char name[WLP_WSS_NAME_SIZE]; - struct uwb_mac_addr bcast; - u8 secure_status:1; - u8 master_key[16]; - /* Local properties. */ - u8 tag; - struct uwb_mac_addr virtual_addr; - /* Extra */ - u8 accept_enroll:1; - enum wlp_wss_state state; -}; - -/** - * WLP main structure - * @mutex: protect changes to WLP structure. We only allow changes to the - * uuid, so currently this mutex only protects this field. - */ -struct wlp { - struct mutex mutex; - struct uwb_rc *rc; /* UWB radio controller */ - struct net_device *ndev; - struct uwb_pal pal; - struct wlp_eda eda; - struct wlp_uuid uuid; - struct wlp_session *session; - struct wlp_wss wss; - struct mutex nbmutex; /* Neighbor mutex protects neighbors list */ - struct list_head neighbors; /* Elements are wlp_neighbor_e */ - struct uwb_notifs_handler uwb_notifs_handler; - struct wlp_device_info *dev_info; - void (*fill_device_info)(struct wlp *wlp, struct wlp_device_info *info); - int (*xmit_frame)(struct wlp *, struct sk_buff *, - struct uwb_dev_addr *); - void (*stop_queue)(struct wlp *); - void (*start_queue)(struct wlp *); -}; - -/* sysfs */ - - -struct wlp_wss_attribute { - struct attribute attr; - ssize_t (*show)(struct wlp_wss *wss, char *buf); - ssize_t (*store)(struct wlp_wss *wss, const char *buf, size_t count); -}; - -#define WSS_ATTR(_name, _mode, _show, _store) \ -static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \ - _show, _store) - -extern int wlp_setup(struct wlp *, struct uwb_rc *, struct net_device *ndev); -extern void wlp_remove(struct wlp *); -extern ssize_t wlp_neighborhood_show(struct wlp *, char *); -extern int wlp_wss_setup(struct net_device *, struct wlp_wss *); -extern void wlp_wss_remove(struct wlp_wss *); -extern ssize_t wlp_wss_activate_show(struct wlp_wss *, char *); -extern ssize_t wlp_wss_activate_store(struct wlp_wss *, const char *, size_t); -extern ssize_t wlp_eda_show(struct wlp *, char *); -extern ssize_t wlp_eda_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_uuid_show(struct wlp *, char *); -extern ssize_t wlp_uuid_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_name_show(struct wlp *, char *); -extern ssize_t wlp_dev_name_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_manufacturer_show(struct wlp *, char *); -extern ssize_t wlp_dev_manufacturer_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_model_name_show(struct wlp *, char *); -extern ssize_t wlp_dev_model_name_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_model_nr_show(struct wlp *, char *); -extern ssize_t wlp_dev_model_nr_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_serial_show(struct wlp *, char *); -extern ssize_t wlp_dev_serial_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_prim_category_show(struct wlp *, char *); -extern ssize_t wlp_dev_prim_category_store(struct wlp *, const char *, - size_t); -extern ssize_t wlp_dev_prim_OUI_show(struct wlp *, char *); -extern ssize_t wlp_dev_prim_OUI_store(struct wlp *, const char *, size_t); -extern ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *, char *); -extern ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *, const char *, - size_t); -extern ssize_t wlp_dev_prim_subcat_show(struct wlp *, char *); -extern ssize_t wlp_dev_prim_subcat_store(struct wlp *, const char *, - size_t); -extern int wlp_receive_frame(struct device *, struct wlp *, struct sk_buff *, - struct uwb_dev_addr *); -extern int wlp_prepare_tx_frame(struct device *, struct wlp *, - struct sk_buff *, struct uwb_dev_addr *); -void wlp_reset_all(struct wlp *wlp); - -/** - * Initialize WSS - */ -static inline -void wlp_wss_init(struct wlp_wss *wss) -{ - mutex_init(&wss->mutex); -} - -static inline -void wlp_init(struct wlp *wlp) -{ - INIT_LIST_HEAD(&wlp->neighbors); - mutex_init(&wlp->mutex); - mutex_init(&wlp->nbmutex); - wlp_wss_init(&wlp->wss); -} - - -#endif /* #ifndef __LINUX__WLP_H_ */ diff --git a/include/media/rc-map.h b/include/media/rc-map.h index a9c041d49662..9b201ec8dc7f 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -35,7 +35,7 @@ struct ir_scancode_table { unsigned int len; /* Used number of entries */ unsigned int alloc; /* Size of *scan in bytes */ u64 ir_type; - char *name; + const char *name; spinlock_t lock; }; diff --git a/include/sound/core.h b/include/sound/core.h index df26ebbfa9c6..1fa2407c966f 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -177,7 +177,7 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state); #define snd_power_lock(card) do { (void)(card); } while (0) #define snd_power_unlock(card) do { (void)(card); } while (0) static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } -#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 +#define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; }) #define snd_power_change_state(card, state) do { (void)(card); } while (0) #endif /* CONFIG_PM */ diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 7dc97d12253c..4f865df42f0f 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h @@ -438,6 +438,8 @@ #define CCCA_CURRADDR_MASK 0x00ffffff /* Current address of the selected channel */ #define CCCA_CURRADDR 0x18000008 +/* undefine CCR to avoid conflict with the definition for SH */ +#undef CCR #define CCR 0x09 /* Cache control register */ #define CCR_CACHEINVALIDSIZE 0x07190009 #define CCR_CACHEINVALIDSIZE_MASK 0xfe000000 /* Number of invalid samples cache for this channel */ diff --git a/include/sound/jack.h b/include/sound/jack.h index d90b9fa32707..c140fc7cbd3f 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -47,6 +47,9 @@ enum snd_jack_types { SND_JACK_BTN_0 = 0x4000, SND_JACK_BTN_1 = 0x2000, SND_JACK_BTN_2 = 0x1000, + SND_JACK_BTN_3 = 0x0800, + SND_JACK_BTN_4 = 0x0400, + SND_JACK_BTN_5 = 0x0200, }; struct snd_jack { @@ -55,7 +58,7 @@ struct snd_jack { int type; const char *id; char name[100]; - unsigned int key[3]; /* Keep in sync with definitions above */ + unsigned int key[6]; /* Keep in sync with definitions above */ void *private_data; void (*private_free)(struct snd_jack *); }; diff --git a/include/sound/max98088.h b/include/sound/max98088.h new file mode 100644 index 000000000000..c3ba8239182d --- /dev/null +++ b/include/sound/max98088.h @@ -0,0 +1,50 @@ +/* + * Platform data for MAX98088 + * + * Copyright 2010 Maxim Integrated Products + * + * 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 __SOUND_MAX98088_PDATA_H__ +#define __SOUND_MAX98088_PDATA_H__ + +/* Equalizer filter response configuration */ +struct max98088_eq_cfg { + const char *name; + unsigned int rate; + u16 band1[5]; + u16 band2[5]; + u16 band3[5]; + u16 band4[5]; + u16 band5[5]; +}; + +/* codec platform data */ +struct max98088_pdata { + + /* Equalizers for DAI1 and DAI2 */ + struct max98088_eq_cfg *eq_cfg; + unsigned int eq_cfgcnt; + + /* Receiver output can be configured as power amplifier or LINE out */ + /* Set receiver_mode to: + * 0 = amplifier output, or + * 1 = LINE level output + */ + unsigned int receiver_mode:1; + + /* Analog/digital microphone configuration: + * 0 = analog microphone input (normal setting) + * 1 = digital microphone input + */ + unsigned int digmic_left_mode:1; + unsigned int digmic_right_mode:1; + +}; + +#endif diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 85f1c6bf8566..dfd9b76b1853 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -278,6 +278,7 @@ struct snd_pcm_runtime { snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ + unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */ snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ /* -- HW params -- */ diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h index 9d51d6f35893..fa60cbda90a4 100644 --- a/include/sound/sh_fsi.h +++ b/include/sound/sh_fsi.h @@ -114,7 +114,4 @@ struct sh_fsi_platform_info { int (*set_rate)(int is_porta, int rate); /* for master mode */ }; -extern struct snd_soc_dai fsi_soc_dai[2]; -extern struct snd_soc_platform fsi_soc_platform; - #endif /* __SOUND_FSI_H */ diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 377693a14385..e7b680248006 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -91,15 +91,17 @@ struct snd_pcm_substream; SNDRV_PCM_FMTBIT_S32_LE |\ SNDRV_PCM_FMTBIT_S32_BE) -struct snd_soc_dai_ops; +struct snd_soc_dai_driver; struct snd_soc_dai; struct snd_ac97_bus_ops; /* Digital Audio Interface registration */ -int snd_soc_register_dai(struct snd_soc_dai *dai); -void snd_soc_unregister_dai(struct snd_soc_dai *dai); -int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count); -void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count); +int snd_soc_register_dai(struct device *dev, + struct snd_soc_dai_driver *dai_drv); +void snd_soc_unregister_dai(struct device *dev); +int snd_soc_register_dais(struct device *dev, + struct snd_soc_dai_driver *dai_drv, size_t count); +void snd_soc_unregister_dais(struct device *dev, size_t count); /* Digital Audio Interface clocking API.*/ int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, @@ -126,16 +128,6 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); /* Digital Audio Interface mute */ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); -/* - * Digital Audio Interface. - * - * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 - * operations and capabilities. Codec and platform drivers will register this - * structure for every DAI they have. - * - * This structure covers the clocking, formating and ALSA operations for each - * interface. - */ struct snd_soc_dai_ops { /* * DAI clocking configuration, all optional. @@ -191,24 +183,24 @@ struct snd_soc_dai_ops { }; /* - * Digital Audio Interface runtime data. + * Digital Audio Interface Driver. * - * Holds runtime data for a DAI. + * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 + * operations and capabilities. Codec and platform drivers will register this + * structure for every DAI they have. + * + * This structure covers the clocking, formating and ALSA operations for each + * interface. */ -struct snd_soc_dai { +struct snd_soc_dai_driver { /* DAI description */ - char *name; + const char *name; unsigned int id; int ac97_control; - struct device *dev; - void *ac97_pdata; /* platform_data for the ac97 codec */ - - /* DAI callbacks */ - int (*probe)(struct platform_device *pdev, - struct snd_soc_dai *dai); - void (*remove)(struct platform_device *pdev, - struct snd_soc_dai *dai); + /* DAI driver callbacks */ + int (*probe)(struct snd_soc_dai *dai); + int (*remove)(struct snd_soc_dai *dai); int (*suspend)(struct snd_soc_dai *dai); int (*resume)(struct snd_soc_dai *dai); @@ -219,26 +211,51 @@ struct snd_soc_dai { struct snd_soc_pcm_stream capture; struct snd_soc_pcm_stream playback; unsigned int symmetric_rates:1; +}; + +/* + * Digital Audio Interface runtime data. + * + * Holds runtime data for a DAI. + */ +struct snd_soc_dai { + const char *name; + int id; + struct device *dev; + void *ac97_pdata; /* platform_data for the ac97 codec */ + + /* driver ops */ + struct snd_soc_dai_driver *driver; /* DAI runtime info */ - struct snd_soc_codec *codec; + unsigned int capture_active:1; /* stream is in use */ + unsigned int playback_active:1; /* stream is in use */ + unsigned int symmetric_rates:1; + struct snd_pcm_runtime *runtime; unsigned int active; unsigned char pop_wait:1; + unsigned char probed:1; - /* DAI private data */ - void *private_data; + /* DAI DMA data */ + void *playback_dma_data; + void *capture_dma_data; - /* parent platform */ - struct snd_soc_platform *platform; + /* parent platform/codec */ + union { + struct snd_soc_platform *platform; + struct snd_soc_codec *codec; + }; + struct snd_soc_card *card; struct list_head list; + struct list_head card_list; }; static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, const struct snd_pcm_substream *ss) { return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? - dai->playback.dma_data : dai->capture.dma_data; + dai->playback_dma_data : dai->capture_dma_data; } static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, @@ -246,9 +263,20 @@ static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, void *data) { if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback.dma_data = data; + dai->playback_dma_data = data; else - dai->capture.dma_data = data; + dai->capture_dma_data = data; +} + +static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai, + void *data) +{ + dev_set_drvdata(dai->dev, data); +} + +static inline void *snd_soc_dai_get_drvdata(struct snd_soc_dai *dai) +{ + return dev_get_drvdata(dai->dev); } #endif diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c5d9987bc897..8fd3b41b763f 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -172,9 +172,19 @@ #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ .reg = wreg, .shift = wshift, .invert = winvert } +#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ + wevent, wflags) \ +{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ + .reg = wreg, .shift = wshift, .invert = winvert, \ + .event = wevent, .event_flags = wflags } #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ .reg = wreg, .shift = wshift, .invert = winvert } +#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ + wevent, wflags) \ +{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ + .reg = wreg, .shift = wshift, .invert = winvert, \ + .event = wevent, .event_flags = wflags } #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ .shift = wshift, .invert = winvert} @@ -322,14 +332,14 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, /* dapm path setup */ int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); -void snd_soc_dapm_free(struct snd_soc_device *socdev); +void snd_soc_dapm_free(struct snd_soc_codec *codec); int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, const struct snd_soc_dapm_route *route, int num); /* dapm events */ -int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, - int event); -void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); +int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, + const char *stream, int event); +void snd_soc_dapm_shutdown(struct snd_soc_card *card); /* dapm sys fs - used by the core */ int snd_soc_dapm_sys_add(struct device *dev); diff --git a/include/sound/soc-of-simple.h b/include/sound/soc-of-simple.h deleted file mode 100644 index a064e1934a56..000000000000 --- a/include/sound/soc-of-simple.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * OF helpers for ALSA SoC - * - * Copyright (C) 2008, Secret Lab Technologies Ltd. - */ - -#ifndef _INCLUDE_SOC_OF_H_ -#define _INCLUDE_SOC_OF_H_ - -#if defined(CONFIG_SND_SOC_OF_SIMPLE) || defined(CONFIG_SND_SOC_OF_SIMPLE_MODULE) - -#include <linux/of.h> -#include <sound/soc.h> - -int of_snd_soc_register_codec(struct snd_soc_codec_device *codec_dev, - void *codec_data, struct snd_soc_dai *dai, - struct device_node *node); - -int of_snd_soc_register_platform(struct snd_soc_platform *platform, - struct device_node *node, - struct snd_soc_dai *cpu_dai); - -#endif - -#endif /* _INCLUDE_SOC_OF_H_ */ diff --git a/include/sound/soc.h b/include/sound/soc.h index 65e9d03ed4f5..5c3bce83f28a 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -214,10 +214,10 @@ * @OFF: Power Off. No restrictions on transition times. */ enum snd_soc_bias_level { - SND_SOC_BIAS_ON, - SND_SOC_BIAS_PREPARE, - SND_SOC_BIAS_STANDBY, SND_SOC_BIAS_OFF, + SND_SOC_BIAS_STANDBY, + SND_SOC_BIAS_PREPARE, + SND_SOC_BIAS_ON, }; struct snd_jack; @@ -228,13 +228,17 @@ struct snd_soc_ops; struct snd_soc_dai_mode; struct snd_soc_pcm_runtime; struct snd_soc_dai; +struct snd_soc_dai_driver; struct snd_soc_platform; struct snd_soc_dai_link; +struct snd_soc_platform_driver; struct snd_soc_codec; +struct snd_soc_codec_driver; struct soc_enum; struct snd_soc_ac97_ops; struct snd_soc_jack; struct snd_soc_jack_pin; + #ifdef CONFIG_GPIOLIB struct snd_soc_jack_gpio; #endif @@ -249,19 +253,18 @@ enum snd_soc_control_type { SND_SOC_SPI, }; -int snd_soc_register_platform(struct snd_soc_platform *platform); -void snd_soc_unregister_platform(struct snd_soc_platform *platform); -int snd_soc_register_codec(struct snd_soc_codec *codec); -void snd_soc_unregister_codec(struct snd_soc_codec *codec); +int snd_soc_register_platform(struct device *dev, + struct snd_soc_platform_driver *platform_drv); +void snd_soc_unregister_platform(struct device *dev); +int snd_soc_register_codec(struct device *dev, + struct snd_soc_codec_driver *codec_drv, + struct snd_soc_dai_driver *dai_drv, int num_dai); +void snd_soc_unregister_codec(struct device *dev); int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, int addr_bits, int data_bits, enum snd_soc_control_type control); -/* pcm <-> DAI connect */ -void snd_soc_free_pcms(struct snd_soc_device *socdev); -int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); - /* Utility functions to get clock rates from various things */ int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); @@ -273,7 +276,7 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, const struct snd_pcm_hardware *hw); /* Jack reporting */ -int snd_soc_jack_new(struct snd_soc_card *card, const char *id, int type, +int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, struct snd_soc_jack *jack); void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, @@ -382,7 +385,7 @@ struct snd_soc_jack_gpio { int invert; int debounce_time; struct snd_soc_jack *jack; - struct work_struct work; + struct delayed_work work; int (*jack_status_check)(void); }; @@ -390,7 +393,7 @@ struct snd_soc_jack_gpio { struct snd_soc_jack { struct snd_jack *jack; - struct snd_soc_card *card; + struct snd_soc_codec *codec; struct list_head pins; int status; struct blocking_notifier_head notifier; @@ -398,15 +401,13 @@ struct snd_soc_jack { /* SoC PCM stream information */ struct snd_soc_pcm_stream { - char *stream_name; + const char *stream_name; u64 formats; /* SNDRV_PCM_FMTBIT_* */ unsigned int rates; /* SNDRV_PCM_RATE_* */ unsigned int rate_min; /* min rate */ unsigned int rate_max; /* max rate */ unsigned int channels_min; /* min channels */ unsigned int channels_max; /* max channels */ - unsigned int active; /* stream is in use */ - void *dma_data; /* used by platform code */ }; /* SoC audio ops */ @@ -419,44 +420,36 @@ struct snd_soc_ops { int (*trigger)(struct snd_pcm_substream *, int); }; -/* SoC Audio Codec */ +/* SoC Audio Codec device */ struct snd_soc_codec { - char *name; - struct module *owner; - struct mutex mutex; + const char *name; + int id; struct device *dev; - struct snd_soc_device *socdev; + struct snd_soc_codec_driver *driver; + struct mutex mutex; + struct snd_soc_card *card; struct list_head list; - - /* callbacks */ - int (*set_bias_level)(struct snd_soc_codec *, - enum snd_soc_bias_level level); + struct list_head card_list; + int num_dai; /* runtime */ - struct snd_card *card; struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ unsigned int active; - unsigned int pcm_devs; - void *drvdata; + unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ + unsigned int cache_only:1; /* Suppress writes to hardware */ + unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ + unsigned int suspended:1; /* Codec is in suspend PM state */ + unsigned int probed:1; /* Codec has been probed */ + unsigned int ac97_registered:1; /* Codec has been AC97 registered */ + unsigned int ac97_created:1; /* Codec has been created by SoC */ + unsigned int sysfs_registered:1; /* codec has been sysfs registered */ /* codec IO */ void *control_data; /* codec control (i2c/3wire) data */ - unsigned int (*read)(struct snd_soc_codec *, unsigned int); - int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); - int (*display_register)(struct snd_soc_codec *, char *, - size_t, unsigned int); - int (*volatile_register)(unsigned int); - int (*readable_register)(unsigned int); hw_write_t hw_write; unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); void *reg_cache; - short reg_cache_size; - short reg_cache_step; - - unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ - unsigned int cache_only:1; /* Suppress writes to hardware */ - unsigned int cache_sync:1; /* Cache needs to be synced to hardware */ /* dapm */ u32 pop_time; @@ -466,10 +459,6 @@ struct snd_soc_codec { enum snd_soc_bias_level suspend_bias_level; struct delayed_work delayed_work; - /* codec DAI's */ - struct snd_soc_dai *dai; - unsigned int num_dai; - #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_codec_root; struct dentry *debugfs_reg; @@ -478,23 +467,40 @@ struct snd_soc_codec { #endif }; -/* codec device */ -struct snd_soc_codec_device { - int (*probe)(struct platform_device *pdev); - int (*remove)(struct platform_device *pdev); - int (*suspend)(struct platform_device *pdev, pm_message_t state); - int (*resume)(struct platform_device *pdev); +/* codec driver */ +struct snd_soc_codec_driver { + + /* driver ops */ + int (*probe)(struct snd_soc_codec *); + int (*remove)(struct snd_soc_codec *); + int (*suspend)(struct snd_soc_codec *, + pm_message_t state); + int (*resume)(struct snd_soc_codec *); + + /* codec IO */ + unsigned int (*read)(struct snd_soc_codec *, unsigned int); + int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); + int (*display_register)(struct snd_soc_codec *, char *, + size_t, unsigned int); + int (*volatile_register)(unsigned int); + int (*readable_register)(unsigned int); + short reg_cache_size; + short reg_cache_step; + short reg_word_size; + const void *reg_cache_default; + + /* codec bias level */ + int (*set_bias_level)(struct snd_soc_codec *, + enum snd_soc_bias_level level); }; /* SoC platform interface */ -struct snd_soc_platform { - char *name; - struct list_head list; +struct snd_soc_platform_driver { - int (*probe)(struct platform_device *pdev); - int (*remove)(struct platform_device *pdev); - int (*suspend)(struct snd_soc_dai_link *dai_link); - int (*resume)(struct snd_soc_dai_link *dai_link); + int (*probe)(struct snd_soc_platform *); + int (*remove)(struct snd_soc_platform *); + int (*suspend)(struct snd_soc_dai *dai); + int (*resume)(struct snd_soc_dai *dai); /* pcm creation and destruction */ int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, @@ -509,23 +515,31 @@ struct snd_soc_platform { struct snd_soc_dai *); /* platform stream ops */ - struct snd_pcm_ops *pcm_ops; + struct snd_pcm_ops *ops; }; -/* SoC machine DAI configuration, glues a codec and cpu DAI together */ -struct snd_soc_dai_link { - char *name; /* Codec name */ - char *stream_name; /* Stream name */ +struct snd_soc_platform { + const char *name; + int id; + struct device *dev; + struct snd_soc_platform_driver *driver; - /* DAI */ - struct snd_soc_dai *codec_dai; - struct snd_soc_dai *cpu_dai; + unsigned int suspended:1; /* platform is suspended */ + unsigned int probed:1; - /* machine stream operations */ - struct snd_soc_ops *ops; + struct snd_soc_card *card; + struct list_head list; + struct list_head card_list; +}; - /* codec/machine specific init - e.g. add machine controls */ - int (*init)(struct snd_soc_codec *codec); +struct snd_soc_dai_link { + /* config - must be set by machine driver */ + const char *name; /* Codec name */ + const char *stream_name; /* Stream name */ + const char *codec_name; /* for multi-codec */ + const char *platform_name; /* for multi-platform */ + const char *cpu_dai_name; + const char *codec_dai_name; /* Keep DAI active over suspend */ unsigned int ignore_suspend:1; @@ -533,21 +547,24 @@ struct snd_soc_dai_link { /* Symmetry requirements */ unsigned int symmetric_rates:1; - /* Symmetry data - only valid if symmetry is being enforced */ - unsigned int rate; + /* codec/machine specific init - e.g. add machine controls */ + int (*init)(struct snd_soc_pcm_runtime *rtd); - /* DAI pcm */ - struct snd_pcm *pcm; + /* machine stream operations */ + struct snd_soc_ops *ops; }; /* SoC card */ struct snd_soc_card { - char *name; + const char *name; struct device *dev; + struct snd_card *snd_card; + struct module *owner; struct list_head list; + struct mutex mutex; - int instantiated; + bool instantiated; int (*probe)(struct platform_device *pdev); int (*remove)(struct platform_device *pdev); @@ -568,28 +585,38 @@ struct snd_soc_card { /* CPU <--> Codec DAI links */ struct snd_soc_dai_link *dai_link; int num_links; + struct snd_soc_pcm_runtime *rtd; + int num_rtd; - struct snd_soc_device *socdev; - - struct snd_soc_codec *codec; - - struct snd_soc_platform *platform; - struct delayed_work delayed_work; struct work_struct deferred_resume_work; + + /* lists of probed devices belonging to this card */ + struct list_head codec_dev_list; + struct list_head platform_dev_list; + struct list_head dai_dev_list; }; -/* SoC Device - the audio subsystem */ -struct snd_soc_device { - struct device *dev; +/* SoC machine DAI configuration, glues a codec and cpu DAI together */ +struct snd_soc_pcm_runtime { + struct device dev; struct snd_soc_card *card; - struct snd_soc_codec_device *codec_dev; - void *codec_data; -}; + struct snd_soc_dai_link *dai_link; + + unsigned int complete:1; + unsigned int dev_registered:1; + + /* Symmetry data - only valid if symmetry is being enforced */ + unsigned int rate; + long pmdown_time; -/* runtime channel data */ -struct snd_soc_pcm_runtime { - struct snd_soc_dai_link *dai; - struct snd_soc_device *socdev; + /* runtime devices */ + struct snd_pcm *pcm; + struct snd_soc_codec *codec; + struct snd_soc_platform *platform; + struct snd_soc_dai *codec_dai; + struct snd_soc_dai *cpu_dai; + + struct delayed_work delayed_work; }; /* mixer control */ @@ -615,24 +642,48 @@ struct soc_enum { static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg) { - return codec->read(codec, reg); + return codec->driver->read(codec, reg); } static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int val) { - return codec->write(codec, reg, val); + return codec->driver->write(codec, reg, val); } +/* device driver data */ + static inline void snd_soc_codec_set_drvdata(struct snd_soc_codec *codec, - void *data) + void *data) { - codec->drvdata = data; + dev_set_drvdata(codec->dev, data); } static inline void *snd_soc_codec_get_drvdata(struct snd_soc_codec *codec) { - return codec->drvdata; + return dev_get_drvdata(codec->dev); +} + +static inline void snd_soc_platform_set_drvdata(struct snd_soc_platform *platform, + void *data) +{ + dev_set_drvdata(platform->dev, data); +} + +static inline void *snd_soc_platform_get_drvdata(struct snd_soc_platform *platform) +{ + return dev_get_drvdata(platform->dev); +} + +static inline void snd_soc_pcm_set_drvdata(struct snd_soc_pcm_runtime *rtd, + void *data) +{ + dev_set_drvdata(&rtd->dev, data); +} + +static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd) +{ + return dev_get_drvdata(&rtd->dev); } #include <sound/soc-dai.h> diff --git a/include/sound/tlv.h b/include/sound/tlv.h index 9fd5b19ccf5c..7067e2dfb0b9 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h @@ -38,9 +38,11 @@ #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ +#define TLV_DB_SCALE_MASK 0xffff +#define TLV_DB_SCALE_MUTE 0x10000 #define TLV_DB_SCALE_ITEM(min, step, mute) \ SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ - (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) + (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0) #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } diff --git a/include/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h index b1a5f34e5cfa..99e0308bf2c2 100644 --- a/include/sound/tlv320aic3x.h +++ b/include/sound/tlv320aic3x.h @@ -10,8 +10,49 @@ #ifndef __TLV320AIC3x_H__ #define __TLV320AIC3x_H__ +/* GPIO API */ +enum { + AIC3X_GPIO1_FUNC_DISABLED = 0, + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC = 1, + AIC3X_GPIO1_FUNC_CLOCK_MUX = 2, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2 = 3, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4 = 4, + AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8 = 5, + AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ = 6, + AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ = 7, + AIC3X_GPIO1_FUNC_INPUT = 8, + AIC3X_GPIO1_FUNC_OUTPUT = 9, + AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10, + AIC3X_GPIO1_FUNC_AUDIO_WORDCLK = 11, + AIC3X_GPIO1_FUNC_BUTTON_IRQ = 12, + AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13, + AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 14, + AIC3X_GPIO1_FUNC_ALL_IRQ = 16 +}; + +enum { + AIC3X_GPIO2_FUNC_DISABLED = 0, + AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2, + AIC3X_GPIO2_FUNC_INPUT = 3, + AIC3X_GPIO2_FUNC_OUTPUT = 4, + AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT = 5, + AIC3X_GPIO2_FUNC_AUDIO_BITCLK = 8, + AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9, + AIC3X_GPIO2_FUNC_ALL_IRQ = 10, + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11, + AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12, + AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ = 13, + AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ = 14, + AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ = 15 +}; + +struct aic3x_setup_data { + unsigned int gpio_func[2]; +}; + struct aic3x_pdata { int gpio_reset; /* < 0 if not used */ + struct aic3x_setup_data *setup; }; -#endif
\ No newline at end of file +#endif diff --git a/include/sound/wm8962.h b/include/sound/wm8962.h new file mode 100644 index 000000000000..2b5306c503fb --- /dev/null +++ b/include/sound/wm8962.h @@ -0,0 +1,32 @@ +/* + * wm8962.h -- WM8962 Soc Audio driver platform data + * + * 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. + */ + +#ifndef _WM8962_PDATA_H +#define _WM8962_PDATA_H + +#define WM8962_MAX_GPIO 6 + +/* Use to set GPIO default values to zero */ +#define WM8962_GPIO_SET 0x10000 + +struct wm8962_pdata { + int gpio_base; + u32 gpio_init[WM8962_MAX_GPIO]; + + /* Setup for microphone detection, raw value to be written to + * R48(0x30) - only microphone related bits will be updated. + * Detection may be enabled here for use with signals brought + * out on the GPIOs. */ + u32 mic_cfg; + + bool irq_active_low; + + bool spk_mono; /* Speaker outputs tied together as mono */ +}; + +#endif diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h index 577cf18cce89..1e1aa54ab2e4 100644 --- a/include/video/sh_mobile_hdmi.h +++ b/include/video/sh_mobile_hdmi.h @@ -14,9 +14,25 @@ struct sh_mobile_lcdc_chan_cfg; struct device; +/* + * flags format + * + * 0x0000000A + * + * A: Audio source select + */ + +/* Audio source select */ +#define HDMI_SND_SRC_MASK (0xF << 0) +#define HDMI_SND_SRC_I2S (0 << 0) /* default */ +#define HDMI_SND_SRC_SPDIF (1 << 0) +#define HDMI_SND_SRC_DSD (2 << 0) +#define HDMI_SND_SRC_HBR (3 << 0) + struct sh_mobile_hdmi_info { struct sh_mobile_lcdc_chan_cfg *lcd_chan; struct device *lcd_dev; + unsigned int flags; }; #endif |