Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | sound/pci/hda/hda_intel.c | static void azx_clear_irq_pending(struct azx *chip) {
struct hdac_bus *bus = azx_bus(chip);
struct hdac_stream *s;
spin_lock_irq(&bus->reg_lock);
list_for_each_entry(s, &bus->stream_list, list) {
struct azx_dev *azx_dev = stream_to_azx_dev(s);
azx_dev->irq_pending = 0;
}
spin_unlock_irq(&bus->reg_l... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static void azx_add_card_list(struct azx *chip) {
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
mutex_lock(&card_list_lock);
list_add(&hda->list, &card_list);
mutex_unlock(&card_list_lock);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static void azx_del_card_list(struct azx *chip) {
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
mutex_lock(&card_list_lock);
list_del_init(&hda->list);
mutex_unlock(&card_list_lock);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int param_set_xint(const char *val, const struct kernel_param *kp) {
struct hda_intel *hda;
struct azx *chip;
int prev = power_save;
int ret = param_set_int(val, kp);
if (ret || prev == power_save)
return ret;
mutex_lock(&card_list_lock);
list_for_each_entry(hda, &card_list, list) {
chip ... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int azx_prepare(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip;
if (!azx_is_pm_ready(card))
return 0;
chip = card->private_data;
chip->pm_prepared = 1;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
flush_work(&azx_bus(chip)->unsol_work);
return... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static int azx_suspend(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip;
struct hdac_bus *bus;
if (!azx_is_pm_ready(card))
return 0;
chip = card->private_data;
bus = azx_bus(chip);
azx_shutdown_chip(chip);
if (bus->irq >= 0) {
free_irq(bus->irq, chip);
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static int azx_resume(struct device *dev) {
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip;
if (!azx_is_pm_ready(card))
return 0;
chip = card->private_data;
if (chip->msi)
if (pci_enable_msi(chip->pci) < 0)
chip->msi = 0;
if (azx_acquire_irq(chip, 1) < 0)
return -EIO;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static int register_vga_switcheroo(struct azx *chip) {
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
struct pci_dev *p;
int err;
if (!hda->use_vga_switcheroo)
return 0;
p = get_bound_vga(chip->pci);
err = vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops, p);
pci_dev... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static void azx_free(struct azx *chip) {
struct pci_dev *pci = chip->pci;
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
struct hdac_bus *bus = azx_bus(chip);
if (hda->freed)
return;
if (azx_has_pm_runtime(chip) && chip->running) {
pm_runtime_get_noresume(&pci->dev);
pm_runt... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static bool atpx_present(void) {
struct pci_dev *pdev = NULL;
acpi_handle dhandle, atpx_handle;
acpi_status status;
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
dhandle = ACPI_HANDLE(&pdev->dev);
if (dhandle) {
status = acpi_get_handle(dhandle, "ATPX", &atpx_handle);... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static bool atpx_present(void) { return false; }
#endif | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static void assign_position_fix(struct azx *chip, int fix) {
static const azx_get_pos_callback_t callbacks[] = {
[POS_FIX_AUTO] = NULL,
[POS_FIX_LPIB] = azx_get_pos_lpib,
[POS_FIX_POSBUF] = azx_get_pos_posbuf,
[POS_FIX_VIACOMBO] = azx_via_get_position,
[POS_FIX_COMBO] = azx_get_pos_lpib,... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static void azx_check_snoop_available(struct azx *chip) {
int snoop = hda_snoop;
if (snoop >= 0) {
dev_info(chip->card->dev, "Force to %s mode by module option\n",
snoop ? "snoop" : "non-snoop");
chip->snoop = snoop;
chip->uc_buffer = !snoop;
return;
}
snoop = true;
if (azx_get_... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c | static int default_bdl_pos_adj(struct azx *chip) {
if (chip->pci->vendor == PCI_VENDOR_ID_INTEL) {
switch (chip->pci->device) {
case 0x0f04: /* Baytrail */
case 0x2284: /* Braswell */
return 32;
}
}
switch (chip->driver_type) {
case AZX_DRIVER_ICH:
case AZX_DRIVER_PCH:
return 1;
... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_intel.c |
static int disable_msi_reset_irq(struct azx *chip) {
struct hdac_bus *bus = azx_bus(chip);
int err;
free_irq(bus->irq, chip);
bus->irq = -1;
chip->card->sync_irq = -1;
pci_disable_msi(chip->pci);
chip->msi = 0;
err = azx_acquire_irq(chip, 1);
if (err < 0)
return err;
return 0;
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | bool is_jack_detectable(struct hda_codec *codec, hda_nid_t nid) {
if (codec->no_jack_detect)
return false;
if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_PRES_DETECT))
return false;
if (get_defcfg_misc(snd_hda_codec_get_pincfg(codec, nid)) &
AC_DEFCFG_MISC_NO_PRESENCE)
return false;
if (... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | struct hda_jack_tbl *snd_hda_jack_tbl_get_mst(struct hda_codec *codec,
hda_nid_t nid, int dev_id) {
struct hda_jack_tbl *jack = codec->jacktbl.list;
int i;
if (!nid || !jack)
return NULL;
for (i = 0; i < codec->jacktbl.used; i++, jack++)
if (jack->nid == ni... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c |
void snd_hda_jack_tbl_disconnect(struct hda_codec *codec) {
struct hda_jack_tbl *jack = codec->jacktbl.list;
int i;
for (i = 0; i < codec->jacktbl.used; i++, jack++) {
if (!codec->bus->shutdown && jack->jack)
snd_device_disconnect(codec->card, jack->jack);
}
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | void snd_hda_jack_set_dirty_all(struct hda_codec *codec) {
struct hda_jack_tbl *jack = codec->jacktbl.list;
int i;
for (i = 0; i < codec->jacktbl.used; i++, jack++)
if (jack->nid)
jack->jack_dirty = 1;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | int snd_hda_jack_detect_state_mst(struct hda_codec *codec, hda_nid_t nid,
int dev_id) {
struct hda_jack_tbl *jack = snd_hda_jack_tbl_get_mst(codec, nid, dev_id);
if (jack && jack->phantom_jack)
return HDA_JACK_PHANTOM;
else if (snd_hda_jack_pin_sense(codec, nid, dev_id) & AC_... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid) {
unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid);
switch (get_defcfg_device(def_conf)) {
case AC_JACK_LINE_OUT:
case AC_JACK_SPEAKER:
return SND_JACK_LINEOUT;
case AC_JACK_HP_OUT:
return SND_JACK_HEADPHONE;
case AC_... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | int snd_hda_jack_add_kctl_mst(struct hda_codec *codec, hda_nid_t nid,
int dev_id, const char *name, bool phantom_jack,
int type, const struct hda_jack_keymap *keymap) {
struct hda_jack_tbl *jack;
const struct hda_jack_keymap *map;
int err, state, buttons... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.c | void snd_hda_jack_poll_all(struct hda_codec *codec) {
struct hda_jack_tbl *jack = codec->jacktbl.list;
int i, changes = 0;
for (i = 0; i < codec->jacktbl.used; i++, jack++) {
unsigned int old_sense;
if (!jack->nid || !jack->jack_dirty || jack->phantom_jack)
continue;
old_sense = get_jack_plug_s... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_jack.h | static inline int snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
const char *name, bool phantom_jack,
int type,
const struct hda_jack_keymap *keymap) {
return snd_hda_jack_add_kctl_ms... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_local.h |
static inline void snd_hda_override_wcaps(struct hda_codec *codec,
hda_nid_t nid, u32 val) {
if (nid >= codec->core.start_nid &&
nid < codec->core.start_nid + codec->core.num_nodes)
codec->wcaps[nid - codec->core.start_nid] = val;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_local.h |
static inline int snd_hda_get_bool_hint(struct hda_codec *codec,
const char *key) {
return -ENOENT;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static const char *get_wid_type_name(unsigned int wid_value) {
static const char *const names[16] = {
[AC_WID_AUD_OUT] = "Audio Output",
[AC_WID_AUD_IN] = "Audio Input",
[AC_WID_AUD_MIX] = "Audio Mixer",
[AC_WID_AUD_SEL] = "Audio Selector",
[AC_WID_PIN] = "Pin Complex",
[AC_WID_PO... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm) {
static const unsigned int rates[] = {8000, 11025, 16000, 22050,
32000, 44100, 48000, 88200,
96000, 176400, 192000, 384000};
int i;
pcm &= AC_SUPPCM_R... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static const char *get_jack_connection(u32 cfg) {
static const char *const names[16] = {
"Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog",
"DIN", "XLR", "RJ11", "Comb", NULL, NULL, NULL, "Other"};
cfg = (cfg & AC_DEFCFG_CONN_TYPE) >> AC_DEFCFG_CONN_TYPE_SHIFT;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static const char *get_jack_color(u32 cfg) {
static const char *const names[16] = {
"Unknown", "Black", "Grey", "Blue", "Green", "Red", "Orange", "Yellow",
"Purple", "Pink", NULL, NULL, NULL, NULL, "White", "Other",
};
cfg = (cfg & AC_DEFCFG_COLOR) >> AC_DEFCFG_COLOR_SHIFT;
if (names[cfg... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static void print_audio_io(struct snd_info_buffer *buffer,
struct hda_codec *codec, hda_nid_t nid,
unsigned int wid_type) {
int conv = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
snd_iprintf(buffer, " Converter: stream=%d, channel=%d\n",
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c |
static const char *get_pwr_state(u32 state) {
static const char *const buf[] = {"D0", "D1", "D2", "D3", "D3cold"};
if (state < ARRAY_SIZE(buf))
return buf[state];
return "UNKNOWN";
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_proc.c | static void print_conn_list(struct snd_info_buffer *buffer,
struct hda_codec *codec, hda_nid_t nid,
unsigned int wid_type, hda_nid_t *conn,
int conn_len) {
int c, curr = -1;
const hda_nid_t *list;
int cache_len;
if (conn_len > ... | [
1,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c |
static ssize_t pin_configs_show(struct hda_codec *codec, struct snd_array *list,
char *buf) {
const struct hda_pincfg *pin;
int i, len = 0;
mutex_lock(&codec->user_mutex);
snd_array_for_each(list, i, pin) {
len += sysfs_emit_at(buf, len, "0x%02x 0x%08x\n", pin->nid, pin->cfg... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c |
static ssize_t init_pin_configs_show(struct device *dev,
struct device_attribute *attr, char *buf) {
struct hda_codec *codec = dev_get_drvdata(dev);
return pin_configs_show(codec, &codec->init_pins, buf);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c |
static struct hda_hint *get_hint(struct hda_codec *codec, const char *key) {
struct hda_hint *hint;
int i;
snd_array_for_each(&codec->hints, i, hint) {
if (!strcmp(hint->key, key))
return hint;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c |
static void remove_trail_spaces(char *str) {
char *p;
if (!*str)
return;
p = str + strlen(str) - 1;
for (; isspace(*p); p--) {
*p = 0;
if (p == str)
return;
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c |
static int parse_user_pin_configs(struct hda_codec *codec, const char *buf) {
int nid, cfg, err;
if (sscanf(buf, "%i %i", &nid, &cfg) != 2)
return -EINVAL;
if (!nid)
return -EINVAL;
mutex_lock(&codec->user_mutex);
err = snd_hda_add_pincfg(codec, &codec->user_pins, nid, cfg);
mutex_unlock(&codec->u... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_sysfs.c | static int parse_line_mode(char *buf, struct hda_bus *bus) {
int i;
for (i = 0; i < ARRAY_SIZE(patch_items); i++) {
if (!patch_items[i].tag)
continue;
if (strmatch(buf, patch_items[i].tag))
return i;
if (patch_items[i].alias && strmatch(buf, patch_items[i].alias))
return i;
}
retur... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_tegra.c | static void hda_tegra_init(struct hda_tegra *hda) {
u32 v;
v = readl(hda->regs + HDA_IPFS_CONFIG);
v |= HDA_IPFS_EN_FPCI;
writel(v, hda->regs + HDA_IPFS_CONFIG);
/* Enable MEM/IO space and bus master */
v = readl(hda->regs + HDA_CFG_CMD);
v &= ~HDA_DISABLE_INTR;
v |= HDA_ENABLE_MEM_SPACE | HDA_ENABLE_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/hda_tegra.c |
static int hda_tegra_create(struct snd_card *card, unsigned int driver_caps,
struct hda_tegra *hda) {
static const struct snd_device_ops ops = {
.dev_disconnect = hda_tegra_dev_disconnect,
.dev_free = hda_tegra_dev_free,
};
struct azx *chip;
int err;
chip = &hda->chip... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_analog.c | static void ad1986a_fixup_eapd(struct hda_codec *codec,
const struct hda_fixup *fix, int action) {
struct ad198x_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
codec->inv_eapd = 0;
spec->gen.keep_eapd_on = 1;
spec->eapd_nid = 0x1b;
}
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_analog.c | static void ad1986a_fixup_eapd_mix_in(struct hda_codec *codec,
const struct hda_fixup *fix, int action) {
struct ad198x_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ad1986a_fixup_eapd(codec, fix, action);
spec->gen.add_stereo_mix_input = HDA_HINT_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_analog.c | static void ad1884_fixup_thinkpad(struct hda_codec *codec,
const struct hda_fixup *fix, int action) {
struct ad198x_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
spec->gen.keep_eapd_on = 1;
spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook;
spec->... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_analog.c | static int patch_ad1882(struct hda_codec *codec) {
struct ad198x_spec *spec;
int err;
err = alloc_ad_spec(codec);
if (err < 0)
return err;
spec = codec->spec;
spec->gen.mixer_nid = 0x20;
spec->gen.mixer_merge_nid = 0x21;
spec->gen.beep_nid = 0x10;
set_beep_amp(spec, 0x10, 0, HDA_OUTPUT);
err =... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static unsigned int codec_send_command(struct hda_codec *codec, hda_nid_t nid,
unsigned int verb, unsigned int parm,
unsigned int *res) {
unsigned int response;
response = snd_hda_codec_read(codec, nid, 0, verb, parm);
*res = response;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int chipio_read_data(struct hda_codec *codec, unsigned int *data) {
struct ca0132_spec *spec = codec->spec;
int res;
res = chipio_send(codec, VENDOR_CHIPIO_HIC_POST_READ, 0);
if (res != -EIO) {
/* read status */
res = chipio_send(codec, VENDOR_CHIPIO_STATUS, 0);
}
if (res != -EIO) {
/*... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int chipio_write(struct hda_codec *codec, unsigned int chip_addx,
const unsigned int data) {
struct ca0132_spec *spec = codec->spec;
int err;
mutex_lock(&spec->chipio_mutex);
err = chipio_write_address(codec, chip_addx);
if (err < 0)
goto exit;
err = chipio_write_data(c... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int chipio_write_no_mutex(struct hda_codec *codec,
unsigned int chip_addx,
const unsigned int data) {
int err;
err = chipio_write_address(codec, chip_addx);
if (err < 0)
goto exit;
err = chipio_write_data(codec, data);
if (err < 0)... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int chipio_read(struct hda_codec *codec, unsigned int chip_addx,
unsigned int *data) {
struct ca0132_spec *spec = codec->spec;
int err;
mutex_lock(&spec->chipio_mutex);
err = chipio_write_address(codec, chip_addx);
if (err < 0)
goto exit;
err = chipio_read_data(codec, da... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void chipio_set_conn_rate(struct hda_codec *codec, int connid,
enum ca0132_sample_rate rate) {
chipio_set_control_param(codec, CONTROL_PARAM_CONN_POINT_ID, connid);
chipio_set_control_param(codec, CONTROL_PARAM_CONN_POINT_SAMPLE_RATE, rate);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void chipio_8051_write_direct(struct hda_codec *codec, unsigned int addr,
unsigned int data) {
unsigned int verb;
verb = VENDOR_CHIPIO_8051_WRITE_DIRECT | data;
snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, verb, addr);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static unsigned int chipio_8051_get_data(struct hda_codec *codec) {
return snd_hda_codec_read(codec, WIDGET_CHIP_CTRL, 0,
VENDOR_CHIPIO_8051_DATA_READ, 0);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void chipio_8051_set_data_pll(struct hda_codec *codec,
unsigned int data) {
snd_hda_codec_write(codec, WIDGET_CHIP_CTRL, 0, VENDOR_CHIPIO_PLL_PMU_WRITE,
data & 0xff);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void chipio_8051_write_exram(struct hda_codec *codec, unsigned int addr,
unsigned int data) {
struct ca0132_spec *spec = codec->spec;
mutex_lock(&spec->chipio_mutex);
chipio_8051_set_address(codec, addr);
chipio_8051_set_data(codec, data);
mutex_unlock(&spec->chi... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void chipio_8051_read_exram(struct hda_codec *codec, unsigned int addr,
unsigned int *data) {
chipio_8051_set_address(codec, addr);
*data = chipio_8051_get_data(codec);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int dspio_send(struct hda_codec *codec, unsigned int reg,
unsigned int data) {
int res;
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
do {
res = snd_hda_codec_read(codec, WIDGET_DSP_CTRL, 0, reg, data);
if ((res >= 0) && (res != VENDOR_STATUS_DSPIO_BUSY))
re... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void dspio_clear_response_queue(struct hda_codec *codec) {
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
unsigned int dummy = 0;
int status;
do {
status = dspio_read(codec, &dummy);
} while (status == 0 && time_before(jiffies, timeout));
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int dspio_get_response_data(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
unsigned int data = 0;
unsigned int count;
if (dspio_read(codec, &data) < 0)
return -EIO;
if ((data & 0x00ffffff) == spec->wait_scp_header) {
spec->scp_resp_header = data;
spec->scp_resp_count ... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int dsp_reset(struct hda_codec *codec) {
unsigned int res;
int retry = 20;
codec_dbg(codec, "dsp_reset\n");
do {
res = dspio_send(codec, VENDOR_DSPIO_DSP_INIT, 0);
retry--;
} while (res == -EIO && retry);
if (!retry) {
codec_dbg(codec, "dsp_reset timeout\n");
return -EIO;
}
ret... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int dsp_allocate_ports_format(struct hda_codec *codec,
const unsigned short fmt,
unsigned int *port_map) {
unsigned int num_chans;
unsigned int sample_rate_div = ((get_hdafmt_rate(fmt) >> 0) & 3) + 1;
unsigned int sample_rate_mul =... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int dma_convert_to_hda_format(struct hda_codec *codec,
unsigned int sample_rate,
unsigned short channels,
unsigned short *hda_format) {
unsigned int format_val;
format_val = snd_hdac_calc_stream_f... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int dma_set_state(struct dma_engine *dma, enum dma_state state) {
bool cmd;
switch (state) {
case DMA_STATE_STOP:
cmd = false;
break;
case DMA_STATE_RUN:
cmd = true;
break;
default:
return 0;
}
snd_hda_codec_load_dsp_trigger(dma->codec, cmd);
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static unsigned int dma_get_stream_id(struct dma_engine *dma) {
struct ca0132_spec *spec = dma->codec->spec;
return spec->dsp_stream_id;
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static size_t dsp_sizeof(const struct dsp_image_seg *p) {
return struct_size(p, data, p->count);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static bool dspload_wait_loaded(struct hda_codec *codec) {
unsigned long timeout = jiffies + msecs_to_jiffies(2000);
do {
if (dspload_is_loaded(codec)) {
codec_info(codec, "ca0132 DSP downloaded and running\n");
return true;
}
msleep(20);
} while (time_before(jiffies, timeout));
codec... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void ca0113_mmio_gpio_set(struct hda_codec *codec, unsigned int gpio_pin,
bool enable) {
struct ca0132_spec *spec = codec->spec;
unsigned short gpio_data;
gpio_data = gpio_pin & 0xF;
gpio_data |= ((enable << 8) & 0x100);
writew(gpio_data, spec->mem_base + 0x320);
} | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream) {
struct ca0132_spec *spec = codec->spec;
return snd_hda_multi_out_dig_open(codec, &spec->multiout);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int ca0132_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream) {
struct ca0132_spec *spec = codec->spec;
return snd_hda_multi_out_dig_close(codec, &spec->multiout)... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *sub... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid,
const unsigned int *lookup, int idx) {
int i = 0;
for (i = 0; i < TUNING_CTLS_COUNT; i++)
if (nid == ca0132_tuning_ctls[i].nid)
break;
snd_hda_power_up(codec);
dspio_set_param(codec, ca0132_tuning_ctls[i].mi... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int equalizer_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
int chs = get_amp_channels(kcontrol);
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = chs == 3 ? 2 : 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 48;
uinfo-... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int equalizer_ctl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
hda_nid_t nid = get_amp_nid(kcontrol);
long *valp = ucontrol->value.integer.value;
int ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_alt_surround_set_bass_redirection(struct hda_codec *codec,
bool val) {
struct ca0132_spec *spec = codec->spec;
unsigned int tmp;
int err;
if (val && spec->channel_cfg_val != SPEAKER_CHANNELS_4_0 &&
spec->channel_cfg_val != SPEAKER_CHAN... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int stop_mic1(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
unsigned int oldval =
snd_hda_codec_read(codec, spec->adcs[0], 0, AC_VERB_GET_CONV, 0);
if (oldval != 0)
snd_hda_codec_write(codec, spec->adcs[0], 0, AC_VERB_SET_CHANNEL_STREAMID,
0);
return... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_cvoice_switch_set(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
hda_nid_t nid;
int i, ret = 0;
unsigned int oldval;
codec_dbg(codec, "ca0132_cvoice_switch_set: val=%ld\n",
spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]);
i = IN_EFFECT_START_NID - ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int ca0132_alt_mic_boost_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] = spec->mic_boost_enum_val;
return 0;
... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_alt_mic_boost_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
int sel = ucontrol->value.enumerated.item[0];
unsigned int items = MIC_BOOS... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ae5_headphone_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
int sel = ucontrol->value.enumerated.item[0];
unsigned int items = AE5_HEADPHON... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_alt_input_source_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = IN_SRC_NUM_OF_INPUTS;
if (uinfo->value.enumerated.item >= IN_SRC_NUM_O... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int ca0132_alt_input_source_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] = spec->in_enum_val;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_alt_output_select_get_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo) {
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = NUM_OF_OUTPUTS;
if (uinfo->value.enumerated.item >= NUM_OF_O... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int
ca0132_alt_speaker_channel_cfg_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] = spec->channel_cfg_val;
retu... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int
ca0132_alt_speaker_channel_cfg_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
int sel = ucontrol->value.enumerated.item[0];
unsigned int items =... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int ca0132_alt_eq_preset_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) {
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ca0132_spec *spec = codec->spec;
ucontrol->value.enumerated.item[0] = spec->eq_preset_val;
return 0;
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ca0132_alt_add_front_full_range_switch(struct hda_codec *codec) {
struct snd_kcontrol_new knew = CA0132_CODEC_MUTE_MONO(
"Full-Range Front Speakers", SPEAKER_FULL_RANGE_FRONT, 1, HDA_OUTPUT);
return snd_hda_ctl_add(codec, SPEAKER_FULL_RANGE_FRONT,
snd_ctl_new1(&knew, codec... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static int ae5_add_headphone_gain_enum(struct hda_codec *codec) {
struct snd_kcontrol_new knew = HDA_CODEC_MUTE_MONO(
"AE-5: Headphone Gain", AE5_HEADPHONE_GAIN_ENUM, 1, 0, HDA_OUTPUT);
knew.info = ae5_headphone_gain_info;
knew.get = ae5_headphone_gain_get;
knew.put = ae5_headphone_gain_put;
return snd_... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static int dbpro_build_pcms(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
struct hda_pcm *info;
info = snd_hda_codec_pcm_new(codec, "CA0132 Alt Analog");
if (!info)
return -ENOMEM;
info->stream[SNDRV_PCM_STREAM_CAPTURE] = ca0132_pcm_analog_capture;
info->stream[SNDRV_PCM_STREAM_CA... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) {
if (pin) {
snd_hda_set_pin_ctl(codec, pin, PIN_VREF80);
if (get_wcaps(codec, pin) & AC_WCAP_IN_AMP)
snd_hda_codec_write(codec, pin, 0, AC_VERB_SET_AMP_GAIN_MUTE,
AMP_IN_UNMUTE(0));
}
if (adc && ... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void ca0132_alt_free_active_dma_channels(struct hda_codec *codec) {
unsigned int i, tmp;
int status;
status = chipio_read(codec, DSPDMAC_CHNLSTART_MODULE_OFFSET, &tmp);
if (status >= 0) {
/* AND against 0xfff to get the active channel bits. */
tmp = tmp & 0xfff;
/* If there are no active ch... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void ca0132_alt_start_dsp_audio_streams(struct hda_codec *codec) {
static const unsigned int dsp_dma_stream_ids[] = {0x0c, 0x03, 0x04};
struct ca0132_spec *spec = codec->spec;
unsigned int i, tmp;
mutex_lock(&spec->chipio_mutex);
for (i = 0; i < ARRAY_SIZE(dsp_dma_stream_ids); i++) {
chipio_get_s... | [
1,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void ca0132_alt_init_analog_mics(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
unsigned int tmp;
chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000);
chipio_set_conn_rate(codec, MEM_CONNID_MICOUT1, SR_96_000);
if (ca0132_quirk(spec) == QUIRK_R3DI) {
chipio_set_conn_rate(... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void ca0132_alt_dsp_initial_mic_setup(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
unsigned int tmp;
chipio_set_stream_control(codec, 0x03, 0);
chipio_set_stream_control(codec, 0x04, 0);
chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000);
chipio_set_conn_rate(codec, ME... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void ae5_post_dsp_pll_setup(struct hda_codec *codec) {
chipio_8051_write_pll_pmu(codec, 0x41, 0xc8);
chipio_8051_write_pll_pmu(codec, 0x45, 0xcc);
chipio_8051_write_pll_pmu(codec, 0x40, 0xcb);
chipio_8051_write_pll_pmu(codec, 0x43, 0xc7);
chipio_8051_write_pll_pmu(codec, 0x51, 0x8d);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void ae7_post_dsp_setup_ports(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
mutex_lock(&spec->chipio_mutex);
chipio_remap_stream(codec, &stream_remap_data[1]);
ca0113_mmio_command_set(codec, 0x30, 0x30, 0x00);
ca0113_mmio_command_set(codec, 0x48, 0x0d, 0x40);
ca0113_mmio_comma... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c | static void r3d_setup_defaults(struct hda_codec *codec) {
struct ca0132_spec *spec = codec->spec;
unsigned int tmp;
int num_fx;
int idx, i;
if (spec->dsp_state != DSP_DOWNLOADED)
return;
ca0132_alt_init_analog_mics(codec);
ca0132_alt_start_dsp_audio_streams(codec);
tmp = FLOAT_ZERO;
dspio_set_u... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void ca0132_process_dsp_response(struct hda_codec *codec,
struct hda_jack_callback *callback) {
struct ca0132_spec *spec = codec->spec;
codec_dbg(codec, "ca0132_process_dsp_response\n");
snd_hda_power_up_pm(codec);
if (spec->wait_scp) {
if (dspio_get_response... | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void ca0132_clear_unsolicited(struct hda_codec *codec) {
static const hda_nid_t pins[] = {0x0B, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13};
unsigned int i;
for (i = 0; i < ARRAY_SIZE(pins); i++) {
snd_hda_codec_write(codec, pins[i], 0, AC_VERB_SET_UNSOLICITED_ENABLE,
0x00);
}
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void zxr_dbpro_power_state_shutdown(struct hda_codec *codec) {
static const hda_nid_t pins[] = {0x05, 0x0c, 0x09, 0x0e, 0x08, 0x11, 0x01};
unsigned int i;
for (i = 0; i < ARRAY_SIZE(pins); i++)
snd_hda_codec_write(codec, pins[i], 0, AC_VERB_SET_POWER_STATE, 0x03);
} | [
0,
0
] |
Linux Kernel | sound/pci/hda/patch_ca0132.c |
static void ae7_exit_chip(struct hda_codec *codec) {
chipio_set_stream_control(codec, 0x18, 0);
chipio_set_stream_source_dest(codec, 0x21, 0xc8, 0xc8);
chipio_set_stream_channels(codec, 0x21, 0);
chipio_set_control_param(codec, CONTROL_PARAM_NODE_ID, 0x09);
chipio_set_control_param(codec, 0x20, 0x01);
chi... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.