Commit graph

22 commits

Author SHA1 Message Date
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Tomasz Bursztyka 97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
Carles Cufi 9ba20dd48e drivers: audio: Port to the new timeout API
Port the I2S and DMIC drivers to the new timeout API so that they do
not need to enable legacy timeouts.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Anas Nashif 5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 46a5d1e5cb cleanup: include/: move dma.h to drivers/dma.h
move dma.h to drivers/dma.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Sathish Kuttan d143982129 drivers: i2s_cavs: replace cache operation macros
Replace local macros for cache invalidation and flush operations
with macros from soc.h

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-20 07:33:11 -05:00
Sathish Kuttan b72f5fd033 drivers: i2s_cavs: fix for I2S start after stop
Fixed an issue I2S wouldn't resume when started after a stop
Added code to empty the TX/RX FIFOs upon stop
TX stop is achieved by letting FIFO underrun, then changing state in ISR
RX FIFO is read until empty when RX is stopped

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-04 00:52:15 -05:00
Sathish Kuttan d835714de3 drivers: i2s_cavs: macros for object instantiation
Add macros to define and instantiate driver objects
for multiple instances

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-04 00:52:15 -05:00
Sathish Kuttan 6ff32c7877 drivers: i2s_cavs: reduce buffer queue length
Reduce the length of internal buffer queue from 4 down to 2.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-04 00:52:15 -05:00
Patrik Flykt 8ff96b5a57 drivers: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Sathish Kuttan 7e3a457308 drivers: i2s_cavs: Add bidirectional I2S support
Added bidirectional I2S support for Intel S1000

- Added implementation for I2S receive mode
- Extended driver instances to support 3 I2S ports
- Added DMA channel mappings for upto 4 I2S ports
- Utilized k_msgq to track buffers through the driver
    - Allocate buffers for audio reception in the driver
    - Free buffers after audio transmission in the driver
- Perform buffer reload for DMA after every reception/transmission
- Removed unused Kconfig variables
    - I2S_CAVS_TX_BLOCK_COUNT
    - I2S_CAVS_RX_BLOCK_COUNT

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-11-05 08:48:36 -05:00
Daniel Leung d70eb98537 i2s: i2s_cavs: fix dma_tx_callback function signature
The dma_tx_callback() function signature is different than the one
required by struct dma_config. So change the signature to fix
a compiler warning.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-10-31 22:04:20 -04:00
Anas Nashif a5ae1af615 drivers: i2s_cavs: fix syntax using uncrustify
After changing the logger, run uncrustify to update syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Anas Nashif a66967b0f2 driver: i2s: move to new logger
Move drivers to new logger and change samples enabling logging in
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Flavio Ceolin da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Sathish Kuttan dc88fa6aa0 drivers: i2s_cavs: Remove resource owner config
Remove I2S resource ownership configuration.
Such configuration will be done in an SoC level
initialization routine

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-08-19 11:06:09 -07:00
Sathish Kuttan 9f4702b3b4 arch: soc: intel_s1000: set M/N divider ownership
Add bit definitions and set M/N divider ownership in
i2s_initialize.
Changes to comply with coding guidelines
Changes to address review comments

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-06-01 08:59:01 -04:00
Sathish Kuttan f36edc6c29 drivers: i2s: intel_s1000: Fractional bit-clock
Added support for fractional division of reference clock to obtain
I2S bit clocks
For example:
    If reference clock is 38.4MHz and
    if the I2S format is 2ch, 32bits per channel, 48KHz sample rate,
    the bit clock frequency has to be 2*32*48K = 3.072MHz
    38.4MHz/3.072MHz = 12.5 (a fraction)

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2018-06-01 08:59:01 -04:00
Kumar Gala f245ef2aeb drivers: i2s: i2s_cavs: Fix typo in IRQ priority
The driver was using CONFIG_I2S_1_IRQ_PRI which doesn't exist.  It
should use CONFIG_I2S_CAVS_1_IRQ_PRI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-25 08:04:47 -05:00
Rajavardhan Gundi 5b6f02442b drivers: i2s: introduce CAVS I2S
Implements the driver for Intel CAVS I2S. Only Playback
is currently supported.

Change-Id: I7b816f9736dc35e79a81d3664d6405dc0aac15b4
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00