Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
onyx.c File Reference
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/slab.h>
#include "onyx.h"
#include "../aoa.h"
#include "../soundbus/soundbus.h"

Go to the source code of this file.

Data Structures

struct  onyx
 

Macros

#define PFX   "snd-aoa-codec-onyx: "
 
#define codec_to_onyx(c)   container_of(c, struct onyx, codec)
 
#define VOLUME_RANGE_SHIFT   128
 
#define INPUTGAIN_RANGE_SHIFT   (-3)
 
#define onyx_snd_mute_info   snd_ctl_boolean_stereo_info
 
#define onyx_snd_single_bit_info   snd_ctl_boolean_mono_info
 
#define FLAG_POLARITY_INVERT   1
 
#define FLAG_SPDIFLOCK   2
 
#define SINGLE_BIT(n, type, description, address, mask, flags)
 
#define ADDCTL(n)
 

Functions

 MODULE_AUTHOR ("Johannes Berg <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("pcm3052 (onyx) codec driver for snd-aoa")
 
 SINGLE_BIT (spdif, MIXER, SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), ONYX_REG_DIG_INFO4, ONYX_SPDIF_ENABLE, FLAG_SPDIFLOCK)
 
 SINGLE_BIT (ovr1, MIXER,"Oversampling Rate", ONYX_REG_DAC_CONTROL, ONYX_OVR1, 0)
 
 SINGLE_BIT (flt0, MIXER,"Fast Digital Filter Rolloff", ONYX_REG_DAC_FILTER, ONYX_ROLLOFF_FAST, FLAG_POLARITY_INVERT)
 
 SINGLE_BIT (hpf, MIXER,"Highpass Filter", ONYX_REG_ADC_HPF_BYPASS, ONYX_HPF_DISABLE, FLAG_POLARITY_INVERT)
 
 SINGLE_BIT (dm12, MIXER,"Digital De-Emphasis", ONYX_REG_DAC_DEEMPH, ONYX_DIGDEEMPH_CTRL, 0)
 
 MODULE_DEVICE_TABLE (i2c, onyx_i2c_id)
 
 module_i2c_driver (onyx_driver)
 

Macro Definition Documentation

#define ADDCTL (   n)
Value:
do { \
ctl = snd_ctl_new1(&n, onyx); \
if (ctl) { \
ctl->id.device = \
onyx->codec.soundbus_dev->pcm->device; \
err = aoa_snd_ctl_add(ctl); \
if (err) \
goto error; \
} \
} while (0)
#define codec_to_onyx (   c)    container_of(c, struct onyx, codec)

Definition at line 65 of file onyx.c.

#define FLAG_POLARITY_INVERT   1

Definition at line 369 of file onyx.c.

#define FLAG_SPDIFLOCK   2

Definition at line 370 of file onyx.c.

#define INPUTGAIN_RANGE_SHIFT   (-3)

Definition at line 183 of file onyx.c.

#define onyx_snd_mute_info   snd_ctl_boolean_stereo_info

Definition at line 313 of file onyx.c.

#define onyx_snd_single_bit_info   snd_ctl_boolean_mono_info

Definition at line 367 of file onyx.c.

#define PFX   "snd-aoa-codec-onyx: "

Definition at line 46 of file onyx.c.

#define SINGLE_BIT (   n,
  type,
  description,
  address,
  mask,
  flags 
)
Value:
static struct snd_kcontrol_new n##_control = { \
.iface = SNDRV_CTL_ELEM_IFACE_##type, \
.name = description, \
.get = onyx_snd_single_bit_get, \
.put = onyx_snd_single_bit_put, \
.private_value = (flags << 16) | (address << 8) | mask \
}

Definition at line 422 of file onyx.c.

#define VOLUME_RANGE_SHIFT   128

Definition at line 107 of file onyx.c.

Function Documentation

MODULE_AUTHOR ( "Johannes Berg <[email protected]>"  )
MODULE_DESCRIPTION ( "pcm3052 (onyx) codec driver for snd-aoa"  )
MODULE_DEVICE_TABLE ( i2c  ,
onyx_i2c_id   
)
module_i2c_driver ( onyx_driver  )
MODULE_LICENSE ( "GPL"  )
SINGLE_BIT ( ovr1  ,
MIXER  ,
"Oversampling Rate"  ,
ONYX_REG_DAC_CONTROL  ,
ONYX_OVR1  ,
 
)
SINGLE_BIT ( flt0  ,
MIXER  ,
"Fast Digital Filter Rolloff"  ,
ONYX_REG_DAC_FILTER  ,
ONYX_ROLLOFF_FAST  ,
FLAG_POLARITY_INVERT   
)
SINGLE_BIT ( hpf  ,
MIXER  ,
"Highpass Filter ,
ONYX_REG_ADC_HPF_BYPASS  ,
ONYX_HPF_DISABLE  ,
FLAG_POLARITY_INVERT   
)
SINGLE_BIT ( dm12  ,
MIXER  ,
"Digital De-Emphasis"  ,
ONYX_REG_DAC_DEEMPH  ,
ONYX_DIGDEEMPH_CTRL  ,
 
)