Rajeshwari Shinde | 511ed5f | 2012-10-25 19:49:22 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Samsung Electronics |
| 3 | * R. Chandrasekar < rcsekar@samsung.com> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Rajeshwari Shinde | 511ed5f | 2012-10-25 19:49:22 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __SOUND_H__ |
| 9 | #define __SOUND_H__ |
| 10 | |
| 11 | /* sound codec enum */ |
| 12 | enum en_sound_codec { |
| 13 | CODEC_WM_8994, |
| 14 | CODEC_WM_8995, |
Rajeshwari Shinde | 14d2dfc | 2013-02-14 19:46:13 +0000 | [diff] [blame] | 15 | CODEC_MAX_98095, |
Rajeshwari Shinde | 511ed5f | 2012-10-25 19:49:22 +0000 | [diff] [blame] | 16 | CODEC_MAX |
| 17 | }; |
| 18 | |
| 19 | /* sound codec enum */ |
| 20 | enum sound_compat { |
| 21 | AUDIO_COMPAT_SPI, |
| 22 | AUDIO_COMPAT_I2C, |
| 23 | }; |
| 24 | |
| 25 | /* Codec information structure to store the info from device tree */ |
| 26 | struct sound_codec_info { |
| 27 | int i2c_bus; |
| 28 | int i2c_dev_addr; |
| 29 | enum en_sound_codec codec_type; |
| 30 | }; |
| 31 | |
| 32 | /* |
| 33 | * Initialises audio sub system |
Rajeshwari Shinde | f482310 | 2012-12-26 20:03:17 +0000 | [diff] [blame] | 34 | * @param blob Pointer of device tree node or NULL if none. |
Rajeshwari Shinde | 511ed5f | 2012-10-25 19:49:22 +0000 | [diff] [blame] | 35 | * @return int value 0 for success, -1 for error |
| 36 | */ |
Rajeshwari Shinde | f482310 | 2012-12-26 20:03:17 +0000 | [diff] [blame] | 37 | int sound_init(const void *blob); |
Rajeshwari Shinde | 511ed5f | 2012-10-25 19:49:22 +0000 | [diff] [blame] | 38 | |
| 39 | /* |
| 40 | * plays the pcm data buffer in pcm_data.h through i2s1 to make the |
| 41 | * sine wave sound |
| 42 | * |
| 43 | * @return int 0 for success, -1 for error |
| 44 | */ |
| 45 | int sound_play(uint32_t msec, uint32_t frequency); |
| 46 | |
| 47 | #endif /* __SOUND__H__ */ |