virtio_clk.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef _LINUX_VIRTIO_CLK_H
  6. #define _LINUX_VIRTIO_CLK_H
  7. #include <linux/types.h>
  8. #include <linux/virtio_ids.h>
  9. #include <linux/virtio_config.h>
  10. #include <linux/virtio_types.h>
  11. /* Virtio ID of clock */
  12. #ifdef VIRTIO_ID_CLOCK
  13. #undef VIRTIO_ID_CLOCK
  14. #endif
  15. /* Virtio ID of clock : 0xC000 */
  16. #define VIRTIO_ID_CLOCK 49152
  17. /* Feature bits */
  18. #define VIRTIO_CLK_F_RESET 1 /* Support reset */
  19. #define VIRTIO_CLK_F_NAME 2 /* Support clock name */
  20. /* Configuration layout */
  21. struct virtio_clk_config {
  22. __u32 num_clks;
  23. __u32 num_resets;
  24. __u8 name[20];
  25. } __packed;
  26. /* Request/response message format */
  27. struct virtio_clk_msg {
  28. u8 name[40];
  29. __virtio32 id;
  30. __virtio32 type;
  31. __virtio32 result;
  32. __virtio32 data[4];
  33. };
  34. /* Request type */
  35. #define VIRTIO_CLK_T_ENABLE 0
  36. #define VIRTIO_CLK_T_DISABLE 1
  37. #define VIRTIO_CLK_T_SET_RATE 2
  38. #define VIRTIO_CLK_T_GET_RATE 3
  39. #define VIRTIO_CLK_T_ROUND_RATE 4
  40. #define VIRTIO_CLK_T_RESET 5
  41. #define VIRTIO_CLK_T_SET_FLAGS 6
  42. #define VIRTIO_CLK_T_SET_PARENT 8
  43. #endif /* _LINUX_VIRTIO_CLK_H */