Won Kang | 61e1210 | 2013-07-25 03:36:17 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. |
| 3 | * |
| 4 | * This software is licensed under the terms of the GNU General Public |
| 5 | * License version 2, as published by the Free Software Foundation, and |
| 6 | * may be copied, distributed, and modified under those terms. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __GDM_ENDIAN_H__ |
| 15 | #define __GDM_ENDIAN_H__ |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | |
Won Kang | 61e1210 | 2013-07-25 03:36:17 +0900 | [diff] [blame] | 19 | enum { |
| 20 | ENDIANNESS_MIN = 0, |
| 21 | ENDIANNESS_UNKNOWN, |
| 22 | ENDIANNESS_LITTLE, |
| 23 | ENDIANNESS_BIG, |
| 24 | ENDIANNESS_MIDDLE, |
| 25 | ENDIANNESS_MAX |
| 26 | }; |
| 27 | |
| 28 | struct gdm_endian { |
| 29 | u8 dev_ed; |
Won Kang | 61e1210 | 2013-07-25 03:36:17 +0900 | [diff] [blame] | 30 | }; |
| 31 | |
Won Kang | 9c02d0d | 2013-07-27 15:42:18 +0900 | [diff] [blame] | 32 | void gdm_set_endian(struct gdm_endian *ed, u8 dev_endian); |
Won Kang | 61e1210 | 2013-07-25 03:36:17 +0900 | [diff] [blame] | 33 | u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x); |
| 34 | u16 gdm_dev16_to_cpu(struct gdm_endian *ed, u16 x); |
| 35 | u32 gdm_cpu_to_dev32(struct gdm_endian *ed, u32 x); |
| 36 | u32 gdm_dev32_to_cpu(struct gdm_endian *ed, u32 x); |
| 37 | |
| 38 | #endif /*__GDM_ENDIAN_H__*/ |