162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * rt5677-spi.h  --  RT5677 ALSA SoC audio codec driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright 2013 Realtek Semiconductor Corp.
662306a36Sopenharmony_ci * Author: Oder Chiou <oder_chiou@realtek.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __RT5677_SPI_H__
1062306a36Sopenharmony_ci#define __RT5677_SPI_H__
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
1362306a36Sopenharmony_ciint rt5677_spi_read(u32 addr, void *rxbuf, size_t len);
1462306a36Sopenharmony_ciint rt5677_spi_write(u32 addr, const void *txbuf, size_t len);
1562306a36Sopenharmony_ciint rt5677_spi_write_firmware(u32 addr, const struct firmware *fw);
1662306a36Sopenharmony_civoid rt5677_spi_hotword_detected(void);
1762306a36Sopenharmony_ci#else
1862306a36Sopenharmony_cistatic inline int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
1962306a36Sopenharmony_ci{
2062306a36Sopenharmony_ci	return -EINVAL;
2162306a36Sopenharmony_ci}
2262306a36Sopenharmony_cistatic inline int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
2362306a36Sopenharmony_ci{
2462306a36Sopenharmony_ci	return -EINVAL;
2562306a36Sopenharmony_ci}
2662306a36Sopenharmony_cistatic inline int rt5677_spi_write_firmware(u32 addr, const struct firmware *fw)
2762306a36Sopenharmony_ci{
2862306a36Sopenharmony_ci	return -EINVAL;
2962306a36Sopenharmony_ci}
3062306a36Sopenharmony_cistatic inline void rt5677_spi_hotword_detected(void){}
3162306a36Sopenharmony_ci#endif
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#endif /* __RT5677_SPI_H__ */
34