Exemplo n.º 1
0
static int jz_dmic_probe(struct snd_soc_dai *dai)
{
	struct device *dev = dai->dev;
	struct jz_dmic *jz_dmic = dev_get_drvdata(dai->dev);
	clk_enable(jz_dmic->clk_gate_dmic);
	/*gain: 0, ..., e*/
	__dmic_reset(dev);
	while(__dmic_get_reset(dev));
	__dmic_set_sr_8k(dev);
	__dmic_enable_hpf1(dev);
/*	__dmic_disable_hpf1(dev);*/
	__dmic_set_gcr(dev,8);
	__dmic_mask_all_int(dev);
	__dmic_enable_rdms(dev);
	__dmic_enable_pack(dev);
	__dmic_disable_sw_lr(dev);
	__dmic_enable_lp(dev);
	__dmic_set_request(dev,48);
	__dmic_enable_hpf2(dev);
	__dmic_set_thr_high(dev,32);
	__dmic_set_thr_low(dev,16);
	__dmic_enable_tri(dev);
	__dmic_unpack_dis(dev);

	clk_disable(jz_dmic->clk_gate_dmic);

	return 0;
}
Exemplo n.º 2
0
void dmic_init(void)
{
	gpio_as_dmic();
	dmic_clk_config();
	__dmic_reset();
	__dmic_reset_tri();
}