Merge tag 'media/v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - new framework support for HDMI CEC and remote control support

 - new encoding codec driver for Mediatek SoC

 - new frontend driver: helene tuner

 - added support for NetUp almost universal devices, with supports
   DVB-C/S/S2/T/T2 and ISDB-T

 - the mn88472 frontend driver got promoted from staging

 - a new driver for RCar video input

 - some soc_camera legacy drivers got removed: timb, omap1, mx2, mx3

 - lots of driver cleanups, improvements and fixups

* tag 'media/v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (377 commits)
  [media] cec: always check all_device_types and features
  [media] cec: poll should check if there is room in the tx queue
  [media] vivid: support monitor all mode
  [media] cec: fix test for unconfigured adapter in main message loop
  [media] cec: limit the size of the transmit queue
  [media] cec: zero unused msg part after msg->len
  [media] cec: don't set fh to NULL in CEC_TRANSMIT
  [media] cec: clear all status fields before transmit and always fill in sequence
  [media] cec: CEC_RECEIVE overwrote the timeout field
  [media] cxd2841er: Reading SNR for DVB-C added
  [media] cxd2841er: Reading BER and UCB for DVB-C added
  [media] cxd2841er: fix switch-case for DVB-C
  [media] cxd2841er: fix signal strength scale for ISDB-T
  [media] cxd2841er: adjust the dB scale for DVB-C
  [media] cxd2841er: provide signal strength for DVB-C
  [media] cxd2841er: fix BER report via DVBv5 stats API
  [media] mb86a20s: apply mask to val after checking for read failure
  [media] airspy: fix error logic during device register
  [media] s5p-cec/TODO: add TODO item
  [media] cec/TODO: drop comment about sphinx documentation
  ...
This commit is contained in:
Linus Torvalds
2016-07-26 18:59:59 -07:00
446 changed files with 28797 additions and 11198 deletions

1899
include/linux/cec-funcs.h Normal file

File diff suppressed because it is too large Load Diff

1011
include/linux/cec.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
#ifndef __OF_RESERVED_MEM_H
#define __OF_RESERVED_MEM_H
struct device;
#include <linux/device.h>
struct of_phandle_args;
struct reserved_mem_ops;
@@ -28,7 +29,9 @@ typedef int (*reservedmem_of_init_fn)(struct reserved_mem *rmem);
_OF_DECLARE(reservedmem, name, compat, init, reservedmem_of_init_fn)
#ifdef CONFIG_OF_RESERVED_MEM
int of_reserved_mem_device_init(struct device *dev);
int of_reserved_mem_device_init_by_idx(struct device *dev,
struct device_node *np, int idx);
void of_reserved_mem_device_release(struct device *dev);
int early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
@@ -42,7 +45,8 @@ void fdt_init_reserved_mem(void);
void fdt_reserved_mem_save_node(unsigned long node, const char *uname,
phys_addr_t base, phys_addr_t size);
#else
static inline int of_reserved_mem_device_init(struct device *dev)
static inline int of_reserved_mem_device_init_by_idx(struct device *dev,
struct device_node *np, int idx)
{
return -ENOSYS;
}
@@ -53,4 +57,19 @@ static inline void fdt_reserved_mem_save_node(unsigned long node,
const char *uname, phys_addr_t base, phys_addr_t size) { }
#endif
/**
* of_reserved_mem_device_init() - assign reserved memory region to given device
* @dev: Pointer to the device to configure
*
* This function assigns respective DMA-mapping operations based on the first
* reserved memory region specified by 'memory-region' property in device tree
* node of the given device.
*
* Returns error code or zero on success.
*/
static inline int of_reserved_mem_device_init(struct device *dev)
{
return of_reserved_mem_device_init_by_idx(dev, dev->of_node, 0);
}
#endif /* __OF_RESERVED_MEM_H */

104
include/media/cec-edid.h Normal file
View File

@@ -0,0 +1,104 @@
/*
* cec-edid - HDMI Consumer Electronics Control & EDID helpers
*
* Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*
* This program is free software; you may redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _MEDIA_CEC_EDID_H
#define _MEDIA_CEC_EDID_H
#include <linux/types.h>
#define CEC_PHYS_ADDR_INVALID 0xffff
#define cec_phys_addr_exp(pa) \
((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
/**
* cec_get_edid_phys_addr() - find and return the physical address
*
* @edid: pointer to the EDID data
* @size: size in bytes of the EDID data
* @offset: If not %NULL then the location of the physical address
* bytes in the EDID will be returned here. This is set to 0
* if there is no physical address found.
*
* Return: the physical address or CEC_PHYS_ADDR_INVALID if there is none.
*/
u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
unsigned int *offset);
/**
* cec_set_edid_phys_addr() - find and set the physical address
*
* @edid: pointer to the EDID data
* @size: size in bytes of the EDID data
* @phys_addr: the new physical address
*
* This function finds the location of the physical address in the EDID
* and fills in the given physical address and updates the checksum
* at the end of the EDID block. It does nothing if the EDID doesn't
* contain a physical address.
*/
void cec_set_edid_phys_addr(u8 *edid, unsigned int size, u16 phys_addr);
/**
* cec_phys_addr_for_input() - calculate the PA for an input
*
* @phys_addr: the physical address of the parent
* @input: the number of the input port, must be between 1 and 15
*
* This function calculates a new physical address based on the input
* port number. For example:
*
* PA = 0.0.0.0 and input = 2 becomes 2.0.0.0
*
* PA = 3.0.0.0 and input = 1 becomes 3.1.0.0
*
* PA = 3.2.1.0 and input = 5 becomes 3.2.1.5
*
* PA = 3.2.1.3 and input = 5 becomes f.f.f.f since it maxed out the depth.
*
* Return: the new physical address or CEC_PHYS_ADDR_INVALID.
*/
u16 cec_phys_addr_for_input(u16 phys_addr, u8 input);
/**
* cec_phys_addr_validate() - validate a physical address from an EDID
*
* @phys_addr: the physical address to validate
* @parent: if not %NULL, then this is filled with the parents PA.
* @port: if not %NULL, then this is filled with the input port.
*
* This validates a physical address as read from an EDID. If the
* PA is invalid (such as 1.0.1.0 since '0' is only allowed at the end),
* then it will return -EINVAL.
*
* The parent PA is passed into %parent and the input port is passed into
* %port. For example:
*
* PA = 0.0.0.0: has parent 0.0.0.0 and input port 0.
*
* PA = 1.0.0.0: has parent 0.0.0.0 and input port 1.
*
* PA = 3.2.0.0: has parent 3.0.0.0 and input port 2.
*
* PA = f.f.f.f: has parent f.f.f.f and input port 0.
*
* Return: 0 if the PA is valid, -EINVAL if not.
*/
int cec_phys_addr_validate(u16 phys_addr, u16 *parent, u16 *port);
#endif /* _MEDIA_CEC_EDID_H */

241
include/media/cec.h Normal file
View File

@@ -0,0 +1,241 @@
/*
* cec - HDMI Consumer Electronics Control support header
*
* Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*
* This program is free software; you may redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _MEDIA_CEC_H
#define _MEDIA_CEC_H
#include <linux/poll.h>
#include <linux/fs.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/kthread.h>
#include <linux/timer.h>
#include <linux/cec-funcs.h>
#include <media/rc-core.h>
#include <media/cec-edid.h>
/**
* struct cec_devnode - cec device node
* @dev: cec device
* @cdev: cec character device
* @parent: parent device
* @minor: device node minor number
* @registered: the device was correctly registered
* @unregistered: the device was unregistered
* @fhs_lock: lock to control access to the filehandle list
* @fhs: the list of open filehandles (cec_fh)
*
* This structure represents a cec-related device node.
*
* The @parent is a physical device. It must be set by core or device drivers
* before registering the node.
*/
struct cec_devnode {
/* sysfs */
struct device dev;
struct cdev cdev;
struct device *parent;
/* device info */
int minor;
bool registered;
bool unregistered;
struct mutex fhs_lock;
struct list_head fhs;
};
struct cec_adapter;
struct cec_data;
struct cec_data {
struct list_head list;
struct list_head xfer_list;
struct cec_adapter *adap;
struct cec_msg msg;
struct cec_fh *fh;
struct delayed_work work;
struct completion c;
u8 attempts;
bool new_initiator;
bool blocking;
bool completed;
};
struct cec_msg_entry {
struct list_head list;
struct cec_msg msg;
};
#define CEC_NUM_EVENTS CEC_EVENT_LOST_MSGS
struct cec_fh {
struct list_head list;
struct list_head xfer_list;
struct cec_adapter *adap;
u8 mode_initiator;
u8 mode_follower;
/* Events */
wait_queue_head_t wait;
unsigned int pending_events;
struct cec_event events[CEC_NUM_EVENTS];
struct mutex lock;
struct list_head msgs; /* queued messages */
unsigned int queued_msgs;
};
#define CEC_SIGNAL_FREE_TIME_RETRY 3
#define CEC_SIGNAL_FREE_TIME_NEW_INITIATOR 5
#define CEC_SIGNAL_FREE_TIME_NEXT_XFER 7
/* The nominal data bit period is 2.4 ms */
#define CEC_FREE_TIME_TO_USEC(ft) ((ft) * 2400)
struct cec_adap_ops {
/* Low-level callbacks */
int (*adap_enable)(struct cec_adapter *adap, bool enable);
int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
u32 signal_free_time, struct cec_msg *msg);
void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
/* High-level CEC message callback */
int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
};
/*
* The minimum message length you can receive (excepting poll messages) is 2.
* With a transfer rate of at most 36 bytes per second this makes 18 messages
* per second worst case.
*
* We queue at most 3 seconds worth of received messages. The CEC specification
* requires that messages are replied to within a second, so 3 seconds should
* give more than enough margin. Since most messages are actually more than 2
* bytes, this is in practice a lot more than 3 seconds.
*/
#define CEC_MAX_MSG_RX_QUEUE_SZ (18 * 3)
/*
* The transmit queue is limited to 1 second worth of messages (worst case).
* Messages can be transmitted by userspace and kernel space. But for both it
* makes no sense to have a lot of messages queued up. One second seems
* reasonable.
*/
#define CEC_MAX_MSG_TX_QUEUE_SZ (18 * 1)
struct cec_adapter {
struct module *owner;
char name[32];
struct cec_devnode devnode;
struct mutex lock;
struct rc_dev *rc;
struct list_head transmit_queue;
unsigned int transmit_queue_sz;
struct list_head wait_queue;
struct cec_data *transmitting;
struct task_struct *kthread_config;
struct completion config_completion;
struct task_struct *kthread;
wait_queue_head_t kthread_waitq;
wait_queue_head_t waitq;
const struct cec_adap_ops *ops;
void *priv;
u32 capabilities;
u8 available_log_addrs;
u16 phys_addr;
bool is_configuring;
bool is_configured;
u32 monitor_all_cnt;
u32 follower_cnt;
struct cec_fh *cec_follower;
struct cec_fh *cec_initiator;
bool passthrough;
struct cec_log_addrs log_addrs;
struct dentry *cec_dir;
struct dentry *status_file;
u16 phys_addrs[15];
u32 sequence;
char input_name[32];
char input_phys[32];
char input_drv[32];
};
static inline bool cec_has_log_addr(const struct cec_adapter *adap, u8 log_addr)
{
return adap->log_addrs.log_addr_mask & (1 << log_addr);
}
static inline bool cec_is_sink(const struct cec_adapter *adap)
{
return adap->phys_addr == 0;
}
#if IS_ENABLED(CONFIG_MEDIA_CEC)
struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
void *priv, const char *name, u32 caps, u8 available_las,
struct device *parent);
int cec_register_adapter(struct cec_adapter *adap);
void cec_unregister_adapter(struct cec_adapter *adap);
void cec_delete_adapter(struct cec_adapter *adap);
int cec_s_log_addrs(struct cec_adapter *adap, struct cec_log_addrs *log_addrs,
bool block);
void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr,
bool block);
int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
bool block);
/* Called by the adapter */
void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);
#else
static inline int cec_register_adapter(struct cec_adapter *adap)
{
return 0;
}
static inline void cec_unregister_adapter(struct cec_adapter *adap)
{
}
static inline void cec_delete_adapter(struct cec_adapter *adap)
{
}
static inline void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr,
bool block)
{
}
#endif
#endif /* _MEDIA_CEC_H */

View File

@@ -81,8 +81,6 @@ struct vpbe_layer {
* Buffer queue used in video-buf
*/
struct vb2_queue buffer_queue;
/* allocator-specific contexts for each plane */
struct vb2_alloc_ctx *alloc_ctx;
/* Queue of filled frames */
struct list_head dma_queue;
/* Used in video-buf */

View File

@@ -32,11 +32,7 @@ struct adv7511_monitor_detect {
struct adv7511_edid_detect {
int present;
int segment;
};
struct adv7511_cec_arg {
void *arg;
u32 f_flags;
uint16_t phys_addr;
};
struct adv7511_platform_data {

View File

@@ -121,8 +121,6 @@ struct adv76xx_platform_data {
/* IO register 0x02 */
unsigned alt_gamma:1;
unsigned op_656_range:1;
unsigned alt_data_sat:1;
/* IO register 0x05 */
unsigned blank_data:1;

View File

@@ -165,8 +165,6 @@ struct adv7842_platform_data {
/* IO register 0x02 */
unsigned alt_gamma:1;
unsigned op_656_range:1;
unsigned alt_data_sat:1;
/* IO register 0x05 */
unsigned blank_data:1;

View File

@@ -347,7 +347,7 @@ struct media_entity_notify {
struct media_device {
/* dev->driver_data points to this struct. */
struct device *dev;
struct media_devnode devnode;
struct media_devnode *devnode;
char model[32];
char driver_name[32];
@@ -393,9 +393,6 @@ struct usb_device;
#define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0
#define MEDIA_DEV_NOTIFY_POST_LINK_CH 1
/* media_devnode to media_device */
#define to_media_device(node) container_of(node, struct media_device, devnode)
/**
* media_entity_enum_init - Initialise an entity enumeration
*

View File

@@ -33,6 +33,8 @@
#include <linux/device.h>
#include <linux/cdev.h>
struct media_device;
/*
* Flag to mark the media_devnode struct as registered. Drivers must not touch
* this flag directly, it will be set and cleared by media_devnode_register and
@@ -67,8 +69,9 @@ struct media_file_operations {
/**
* struct media_devnode - Media device node
* @media_dev: pointer to struct &media_device
* @fops: pointer to struct &media_file_operations with media device ops
* @dev: struct device pointer for the media controller device
* @dev: pointer to struct &device containing the media controller device
* @cdev: struct cdev pointer character device
* @parent: parent device
* @minor: device node minor number
@@ -81,6 +84,8 @@ struct media_file_operations {
* before registering the node.
*/
struct media_devnode {
struct media_device *media_dev;
/* device ops */
const struct media_file_operations *fops;
@@ -94,7 +99,7 @@ struct media_devnode {
unsigned long flags; /* Use bitops to access flags */
/* callbacks */
void (*release)(struct media_devnode *mdev);
void (*release)(struct media_devnode *devnode);
};
/* dev to media_devnode */
@@ -103,7 +108,8 @@ struct media_devnode {
/**
* media_devnode_register - register a media device node
*
* @mdev: media device node structure we want to register
* @mdev: struct media_device we want to register a device node
* @devnode: media device node structure we want to register
* @owner: should be filled with %THIS_MODULE
*
* The registration code assigns minor numbers and registers the new device node
@@ -116,20 +122,33 @@ struct media_devnode {
* the media_devnode structure is *not* called, so the caller is responsible for
* freeing any data.
*/
int __must_check media_devnode_register(struct media_devnode *mdev,
int __must_check media_devnode_register(struct media_device *mdev,
struct media_devnode *devnode,
struct module *owner);
/**
* media_devnode_unregister - unregister a media device node
* @mdev: the device node to unregister
* media_devnode_unregister_prepare - clear the media device node register bit
* @devnode: the device node to prepare for unregister
*
* This unregisters the passed device. Future open calls will be met with
* errors.
* This clears the passed device register bit. Future open calls will be met
* with errors. Should be called before media_devnode_unregister() to avoid
* races with unregister and device file open calls.
*
* This function can safely be called if the device node has never been
* registered or has already been unregistered.
*/
void media_devnode_unregister(struct media_devnode *mdev);
void media_devnode_unregister_prepare(struct media_devnode *devnode);
/**
* media_devnode_unregister - unregister a media device node
* @devnode: the device node to unregister
*
* This unregisters the passed device. Future open calls will be met with
* errors.
*
* Should be called after media_devnode_unregister_prepare()
*/
void media_devnode_unregister(struct media_devnode *devnode);
/**
* media_devnode_data - returns a pointer to the &media_devnode
@@ -145,11 +164,16 @@ static inline struct media_devnode *media_devnode_data(struct file *filp)
* media_devnode_is_registered - returns true if &media_devnode is registered;
* false otherwise.
*
* @mdev: pointer to struct &media_devnode.
* @devnode: pointer to struct &media_devnode.
*
* Note: If mdev is NULL, it also returns false.
*/
static inline int media_devnode_is_registered(struct media_devnode *mdev)
static inline int media_devnode_is_registered(struct media_devnode *devnode)
{
return test_bit(MEDIA_FLAG_REGISTERED, &mdev->flags);
if (!devnode)
return false;
return test_bit(MEDIA_FLAG_REGISTERED, &devnode->flags);
}
#endif /* _MEDIA_DEVNODE_H */

View File

@@ -119,6 +119,7 @@ enum rc_filter_type {
* @s_carrier_report: enable carrier reports
* @s_filter: set the scancode filter
* @s_wakeup_filter: set the wakeup scancode filter
* @s_timeout: set hardware timeout in ns
*/
struct rc_dev {
struct device dev;
@@ -174,6 +175,8 @@ struct rc_dev {
struct rc_scancode_filter *filter);
int (*s_wakeup_filter)(struct rc_dev *dev,
struct rc_scancode_filter *filter);
int (*s_timeout)(struct rc_dev *dev,
unsigned int timeout);
};
#define to_rc_dev(d) container_of(d, struct rc_dev, dev)

View File

@@ -31,6 +31,7 @@ enum rc_type {
RC_TYPE_RC6_MCE = 16, /* MCE (Philips RC6-6A-32 subtype) protocol */
RC_TYPE_SHARP = 17, /* Sharp protocol */
RC_TYPE_XMP = 18, /* XMP protocol */
RC_TYPE_CEC = 19, /* CEC protocol */
};
#define RC_BIT_NONE 0ULL
@@ -53,6 +54,7 @@ enum rc_type {
#define RC_BIT_RC6_MCE (1ULL << RC_TYPE_RC6_MCE)
#define RC_BIT_SHARP (1ULL << RC_TYPE_SHARP)
#define RC_BIT_XMP (1ULL << RC_TYPE_XMP)
#define RC_BIT_CEC (1ULL << RC_TYPE_CEC)
#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | \
RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \
@@ -61,7 +63,7 @@ enum rc_type {
RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \
RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \
RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP | \
RC_BIT_XMP)
RC_BIT_XMP | RC_BIT_CEC)
#define RC_SCANCODE_UNKNOWN(x) (x)
@@ -123,6 +125,7 @@ void rc_map_init(void);
#define RC_MAP_BEHOLD_COLUMBUS "rc-behold-columbus"
#define RC_MAP_BEHOLD "rc-behold"
#define RC_MAP_BUDGET_CI_OLD "rc-budget-ci-old"
#define RC_MAP_CEC "rc-cec"
#define RC_MAP_CINERGY_1400 "rc-cinergy-1400"
#define RC_MAP_CINERGY "rc-cinergy"
#define RC_MAP_DELOCK_61959 "rc-delock-61959"
@@ -133,6 +136,7 @@ void rc_map_init(void);
#define RC_MAP_DM1105_NEC "rc-dm1105-nec"
#define RC_MAP_DNTV_LIVE_DVBT_PRO "rc-dntv-live-dvbt-pro"
#define RC_MAP_DNTV_LIVE_DVB_T "rc-dntv-live-dvb-t"
#define RC_MAP_DTT200U "rc-dtt200u"
#define RC_MAP_DVBSKY "rc-dvbsky"
#define RC_MAP_EMPTY "rc-empty"
#define RC_MAP_EM_TERRATEC "rc-em-terratec"

37
include/media/rcar-fcp.h Normal file
View File

@@ -0,0 +1,37 @@
/*
* rcar-fcp.h -- R-Car Frame Compression Processor Driver
*
* Copyright (C) 2016 Renesas Electronics Corporation
*
* Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __MEDIA_RCAR_FCP_H__
#define __MEDIA_RCAR_FCP_H__
struct device_node;
struct rcar_fcp_device;
#if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP)
struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np);
void rcar_fcp_put(struct rcar_fcp_device *fcp);
int rcar_fcp_enable(struct rcar_fcp_device *fcp);
void rcar_fcp_disable(struct rcar_fcp_device *fcp);
#else
static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np)
{
return ERR_PTR(-ENOENT);
}
static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { }
static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp)
{
return -ENOSYS;
}
static inline void rcar_fcp_disable(struct rcar_fcp_device *fcp) { }
#endif
#endif /* __MEDIA_RCAR_FCP_H__ */

View File

@@ -759,9 +759,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
* @ctrl: The control.
* @val: The new value.
*
* This set the control's new value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
* This sets the control's new value safely by going through the control
* framework. This function assumes the control's handler is already locked,
* allowing it to be used from within the &v4l2_ctrl_ops functions.
*
* This function is for integer type controls only.
*/
@@ -771,7 +771,7 @@ int __v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
* @ctrl: The control.
* @val: The new value.
*
* This set the control's new value safely by going through the control
* This sets the control's new value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
*
@@ -807,9 +807,9 @@ s64 v4l2_ctrl_g_ctrl_int64(struct v4l2_ctrl *ctrl);
* @ctrl: The control.
* @val: The new value.
*
* This set the control's new value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
* This sets the control's new value safely by going through the control
* framework. This function assumes the control's handler is already locked,
* allowing it to be used from within the &v4l2_ctrl_ops functions.
*
* This function is for 64-bit integer type controls only.
*/
@@ -821,7 +821,7 @@ int __v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val);
* @ctrl: The control.
* @val: The new value.
*
* This set the control's new value safely by going through the control
* This sets the control's new value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
*
@@ -843,9 +843,9 @@ static inline int v4l2_ctrl_s_ctrl_int64(struct v4l2_ctrl *ctrl, s64 val)
* @ctrl: The control.
* @s: The new string.
*
* This set the control's new string safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
* This sets the control's new string safely by going through the control
* framework. This function assumes the control's handler is already locked,
* allowing it to be used from within the &v4l2_ctrl_ops functions.
*
* This function is for string type controls only.
*/
@@ -857,7 +857,7 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s);
* @ctrl: The control.
* @s: The new string.
*
* This set the control's new string safely by going through the control
* This sets the control's new string safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
*
@@ -903,16 +903,6 @@ int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *
int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_ext_controls *c);
/* Helpers for subdevices. If the associated ctrl_handler == NULL then they
will all return -EINVAL. */
int v4l2_subdev_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc);
int v4l2_subdev_querymenu(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
int v4l2_subdev_g_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_try_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
/* Can be used as a subscribe_event function that just subscribes control
events. */
int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,

View File

@@ -143,20 +143,6 @@ struct v4l2_subdev_io_pin_config {
* @s_gpio: set GPIO pins. Very simple right now, might need to be extended with
* a direction argument if needed.
*
* @queryctrl: callback for VIDIOC_QUERYCTL ioctl handler code.
*
* @g_ctrl: callback for VIDIOC_G_CTRL ioctl handler code.
*
* @s_ctrl: callback for VIDIOC_S_CTRL ioctl handler code.
*
* @g_ext_ctrls: callback for VIDIOC_G_EXT_CTRLS ioctl handler code.
*
* @s_ext_ctrls: callback for VIDIOC_S_EXT_CTRLS ioctl handler code.
*
* @try_ext_ctrls: callback for VIDIOC_TRY_EXT_CTRLS ioctl handler code.
*
* @querymenu: callback for VIDIOC_QUERYMENU ioctl handler code.
*
* @ioctl: called at the end of ioctl() syscall handler at the V4L2 core.
* used to provide support for private ioctls used on the driver.
*
@@ -190,13 +176,6 @@ struct v4l2_subdev_core_ops {
int (*load_fw)(struct v4l2_subdev *sd);
int (*reset)(struct v4l2_subdev *sd, u32 val);
int (*s_gpio)(struct v4l2_subdev *sd, u32 val);
int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc);
int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
int (*g_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
#ifdef CONFIG_COMPAT
long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd,

View File

@@ -27,7 +27,6 @@ enum vb2_memory {
VB2_MEMORY_DMABUF = 4,
};
struct vb2_alloc_ctx;
struct vb2_fileio_data;
struct vb2_threadio_data;
@@ -57,7 +56,7 @@ struct vb2_threadio_data;
* @put_userptr: inform the allocator that a USERPTR buffer will no longer
* be used.
* @attach_dmabuf: attach a shared struct dma_buf for a hardware operation;
* used for DMABUF memory types; alloc_ctx is the alloc context
* used for DMABUF memory types; dev is the alloc device
* dbuf is the shared dma_buf; returns NULL on failure;
* allocator private per-buffer structure on success;
* this needs to be used for further accesses to the buffer.
@@ -93,13 +92,13 @@ struct vb2_threadio_data;
* unmap_dmabuf.
*/
struct vb2_mem_ops {
void *(*alloc)(void *alloc_ctx, unsigned long size,
enum dma_data_direction dma_dir,
void *(*alloc)(struct device *dev, const struct dma_attrs *attrs,
unsigned long size, enum dma_data_direction dma_dir,
gfp_t gfp_flags);
void (*put)(void *buf_priv);
struct dma_buf *(*get_dmabuf)(void *buf_priv, unsigned long flags);
void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr,
void *(*get_userptr)(struct device *dev, unsigned long vaddr,
unsigned long size,
enum dma_data_direction dma_dir);
void (*put_userptr)(void *buf_priv);
@@ -107,7 +106,7 @@ struct vb2_mem_ops {
void (*prepare)(void *buf_priv);
void (*finish)(void *buf_priv);
void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf,
void *(*attach_dmabuf)(struct device *dev, struct dma_buf *dbuf,
unsigned long size,
enum dma_data_direction dma_dir);
void (*detach_dmabuf)(void *buf_priv);
@@ -282,7 +281,7 @@ struct vb2_buffer {
* in *num_buffers, the required number of planes per
* buffer in *num_planes, the size of each plane should be
* set in the sizes[] array and optional per-plane
* allocator specific context in the alloc_ctxs[] array.
* allocator specific device in the alloc_devs[] array.
* When called from VIDIOC_REQBUFS, *num_planes == 0, the
* driver has to use the currently configured format to
* determine the plane sizes and *num_buffers is the total
@@ -356,7 +355,7 @@ struct vb2_buffer {
struct vb2_ops {
int (*queue_setup)(struct vb2_queue *q,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[], void *alloc_ctxs[]);
unsigned int sizes[], struct device *alloc_devs[]);
void (*wait_prepare)(struct vb2_queue *q);
void (*wait_finish)(struct vb2_queue *q);
@@ -401,6 +400,9 @@ struct vb2_buf_ops {
* caller. For example, for V4L2, it should match
* the V4L2_BUF_TYPE_* in include/uapi/linux/videodev2.h
* @io_modes: supported io methods (see vb2_io_modes enum)
* @dev: device to use for the default allocation context if the driver
* doesn't fill in the @alloc_devs array.
* @dma_attrs: DMA attributes to use for the DMA. May be NULL.
* @fileio_read_once: report EOF after reading the first buffer
* @fileio_write_immediately: queue buffer after each write() call
* @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver
@@ -447,7 +449,7 @@ struct vb2_buf_ops {
* @done_list: list of buffers ready to be dequeued to userspace
* @done_lock: lock to protect done_list list
* @done_wq: waitqueue for processes waiting for buffers ready to be dequeued
* @alloc_ctx: memory type/allocator-specific contexts for each plane
* @alloc_devs: memory type/allocator-specific per-plane device
* @streaming: current streaming state
* @start_streaming_called: start_streaming() was called successfully and we
* started streaming.
@@ -467,6 +469,8 @@ struct vb2_buf_ops {
struct vb2_queue {
unsigned int type;
unsigned int io_modes;
struct device *dev;
const struct dma_attrs *dma_attrs;
unsigned fileio_read_once:1;
unsigned fileio_write_immediately:1;
unsigned allow_zero_bytesused:1;
@@ -499,7 +503,7 @@ struct vb2_queue {
spinlock_t done_lock;
wait_queue_head_t done_wq;
void *alloc_ctx[VB2_MAX_PLANES];
struct device *alloc_devs[VB2_MAX_PLANES];
unsigned int streaming:1;
unsigned int start_streaming_called:1;

View File

@@ -26,15 +26,8 @@ vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no)
return *addr;
}
void *vb2_dma_contig_init_ctx_attrs(struct device *dev,
struct dma_attrs *attrs);
static inline void *vb2_dma_contig_init_ctx(struct device *dev)
{
return vb2_dma_contig_init_ctx_attrs(dev, NULL);
}
void vb2_dma_contig_cleanup_ctx(void *alloc_ctx);
int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size);
void vb2_dma_contig_clear_max_seg_size(struct device *dev);
extern const struct vb2_mem_ops vb2_dma_contig_memops;

View File

@@ -21,9 +21,6 @@ static inline struct sg_table *vb2_dma_sg_plane_desc(
return (struct sg_table *)vb2_plane_cookie(vb, plane_no);
}
void *vb2_dma_sg_init_ctx(struct device *dev);
void vb2_dma_sg_cleanup_ctx(void *alloc_ctx);
extern const struct vb2_mem_ops vb2_dma_sg_memops;
#endif

View File

@@ -14,31 +14,28 @@
#define __MEDIA_VSP1_H__
#include <linux/types.h>
#include <linux/videodev2.h>
struct device;
struct v4l2_rect;
int vsp1_du_init(struct device *dev);
int vsp1_du_setup_lif(struct device *dev, unsigned int width,
unsigned int height);
struct vsp1_du_atomic_config {
u32 pixelformat;
unsigned int pitch;
dma_addr_t mem[2];
struct v4l2_rect src;
struct v4l2_rect dst;
unsigned int alpha;
unsigned int zpos;
};
void vsp1_du_atomic_begin(struct device *dev);
int vsp1_du_atomic_update_ext(struct device *dev, unsigned int rpf,
u32 pixelformat, unsigned int pitch,
dma_addr_t mem[2], const struct v4l2_rect *src,
const struct v4l2_rect *dst, unsigned int alpha,
unsigned int zpos);
int vsp1_du_atomic_update(struct device *dev, unsigned int rpf,
const struct vsp1_du_atomic_config *cfg);
void vsp1_du_atomic_flush(struct device *dev);
static inline int vsp1_du_atomic_update(struct device *dev,
unsigned int rpf_index, u32 pixelformat,
unsigned int pitch, dma_addr_t mem[2],
const struct v4l2_rect *src,
const struct v4l2_rect *dst)
{
return vsp1_du_atomic_update_ext(dev, rpf_index, pixelformat, pitch,
mem, src, dst, 255, 0);
}
#endif /* __MEDIA_VSP1_H__ */

View File

@@ -94,6 +94,16 @@ struct media_device_info {
#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
/*
* Processing entities
*/
#define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001)
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002)
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003)
#define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004)
#define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005)
#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
/*
* Connectors
*/

View File

@@ -78,5 +78,6 @@
#define SERIO_TSC40 0x3d
#define SERIO_WACOM_IV 0x3e
#define SERIO_EGALAX 0x3f
#define SERIO_PULSE8_CEC 0x40
#endif /* _UAPI_SERIO_H */

View File

@@ -504,22 +504,16 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /* 8 UV 4:4 */
/* Luminance+Chrominance formats */
#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
@@ -540,6 +534,14 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
/* three planes - Y Cb, Cr */
#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 12 YVU411 planar */
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
/* three non contiguous planes - Y, Cb, Cr */
#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */

View File

@@ -1,34 +0,0 @@
/*
* vsp1.h
*
* Renesas R-Car VSP1 - User-space API
*
* Copyright (C) 2013 Renesas Corporation
*
* Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __VSP1_USER_H__
#define __VSP1_USER_H__
#include <linux/types.h>
#include <linux/videodev2.h>
/*
* Private IOCTLs
*
* VIDIOC_VSP1_LUT_CONFIG - Configure the lookup table
*/
#define VIDIOC_VSP1_LUT_CONFIG \
_IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct vsp1_lut_config)
struct vsp1_lut_config {
__u32 lut[256];
};
#endif /* __VSP1_USER_H__ */