]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/media/v4l2-subdev.h
V4L/DVB: v4l2_subdev: Get rid of now unused IR pulse width defines
[karo-tx-linux.git] / include / media / v4l2-subdev.h
index 02c6f4d11ed3654d76e2908983b26353361d2b1a..08880dd15d2fe6582865633f297a5e0293becf82 100644 (file)
@@ -90,10 +90,31 @@ struct v4l2_decode_vbi_line {
    not yet implemented) since ops provide proper type-checking.
  */
 
+/* Subdevice external IO pin configuration */
+#define V4L2_SUBDEV_IO_PIN_DISABLE     (1 << 0) /* ENABLE assumed */
+#define V4L2_SUBDEV_IO_PIN_OUTPUT      (1 << 1)
+#define V4L2_SUBDEV_IO_PIN_INPUT       (1 << 2)
+#define V4L2_SUBDEV_IO_PIN_SET_VALUE   (1 << 3) /* Set output value */
+#define V4L2_SUBDEV_IO_PIN_ACTIVE_LOW  (1 << 4) /* ACTIVE HIGH assumed */
+
+struct v4l2_subdev_io_pin_config {
+       u32 flags;      /* V4L2_SUBDEV_IO_PIN_* flags for this pin's config */
+       u8 pin;         /* Chip external IO pin to configure */
+       u8 function;    /* Internal signal pad/function to route to IO pin */
+       u8 value;       /* Initial value for pin - e.g. GPIO output value */
+       u8 strength;    /* Pin drive strength */
+};
+
 /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*
        functions after the v4l2_subdev was registered. It is used to pass
        platform data to the subdev which can be used during initialization.
 
+   s_io_pin_config: configure one or more chip I/O pins for chips that
+       multiplex different internal signal pads out to IO pins.  This function
+       takes a pointer to an array of 'n' pin configuration entries, one for
+       each pin being configured.  This function could be called at times
+       other than just subdevice initialization.
+
    init: initialize the sensor registors to some sort of reasonable default
        values. Do not use for new drivers and should be removed in existing
        drivers.
@@ -110,11 +131,18 @@ struct v4l2_decode_vbi_line {
 
    s_power: puts subdevice in power saving mode (on == 0) or normal operation
        mode (on == 1).
+
+   interrupt_service_routine: Called by the bridge chip's interrupt service
+       handler, when an interrupt status has be raised due to this subdev,
+       so that this subdev can handle the details.  It may schedule work to be
+       performed later.  It must not sleep.  *Called from an IRQ context*.
  */
 struct v4l2_subdev_core_ops {
        int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
        int (*log_status)(struct v4l2_subdev *sd);
        int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
+       int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
+                                     struct v4l2_subdev_io_pin_config *pincfg);
        int (*init)(struct v4l2_subdev *sd, u32 val);
        int (*load_fw)(struct v4l2_subdev *sd);
        int (*reset)(struct v4l2_subdev *sd, u32 val);
@@ -133,6 +161,8 @@ struct v4l2_subdev_core_ops {
        int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
 #endif
        int (*s_power)(struct v4l2_subdev *sd, int on);
+       int (*interrupt_service_routine)(struct v4l2_subdev *sd,
+                                               u32 status, bool *handled);
 };
 
 /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
@@ -307,11 +337,6 @@ struct v4l2_subdev_sensor_ops {
 };
 
 /*
-   interrupt_service_routine: Called by the bridge chip's interrupt service
-       handler, when an IR interrupt status has be raised due to this subdev,
-       so that this subdev can handle the details.  It may schedule work to be
-       performed later.  It must not sleep.  *Called from an IRQ context*.
-
    [rt]x_g_parameters: Get the current operating parameters and state of the
        the IR receiver or transmitter.
 
@@ -335,14 +360,9 @@ struct v4l2_subdev_sensor_ops {
  */
 
 enum v4l2_subdev_ir_mode {
-       V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* space & mark widths in nanosecs */
+       V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* uses struct ir_raw_event records */
 };
 
-/* Data format of data read or written for V4L2_SUBDEV_IR_MODE_PULSE_WIDTH */
-#define V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS      0x7fffffff
-#define V4L2_SUBDEV_IR_PULSE_LEVEL_MASK                0x80000000
-#define V4L2_SUBDEV_IR_PULSE_RX_SEQ_END                0xffffffff
-
 struct v4l2_subdev_ir_parameters {
        /* Either Rx or Tx */
        unsigned int bytes_per_data_element; /* of data in read or write call */
@@ -356,7 +376,10 @@ struct v4l2_subdev_ir_parameters {
        u32 max_pulse_width;       /* ns,      valid only for baseband signal */
        unsigned int carrier_freq; /* Hz,      valid only for modulated signal*/
        unsigned int duty_cycle;   /* percent, valid only for modulated signal*/
-       bool invert;               /* logically invert sense of mark/space */
+       bool invert_level;         /* invert signal level */
+
+       /* Tx only */
+       bool invert_carrier_sense; /* Send 0/space as a carrier burst */
 
        /* Rx only */
        u32 noise_filter_min_width;       /* ns, min time of a valid pulse */
@@ -366,10 +389,6 @@ struct v4l2_subdev_ir_parameters {
 };
 
 struct v4l2_subdev_ir_ops {
-       /* Common to receiver and transmitter */
-       int (*interrupt_service_routine)(struct v4l2_subdev *sd,
-                                               u32 status, bool *handled);
-
        /* Receiver */
        int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
                                ssize_t *num);