CHROMIUM: ALSA: ASoC: exynos hdmi - disable audio in DVI mode
[cascardo/linux.git] / drivers / platform / chromeos.h
1 /*
2  *  Copyright (C) 2011 The Chromium OS Authors
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18 #ifndef _DRIVERS_PLATFORM_CHROMEOS_H
19 #define _DRIVERS_PLATFORM_CHROMEOS_H
20
21 #define MAX_VBOOT_CONTEXT_BUFFER_SIZE 64  /* Should be enough for anything. */
22
23 #ifdef CONFIG_ACPI_CHROMEOS
24 extern int chromeos_legacy_set_need_recovery(void);
25 #else
26 static inline int chromeos_legacy_set_need_recovery(void) { return -ENODEV; }
27 #endif
28
29 struct chromeos_vbc {
30         /**
31          * Read vboot context to buffer
32          *
33          * @param buf           Pointer to buffer for storing vboot context
34          * @param count         Size of buffer
35          * @return      on success, the number of bytes read is returned and
36          *              on error, -err is returned.
37          */
38         ssize_t (*read)(void *buf, size_t count);
39
40         /**
41          * Write vboot context from buffer
42          *
43          * @param buf           Pointer to buffer of new vboot context content
44          * @param count         Size of buffer
45          * @return      on success, the number of bytes written is returned and
46          *              on error, -err is returned.
47          */
48         ssize_t (*write)(const void *buf, size_t count);
49
50         const char *name;
51 };
52
53 /**
54  * Register chromeos_vbc callbacks.
55  *
56  * @param chromeos_vbc  Pointer to struct holding callbacks
57  * @return      on success, return 0, on error, -err is returned.
58  */
59 int chromeos_vbc_register(struct chromeos_vbc *chromeos_vbc);
60
61 #endif /* _DRIVERS_PLATFORM_CHROMEOS_H */