Home
last modified time | relevance | path

Searched refs:div (Results 1 – 25 of 80) sorted by relevance

1234

/sound/aoa/soundbus/i2sbus/
Dinterface.h89 # define I2S_SF_MCLKDIV_OTHER(div) (((div/2-1)<<I2S_SF_MCLKDIV_SHIFT)&I2S_SF_MCLKDIV_MASK) argument
90 static inline int i2s_sf_mclkdiv(int div, int *out) in i2s_sf_mclkdiv() argument
94 switch(div) { in i2s_sf_mclkdiv()
100 if (div%2) return -1; in i2s_sf_mclkdiv()
101 d = div/2-1; in i2s_sf_mclkdiv()
104 *out |= I2S_SF_MCLKDIV_OTHER(div); in i2s_sf_mclkdiv()
116 # define I2S_SF_SCLKDIV_OTHER(div) (((div/2-1)<<I2S_SF_SCLKDIV_SHIFT)&I2S_SF_SCLKDIV_MASK) argument
117 static inline int i2s_sf_sclkdiv(int div, int *out) in i2s_sf_sclkdiv() argument
121 switch(div) { in i2s_sf_sclkdiv()
125 if (div%2) return -1; in i2s_sf_sclkdiv()
[all …]
/sound/soc/codecs/
Dadau-utils.c19 unsigned int div; in adau_calc_pll_cfg() local
25 div = 0; in adau_calc_pll_cfg()
28 div = DIV_ROUND_UP(freq_in, 13500000); in adau_calc_pll_cfg()
29 freq_in /= div; in adau_calc_pll_cfg()
35 div--; in adau_calc_pll_cfg()
40 div = 0; in adau_calc_pll_cfg()
42 if (n > 0xffff || m > 0xffff || div > 3 || r > 8 || r < 2) in adau_calc_pll_cfg()
50 regs[4] = (r << 3) | (div << 1); in adau_calc_pll_cfg()
Drl6231.c72 static const int div[] = {2, 3, 4, 6, 8, 12}; in rl6231_calc_dmic_clk() local
75 if (rate < 1000000 * div[0]) { in rl6231_calc_dmic_clk()
80 for (i = 0; i < ARRAY_SIZE(div); i++) { in rl6231_calc_dmic_clk()
81 if ((div[i] % 3) == 0) in rl6231_calc_dmic_clk()
84 if (1536000 * div[i] >= rate) in rl6231_calc_dmic_clk()
112 unsigned int max, unsigned int div) in find_best_div() argument
123 while (div % d != 0) in find_best_div()
146 unsigned int red, pll_out, in_t, out_t, div, div_t; in rl6231_pll_calc() local
175 div = find_best_div(freq_in, f_max, div_t); in rl6231_pll_calc()
176 f_in = freq_in / div; in rl6231_pll_calc()
[all …]
Dtlv320aic32x4-clk.c301 struct clk_aic32x4 *div = to_clk_aic32x4(hw); in clk_aic32x4_div_prepare() local
303 return regmap_update_bits(div->regmap, div->reg, in clk_aic32x4_div_prepare()
309 struct clk_aic32x4 *div = to_clk_aic32x4(hw); in clk_aic32x4_div_unprepare() local
311 regmap_update_bits(div->regmap, div->reg, in clk_aic32x4_div_unprepare()
318 struct clk_aic32x4 *div = to_clk_aic32x4(hw); in clk_aic32x4_div_set_rate() local
325 return regmap_update_bits(div->regmap, div->reg, in clk_aic32x4_div_set_rate()
344 struct clk_aic32x4 *div = to_clk_aic32x4(hw); in clk_aic32x4_div_recalc_rate() local
348 regmap_read(div->regmap, div->reg, &val); in clk_aic32x4_div_recalc_rate()
Dwm8900.c684 unsigned int div; in fll_factors() local
692 div = 1; in fll_factors()
694 div *= 2; in fll_factors()
701 if (div > 32) { in fll_factors()
704 div, Fref, Fout, target); in fll_factors()
708 fll_div->fllclk_div = div >> 2; in fll_factors()
816 int div_id, int div) in wm8900_set_dai_clkdiv() argument
823 WM8900_REG_CLOCKING1_BCLK_MASK, div); in wm8900_set_dai_clkdiv()
827 WM8900_REG_CLOCKING1_OPCLK_MASK, div); in wm8900_set_dai_clkdiv()
831 WM8900_LRC_MASK, div); in wm8900_set_dai_clkdiv()
[all …]
Dwm9081.c119 int div; /* *10 due to .5s */ member
467 unsigned int div; in fll_factors() local
471 div = 1; in fll_factors()
472 while ((Fref / div) > 13500000) { in fll_factors()
473 div *= 2; in fll_factors()
475 if (div > 8) { in fll_factors()
481 fll_div->fll_clk_ref_div = div / 2; in fll_factors()
486 Fref /= div; in fll_factors()
489 div = 0; in fll_factors()
492 div++; in fll_factors()
[all …]
Dwm8350.c787 static int wm8350_set_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div) in wm8350_set_clkdiv() argument
796 snd_soc_component_write(component, WM8350_ADC_DIVIDER, val | div); in wm8350_set_clkdiv()
801 snd_soc_component_write(component, WM8350_DAC_CLOCK_CONTROL, val | div); in wm8350_set_clkdiv()
806 snd_soc_component_write(component, WM8350_CLOCK_CONTROL_1, val | div); in wm8350_set_clkdiv()
811 snd_soc_component_write(component, WM8350_CLOCK_CONTROL_1, val | div); in wm8350_set_clkdiv()
816 snd_soc_component_write(component, WM8350_CLOCK_CONTROL_1, val | div); in wm8350_set_clkdiv()
821 snd_soc_component_write(component, WM8350_DAC_LR_RATE, val | div); in wm8350_set_clkdiv()
826 snd_soc_component_write(component, WM8350_ADC_LR_RATE, val | div); in wm8350_set_clkdiv()
963 int div; /* FLL_OUTDIV */ member
980 fll_div->div = 0x4; in fll_factors()
[all …]
Dadau17x1.c474 unsigned int val, div, dsp_div; in adau17x1_hw_params() local
497 div = 0; in adau17x1_hw_params()
501 div = 1; in adau17x1_hw_params()
505 div = 2; in adau17x1_hw_params()
509 div = 3; in adau17x1_hw_params()
513 div = 4; in adau17x1_hw_params()
517 div = 5; in adau17x1_hw_params()
521 div = 6; in adau17x1_hw_params()
529 ADAU17X1_CONVERTER0_CONVSR_MASK, div); in adau17x1_hw_params()
532 regmap_write(adau->regmap, ADAU17X1_SERIAL_SAMPLING_RATE, div); in adau17x1_hw_params()
Dwm8510.c350 int div_id, int div) in wm8510_set_dai_clkdiv() argument
358 snd_soc_component_write(component, WM8510_GPIO, reg | div); in wm8510_set_dai_clkdiv()
362 snd_soc_component_write(component, WM8510_CLOCK, reg | div); in wm8510_set_dai_clkdiv()
366 snd_soc_component_write(component, WM8510_ADC, reg | div); in wm8510_set_dai_clkdiv()
370 snd_soc_component_write(component, WM8510_DAC, reg | div); in wm8510_set_dai_clkdiv()
374 snd_soc_component_write(component, WM8510_CLOCK, reg | div); in wm8510_set_dai_clkdiv()
Dwm8993.c182 int div; /* *10 due to .5s */ member
387 unsigned int div; in fll_factors() local
391 div = 1; in fll_factors()
393 while ((Fref / div) > 13500000) { in fll_factors()
394 div *= 2; in fll_factors()
397 if (div > 8) { in fll_factors()
407 Fref /= div; in fll_factors()
410 div = 0; in fll_factors()
413 div++; in fll_factors()
415 if (div > 7) { in fll_factors()
[all …]
Darizona.c1282 int ref, div, refclk; in arizona_set_opclk() local
1304 div = 1; in arizona_set_opclk()
1305 while (rates[ref] / div >= freq && div < 32) { in arizona_set_opclk()
1306 if (rates[ref] / div == freq) { in arizona_set_opclk()
1312 (div << in arizona_set_opclk()
1317 div++; in arizona_set_opclk()
2156 int refdiv, div; in arizona_calc_fratio() local
2159 div = 1; in arizona_calc_fratio()
2162 div *= 2; in arizona_calc_fratio()
2166 if (div > ARIZONA_FLL_MAX_REFDIV) in arizona_calc_fratio()
[all …]
/sound/soc/samsung/
Ds3c-i2s-v2.c435 int div_id, int div) in s3c2412_i2s_set_clkdiv() argument
440 pr_debug("%s(%p, %d, %d)\n", __func__, cpu_dai, div_id, div); in s3c2412_i2s_set_clkdiv()
444 switch (div) { in s3c2412_i2s_set_clkdiv()
446 div = S3C2412_IISMOD_BCLK_16FS; in s3c2412_i2s_set_clkdiv()
450 div = S3C2412_IISMOD_BCLK_32FS; in s3c2412_i2s_set_clkdiv()
454 div = S3C2412_IISMOD_BCLK_24FS; in s3c2412_i2s_set_clkdiv()
458 div = S3C2412_IISMOD_BCLK_48FS; in s3c2412_i2s_set_clkdiv()
467 writel(reg | div, i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_clkdiv()
473 switch (div) { in s3c2412_i2s_set_clkdiv()
475 div = S3C2412_IISMOD_RCLK_256FS; in s3c2412_i2s_set_clkdiv()
[all …]
Drx1950_uda1380.c149 int div; in rx1950_hw_params() local
159 div = s3c24xx_i2s_get_clockrate() / (256 * rate); in rx1950_hw_params()
161 div++; in rx1950_hw_params()
167 div = 1; in rx1950_hw_params()
195 S3C24XX_PRESCALE(div, div)); in rx1950_hw_params()
Dh1940_uda1380.c70 int div; in h1940_hw_params() local
78 div = s3c24xx_i2s_get_clockrate() / (384 * rate); in h1940_hw_params()
80 div++; in h1940_hw_params()
108 S3C24XX_PRESCALE(div, div)); in h1940_hw_params()
Djive_wm8750.c38 struct s3c_i2sv2_rate_calc div; in jive_hw_params() local
56 s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params), in jive_hw_params()
65 ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C2412_DIV_RCLK, div.fs_div); in jive_hw_params()
70 div.clk_div - 1); in jive_hw_params()
Ds3c24xx_uda134x.c129 unsigned int div; in s3c24xx_uda134x_hw_params() local
149 div = 1; in s3c24xx_uda134x_hw_params()
152 div = bi % 33; in s3c24xx_uda134x_hw_params()
162 div, clk, err); in s3c24xx_uda134x_hw_params()
185 S3C24XX_PRESCALE(div, div)); in s3c24xx_uda134x_hw_params()
/sound/soc/sunxi/
Dsun4i-i2s.c232 u8 div; member
237 { .div = 2, .val = 0 },
238 { .div = 4, .val = 1 },
239 { .div = 6, .val = 2 },
240 { .div = 8, .val = 3 },
241 { .div = 12, .val = 4 },
242 { .div = 16, .val = 5 },
247 { .div = 1, .val = 0 },
248 { .div = 2, .val = 1 },
249 { .div = 4, .val = 2 },
[all …]
Dsun8i-codec.c456 u8 div; member
461 { .div = 1, .val = 0 },
462 { .div = 2, .val = 1 },
463 { .div = 4, .val = 2 },
464 { .div = 6, .val = 3 },
465 { .div = 8, .val = 4 },
466 { .div = 12, .val = 5 },
467 { .div = 16, .val = 6 },
468 { .div = 24, .val = 7 },
469 { .div = 32, .val = 8 },
[all …]
/sound/soc/sh/rcar/
Dadg.c66 static u32 rsnd_adg_calculate_rbgx(unsigned long div) in rsnd_adg_calculate_rbgx() argument
70 if (!div) in rsnd_adg_calculate_rbgx()
75 if (0 == (div % ratio)) in rsnd_adg_calculate_rbgx()
76 return (u32)((i << 8) | ((div / ratio) - 1)); in rsnd_adg_calculate_rbgx()
132 int div; in __rsnd_adg_get_timesel_ratio() local
137 for (div = 2; div <= 98304; div += step) { in __rsnd_adg_get_timesel_ratio()
138 diff = abs(target_rate - sel_rate[sel] / div); in __rsnd_adg_get_timesel_ratio()
152 div += step; in __rsnd_adg_get_timesel_ratio()
469 u32 rate, div; in rsnd_adg_get_clkout() local
542 div = 6; in rsnd_adg_get_clkout()
[all …]
/sound/soc/stm/
Dstm32_sai_sub.c317 int div; in stm32_sai_get_clk_div() local
319 div = DIV_ROUND_CLOSEST(input_rate, output_rate); in stm32_sai_get_clk_div()
320 if (div > SAI_XCR1_MCKDIV_MAX(version)) { in stm32_sai_get_clk_div()
321 dev_err(&sai->pdev->dev, "Divider %d out of range\n", div); in stm32_sai_get_clk_div()
324 dev_dbg(&sai->pdev->dev, "SAI divider %d\n", div); in stm32_sai_get_clk_div()
326 if (input_rate % div) in stm32_sai_get_clk_div()
329 output_rate, input_rate / div); in stm32_sai_get_clk_div()
331 return div; in stm32_sai_get_clk_div()
335 unsigned int div) in stm32_sai_set_clk_div() argument
340 if (div > SAI_XCR1_MCKDIV_MAX(version)) { in stm32_sai_set_clk_div()
[all …]
/sound/soc/fsl/
Dfsl_asrc.c127 static bool fsl_asrc_divider_avail(int clk_rate, int rate, int *div) in fsl_asrc_divider_avail() argument
132 if (div) in fsl_asrc_divider_avail()
133 *div = 0; in fsl_asrc_divider_avail()
141 if (div) in fsl_asrc_divider_avail()
142 *div = n; in fsl_asrc_divider_avail()
304 static u32 fsl_asrc_cal_asrck_divisor(struct fsl_asrc_pair *pair, u32 div) in fsl_asrc_cal_asrck_divisor() argument
309 for (ps = 0; div > 8; ps++) in fsl_asrc_cal_asrck_divisor()
310 div >>= 1; in fsl_asrc_cal_asrck_divisor()
312 return ((div - 1) << ASRCDRi_AxCPi_WIDTH) | ps; in fsl_asrc_cal_asrck_divisor()
387 u32 clk_index[2], div[2]; in fsl_asrc_config_pair() local
[all …]
Dfsl_mqs.c80 int div, res; in fsl_mqs_hw_params() local
91 div = mclk_rate / (32 * lrclk * 2 * 8); in fsl_mqs_hw_params()
94 if (res == 0 && div > 0 && div <= 256) { in fsl_mqs_hw_params()
97 (div - 1) << mqs_priv->soc->div_shift); in fsl_mqs_hw_params()
/sound/soc/xilinx/
Dxlnx_i2s.c39 int div_id, int div) in xlnx_i2s_set_sclkout_div() argument
43 if (!div || (div & ~I2S_I2STIM_VALID_MASK)) in xlnx_i2s_set_sclkout_div()
48 writel(div, drv_data->base + I2S_I2STIM_OFFSET); in xlnx_i2s_set_sclkout_div()
/sound/pci/
Dsonicvibes.c524 unsigned int div; in snd_sonicvibes_set_adc_rate() local
527 div = 48000 / rate; in snd_sonicvibes_set_adc_rate()
528 if (div > 8) in snd_sonicvibes_set_adc_rate()
529 div = 8; in snd_sonicvibes_set_adc_rate()
530 if ((48000 / div) == rate) { /* use the alternate clock */ in snd_sonicvibes_set_adc_rate()
537 snd_sonicvibes_out1(sonic, SV_IREG_ADC_ALT_RATE, (div - 1) << 4); in snd_sonicvibes_set_adc_rate()
545 unsigned int rate, div, r, m, n; in snd_sonicvibes_hw_constraint_dac_rate() local
550 div = 48000 / rate; in snd_sonicvibes_hw_constraint_dac_rate()
551 if (div > 8) in snd_sonicvibes_hw_constraint_dac_rate()
552 div = 8; in snd_sonicvibes_hw_constraint_dac_rate()
[all …]
/sound/drivers/pcsp/
Dpcsp.c46 int div, min_div, order; in snd_pcsp_create() local
68 div = MAX_DIV / min_div; in snd_pcsp_create()
69 order = fls(div) - 1; in snd_pcsp_create()

1234