void cobalt_i2c_exit(struct cobalt *cobalt) { int i; cobalt_dbg(1, "i2c exit\n"); for (i = 0; i < COBALT_NUM_ADAPTERS; i++) { cobalt_err("unregistered bus %s\n", cobalt->i2c_adap[i].name); i2c_del_adapter(&cobalt->i2c_adap[i]); } }
int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc) { struct snd_pcm *sp; struct snd_card *sc = cobsc->sc; struct cobalt_stream *s = cobsc->s; struct cobalt *cobalt = s->cobalt; int ret; s->q.gfp_flags |= __GFP_ZERO; if (!s->is_output) { cobalt_s_bit_sysctrl(cobalt, COBALT_SYS_CTRL_AUDIO_IPP_RESETN_BIT(s->video_channel), 0); mdelay(2); cobalt_s_bit_sysctrl(cobalt, COBALT_SYS_CTRL_AUDIO_IPP_RESETN_BIT(s->video_channel), 1); mdelay(1); ret = snd_pcm_new(sc, "Cobalt PCM-In HDMI", 0, /* PCM device 0, the only one for this card */ 0, /* 0 playback substreams */ 1, /* 1 capture substream */ &sp); if (ret) { cobalt_err("snd_cobalt_pcm_create() failed for input with err %d\n", ret); goto err_exit; } snd_pcm_set_ops(sp, SNDRV_PCM_STREAM_CAPTURE, &snd_cobalt_pcm_capture_ops); sp->info_flags = 0; sp->private_data = cobsc; strscpy(sp->name, "cobalt", sizeof(sp->name)); } else { cobalt_s_bit_sysctrl(cobalt, COBALT_SYS_CTRL_AUDIO_OPP_RESETN_BIT, 0); mdelay(2); cobalt_s_bit_sysctrl(cobalt, COBALT_SYS_CTRL_AUDIO_OPP_RESETN_BIT, 1); mdelay(1); ret = snd_pcm_new(sc, "Cobalt PCM-Out HDMI", 0, /* PCM device 0, the only one for this card */ 1, /* 0 playback substreams */ 0, /* 1 capture substream */ &sp); if (ret) { cobalt_err("snd_cobalt_pcm_create() failed for output with err %d\n", ret); goto err_exit; } snd_pcm_set_ops(sp, SNDRV_PCM_STREAM_PLAYBACK, &snd_cobalt_pcm_playback_ops); sp->info_flags = 0; sp->private_data = cobsc; strscpy(sp->name, "cobalt", sizeof(sp->name)); } return 0; err_exit: return ret; }