vsp1_entity.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * vsp1_entity.h -- R-Car VSP1 Base Entity
  3. *
  4. * Copyright (C) 2013 Renesas Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef __VSP1_ENTITY_H__
  14. #define __VSP1_ENTITY_H__
  15. #include <linux/list.h>
  16. #include <media/v4l2-subdev.h>
  17. struct vsp1_device;
  18. enum vsp1_entity_type {
  19. VSP1_ENTITY_LIF,
  20. VSP1_ENTITY_RPF,
  21. VSP1_ENTITY_UDS,
  22. VSP1_ENTITY_WPF,
  23. };
  24. struct vsp1_entity {
  25. struct vsp1_device *vsp1;
  26. enum vsp1_entity_type type;
  27. unsigned int index;
  28. unsigned int id;
  29. unsigned int route;
  30. struct list_head list_dev;
  31. struct list_head list_pipe;
  32. struct media_pad *pads;
  33. unsigned int source_pad;
  34. struct media_entity *sink;
  35. struct v4l2_subdev subdev;
  36. struct v4l2_mbus_framefmt *formats;
  37. };
  38. static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
  39. {
  40. return container_of(subdev, struct vsp1_entity, subdev);
  41. }
  42. int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
  43. unsigned int num_pads);
  44. void vsp1_entity_destroy(struct vsp1_entity *entity);
  45. extern const struct v4l2_subdev_internal_ops vsp1_subdev_internal_ops;
  46. extern const struct media_entity_operations vsp1_media_ops;
  47. struct v4l2_mbus_framefmt *
  48. vsp1_entity_get_pad_format(struct vsp1_entity *entity,
  49. struct v4l2_subdev_fh *fh,
  50. unsigned int pad, u32 which);
  51. void vsp1_entity_init_formats(struct v4l2_subdev *subdev,
  52. struct v4l2_subdev_fh *fh);
  53. #endif /* __VSP1_ENTITY_H__ */