Lines Matching refs:pdm
21 #include "pdm-decim-fir.h"
159 /* Check for sane pdm clock, min 100 kHz, max ioclk/2 */
162 fprintf(stderr, "find_modes(): pdm clock max not in range\n");
167 fprintf(stderr, "find_modes(): pdm clock min not in range\n");
178 fprintf(stderr, "find_modes(): pdm clock min not in range\n");
183 fprintf(stderr, "find_modes(): pdm clock max not in range\n");
552 int pdm[DMIC_HW_CONTROLLERS];
555 /* Loop number of PDM controllers in the configuration. If mic A or B is enabled then a pdm
559 if (dmic->dmic_prm[di].pdm[i].enable_mic_a ||
560 dmic->dmic_prm[di].pdm[i].enable_mic_b)
561 pdm[i] = 1;
563 pdm[i] = 0;
566 /* Set IPM to match active pdm controllers. */
569 if (pdm[0] == 0 && pdm[1] > 0)
572 if (pdm[0] > 0 && pdm[1] > 0)
579 int pdm[DMIC_HW_CONTROLLERS];
586 /* Loop number of PDM controllers in the configuration. If mic A or B is enabled then a pdm
588 * enabled pdm controllers to be used for IPM configuration.
591 if (dmic->dmic_prm[di].pdm[i].enable_mic_a ||
592 dmic->dmic_prm[di].pdm[i].enable_mic_b) {
593 pdm[i] = 1;
597 pdm[i] = 0;
601 /* IPM bit field is set to count of active pdm controllers. */
602 *ipm = pdm[0];
604 *ipm += pdm[i];
620 if (dmic->dmic_prm[0].pdm[i].enable_mic_a ||
621 dmic->dmic_prm[1].pdm[i].enable_mic_a)
624 if (dmic->dmic_prm[0].pdm[i].enable_mic_b ||
625 dmic->dmic_prm[1].pdm[i].enable_mic_b)
633 swap[i] = (dmic->dmic_prm[0].pdm[i].enable_mic_b ||
634 dmic->dmic_prm[1].pdm[i].enable_mic_b) && !cnt;
637 swap_check = (dmic->dmic_prm[1].pdm[i].enable_mic_a ||
638 dmic->dmic_prm[0].pdm[i].enable_mic_a);
684 * ts_group array index corresponds to dmic hw fifos, that gather audio samples from pdm
685 * controllers. 1 pdm controller can host 2 mono dmics and usually pdm controllers are
691 * mapping the pdm channels arbitrarely into hw fifos, however currently it is used as
694 * if we have 2 dmics (stereo) it means we are using 1 pdm controller with possibly 2 hw
705 * if we have 4 dmics, it means we are using 2 pdm controller with possibly 2 x 4 channel hw
721 * channel_pdm_mask defines which existing pdm controllers will be taken into use. So if
722 * either of mic a or b is enabled -> that particular pdm controller is in use. For example
725 * channel_ctrl_mask defines what mic channels are available in hw for a pdm controller. in
726 * theory pdm controller could have only 1 channel enabled, in practice there's always 2
732 if (dmic->dmic_prm[di].pdm[i].enable_mic_a) {
737 if (dmic->dmic_prm[di].pdm[i].enable_mic_b) {
744 /* set channel_pdm_mask to describe what pdm controllers are in use */
831 CIC_CONTROL_MIC_B_POLARITY(dmic->dmic_prm[di].pdm[i].polarity_mic_b) |
832 CIC_CONTROL_MIC_A_POLARITY(dmic->dmic_prm[di].pdm[i].polarity_mic_a) |
848 edge = dmic->dmic_prm[di].pdm[i].clk_edge;
853 MIC_CONTROL_PDM_SKEW(dmic->dmic_prm[di].pdm[i].skew) |
1056 /* check all pdm's for enabled mics */
1058 if (dmic->dmic_prm[index].pdm[0].enable_mic_a)
1061 if (dmic->dmic_prm[index].pdm[0].enable_mic_b)
1064 if (dmic->dmic_prm[index].pdm[1].enable_mic_a)
1067 if (dmic->dmic_prm[index].pdm[1].enable_mic_b)
1134 /* variable amount of pdm's */
1136 /* only copy the pdm data if it is enabled */
1186 /* variable amount of pdm's */
1188 /* only copy the pdm data if it is enabled */
1192 /* top level struct first pdm data */
1197 /* top level struct first pdm data first fir */
1202 /* top level struct first pdm data second fir */
1270 dmic->dmic_prm[di].pdm[pdm_index].enable_mic_a = enable_a;
1271 dmic->dmic_prm[di].pdm[pdm_index].enable_mic_b = enable_b;
1272 dmic->dmic_prm[di].pdm[pdm_index].polarity_mic_a = polarity_a;
1273 dmic->dmic_prm[di].pdm[pdm_index].polarity_mic_b = polarity_b;
1274 dmic->dmic_prm[di].pdm[pdm_index].clk_edge = clk_edge;
1275 dmic->dmic_prm[di].pdm[pdm_index].skew = skew;