~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/atmel/atmel_ssc_dai.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * atmel_ssc_dai.h - ALSA SSC interface for the Atmel  SoC
  4  *
  5  * Copyright (C) 2005 SAN People
  6  * Copyright (C) 2008 Atmel
  7  *
  8  * Author: Sedji Gaouaou <sedji.gaouaou@atmel.com>
  9  *         ATMEL CORP.
 10  *
 11  * Based on at91-ssc.c by
 12  * Frank Mandarino <fmandarino@endrelia.com>
 13  * Based on pxa2xx Platform drivers by
 14  * Liam Girdwood <lrg@slimlogic.co.uk>
 15  */
 16 
 17 #ifndef _ATMEL_SSC_DAI_H
 18 #define _ATMEL_SSC_DAI_H
 19 
 20 #include <linux/types.h>
 21 #include <linux/atmel-ssc.h>
 22 
 23 #include "atmel-pcm.h"
 24 
 25 /* SSC system clock ids */
 26 #define ATMEL_SYSCLK_MCK        0 /* SSC uses AT91 MCK as system clock */
 27 
 28 /* SSC divider ids */
 29 #define ATMEL_SSC_CMR_DIV       0 /* MCK divider for BCLK */
 30 #define ATMEL_SSC_TCMR_PERIOD   1 /* BCLK divider for transmit FS */
 31 #define ATMEL_SSC_RCMR_PERIOD   2 /* BCLK divider for receive FS */
 32 /*
 33  * SSC direction masks
 34  */
 35 #define SSC_DIR_MASK_UNUSED     0
 36 #define SSC_DIR_MASK_PLAYBACK   1
 37 #define SSC_DIR_MASK_CAPTURE    2
 38 
 39 /*
 40  * SSC register values that Atmel left out of <linux/atmel-ssc.h>.  These
 41  * are expected to be used with SSC_BF
 42  */
 43 /* START bit field values */
 44 #define SSC_START_CONTINUOUS    0
 45 #define SSC_START_TX_RX         1
 46 #define SSC_START_LOW_RF        2
 47 #define SSC_START_HIGH_RF       3
 48 #define SSC_START_FALLING_RF    4
 49 #define SSC_START_RISING_RF     5
 50 #define SSC_START_LEVEL_RF      6
 51 #define SSC_START_EDGE_RF       7
 52 #define SSS_START_COMPARE_0     8
 53 
 54 /* CKI bit field values */
 55 #define SSC_CKI_FALLING         0
 56 #define SSC_CKI_RISING          1
 57 
 58 /* CKO bit field values */
 59 #define SSC_CKO_NONE            0
 60 #define SSC_CKO_CONTINUOUS      1
 61 #define SSC_CKO_TRANSFER        2
 62 
 63 /* CKS bit field values */
 64 #define SSC_CKS_DIV             0
 65 #define SSC_CKS_CLOCK           1
 66 #define SSC_CKS_PIN             2
 67 
 68 /* FSEDGE bit field values */
 69 #define SSC_FSEDGE_POSITIVE     0
 70 #define SSC_FSEDGE_NEGATIVE     1
 71 
 72 /* FSOS bit field values */
 73 #define SSC_FSOS_NONE           0
 74 #define SSC_FSOS_NEGATIVE       1
 75 #define SSC_FSOS_POSITIVE       2
 76 #define SSC_FSOS_LOW            3
 77 #define SSC_FSOS_HIGH           4
 78 #define SSC_FSOS_TOGGLE         5
 79 
 80 #define START_DELAY             1
 81 
 82 struct atmel_ssc_state {
 83         u32 ssc_cmr;
 84         u32 ssc_rcmr;
 85         u32 ssc_rfmr;
 86         u32 ssc_tcmr;
 87         u32 ssc_tfmr;
 88         u32 ssc_sr;
 89         u32 ssc_imr;
 90 };
 91 
 92 
 93 struct atmel_ssc_info {
 94         char *name;
 95         struct ssc_device *ssc;
 96         unsigned short dir_mask;        /* 0=unused, 1=playback, 2=capture */
 97         unsigned short initialized;     /* true if SSC has been initialized */
 98         unsigned short daifmt;
 99         unsigned short cmr_div;
100         unsigned short tcmr_period;
101         unsigned short rcmr_period;
102         unsigned int forced_divider;
103         struct atmel_pcm_dma_params *dma_params[2];
104         struct atmel_ssc_state ssc_state;
105         unsigned long mck_rate;
106 };
107 
108 int atmel_ssc_set_audio(int ssc_id);
109 void atmel_ssc_put_audio(int ssc_id);
110 
111 #endif /* _AT91_SSC_DAI_H */
112 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php