diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/cec-notifier.h | 10 | ||||
-rw-r--r-- | include/media/lirc_dev.h | 32 | ||||
-rw-r--r-- | include/media/v4l2-async.h | 8 | ||||
-rw-r--r-- | include/media/v4l2-flash-led-class.h | 6 | ||||
-rw-r--r-- | include/media/v4l2-fwnode.h (renamed from include/media/v4l2-of.h) | 96 | ||||
-rw-r--r-- | include/media/v4l2-subdev.h | 5 |
6 files changed, 56 insertions, 101 deletions
diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h index 413335c8cb52..298f996969df 100644 --- a/include/media/cec-notifier.h +++ b/include/media/cec-notifier.h @@ -106,6 +106,16 @@ static inline void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n, { } +static inline void cec_notifier_register(struct cec_notifier *n, + struct cec_adapter *adap, + void (*callback)(struct cec_adapter *adap, u16 pa)) +{ +} + +static inline void cec_notifier_unregister(struct cec_notifier *n) +{ +} + #endif #endif diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index cec7d35602d1..86d15a9b6c01 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h @@ -12,8 +12,6 @@ #define MAX_IRCTL_DEVICES 8 #define BUFLEN 16 -#define mod(n, div) ((n) % (div)) - #include <linux/slab.h> #include <linux/fs.h> #include <linux/ioctl.h> @@ -90,11 +88,6 @@ static inline int lirc_buffer_empty(struct lirc_buffer *buf) return !lirc_buffer_len(buf); } -static inline int lirc_buffer_available(struct lirc_buffer *buf) -{ - return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); -} - static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, unsigned char *dest) { @@ -133,12 +126,6 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, * @buffer_size: Number of FIFO buffers with @chunk_size size. If zero, * creates a buffer with BUFLEN size (16 bytes). * - * @sample_rate: if zero, the device will wait for an event with a new - * code to be parsed. Otherwise, specifies the sample - * rate for polling. Value should be between 0 - * and HZ. If equal to HZ, it would mean one polling per - * second. - * * @features: lirc compatible hardware features, like LIRC_MODE_RAW, * LIRC_CAN\_\*, as defined at include/media/lirc.h. * @@ -153,22 +140,10 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, * @max_timeout: Maximum timeout for record. Valid only if * LIRC_CAN_SET_REC_TIMEOUT is defined. * - * @add_to_buf: add_to_buf will be called after specified period of the - * time or triggered by the external event, this behavior - * depends on value of the sample_rate this function will - * be called in user context. This routine should return - * 0 if data was added to the buffer and -ENODATA if none - * was available. This should add some number of bits - * evenly divisible by code_length to the buffer. - * * @rbuf: if not NULL, it will be used as a read buffer, you will * have to write to the buffer by other means, like irq's * (see also lirc_serial.c). * - * @set_use_inc: set_use_inc will be called after device is opened - * - * @set_use_dec: set_use_dec will be called after device is closed - * * @rdev: Pointed to struct rc_dev associated with the LIRC * device. * @@ -188,7 +163,6 @@ struct lirc_driver { int minor; __u32 code_length; unsigned int buffer_size; /* in chunks holding one code each */ - int sample_rate; __u32 features; unsigned int chunk_size; @@ -196,10 +170,7 @@ struct lirc_driver { void *data; int min_timeout; int max_timeout; - int (*add_to_buf)(void *data, struct lirc_buffer *buf); struct lirc_buffer *rbuf; - int (*set_use_inc)(void *data); - void (*set_use_dec)(void *data); struct rc_dev *rdev; const struct file_operations *fops; struct device *dev; @@ -232,7 +203,4 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length, loff_t *ppos); -ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, - size_t length, loff_t *ppos); - #endif diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h index 8e2a236a4d03..c69d8c8a66d0 100644 --- a/include/media/v4l2-async.h +++ b/include/media/v4l2-async.h @@ -31,7 +31,7 @@ struct v4l2_async_notifier; * v4l2_async_subdev.match ops * @V4L2_ASYNC_MATCH_DEVNAME: Match will use the device name * @V4L2_ASYNC_MATCH_I2C: Match will check for I2C adapter ID and address - * @V4L2_ASYNC_MATCH_OF: Match will use OF node + * @V4L2_ASYNC_MATCH_FWNODE: Match will use firmware node * * This enum is used by the asyncrhronous sub-device logic to define the * algorithm that will be used to match an asynchronous device. @@ -40,7 +40,7 @@ enum v4l2_async_match_type { V4L2_ASYNC_MATCH_CUSTOM, V4L2_ASYNC_MATCH_DEVNAME, V4L2_ASYNC_MATCH_I2C, - V4L2_ASYNC_MATCH_OF, + V4L2_ASYNC_MATCH_FWNODE, }; /** @@ -55,8 +55,8 @@ struct v4l2_async_subdev { enum v4l2_async_match_type match_type; union { struct { - const struct device_node *node; - } of; + struct fwnode_handle *fwnode; + } fwnode; struct { const char *name; } device_name; diff --git a/include/media/v4l2-flash-led-class.h b/include/media/v4l2-flash-led-class.h index b0fe4d6f4a5f..f9dcd54c1745 100644 --- a/include/media/v4l2-flash-led-class.h +++ b/include/media/v4l2-flash-led-class.h @@ -108,7 +108,7 @@ static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c) /** * v4l2_flash_init - initialize V4L2 flash led sub-device * @dev: flash device, e.g. an I2C device - * @of_node: of_node of the LED, may be NULL if the same as device's + * @fwn: fwnode_handle of the LED, may be NULL if the same as device's * @fled_cdev: LED flash class device to wrap * @iled_cdev: LED flash class device representing indicator LED associated * with fled_cdev, may be NULL @@ -122,7 +122,7 @@ static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c) * PTR_ERR() to obtain the numeric return value. */ struct v4l2_flash *v4l2_flash_init( - struct device *dev, struct device_node *of_node, + struct device *dev, struct fwnode_handle *fwn, struct led_classdev_flash *fled_cdev, struct led_classdev_flash *iled_cdev, const struct v4l2_flash_ops *ops, @@ -138,7 +138,7 @@ void v4l2_flash_release(struct v4l2_flash *v4l2_flash); #else static inline struct v4l2_flash *v4l2_flash_init( - struct device *dev, struct device_node *of_node, + struct device *dev, struct fwnode_handle *fwn, struct led_classdev_flash *fled_cdev, struct led_classdev_flash *iled_cdev, const struct v4l2_flash_ops *ops, diff --git a/include/media/v4l2-of.h b/include/media/v4l2-fwnode.h index 4dc34b245d47..ecc1233a873e 100644 --- a/include/media/v4l2-of.h +++ b/include/media/v4l2-fwnode.h @@ -1,5 +1,8 @@ /* - * V4L2 OF binding parsing library + * V4L2 fwnode binding parsing library + * + * Copyright (c) 2016 Intel Corporation. + * Author: Sakari Ailus <sakari.ailus@linux.intel.com> * * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd. * Author: Sylwester Nawrocki <s.nawrocki@samsung.com> @@ -11,20 +14,20 @@ * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. */ -#ifndef _V4L2_OF_H -#define _V4L2_OF_H +#ifndef _V4L2_FWNODE_H +#define _V4L2_FWNODE_H +#include <linux/errno.h> +#include <linux/fwnode.h> #include <linux/list.h> #include <linux/types.h> -#include <linux/errno.h> -#include <linux/of_graph.h> #include <media/v4l2-mediabus.h> -struct device_node; +struct fwnode_handle; /** - * struct v4l2_of_bus_mipi_csi2 - MIPI CSI-2 bus data structure + * struct v4l2_fwnode_bus_mipi_csi2 - MIPI CSI-2 bus data structure * @flags: media bus (V4L2_MBUS_*) flags * @data_lanes: an array of physical data lane indexes * @clock_lane: physical lane index of the clock lane @@ -32,7 +35,7 @@ struct device_node; * @lane_polarities: polarity of the lanes. The order is the same of * the physical lanes. */ -struct v4l2_of_bus_mipi_csi2 { +struct v4l2_fwnode_bus_mipi_csi2 { unsigned int flags; unsigned char data_lanes[4]; unsigned char clock_lane; @@ -41,88 +44,61 @@ struct v4l2_of_bus_mipi_csi2 { }; /** - * struct v4l2_of_bus_parallel - parallel data bus data structure + * struct v4l2_fwnode_bus_parallel - parallel data bus data structure * @flags: media bus (V4L2_MBUS_*) flags * @bus_width: bus width in bits * @data_shift: data shift in bits */ -struct v4l2_of_bus_parallel { +struct v4l2_fwnode_bus_parallel { unsigned int flags; unsigned char bus_width; unsigned char data_shift; }; /** - * struct v4l2_of_endpoint - the endpoint data structure - * @base: struct of_endpoint containing port, id, and local of_node + * struct v4l2_fwnode_endpoint - the endpoint data structure + * @base: fwnode endpoint of the v4l2_fwnode * @bus_type: bus type * @bus: bus configuration data structure * @link_frequencies: array of supported link frequencies * @nr_of_link_frequencies: number of elements in link_frequenccies array */ -struct v4l2_of_endpoint { - struct of_endpoint base; - /* Fields below this line will be zeroed by v4l2_of_parse_endpoint() */ +struct v4l2_fwnode_endpoint { + struct fwnode_endpoint base; + /* + * Fields below this line will be zeroed by + * v4l2_fwnode_parse_endpoint() + */ enum v4l2_mbus_type bus_type; union { - struct v4l2_of_bus_parallel parallel; - struct v4l2_of_bus_mipi_csi2 mipi_csi2; + struct v4l2_fwnode_bus_parallel parallel; + struct v4l2_fwnode_bus_mipi_csi2 mipi_csi2; } bus; u64 *link_frequencies; unsigned int nr_of_link_frequencies; }; /** - * struct v4l2_of_link - a link between two endpoints + * struct v4l2_fwnode_link - a link between two endpoints * @local_node: pointer to device_node of this endpoint * @local_port: identifier of the port this endpoint belongs to * @remote_node: pointer to device_node of the remote endpoint * @remote_port: identifier of the port the remote endpoint belongs to */ -struct v4l2_of_link { - struct device_node *local_node; +struct v4l2_fwnode_link { + struct fwnode_handle *local_node; unsigned int local_port; - struct device_node *remote_node; + struct fwnode_handle *remote_node; unsigned int remote_port; }; -#ifdef CONFIG_OF -int v4l2_of_parse_endpoint(const struct device_node *node, - struct v4l2_of_endpoint *endpoint); -struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint( - const struct device_node *node); -void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint); -int v4l2_of_parse_link(const struct device_node *node, - struct v4l2_of_link *link); -void v4l2_of_put_link(struct v4l2_of_link *link); -#else /* CONFIG_OF */ - -static inline int v4l2_of_parse_endpoint(const struct device_node *node, - struct v4l2_of_endpoint *link) -{ - return -ENOSYS; -} - -static inline struct v4l2_of_endpoint *v4l2_of_alloc_parse_endpoint( - const struct device_node *node) -{ - return NULL; -} - -static inline void v4l2_of_free_endpoint(struct v4l2_of_endpoint *endpoint) -{ -} - -static inline int v4l2_of_parse_link(const struct device_node *node, - struct v4l2_of_link *link) -{ - return -ENOSYS; -} - -static inline void v4l2_of_put_link(struct v4l2_of_link *link) -{ -} - -#endif /* CONFIG_OF */ +int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, + struct v4l2_fwnode_endpoint *vep); +struct v4l2_fwnode_endpoint *v4l2_fwnode_endpoint_alloc_parse( + struct fwnode_handle *fwnode); +void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep); +int v4l2_fwnode_parse_link(struct fwnode_handle *fwnode, + struct v4l2_fwnode_link *link); +void v4l2_fwnode_put_link(struct v4l2_fwnode_link *link); -#endif /* _V4L2_OF_H */ +#endif /* _V4L2_FWNODE_H */ diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 0ab1c5df6fac..a40760174797 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -787,7 +787,8 @@ struct v4l2_subdev_platform_data { * is attached. * @devnode: subdev device node * @dev: pointer to the physical device, if any - * @of_node: The device_node of the subdev, usually the same as dev->of_node. + * @fwnode: The fwnode_handle of the subdev, usually the same as + * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL). * @async_list: Links this subdev to a global subdev_list or @notifier->done * list. * @asd: Pointer to respective &struct v4l2_async_subdev. @@ -818,7 +819,7 @@ struct v4l2_subdev { void *host_priv; struct video_device *devnode; struct device *dev; - struct device_node *of_node; + struct fwnode_handle *fwnode; struct list_head async_list; struct v4l2_async_subdev *asd; struct v4l2_async_notifier *notifier; |