Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * rt5677-spi.h  --  RT5677 ALSA SoC audio codec driver
0004  *
0005  * Copyright 2013 Realtek Semiconductor Corp.
0006  * Author: Oder Chiou <oder_chiou@realtek.com>
0007  */
0008 
0009 #ifndef __RT5677_SPI_H__
0010 #define __RT5677_SPI_H__
0011 
0012 #if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
0013 int rt5677_spi_read(u32 addr, void *rxbuf, size_t len);
0014 int rt5677_spi_write(u32 addr, const void *txbuf, size_t len);
0015 int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw);
0016 void rt5677_spi_hotword_detected(void);
0017 #else
0018 static inline int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
0019 {
0020     return -EINVAL;
0021 }
0022 static inline int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
0023 {
0024     return -EINVAL;
0025 }
0026 static inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw)
0027 {
0028     return -EINVAL;
0029 }
0030 static inline void rt5677_spi_hotword_detected(void){}
0031 #endif
0032 
0033 #endif /* __RT5677_SPI_H__ */