gdm_endian.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef __GDM_ENDIAN_H__
  14. #define __GDM_ENDIAN_H__
  15. #include <linux/types.h>
  16. enum {
  17. ENDIANNESS_MIN = 0,
  18. ENDIANNESS_UNKNOWN,
  19. ENDIANNESS_LITTLE,
  20. ENDIANNESS_BIG,
  21. ENDIANNESS_MIDDLE,
  22. ENDIANNESS_MAX
  23. };
  24. struct gdm_endian {
  25. u8 dev_ed;
  26. };
  27. void gdm_set_endian(struct gdm_endian *ed, u8 dev_endian);
  28. u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x);
  29. u16 gdm_dev16_to_cpu(struct gdm_endian *ed, u16 x);
  30. u32 gdm_cpu_to_dev32(struct gdm_endian *ed, u32 x);
  31. u32 gdm_dev32_to_cpu(struct gdm_endian *ed, u32 x);
  32. #endif /*__GDM_ENDIAN_H__*/