Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110862
b: refs/heads/master
c: 241b3ee
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and Jaroslav Kysela committed Aug 6, 2008
1 parent 7cedbc6 commit aa2691a
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 111 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7779f75f072784d3fccf721b8ec43107f93619a0
refs/heads/master: 241b3ee70d2d69e88d5c144ce938b1887cd6d3fc
43 changes: 9 additions & 34 deletions trunk/include/sound/ad1848.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "pcm.h"
#include <linux/interrupt.h>

#include "wss.h" /* temporary till the driver is removed */

/* IO ports */

#define AD1848P( chip, x ) ( (chip) -> port + c_d_c_AD1848##x )
Expand Down Expand Up @@ -127,48 +129,20 @@
#define AD1848_THINKPAD_CTL_PORT2 0x15e9
#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02

struct snd_ad1848 {
unsigned long port; /* i/o port */
struct resource *res_port;
int irq; /* IRQ line */
int dma; /* data DMA */
unsigned short version; /* version of CODEC chip */
unsigned short mode; /* see to AD1848_MODE_XXXX */
unsigned short hardware; /* see to AD1848_HW_XXXX */
unsigned short single_dma:1; /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */

struct snd_pcm *pcm;
struct snd_pcm_substream *playback_substream;
struct snd_pcm_substream *capture_substream;
struct snd_card *card;

unsigned char image[32]; /* SGalaxy needs an access to extended registers */
int mce_bit;
int calibrate_mute;
int dma_size;
int thinkpad_flag; /* Thinkpad CS4248 needs some extra help */

#ifdef CONFIG_PM
void (*suspend)(struct snd_ad1848 *chip);
void (*resume)(struct snd_ad1848 *chip);
#endif

spinlock_t reg_lock;
};

/* exported functions */

void snd_ad1848_out(struct snd_ad1848 *chip, unsigned char reg, unsigned char value);
void snd_ad1848_out(struct snd_wss *chip, unsigned char reg,
unsigned char value);

int snd_ad1848_create(struct snd_card *card,
unsigned long port,
int irq, int dma,
unsigned short hardware,
struct snd_ad1848 ** chip);
struct snd_wss **chip);

int snd_ad1848_pcm(struct snd_ad1848 * chip, int device, struct snd_pcm **rpcm);
int snd_ad1848_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm);
const struct snd_pcm_ops *snd_ad1848_get_pcm_ops(int direction);
int snd_ad1848_mixer(struct snd_ad1848 * chip);
int snd_ad1848_mixer(struct snd_wss *chip);

/* exported mixer stuffs */
enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE };
Expand Down Expand Up @@ -213,6 +187,7 @@ struct ad1848_mix_elem {
.private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert), \
.tlv = xtlv }

int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c);
int snd_ad1848_add_ctl_elem(struct snd_wss *chip,
const struct ad1848_mix_elem *c);

#endif /* __SOUND_AD1848_H */
6 changes: 4 additions & 2 deletions trunk/include/sound/wss.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ struct snd_wss {
unsigned short mode; /* see to WSS_MODE_XXXX */
unsigned short hardware; /* see to WSS_HW_XXXX */
unsigned short hwshare; /* shared resources */
unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */
ebus_flag:1; /* SPARC: EBUS present */
unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit */
/* daughter board) or dma1 == dma2 */
ebus_flag:1, /* SPARC: EBUS present */
thinkpad_flag:1; /* Thinkpad CS4248 needs extra help */

struct snd_card *card;
struct snd_pcm *pcm;
Expand Down
6 changes: 3 additions & 3 deletions trunk/sound/isa/ad1848/ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
static int __devinit snd_ad1848_probe(struct device *dev, unsigned int n)
{
struct snd_card *card;
struct snd_ad1848 *chip;
struct snd_wss *chip;
struct snd_pcm *pcm;
int error;

Expand Down Expand Up @@ -142,7 +142,7 @@ static int __devexit snd_ad1848_remove(struct device *dev, unsigned int n)
static int snd_ad1848_suspend(struct device *dev, unsigned int n, pm_message_t state)
{
struct snd_card *card = dev_get_drvdata(dev);
struct snd_ad1848 *chip = card->private_data;
struct snd_wss *chip = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
chip->suspend(chip);
Expand All @@ -152,7 +152,7 @@ static int snd_ad1848_suspend(struct device *dev, unsigned int n, pm_message_t s
static int snd_ad1848_resume(struct device *dev, unsigned int n)
{
struct snd_card *card = dev_get_drvdata(dev);
struct snd_ad1848 *chip = card->private_data;
struct snd_wss *chip = card->private_data;

chip->resume(chip);
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
Expand Down
Loading

0 comments on commit aa2691a

Please sign in to comment.