X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fice1712%2Fice1712.h;h=ce96b3bb653165c1b217cf5c6f240b4077f040de;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=f8233bfdcf4ec7ac04f4c21f04db24f7fffe764c;hpb=bc77d24c47b89f1e0efed0b8e4be5f8aad102883;p=linux-2.6.git diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h index f8233bfdc..ce96b3bb6 100644 --- a/sound/pci/ice1712/ice1712.h +++ b/sound/pci/ice1712/ice1712.h @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -214,9 +215,9 @@ * */ -typedef struct _snd_ice1712 ice1712_t; +struct snd_ice1712; -typedef struct { +struct snd_ice1712_eeprom { unsigned int subvendor; /* PCI[2c-2f] */ unsigned char size; /* size of EEPROM image in bytes */ unsigned char version; /* must be 1 (or 2 for vt1724) */ @@ -224,7 +225,7 @@ typedef struct { unsigned int gpiomask; unsigned int gpiostate; unsigned int gpiodir; -} ice1712_eeprom_t; +}; enum { ICE_EEP1_CODEC = 0, /* 06 */ @@ -265,28 +266,28 @@ struct snd_ak4xxx_private { unsigned int add_flags; /* additional bits at init */ unsigned int mask_flags; /* total mask bits */ struct snd_akm4xxx_ops { - void (*set_rate_val)(akm4xxx_t *ak, unsigned int rate); + void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); } ops; }; struct snd_ice1712_spdif { unsigned char cs8403_bits; unsigned char cs8403_stream_bits; - snd_kcontrol_t *stream_ctl; + struct snd_kcontrol *stream_ctl; struct snd_ice1712_spdif_ops { - void (*open)(ice1712_t *, snd_pcm_substream_t *); - void (*setup_rate)(ice1712_t *, int rate); - void (*close)(ice1712_t *, snd_pcm_substream_t *); - void (*default_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); - int (*default_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); - void (*stream_get)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); - int (*stream_put)(ice1712_t *, snd_ctl_elem_value_t * ucontrol); + void (*open)(struct snd_ice1712 *, struct snd_pcm_substream *); + void (*setup_rate)(struct snd_ice1712 *, int rate); + void (*close)(struct snd_ice1712 *, struct snd_pcm_substream *); + void (*default_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); + int (*default_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); + void (*stream_get)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); + int (*stream_put)(struct snd_ice1712 *, struct snd_ctl_elem_value *ucontrol); } ops; }; -struct _snd_ice1712 { +struct snd_ice1712 { unsigned long conp_dma_size; unsigned long conc_dma_size; unsigned long prop_dma_size; @@ -294,37 +295,33 @@ struct _snd_ice1712 { int irq; unsigned long port; - struct resource *res_port; unsigned long ddma_port; - struct resource *res_ddma_port; unsigned long dmapath_port; - struct resource *res_dmapath_port; unsigned long profi_port; - struct resource *res_profi_port; struct pci_dev *pci; - snd_card_t *card; - snd_pcm_t *pcm; - snd_pcm_t *pcm_ds; - snd_pcm_t *pcm_pro; - snd_pcm_substream_t *playback_con_substream; - snd_pcm_substream_t *playback_con_substream_ds[6]; - snd_pcm_substream_t *capture_con_substream; - snd_pcm_substream_t *playback_pro_substream; - snd_pcm_substream_t *capture_pro_substream; + struct snd_card *card; + struct snd_pcm *pcm; + struct snd_pcm *pcm_ds; + struct snd_pcm *pcm_pro; + struct snd_pcm_substream *playback_con_substream; + struct snd_pcm_substream *playback_con_substream_ds[6]; + struct snd_pcm_substream *capture_con_substream; + struct snd_pcm_substream *playback_pro_substream; + struct snd_pcm_substream *capture_pro_substream; unsigned int playback_pro_size; unsigned int capture_pro_size; unsigned int playback_con_virt_addr[6]; unsigned int playback_con_active_buf[6]; unsigned int capture_con_virt_addr; unsigned int ac97_ext_id; - ac97_t *ac97; - snd_rawmidi_t *rmidi[2]; + struct snd_ac97 *ac97; + struct snd_rawmidi *rmidi[2]; spinlock_t reg_lock; - snd_info_entry_t *proc_entry; + struct snd_info_entry *proc_entry; - ice1712_eeprom_t eeprom; + struct snd_ice1712_eeprom eeprom; unsigned int pro_volumes[20]; unsigned int omni: 1; /* Delta Omni I/O */ @@ -335,61 +332,86 @@ struct _snd_ice1712 { unsigned int force_rdma1: 1; /* VT1720/4 - RDMA1 as non-spdif */ unsigned int num_total_dacs; /* total DACs */ unsigned int num_total_adcs; /* total ADCs */ - unsigned char hoontech_boxbits[4]; - unsigned int hoontech_config; - unsigned short hoontech_boxconfig[4]; unsigned int cur_rate; /* current rate */ struct semaphore open_mutex; - snd_pcm_substream_t *pcm_reserved[4]; + struct snd_pcm_substream *pcm_reserved[4]; + struct snd_pcm_hw_constraint_list *hw_rates; /* card-specific rate constraints */ unsigned int akm_codecs; - akm4xxx_t *akm; + struct snd_akm4xxx *akm; struct snd_ice1712_spdif spdif; - snd_i2c_bus_t *i2c; /* I2C bus */ - snd_i2c_device_t *cs8404; /* CS8404A I2C device */ - snd_i2c_device_t *cs8427; /* CS8427 I2C device */ + struct semaphore i2c_mutex; /* I2C mutex for ICE1724 registers */ + struct snd_i2c_bus *i2c; /* I2C bus */ + struct snd_i2c_device *cs8427; /* CS8427 I2C device */ unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ - snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */ struct ice1712_gpio { unsigned int direction; /* current direction bits */ unsigned int write_mask; /* current mask bits */ unsigned int saved[2]; /* for ewx_i2c */ /* operators */ - void (*set_mask)(ice1712_t *ice, unsigned int data); - void (*set_dir)(ice1712_t *ice, unsigned int data); - void (*set_data)(ice1712_t *ice, unsigned int data); - unsigned int (*get_data)(ice1712_t *ice); + void (*set_mask)(struct snd_ice1712 *ice, unsigned int data); + void (*set_dir)(struct snd_ice1712 *ice, unsigned int data); + void (*set_data)(struct snd_ice1712 *ice, unsigned int data); + unsigned int (*get_data)(struct snd_ice1712 *ice); /* misc operators - move to another place? */ - void (*set_pro_rate)(ice1712_t *ice, unsigned int rate); + void (*set_pro_rate)(struct snd_ice1712 *ice, unsigned int rate); + void (*i2s_mclk_changed)(struct snd_ice1712 *ice); } gpio; struct semaphore gpio_mutex; -}; -#define chip_t ice1712_t + /* other board-specific data */ + union { + /* additional i2c devices for EWS boards */ + struct snd_i2c_device *i2cdevs[3]; + /* AC97 register cache for Aureon */ + struct aureon_spec { + unsigned short stac9744[64]; + unsigned int cs8415_mux; + unsigned short master[2]; + unsigned short vol[8]; + } aureon; + /* AC97 register cache for Phase28 */ + struct phase28_spec { + unsigned short master[2]; + unsigned short vol[8]; + } phase28; + /* Hoontech-specific setting */ + struct hoontech_spec { + unsigned char boxbits[4]; + unsigned int config; + unsigned short boxconfig[4]; + } hoontech; + struct { + struct ak4114 *ak4114; + unsigned int analog: 1; + } juli; + } spec; + +}; /* * gpio access functions */ -static inline void snd_ice1712_gpio_set_dir(ice1712_t *ice, unsigned int bits) +static inline void snd_ice1712_gpio_set_dir(struct snd_ice1712 *ice, unsigned int bits) { ice->gpio.set_dir(ice, bits); } -static inline void snd_ice1712_gpio_set_mask(ice1712_t *ice, unsigned int bits) +static inline void snd_ice1712_gpio_set_mask(struct snd_ice1712 *ice, unsigned int bits) { ice->gpio.set_mask(ice, bits); } -static inline void snd_ice1712_gpio_write(ice1712_t *ice, unsigned int val) +static inline void snd_ice1712_gpio_write(struct snd_ice1712 *ice, unsigned int val) { ice->gpio.set_data(ice, val); } -static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice) +static inline unsigned int snd_ice1712_gpio_read(struct snd_ice1712 *ice) { return ice->gpio.get_data(ice); } @@ -399,14 +421,14 @@ static inline unsigned int snd_ice1712_gpio_read(ice1712_t *ice) * The access to gpio will be protected by mutex, so don't forget to * restore! */ -static inline void snd_ice1712_save_gpio_status(ice1712_t *ice) +static inline void snd_ice1712_save_gpio_status(struct snd_ice1712 *ice) { down(&ice->gpio_mutex); ice->gpio.saved[0] = ice->gpio.direction; ice->gpio.saved[1] = ice->gpio.write_mask; } -static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice) +static inline void snd_ice1712_restore_gpio_status(struct snd_ice1712 *ice) { ice->gpio.set_dir(ice, ice->gpio.saved[0]); ice->gpio.set_mask(ice, ice->gpio.saved[1]); @@ -421,14 +443,15 @@ static inline void snd_ice1712_restore_gpio_status(ice1712_t *ice) .get = snd_ice1712_gpio_get, .put = snd_ice1712_gpio_put, \ .private_value = mask | (invert << 24) } -int snd_ice1712_gpio_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); -int snd_ice1712_gpio_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); -int snd_ice1712_gpio_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); +int snd_ice1712_gpio_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo); +int snd_ice1712_gpio_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); +int snd_ice1712_gpio_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); /* * set gpio direction, write mask and data */ -static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask, unsigned int bits) +static inline void snd_ice1712_gpio_write_bits(struct snd_ice1712 *ice, + unsigned int mask, unsigned int bits) { ice->gpio.direction |= mask; snd_ice1712_gpio_set_dir(ice, ice->gpio.direction); @@ -436,21 +459,22 @@ static inline void snd_ice1712_gpio_write_bits(ice1712_t *ice, unsigned int mask snd_ice1712_gpio_write(ice, mask & bits); } -int snd_ice1712_spdif_build_controls(ice1712_t *ice); +int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice); -int snd_ice1712_akm4xxx_init(akm4xxx_t *ak, const akm4xxx_t *template, const struct snd_ak4xxx_private *priv, ice1712_t *ice); -void snd_ice1712_akm4xxx_free(ice1712_t *ice); -int snd_ice1712_akm4xxx_build_controls(ice1712_t *ice); +int snd_ice1712_akm4xxx_init(struct snd_akm4xxx *ak, const struct snd_akm4xxx *template, + const struct snd_ak4xxx_private *priv, struct snd_ice1712 *ice); +void snd_ice1712_akm4xxx_free(struct snd_ice1712 *ice); +int snd_ice1712_akm4xxx_build_controls(struct snd_ice1712 *ice); -int snd_ice1712_init_cs8427(ice1712_t *ice, int addr); +int snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr); -static inline void snd_ice1712_write(ice1712_t * ice, u8 addr, u8 data) +static inline void snd_ice1712_write(struct snd_ice1712 * ice, u8 addr, u8 data) { outb(addr, ICEREG(ice, INDEX)); outb(data, ICEREG(ice, DATA)); } -static inline u8 snd_ice1712_read(ice1712_t * ice, u8 addr) +static inline u8 snd_ice1712_read(struct snd_ice1712 * ice, u8 addr) { outb(addr, ICEREG(ice, INDEX)); return inb(ICEREG(ice, DATA)); @@ -466,9 +490,9 @@ struct snd_ice1712_card_info { char *name; char *model; char *driver; - int (*chip_init)(ice1712_t *); - int (*build_controls)(ice1712_t *); - int no_mpu401: 1; + int (*chip_init)(struct snd_ice1712 *); + int (*build_controls)(struct snd_ice1712 *); + unsigned int no_mpu401: 1; unsigned int eeprom_size; unsigned char *eeprom_data; };