Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284217
b: refs/heads/master
c: 78c058d
h: refs/heads/master
i:
  284215: 8aeda93
v: v3
  • Loading branch information
Takashi Iwai committed Dec 20, 2011
1 parent c55f492 commit e5e1e5e
Show file tree
Hide file tree
Showing 52 changed files with 662 additions and 831 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: 31ef22579302ac42054bebecb528710f46580925
refs/heads/master: 78c058df6a120044455b5635daefdc515bf9d899
1 change: 0 additions & 1 deletion trunk/Documentation/sound/alsa/HD-Audio-Models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ STAC92HD83*
mic-ref Reference board with power management for ports
dell-s14 Dell laptop
dell-vostro-3500 Dell Vostro 3500 laptop
hp HP laptops with (inverted) mute-LED
hp-dv7-4000 HP dv-7 4000
auto BIOS setup (default)

Expand Down
6 changes: 2 additions & 4 deletions trunk/Documentation/sound/alsa/soc/machine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ Machine DAI Configuration
The machine DAI configuration glues all the codec and CPU DAIs together. It can
also be used to set up the DAI system clock and for any machine related DAI
initialisation e.g. the machine audio map can be connected to the codec audio
map, unconnected codec pins can be set as such. Please see corgi.c, spitz.c
for examples.
map, unconnected codec pins can be set as such.

struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.

Expand Down Expand Up @@ -83,8 +82,7 @@ Machine Power Map
The machine driver can optionally extend the codec power map and to become an
audio power map of the audio subsystem. This allows for automatic power up/down
of speaker/HP amplifiers, etc. Codec pins can be connected to the machines jack
sockets in the machine init function. See soc/pxa/spitz.c and dapm.txt for
details.
sockets in the machine init function.


Machine Controls
Expand Down
1 change: 0 additions & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5648,7 +5648,6 @@ F: drivers/media/video/*7146*
F: include/media/*7146*

SAMSUNG AUDIO (ASoC) DRIVERS
M: Jassi Brar <jassisinghbrar@gmail.com>
M: Sangbeom Kim <sbkim73@samsung.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported
Expand Down
81 changes: 58 additions & 23 deletions trunk/drivers/firmware/sigma.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,34 @@
#include <linux/module.h>
#include <linux/sigma.h>

/* Return: 0==OK, <0==error, =1 ==no more actions */
static size_t sigma_action_size(struct sigma_action *sa)
{
size_t payload = 0;

switch (sa->instr) {
case SIGMA_ACTION_WRITEXBYTES:
case SIGMA_ACTION_WRITESINGLE:
case SIGMA_ACTION_WRITESAFELOAD:
payload = sigma_action_len(sa);
break;
default:
break;
}

payload = ALIGN(payload, 2);

return payload + sizeof(struct sigma_action);
}

/*
* Returns a negative error value in case of an error, 0 if processing of
* the firmware should be stopped after this action, 1 otherwise.
*/
static int
process_sigma_action(struct i2c_client *client, struct sigma_firmware *ssfw)
process_sigma_action(struct i2c_client *client, struct sigma_action *sa)
{
struct sigma_action *sa = (void *)(ssfw->fw->data + ssfw->pos);
size_t len = sigma_action_len(sa);
int ret = 0;
int ret;

pr_debug("%s: instr:%i addr:%#x len:%zu\n", __func__,
sa->instr, sa->addr, len);
Expand All @@ -29,44 +50,50 @@ process_sigma_action(struct i2c_client *client, struct sigma_firmware *ssfw)
case SIGMA_ACTION_WRITEXBYTES:
case SIGMA_ACTION_WRITESINGLE:
case SIGMA_ACTION_WRITESAFELOAD:
if (ssfw->fw->size < ssfw->pos + len)
return -EINVAL;
ret = i2c_master_send(client, (void *)&sa->addr, len);
if (ret < 0)
return -EINVAL;
break;

case SIGMA_ACTION_DELAY:
ret = 0;
udelay(len);
len = 0;
break;

case SIGMA_ACTION_END:
return 1;

return 0;
default:
return -EINVAL;
}

/* when arrive here ret=0 or sent data */
ssfw->pos += sigma_action_size(sa, len);
return ssfw->pos == ssfw->fw->size;
return 1;
}

static int
process_sigma_actions(struct i2c_client *client, struct sigma_firmware *ssfw)
{
pr_debug("%s: processing %p\n", __func__, ssfw);
struct sigma_action *sa;
size_t size;
int ret;

while (ssfw->pos + sizeof(*sa) <= ssfw->fw->size) {
sa = (struct sigma_action *)(ssfw->fw->data + ssfw->pos);

size = sigma_action_size(sa);
ssfw->pos += size;
if (ssfw->pos > ssfw->fw->size || size == 0)
break;

ret = process_sigma_action(client, sa);

while (1) {
int ret = process_sigma_action(client, ssfw);
pr_debug("%s: action returned %i\n", __func__, ret);
if (ret == 1)
return 0;
else if (ret)

if (ret <= 0)
return ret;
}

if (ssfw->pos != ssfw->fw->size)
return -EINVAL;

return 0;
}

int process_sigma_firmware(struct i2c_client *client, const char *name)
Expand All @@ -89,16 +116,24 @@ int process_sigma_firmware(struct i2c_client *client, const char *name)

/* then verify the header */
ret = -EINVAL;
if (fw->size < sizeof(*ssfw_head))

/*
* Reject too small or unreasonable large files. The upper limit has been
* chosen a bit arbitrarily, but it should be enough for all practical
* purposes and having the limit makes it easier to avoid integer
* overflows later in the loading process.
*/
if (fw->size < sizeof(*ssfw_head) || fw->size >= 0x4000000)
goto done;

ssfw_head = (void *)fw->data;
if (memcmp(ssfw_head->magic, SIGMA_MAGIC, ARRAY_SIZE(ssfw_head->magic)))
goto done;

crc = crc32(0, fw->data, fw->size);
crc = crc32(0, fw->data + sizeof(*ssfw_head),
fw->size - sizeof(*ssfw_head));
pr_debug("%s: crc=%x\n", __func__, crc);
if (crc != ssfw_head->crc)
if (crc != le32_to_cpu(ssfw_head->crc))
goto done;

ssfw.pos = sizeof(*ssfw_head);
Expand Down
13 changes: 4 additions & 9 deletions trunk/include/linux/sigma.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct sigma_firmware {
struct sigma_firmware_header {
unsigned char magic[7];
u8 version;
u32 crc;
__le32 crc;
};

enum {
Expand All @@ -40,19 +40,14 @@ enum {
struct sigma_action {
u8 instr;
u8 len_hi;
u16 len;
u16 addr;
__le16 len;
__be16 addr;
unsigned char payload[];
};

static inline u32 sigma_action_len(struct sigma_action *sa)
{
return (sa->len_hi << 16) | sa->len;
}

static inline size_t sigma_action_size(struct sigma_action *sa, u32 payload_len)
{
return sizeof(*sa) + payload_len + (payload_len % 2);
return (sa->len_hi << 16) | le16_to_cpu(sa->len);
}

extern int process_sigma_firmware(struct i2c_client *client, const char *name);
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/cs5535audio/cs5535audio_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
struct cs5535audio_dma_desc *desc =
&((struct cs5535audio_dma_desc *) dma->desc_buf.area)[i];
desc->addr = cpu_to_le32(addr);
desc->size = cpu_to_le32(period_bytes);
desc->size = cpu_to_le16(period_bytes);
desc->ctlreserved = cpu_to_le16(PRD_EOP);
desc_addr += sizeof(struct cs5535audio_dma_desc);
addr += period_bytes;
Expand Down
12 changes: 9 additions & 3 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -3816,6 +3816,12 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type)
if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits))
return audio_idx[type][i];

/* non-fixed slots starting from 10 */
for (i = 10; i < 32; i++) {
if (!test_and_set_bit(i, bus->pcm_dev_bits))
return i;
}

snd_printk(KERN_WARNING "Too many %s devices\n",
snd_hda_pcm_type_name[type]);
return -EAGAIN;
Expand Down Expand Up @@ -4012,9 +4018,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,

/* Search for codec ID */
for (q = tbl; q->subvendor; q++) {
unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);

if (vendorid == codec->subsystem_id)
unsigned int mask = 0xffff0000 | q->subdevice_mask;
unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
if ((codec->subsystem_id & mask) == id)
break;
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,6 @@ enum {
/* max. codec address */
#define HDA_MAX_CODEC_ADDRESS 0x0f

/* max number of PCM devics per card */
#define HDA_MAX_PCMS 10

/*
* generic arrays
*/
Expand Down
28 changes: 19 additions & 9 deletions trunk/sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,28 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,

for (i = 0; i < size; i++) {
unsigned int val = hdmi_get_eld_data(codec, nid, i);
/*
* Graphics driver might be writing to ELD buffer right now.
* Just abort. The caller will repoll after a while.
*/
if (!(val & AC_ELDD_ELD_VALID)) {
if (!i) {
snd_printd(KERN_INFO
"HDMI: invalid ELD data\n");
ret = -EINVAL;
goto error;
}
snd_printd(KERN_INFO
"HDMI: invalid ELD data byte %d\n", i);
val = 0;
} else
val &= AC_ELDD_ELD_DATA;
ret = -EINVAL;
goto error;
}
val &= AC_ELDD_ELD_DATA;
/*
* The first byte cannot be zero. This can happen on some DVI
* connections. Some Intel chips may also need some 250ms delay
* to return non-zero ELD data, even when the graphics driver
* correctly writes ELD content before setting ELD_valid bit.
*/
if (!val && !i) {
snd_printdd(KERN_INFO "HDMI: 0 ELD data\n");
ret = -EINVAL;
goto error;
}
buf[i] = val;
}

Expand Down
Loading

0 comments on commit e5e1e5e

Please sign in to comment.