cx25821-biffuncs.h 565 B

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for the Conexant CX25821 PCIe bridge
  4. *
  5. * Copyright (C) 2009 Conexant Systems Inc.
  6. * Authors <[email protected]>, <[email protected]>
  7. */
  8. #ifndef _BITFUNCS_H
  9. #define _BITFUNCS_H
  10. #define SetBit(Bit) (1 << Bit)
  11. static inline u8 getBit(u32 sample, u8 index)
  12. {
  13. return (u8) ((sample >> index) & 1);
  14. }
  15. static inline u32 clearBitAtPos(u32 value, u8 bit)
  16. {
  17. return value & ~(1 << bit);
  18. }
  19. static inline u32 setBitAtPos(u32 sample, u8 bit)
  20. {
  21. sample |= (1 << bit);
  22. return sample;
  23. }
  24. #endif