Re: [PATCH] drm/bridge/sii8620: add remote control support

2017-08-03 Thread Hans Verkuil
Hi Maciej,

Unfortunately I do not have the MHL spec, but I was wondering what the
relationship between RCP and CEC is. CEC has remote control support as
well, so is RCP that subset of the CEC specification or is it completely
separate?

I'm CC-ing Sean Young and the linux-media mailinglist as well since Sean
maintains the rc subsystem. Which you probably should use, but I'm not the
expert on that.

Regards,

Hans

On 08/03/17 09:44, Maciej Purski wrote:
> MHL specification defines Remote Control Protocol(RCP) to
> send input events between MHL devices.
> The driver now recognizes RCP messages and reacts to them
> by reporting key events to input subsystem, allowing
> a user to control a device using TV remote control.
> 
> Signed-off-by: Maciej Purski 
> ---
>  drivers/gpu/drm/bridge/sil-sii8620.c | 188 
> ++-
>  include/drm/bridge/mhl.h |   4 +
>  2 files changed, 187 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c 
> b/drivers/gpu/drm/bridge/sil-sii8620.c
> index 2d51a22..7e75f2f 100644
> --- a/drivers/gpu/drm/bridge/sil-sii8620.c
> +++ b/drivers/gpu/drm/bridge/sil-sii8620.c
> @@ -19,6 +19,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -58,6 +59,7 @@ enum sii8620_mt_state {
>  struct sii8620 {
>   struct drm_bridge bridge;
>   struct device *dev;
> + struct input_dev *rcp_input_dev;
>   struct clk *clk_xtal;
>   struct gpio_desc *gpio_reset;
>   struct gpio_desc *gpio_int;
> @@ -106,6 +108,82 @@ struct sii8620_mt_msg {
>   sii8620_cb continuation;
>  };
>  
> +static struct {
> + u16 key;
> + u16 extra_key;
> + bool autorepeat;
> +}  rcp_keymap[] = {
> + [0x00] = { KEY_SELECT },
> + [0x01] = { KEY_UP, 0, true },
> + [0x02] = { KEY_DOWN, 0, true },
> + [0x03] = { KEY_LEFT, 0, true },
> + [0x04] = { KEY_RIGHT, 0, true },
> +
> + [0x05] = { KEY_RIGHT, KEY_UP, true },
> + [0x06] = { KEY_RIGHT, KEY_DOWN, true },
> + [0x07] = { KEY_LEFT,  KEY_UP, true },
> + [0x08] = { KEY_LEFT,  KEY_DOWN, true },
> +
> + [0x09] = { KEY_MENU },
> + [0x0A] = { KEY_UNKNOWN },
> + [0x0B] = { KEY_UNKNOWN },
> + [0x0C] = { KEY_BOOKMARKS },
> + [0x0D] = { KEY_EXIT },
> +
> + [0x20] = { KEY_NUMERIC_0 },
> + [0x21] = { KEY_NUMERIC_1 },
> + [0x22] = { KEY_NUMERIC_2 },
> + [0x23] = { KEY_NUMERIC_3 },
> + [0x24] = { KEY_NUMERIC_4 },
> + [0x25] = { KEY_NUMERIC_5 },
> + [0x26] = { KEY_NUMERIC_6 },
> + [0x27] = { KEY_NUMERIC_7 },
> + [0x28] = { KEY_NUMERIC_8 },
> + [0x29] = { KEY_NUMERIC_9 },
> +
> + [0x2A] = { KEY_DOT },
> + [0x2B] = { KEY_ENTER },
> + [0x2C] = { KEY_CLEAR },
> +
> + [0x30] = { KEY_CHANNELUP, 0, true },
> + [0x31] = { KEY_CHANNELDOWN, 0, true },
> +
> + [0x33] = { KEY_SOUND },
> + [0x35] = { KEY_PROGRAM }, /* Show Information */
> +
> + [0x37] = { KEY_PAGEUP, 0, true },
> + [0x38] = { KEY_PAGEDOWN, 0, true },
> +
> + [0x41] = { KEY_VOLUMEUP, 0, true },
> + [0x42] = { KEY_VOLUMEDOWN, 0, true },
> + [0x43] = { KEY_MUTE },
> + [0x44] = { KEY_PLAY },
> + [0x45] = { KEY_STOP },
> + [0x46] = { KEY_PLAYPAUSE }, /* Pause */
> + [0x47] = { KEY_RECORD },
> + [0x48] = { KEY_REWIND, 0, true },
> + [0x49] = { KEY_FASTFORWARD, 0, true },
> + [0x4A] = { KEY_EJECTCD },
> + [0x4B] = { KEY_NEXTSONG, 0, true }, /* Forward */
> + [0x4C] = { KEY_PREVIOUSSONG, 0, true }, /* Backward */
> +
> + [0x60] = { KEY_PLAYPAUSE }, /* Play */
> + [0x61] = { KEY_PLAYPAUSE }, /* Pause the Play */
> + [0x62] = { KEY_RECORD },
> + [0x63] = { KEY_PAUSE },
> + [0x64] = { KEY_STOP },
> + [0x65] = { KEY_MUTE },
> + [0x66] = { KEY_MUTE }, /* Restore Mute */
> +
> + [0x71] = { KEY_F1 },
> + [0x72] = { KEY_F2 },
> + [0x73] = { KEY_F3 },
> + [0x74] = { KEY_F4 },
> + [0x75] = { KEY_F5 },
> +
> + [0x7E] = { KEY_VENDOR },
> +};
> +
>  static const u8 sii8620_i2c_page[] = {
>   0x39, /* Main System */
>   0x3d, /* TDM and HSIC */
> @@ -431,6 +509,16 @@ static void sii8620_mt_rap(struct sii8620 *ctx, u8 code)
>   sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RAP, code);
>  }
>  
> +static void sii8620_mt_rcpk(struct sii8620 *ctx, u8 code)
> +{
> + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPK, code);
> +}
> +
> +static void sii8620_mt_rcpe(struct sii8620 *ctx, u8 code)
> +{
> + sii8620_mt_msc_msg(ctx, MHL_MSC_MSG_RCPE, code);
> +}
> +
>  static void sii8620_mt_read_devcap_send(struct sii8620 *ctx,
>   struct sii8620_mt_msg *msg)
>  {
> @@ -1753,6 +1841,43 @@ static void sii8620_send_features(struct sii8620 *ctx)
>   sii8620_write_buf(ctx, REG_MDT_XMIT_WRITE_PORT, buf, ARRAY_SIZE(buf));
>  }
>  
> +static void sii8620_rcp_report_key(struct sii8620 *ctx, u8 keycode, bool 
> pressed)
> +{
> + 

Re: [RFC 0/2] Add V4L2_BUF_TYPE_META_OUTPUT buffer type

2017-08-03 Thread Tomasz Figa
Hi Sakari,

On Sat, Jun 17, 2017 at 12:14 AM, Sakari Ailus
 wrote:
> The V4L2_BUF_TYPE_META_OUTPUT buffer type complements the metadata buffer
> types support for OUTPUT buffers, capture being already supported. This is
> intended for similar cases than V4L2_BUF_TYPE_META_CAPTURE but for output
> buffers, e.g. device parameters that may be complex and highly
> hierarchical data structure. Statistics are a current use case for
> metadata capture buffers.
>
> There's a warning related to references from make htmldocs; I'll fix that
> in v2 / non-RFC version.
>
> Sakari Ailus (2):
>   v4l: Add support for V4L2_BUF_TYPE_META_OUTPUT
>   docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface
>
>  Documentation/media/uapi/v4l/buffer.rst  |  3 +++
>  Documentation/media/uapi/v4l/dev-meta.rst| 32 
> ++--
>  Documentation/media/uapi/v4l/vidioc-querycap.rst |  3 +++
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c|  2 ++
>  drivers/media/v4l2-core/v4l2-ioctl.c | 25 ++
>  drivers/media/v4l2-core/videobuf2-v4l2.c |  1 +
>  include/media/v4l2-ioctl.h   | 17 +
>  include/uapi/linux/videodev2.h   |  2 ++
>  8 files changed, 72 insertions(+), 13 deletions(-)

Is there by any chance an update on this series?

Best regards,
Tomasz


[PATCH] [media]: dw2102: make dvb_usb_device_description structures const

2017-08-03 Thread Bhumika Goyal
dvb_usb_device_description structures are only used during a copy
operation. Therefore, declare them as const.

Signed-off-by: Bhumika Goyal 
---
 drivers/media/usb/dvb-usb/dw2102.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/dw2102.c 
b/drivers/media/usb/dvb-usb/dw2102.c
index 57b1872..c5e3597 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -2103,46 +2103,46 @@ static int dw2102_load_firmware(struct usb_device *dev,
 };
 
 static struct dvb_usb_device_properties *p1100;
-static struct dvb_usb_device_description d1100 = {
+static const struct dvb_usb_device_description d1100 = {
"Prof 1100 USB ",
{_table[PROF_1100], NULL},
{NULL},
 };
 
 static struct dvb_usb_device_properties *s660;
-static struct dvb_usb_device_description d660 = {
+static const struct dvb_usb_device_description d660 = {
"TeVii S660 USB",
{_table[TEVII_S660], NULL},
{NULL},
 };
 
-static struct dvb_usb_device_description d480_1 = {
+static const struct dvb_usb_device_description d480_1 = {
"TeVii S480.1 USB",
{_table[TEVII_S480_1], NULL},
{NULL},
 };
 
-static struct dvb_usb_device_description d480_2 = {
+static const struct dvb_usb_device_description d480_2 = {
"TeVii S480.2 USB",
{_table[TEVII_S480_2], NULL},
{NULL},
 };
 
 static struct dvb_usb_device_properties *p7500;
-static struct dvb_usb_device_description d7500 = {
+static const struct dvb_usb_device_description d7500 = {
"Prof 7500 USB DVB-S2",
{_table[PROF_7500], NULL},
{NULL},
 };
 
 static struct dvb_usb_device_properties *s421;
-static struct dvb_usb_device_description d421 = {
+static const struct dvb_usb_device_description d421 = {
"TeVii S421 PCI",
{_table[TEVII_S421], NULL},
{NULL},
 };
 
-static struct dvb_usb_device_description d632 = {
+static const struct dvb_usb_device_description d632 = {
"TeVii S632 USB",
{_table[TEVII_S632], NULL},
{NULL},
-- 
1.9.1



[PATCH] [media] rc: gpio-ir-tx: switch to gpiod, fix inverted polarity

2017-08-03 Thread Matthias Reichl
Manual handling of gpio output polarity was inverted.
Switch to using gpiod, this allows us to simplify the code,
delegate polarity handling to gpiod and remove the buggy local
polarity handling code.

Signed-off-by: Matthias Reichl 
---

This patch is against [PATCH v2 3/6] [media] rc: gpio-ir-tx:
add new driver.

Feel free to squash these two patches into one for v3.

so long,

Hias

 drivers/media/rc/gpio-ir-tx.c | 41 +
 1 file changed, 13 insertions(+), 28 deletions(-)

diff --git a/drivers/media/rc/gpio-ir-tx.c b/drivers/media/rc/gpio-ir-tx.c
index 7a5371dbb360..ca6834d09467 100644
--- a/drivers/media/rc/gpio-ir-tx.c
+++ b/drivers/media/rc/gpio-ir-tx.c
@@ -13,11 +13,10 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -25,8 +24,7 @@
 #define DEVICE_NAME"GPIO Bit Banging IR Transmitter"
 
 struct gpio_ir {
-   int gpio_nr;
-   bool active_low;
+   struct gpio_desc *gpio;
unsigned int carrier;
unsigned int duty_cycle;
/* we need a spinlock to hold the cpu while transmitting */
@@ -101,14 +99,12 @@ static int gpio_ir_tx(struct rc_dev *dev, unsigned int 
*txbuf,
ktime_t last = ktime_add_us(edge, txbuf[i]);
 
while (ktime_get() < last) {
-   gpio_set_value(gpio_ir->gpio_nr,
-  gpio_ir->active_low);
+   gpiod_set_value(gpio_ir->gpio, 1);
edge += pulse;
delta = edge - ktime_get();
if (delta > 0)
ndelay(delta);
-   gpio_set_value(gpio_ir->gpio_nr,
-  !gpio_ir->active_low);
+   gpiod_set_value(gpio_ir->gpio, 0);
edge += space;
delta = edge - ktime_get();
if (delta > 0)
@@ -128,16 +124,7 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
 {
struct gpio_ir *gpio_ir;
struct rc_dev *rcdev;
-   enum of_gpio_flags flags;
-   int rc, gpio;
-
-   gpio = of_get_gpio_flags(pdev->dev.of_node, 0, );
-   if (gpio < 0) {
-   if (gpio != -EPROBE_DEFER)
-   dev_err(>dev, "Failed to get gpio flags (%d)\n",
-   gpio);
-   return -EINVAL;
-   }
+   int rc;
 
gpio_ir = devm_kmalloc(>dev, sizeof(*gpio_ir), GFP_KERNEL);
if (!gpio_ir)
@@ -147,6 +134,14 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
if (!rcdev)
return -ENOMEM;
 
+   gpio_ir->gpio = devm_gpiod_get(>dev, NULL, GPIOD_OUT_LOW);
+   if (IS_ERR(gpio_ir->gpio)) {
+   if (PTR_ERR(gpio_ir->gpio) != -EPROBE_DEFER)
+   dev_err(>dev, "Failed to get gpio (%ld)\n",
+   PTR_ERR(gpio_ir->gpio));
+   return PTR_ERR(gpio_ir->gpio);
+   }
+
rcdev->priv = gpio_ir;
rcdev->driver_name = DRIVER_NAME;
rcdev->device_name = DEVICE_NAME;
@@ -154,20 +149,10 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
rcdev->s_tx_duty_cycle = gpio_ir_tx_set_duty_cycle;
rcdev->s_tx_carrier = gpio_ir_tx_set_carrier;
 
-   gpio_ir->gpio_nr = gpio;
-   gpio_ir->active_low = (flags & OF_GPIO_ACTIVE_LOW) != 0;
gpio_ir->carrier = 38000;
gpio_ir->duty_cycle = 50;
spin_lock_init(_ir->lock);
 
-   rc = devm_gpio_request(>dev, gpio, "gpio-ir-tx");
-   if (rc < 0)
-   return rc;
-
-   rc = gpio_direction_output(gpio, !gpio_ir->active_low);
-   if (rc < 0)
-   return rc;
-
rc = devm_rc_register_device(>dev, rcdev);
if (rc < 0)
dev_err(>dev, "failed to register rc device\n");
-- 
2.11.0



Re: [PATCH v6] rockchip/rga: v4l2 m2m support

2017-08-03 Thread kbuild test robot
Hi Jacob,

[auto build test WARNING on rockchip/for-next]
[also build test WARNING on v4.13-rc3 next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Jacob-Chen/rockchip-rga-v4l2-m2m-support/20170802-235943
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git 
for-next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +/case +159 drivers/media/platform/rockchip-rga/rga.c

   150  
   151  static int rga_s_ctrl(struct v4l2_ctrl *ctrl)
   152  {
   153  struct rga_ctx *ctx = container_of(ctrl->handler, struct 
rga_ctx,
   154 ctrl_handler);
   155  unsigned long flags;
   156  
   157  spin_lock_irqsave(>rga->ctrl_lock, flags);
   158  switch (ctrl->id) {
 > 159  case V4L2_CID_PORTER_DUFF_MODE:
   160  ctx->op = ctrl->val;
   161  break;
   162  case V4L2_CID_HFLIP:
   163  ctx->hflip = ctrl->val;
   164  break;
   165  case V4L2_CID_VFLIP:
   166  ctx->vflip = ctrl->val;
   167  break;
   168  case V4L2_CID_ROTATE:
   169  ctx->rotate = ctrl->val;
   170  break;
   171  case V4L2_CID_BG_COLOR:
   172  ctx->fill_color = ctrl->val;
   173  break;
   174  }
   175  spin_unlock_irqrestore(>rga->ctrl_lock, flags);
   176  return 0;
   177  }
   178  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH] media: i2c: adv748x: Store the pixel rate ctrl on CSI objects

2017-08-03 Thread Niklas Söderlund
Hi Kieran,

On 2017-08-03 14:50:23 +0100, Kieran Bingham wrote:
> From: Kieran Bingham 
> 
> The current implementation has to search the list of controls for the
> pixel rate control, each time it is set.  This can be optimised easily
> by storing the ctrl pointer in the CSI/TX object, and referencing that
> directly.
> 
> While at it, fix up a missing blank line also highlighted in review
> comments.
> 
> Signed-off-by: Kieran Bingham 

It won't apply cleanly to the media-tree since there already is a commit 
there which cleans-up the unused variable in dv748x_csi2_init_controls()

Apart from that:

Tested-by: Niklas Söderlund 

> ---
> Small enhancement and fixup as suggested by Sakari, after driver acceptance.
> 
> Niklas, with my current 8 Camera set up - I can't fully test this change.
> Could you give it a spin if you get chance please?
> 
>  drivers/media/i2c/adv748x/adv748x-afe.c  |  1 +
>  drivers/media/i2c/adv748x/adv748x-csi2.c | 15 +++
>  drivers/media/i2c/adv748x/adv748x.h  |  1 +
>  3 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c 
> b/drivers/media/i2c/adv748x/adv748x-afe.c
> index b33ccfc08708..134d981d69d3 100644
> --- a/drivers/media/i2c/adv748x/adv748x-afe.c
> +++ b/drivers/media/i2c/adv748x/adv748x-afe.c
> @@ -262,6 +262,7 @@ static int adv748x_afe_g_input_status(struct v4l2_subdev 
> *sd, u32 *status)
>   ret = adv748x_afe_status(afe, status, NULL);
>  
>   mutex_unlock(>mutex);
> +
>   return ret;
>  }
>  
> diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c 
> b/drivers/media/i2c/adv748x/adv748x-csi2.c
> index b4fee7f52d6a..609d960c0749 100644
> --- a/drivers/media/i2c/adv748x/adv748x-csi2.c
> +++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
> @@ -223,13 +223,12 @@ static const struct v4l2_subdev_ops adv748x_csi2_ops = {
>  
>  int adv748x_csi2_set_pixelrate(struct v4l2_subdev *sd, s64 rate)
>  {
> - struct v4l2_ctrl *ctrl;
> + struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
>  
> - ctrl = v4l2_ctrl_find(sd->ctrl_handler, V4L2_CID_PIXEL_RATE);
> - if (!ctrl)
> + if (!tx->pixel_rate)
>   return -EINVAL;
>  
> - return v4l2_ctrl_s_ctrl_int64(ctrl, rate);
> + return v4l2_ctrl_s_ctrl_int64(tx->pixel_rate, rate);
>  }
>  
>  static int adv748x_csi2_s_ctrl(struct v4l2_ctrl *ctrl)
> @@ -248,12 +247,12 @@ static const struct v4l2_ctrl_ops adv748x_csi2_ctrl_ops 
> = {
>  
>  static int adv748x_csi2_init_controls(struct adv748x_csi2 *tx)
>  {
> - struct v4l2_ctrl *ctrl;
> -
>   v4l2_ctrl_handler_init(>ctrl_hdl, 1);
>  
> - ctrl = v4l2_ctrl_new_std(>ctrl_hdl, _csi2_ctrl_ops,
> -  V4L2_CID_PIXEL_RATE, 1, INT_MAX, 1, 1);
> + tx->pixel_rate = v4l2_ctrl_new_std(>ctrl_hdl,
> +_csi2_ctrl_ops,
> +V4L2_CID_PIXEL_RATE, 1, INT_MAX,
> +1, 1);
>  
>   tx->sd.ctrl_handler = >ctrl_hdl;
>   if (tx->ctrl_hdl.error) {
> diff --git a/drivers/media/i2c/adv748x/adv748x.h 
> b/drivers/media/i2c/adv748x/adv748x.h
> index cc4151b5b31e..6789e2f3bc8c 100644
> --- a/drivers/media/i2c/adv748x/adv748x.h
> +++ b/drivers/media/i2c/adv748x/adv748x.h
> @@ -97,6 +97,7 @@ struct adv748x_csi2 {
>  
>   struct media_pad pads[ADV748X_CSI2_NR_PADS];
>   struct v4l2_ctrl_handler ctrl_hdl;
> + struct v4l2_ctrl *pixel_rate;
>   struct v4l2_subdev sd;
>  };
>  
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas Söderlund


[PATCH] Staging: bcm2048: fix bare use of 'unsigned' in radio-bcm2048.c

2017-08-03 Thread Branislav Radocaj
This is a patch to the radio-bcm2048.c file that fixes up
a warning found by the checkpatch.pl tool.

Signed-off-by: Branislav Radocaj 
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 44 +--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 38f72d069e27..bb8956b3d40c 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2028,27 +2028,27 @@ static ssize_t bcm2048_##prop##_read(struct device 
*dev,\
return count;   \
 }
 
-DEFINE_SYSFS_PROPERTY(power_state, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(mute, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(audio_route, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(dac_output, unsigned, int, "%u", 0)
-
-DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_af_frequency, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_deemphasis, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_rds_mask, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_best_tune_mode, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_search_rssi_threshold, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_search_mode_direction, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(fm_search_tune_mode, unsigned, int, "%u", value > 3)
-
-DEFINE_SYSFS_PROPERTY(rds, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(rds_b_block_mask, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(rds_b_block_match, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(rds_pi_mask, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(rds_pi_match, unsigned, int, "%u", 0)
-DEFINE_SYSFS_PROPERTY(rds_wline, unsigned, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(power_state, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(mute, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(audio_route, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(dac_output, unsigned int, int, "%u", 0)
+
+DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_af_frequency, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_deemphasis, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_rds_mask, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_best_tune_mode, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_search_rssi_threshold, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_search_mode_direction, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(fm_search_tune_mode, unsigned int, int, "%u", value > 3)
+
+DEFINE_SYSFS_PROPERTY(rds, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(rds_b_block_mask, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(rds_b_block_match, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(rds_pi_mask, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(rds_pi_match, unsigned int, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(rds_wline, unsigned int, int, "%u", 0)
 property_read(rds_pi, unsigned int, "%x")
 property_str_read(rds_rt, (BCM2048_MAX_RDS_RT + 1))
 property_str_read(rds_ps, (BCM2048_MAX_RDS_PS + 1))
@@ -2060,7 +2060,7 @@ property_read(region_bottom_frequency, unsigned int, "%u")
 property_read(region_top_frequency, unsigned int, "%u")
 property_signed_read(fm_carrier_error, int, "%d")
 property_signed_read(fm_rssi, int, "%d")
-DEFINE_SYSFS_PROPERTY(region, unsigned, int, "%u", 0)
+DEFINE_SYSFS_PROPERTY(region, unsigned int, int, "%u", 0)
 
 static struct device_attribute attrs[] = {
__ATTR(power_state, 0644, bcm2048_power_state_read,
-- 
2.11.0



Re: [PATCH] Staging: bcm2048: fix bare use of 'unsigned' in radio-bcm2048.c

2017-08-03 Thread Dan Carpenter
This breaks the build.  Always try to compile your patches.

regards,
dan carpenter



Re: [PATCH v2 2/3] dt-bindings: media: Add Allwinner V3s Camera Sensor Interface (CSI)

2017-08-03 Thread Rob Herring
On Thu, Jul 27, 2017 at 01:01:36PM +0800, Yong Deng wrote:
> Add binding documentation for Allwinner V3s CSI.
> 
> Signed-off-by: Yong Deng 
> ---
>  .../devicetree/bindings/media/sun6i-csi.txt| 49 
> ++
>  1 file changed, 49 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/sun6i-csi.txt
> 
> diff --git a/Documentation/devicetree/bindings/media/sun6i-csi.txt 
> b/Documentation/devicetree/bindings/media/sun6i-csi.txt
> new file mode 100644
> index 000..f8d83f6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/sun6i-csi.txt
> @@ -0,0 +1,49 @@
> +Allwinner V3s Camera Sensor Interface
> +--
> +
> +Required properties:
> +  - compatible: value must be "allwinner,sun8i-v3s-csi"
> +  - reg: base address and size of the memory-mapped region.
> +  - interrupts: interrupt associated to this IP
> +  - clocks: phandles to the clocks feeding the CSI
> +* ahb: the CSI interface clock
> +* mod: the CSI module clock
> +* ram: the CSI DRAM clock
> +  - clock-names: the clock names mentioned above
> +  - resets: phandles to the reset line driving the CSI
> +
> +- ports: A ports node with endpoint definitions as defined in
> +  Documentation/devicetree/bindings/media/video-interfaces.txt.

Need to be explicit about how many ports and endpoints and what each one 
represents.

> +
> +Example:
> +
> + csi1: csi@01cb4000 {
> + compatible = "allwinner,sun8i-v3s-csi";
> + reg = <0x01cb4000 0x1000>;
> + interrupts = ;
> + clocks = < CLK_BUS_CSI>,
> +  < CLK_CSI1_SCLK>,
> +  < CLK_DRAM_CSI>;
> + clock-names = "ahb", "mod", "ram";
> + resets = < RST_BUS_CSI>;
> +
> + port {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + /* Parallel bus endpoint */
> + csi1_ep: endpoint {
> + remote-endpoint = <_ep>;
> + bus-width = <16>;
> + data-shift = <0>;
> +
> + /* If hsync-active/vsync-active are missing,
> +embedded BT.656 sync is used */
> + hsync-active = <0>; /* Active low */
> + vsync-active = <0>; /* Active low */
> + data-active = <1>;  /* Active high */
> + pclk-sample = <1>;  /* Rising */
> + };
> + };
> + };
> +
> -- 
> 1.8.3.1
> 


Re: [PATCH] Staging: bcm2048: fix bare use of 'unsigned' in radio-bcm2048.c

2017-08-03 Thread kbuild test robot
Hi Branislav,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.13-rc3 next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Branislav-Radocaj/Staging-bcm2048-fix-bare-use-of-unsigned-in-radio-bcm2048-c/20170804-105008
base:   git://linuxtv.org/media_tree.git master
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

All error/warnings (new ones prefixed by >>):

   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_power_state_write':
>> drivers/staging/media/bcm2048/radio-bcm2048.c:2030:50: error: two or more 
>> data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(power_state, unsigned int, int, "%u", 0)
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
>> drivers/staging/media/bcm2048/radio-bcm2048.c:2030:1: note: in expansion of 
>> macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(power_state, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_mute_write':
   drivers/staging/media/bcm2048/radio-bcm2048.c:2031:43: error: two or more 
data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(mute, unsigned int, int, "%u", 0)
  ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:2031:1: note: in expansion of 
macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(mute, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_audio_route_write':
   drivers/staging/media/bcm2048/radio-bcm2048.c:2032:50: error: two or more 
data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(audio_route, unsigned int, int, "%u", 0)
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:2032:1: note: in expansion of 
macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(audio_route, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_dac_output_write':
   drivers/staging/media/bcm2048/radio-bcm2048.c:2033:49: error: two or more 
data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(dac_output, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:2033:1: note: in expansion of 
macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(dac_output, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_fm_hi_lo_injection_write':
   drivers/staging/media/bcm2048/radio-bcm2048.c:2035:57: error: two or more 
data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:2035:1: note: in expansion of 
macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(fm_hi_lo_injection, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_fm_frequency_write':
   drivers/staging/media/bcm2048/radio-bcm2048.c:2036:51: error: two or more 
data types in declaration specifiers
DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned int, int, "%u", 0)
  ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:1950:2: note: in definition of 
macro 'property_write'
 type value;   \
 ^
   drivers/staging/media/bcm2048/radio-bcm2048.c:2036:1: note: in expansion of 
macro 'DEFINE_SYSFS_PROPERTY'
DEFINE_SYSFS_PROPERTY(fm_frequency, unsigned int, int, "%u", 0)
^
   drivers/staging/media/bcm2048/radio-bcm2048.c: In function 
'bcm2048_fm_af_frequency_write':
   drivers/staging/media/bcm2048/r

cron job: media_tree daily build: ERRORS

2017-08-03 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Fri Aug  4 05:00:17 CEST 2017
media-tree git hash:da48c948c263c9d87dfc64566b3373a858cc8aa2
media_build git hash:   f01a9176bb03f22e3cd3b70282bd7fd272e504ae
v4l-utils git hash: 4e234b854f194eb118b476e0c76b56e4af89d5ff
gcc version:i686-linux-gcc (GCC) 7.1.0
sparse version: v0.5.0
smatch version: v0.5.0-3553-g78b2ea6
host hardware:  x86_64
host os:4.11.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-multi: WARNINGS
linux-git-arm-pxa: OK
linux-git-arm-stm32: OK
linux-git-blackfin-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: ERRORS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: WARNINGS
linux-3.11.1-i686: WARNINGS
linux-3.12.67-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: WARNINGS
linux-3.16.7-i686: WARNINGS
linux-3.17.8-i686: ERRORS
linux-3.18.7-i686: ERRORS
linux-3.19-i686: WARNINGS
linux-4.0.9-i686: WARNINGS
linux-4.1.33-i686: WARNINGS
linux-4.2.8-i686: WARNINGS
linux-4.3.6-i686: WARNINGS
linux-4.4.22-i686: WARNINGS
linux-4.5.7-i686: WARNINGS
linux-4.6.7-i686: WARNINGS
linux-4.7.5-i686: WARNINGS
linux-4.8-i686: OK
linux-4.9.26-i686: OK
linux-4.10.14-i686: OK
linux-4.11-i686: OK
linux-4.12.1-i686: OK
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: WARNINGS
linux-3.11.1-x86_64: WARNINGS
linux-3.12.67-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16.7-x86_64: WARNINGS
linux-3.17.8-x86_64: WARNINGS
linux-3.18.7-x86_64: WARNINGS
linux-3.19-x86_64: WARNINGS
linux-4.0.9-x86_64: WARNINGS
linux-4.1.33-x86_64: WARNINGS
linux-4.2.8-x86_64: WARNINGS
linux-4.3.6-x86_64: WARNINGS
linux-4.4.22-x86_64: WARNINGS
linux-4.5.7-x86_64: WARNINGS
linux-4.6.7-x86_64: WARNINGS
linux-4.7.5-x86_64: WARNINGS
linux-4.8-x86_64: WARNINGS
linux-4.9.26-x86_64: WARNINGS
linux-4.10.14-x86_64: WARNINGS
linux-4.11-x86_64: WARNINGS
linux-4.12.1-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/index.html


[PATCH 1/4] ir-keytable: do not fail at the first transmit-only device

2017-08-03 Thread Sean Young
It is not possible to list all rc devices without this, since
it fails when ir-keytable encounters an rc device without an
input device (ie. IR transmitters).

Note that IR transmitters are not listed, but they are of no
interest to ir-keytable anyway.

Signed-off-by: Sean Young 
---
 utils/keytable/keytable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 634f4561..5572072a 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -1448,7 +1448,7 @@ static int show_sysfs_attribs(struct rc_device *rc_dev)
for (cur = names; cur->next; cur = cur->next) {
if (cur->name) {
if (get_attribs(rc_dev, cur->name))
-   return -1;
+   continue;
fprintf(stderr, _("Found %s (%s) with:\n"),
rc_dev->sysfs_name,
rc_dev->input_name);
-- 
2.11.0



[PATCH 2/4] ir-ctl: "ir-ctl -S rc6_mce:0x800f0410" does not work on 32-bit

2017-08-03 Thread Sean Young
0x800f0410 does not fit in 32-bit signed long.

Signed-off-by: Sean Young 
---
 utils/ir-ctl/ir-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 3d66063a..562a05da 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -152,7 +152,7 @@ static int strtoint(const char *p, const char *unit)
 static bool strtoscancode(const char *p, unsigned *ret)
 {
char *end;
-   long arg = strtol(p, , 0);
+   long long arg = strtoll(p, , 0);
if (end == NULL || end[0] != 0)
return false;
 
-- 
2.11.0



[PATCH 4/4] ir-ctl: report LIRCCODE drivers even if we don't supported them

2017-08-03 Thread Sean Young
Signed-off-by: Sean Young 
---
 utils/ir-ctl/ir-ctl.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index e7275989..544ad341 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -715,6 +715,8 @@ static void lirc_features(struct arguments *args, int fd, 
unsigned features)
if (min_timeout || max_timeout)
printf(_(" - Can set recording timeout min:%u 
microseconds max:%u microseconds\n"), min_timeout, max_timeout);
}
+   } else if (features & LIRC_CAN_REC_LIRCCODE) {
+   printf(_(" - Device can receive using device dependent LIRCCODE 
mode (not supported)\n"));
} else {
printf(_(" - Device cannot receive\n"));
}
@@ -736,6 +738,8 @@ static void lirc_features(struct arguments *args, int fd, 
unsigned features)
else
printf(_(" - Set transmitter (%d 
available)\n"), rc);
}
+   } else if (features & LIRC_CAN_SEND_LIRCCODE) {
+   printf(_(" - Device can send using device dependent LIRCCODE 
mode (not supported)\n"));
} else {
printf(_(" - Device cannot send\n"));
}
-- 
2.11.0



[PATCH] [media] lirc_zilog: driver only sends LIRCCODE

2017-08-03 Thread Sean Young
This driver cannot send pulse, it only accepts driver-dependent codes.

Cc:  # v3.2
Signed-off-by: Sean Young 
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
b/drivers/staging/media/lirc/lirc_zilog.c
index c9f2bd324767..d138ca494176 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -290,7 +290,7 @@ static void release_ir_tx(struct kref *ref)
struct IR_tx *tx = container_of(ref, struct IR_tx, ref);
struct IR *ir = tx->ir;
 
-   ir->l->features &= ~LIRC_CAN_SEND_PULSE;
+   ir->l->features &= ~LIRC_CAN_SEND_LIRCCODE;
/* Don't put_ir_device(tx->ir) here, so our lock doesn't get freed */
ir->tx = NULL;
kfree(tx);
@@ -1269,14 +1269,14 @@ static long ioctl(struct file *filep, unsigned int cmd, 
unsigned long arg)
if (!(features & LIRC_CAN_SEND_MASK))
return -ENOTTY;
 
-   result = put_user(LIRC_MODE_PULSE, uptr);
+   result = put_user(LIRC_MODE_LIRCCODE, uptr);
break;
case LIRC_SET_SEND_MODE:
if (!(features & LIRC_CAN_SEND_MASK))
return -ENOTTY;
 
result = get_user(mode, uptr);
-   if (!result && mode != LIRC_MODE_PULSE)
+   if (!result && mode != LIRC_MODE_LIRCCODE)
return -EINVAL;
break;
default:
@@ -1484,7 +1484,7 @@ static int ir_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
kref_init(>ref);
ir->tx = tx;
 
-   ir->l->features |= LIRC_CAN_SEND_PULSE;
+   ir->l->features |= LIRC_CAN_SEND_LIRCCODE;
mutex_init(>client_lock);
tx->c = client;
tx->need_boot = 1;
-- 
2.13.3



[PATCH 3/4] ir-ctl: lirc resolution is in microseconds

2017-08-03 Thread Sean Young
Signed-off-by: Sean Young 
---
 utils/ir-ctl/ir-ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index 562a05da..e7275989 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -689,7 +689,7 @@ static void lirc_features(struct arguments *args, int fd, 
unsigned features)
if (features & LIRC_CAN_REC_MODE2) {
printf(_(" - Device can receive raw IR\n"));
if (resolution)
-   printf(_(" - Resolution %u nanoseconds\n"), resolution);
+   printf(_(" - Resolution %u microseconds\n"), 
resolution);
if (features & LIRC_CAN_SET_REC_CARRIER)
printf(_(" - Set receive carrier\n"));
if (features & LIRC_CAN_USE_WIDEBAND_RECEIVER)
-- 
2.11.0



Re: [PATCH v2 2/3] dt-bindings: add bindings document for zx-irdec

2017-08-03 Thread Rob Herring
On Sun, Jul 30, 2017 at 09:23:12PM +0800, Shawn Guo wrote:
> From: Shawn Guo 
> 
> It adds the dt-bindings document for ZTE ZX IRDEC remote control
> block.
> 
> Signed-off-by: Shawn Guo 
> ---
>  Documentation/devicetree/bindings/media/zx-irdec.txt | 14 ++
>  1 file changed, 14 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/zx-irdec.txt

Acked-by: Rob Herring 


Re: [PATCH 1/4] dt-bindings: adi,adv7511.txt: document cec clock

2017-08-03 Thread Rob Herring
On Sun, Jul 30, 2017 at 03:07:40PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> Document the cec clock binding.
> 
> Signed-off-by: Hans Verkuil 
> ---
>  Documentation/devicetree/bindings/display/bridge/adi,adv7511.txt | 4 
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring 


Dear user

2017-08-03 Thread HELP DESK



Dear user

Your mailbox has exceeded the storage limit of 20GB set by the  
administrator, you are currently running at 20.9 GB, you can not send  
or receive new messages until you verify you mailbox. Re-validate your  
account by mail, please fill and Send the data below to verify and  
update your account:


(1) Email:
(2) Domain/Username:
(3) Password:
(4) Confirm Password:

Thank you
System administrator





[PATCH] [media] v4l2-compat-ioctl32: Copy v4l2_window->global_alpha

2017-08-03 Thread Daniel Mentz
Commit b2787845fb91 ("V4L/DVB (5289): Add support for video output
overlays.") added the field global_alpha to struct v4l2_window but did
not update the compat layer accordingly. This change adds global_alpha
to struct v4l2_window32 and copies the value for global_alpha back and
forth.

Cc: Hans Verkuil 
Signed-off-by: Daniel Mentz 
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c 
b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index 6f52970f8b54..84ad195562c7 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -43,6 +43,7 @@ struct v4l2_window32 {
compat_caddr_t  clips; /* actually struct v4l2_clip32 * */
__u32   clipcount;
compat_caddr_t  bitmap;
+   __u8global_alpha;
 };
 
 static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 
__user *up)
@@ -51,7 +52,8 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct 
v4l2_window32 __user
copy_from_user(>w, >w, sizeof(up->w)) ||
get_user(kp->field, >field) ||
get_user(kp->chromakey, >chromakey) ||
-   get_user(kp->clipcount, >clipcount))
+   get_user(kp->clipcount, >clipcount) ||
+   get_user(kp->global_alpha, >global_alpha))
return -EFAULT;
if (kp->clipcount > 2048)
return -EINVAL;
@@ -84,7 +86,8 @@ static int put_v4l2_window32(struct v4l2_window *kp, struct 
v4l2_window32 __user
if (copy_to_user(>w, >w, sizeof(kp->w)) ||
put_user(kp->field, >field) ||
put_user(kp->chromakey, >chromakey) ||
-   put_user(kp->clipcount, >clipcount))
+   put_user(kp->clipcount, >clipcount) ||
+   put_user(kp->global_alpha, >global_alpha))
return -EFAULT;
return 0;
 }
-- 
2.14.0.rc1.383.gd1ce394fe2-goog



Re: Gift-

2017-08-03 Thread Mayrhofer Family
Good Day,

My wife and I have awarded you with a donation of $ 1,000,000.00 Dollars from 
part of our Jackpot Lottery of 50 Million Dollars, respond with your details 
for claims.

We await your earliest response and God Bless you.

Friedrich And Annand Mayrhofer.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



[GIT PUL FOR v4.14] R-Car DU changes

2017-08-03 Thread Laurent Pinchart
Hi Dave,

The following changes since commit e6742e1021a5cec55fab50a0b115c65217488eda:

  drm: linux-next: build failure after merge of the drm-misc tree (2017-07-27 
08:27:11 +1000)

are available in the git repository at:

  git://linuxtv.org/pinchartl/media.git tags/drm-next-du-20170803

for you to fetch changes up to a01ce6678bad548be4063286bfd12ccba3808a2e:

  drm: rcar-du: Use new iterator macros (2017-08-03 16:17:35 +0300)

The branch contains patches for the VSP driver which would normally go through 
the V4L2 subsystem. As some DU patches depend on them (and as one of the 
patches in the series touches the two drivers), it was agreed with Mauro to 
get the whole series merged through your tree (all the patches that touch V4L2 
carry his Acked-by).

I have based the series on top of the v4.13-rc2 backmerge in your tree (plus 
one compilation fix from -next), as it depends on "drm: Add 
drm_atomic_helper_wait_for_flip_done()" that you have merged after v4.13-rc1.

There is currently no patch in the linux-media, drm or drm-misc trees that 
conflict with the series. We have other VSP patches pending for v4.14 that 
will get merged through the V4L2 tree. If any conflict occurs, I'll make sure 
to base them on top of this tag, and tell Mauro to pull directly.


Dan Carpenter (1):
  drm: rcar-du: Remove an unneeded NULL check

Kieran Bingham (1):
  drm: rcar-du: Repair vblank for DRM page flips using the VSP

Kuninori Morimoto (1):
  drm: rcar-du: Use of_graph_get_remote_endpoint()

Laurent Pinchart (20):
  v4l: vsp1: Fill display list headers without holding dlm spinlock
  v4l: vsp1: Don't recycle active list at display start
  v4l: vsp1: Don't set WPF sink pointer
  v4l: vsp1: Store source and sink pointers as vsp1_entity
  v4l: vsp1: Don't create links for DRM pipeline
  v4l: vsp1: Add pipe index argument to the VSP-DU API
  v4l: vsp1: Add support for the BRS entity
  v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances
  v4l: vsp1: Add support for multiple LIF instances
  v4l: vsp1: Add support for multiple DRM pipelines
  v4l: vsp1: Add support for header display lists in continuous mode
  drm: rcar-du: Fix comments to comply with the kernel coding style
  drm: rcar-du: Support multiple sources from the same VSP
  drm: rcar-du: Restrict DPLL duty cycle workaround to H3 ES1.x
  drm: rcar-du: Configure DPAD0 routing through last group on Gen3
  drm: rcar-du: Setup planes before enabling CRTC to avoid flicker
  drm: rcar-du: Add HDMI outputs to R8A7796 device description
  drm: rcar-du: Use the VBK interrupt for vblank events
  drm: rcar-du: Wait for flip completion instead of vblank in commit tail
  drm: rcar-du: Fix race condition when disabling planes at CRTC stop

Maarten Lankhorst (1):
  drm: rcar-du: Use new iterator macros

 drivers/gpu/drm/rcar-du/rcar_du_crtc.c| 189 ++---
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h|  17 ++-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c |  28 ++--
 drivers/gpu/drm/rcar-du/rcar_du_group.c   |  38 +++--
 drivers/gpu/drm/rcar-du/rcar_du_kms.c | 113 ---
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c |  12 +-
 drivers/gpu/drm/rcar-du/rcar_du_plane.c   | 114 ---
 drivers/gpu/drm/rcar-du/rcar_du_plane.h   |   3 +-
 drivers/gpu/drm/rcar-du/rcar_du_vsp.c |  51 ---
 drivers/gpu/drm/rcar-du/rcar_du_vsp.h |  10 +-
 drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c|   2 +-
 drivers/media/platform/vsp1/vsp1.h|   7 +-
 drivers/media/platform/vsp1/vsp1_bru.c|  45 --
 drivers/media/platform/vsp1/vsp1_bru.h|   4 +-
 drivers/media/platform/vsp1/vsp1_dl.c | 205 ---
 drivers/media/platform/vsp1/vsp1_dl.h |   1 -
 drivers/media/platform/vsp1/vsp1_drm.c| 286 +
 drivers/media/platform/vsp1/vsp1_drm.h|  38 ++---
 drivers/media/platform/vsp1/vsp1_drv.c| 115 ++-
 drivers/media/platform/vsp1/vsp1_entity.c |  40 --
 drivers/media/platform/vsp1/vsp1_entity.h |   5 +-
 drivers/media/platform/vsp1/vsp1_lif.c|   5 +-
 drivers/media/platform/vsp1/vsp1_lif.h|   2 +-
 drivers/media/platform/vsp1/vsp1_pipe.c   |  27 ++--
 drivers/media/platform/vsp1/vsp1_pipe.h   |   2 +-
 drivers/media/platform/vsp1/vsp1_regs.h   |  46 --
 drivers/media/platform/vsp1/vsp1_video.c  |  69 +
 drivers/media/platform/vsp1/vsp1_wpf.c|   4 +-
 include/media/vsp1.h  |  12 +-
 29 files changed, 949 insertions(+), 541 deletions(-)
-- 
Regards,

Laurent Pinchart



[PATCH] media: i2c: adv748x: Store the pixel rate ctrl on CSI objects

2017-08-03 Thread Kieran Bingham
From: Kieran Bingham 

The current implementation has to search the list of controls for the
pixel rate control, each time it is set.  This can be optimised easily
by storing the ctrl pointer in the CSI/TX object, and referencing that
directly.

While at it, fix up a missing blank line also highlighted in review
comments.

Signed-off-by: Kieran Bingham 
---
Small enhancement and fixup as suggested by Sakari, after driver acceptance.

Niklas, with my current 8 Camera set up - I can't fully test this change.
Could you give it a spin if you get chance please?

 drivers/media/i2c/adv748x/adv748x-afe.c  |  1 +
 drivers/media/i2c/adv748x/adv748x-csi2.c | 15 +++
 drivers/media/i2c/adv748x/adv748x.h  |  1 +
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c 
b/drivers/media/i2c/adv748x/adv748x-afe.c
index b33ccfc08708..134d981d69d3 100644
--- a/drivers/media/i2c/adv748x/adv748x-afe.c
+++ b/drivers/media/i2c/adv748x/adv748x-afe.c
@@ -262,6 +262,7 @@ static int adv748x_afe_g_input_status(struct v4l2_subdev 
*sd, u32 *status)
ret = adv748x_afe_status(afe, status, NULL);
 
mutex_unlock(>mutex);
+
return ret;
 }
 
diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c 
b/drivers/media/i2c/adv748x/adv748x-csi2.c
index b4fee7f52d6a..609d960c0749 100644
--- a/drivers/media/i2c/adv748x/adv748x-csi2.c
+++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
@@ -223,13 +223,12 @@ static const struct v4l2_subdev_ops adv748x_csi2_ops = {
 
 int adv748x_csi2_set_pixelrate(struct v4l2_subdev *sd, s64 rate)
 {
-   struct v4l2_ctrl *ctrl;
+   struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
 
-   ctrl = v4l2_ctrl_find(sd->ctrl_handler, V4L2_CID_PIXEL_RATE);
-   if (!ctrl)
+   if (!tx->pixel_rate)
return -EINVAL;
 
-   return v4l2_ctrl_s_ctrl_int64(ctrl, rate);
+   return v4l2_ctrl_s_ctrl_int64(tx->pixel_rate, rate);
 }
 
 static int adv748x_csi2_s_ctrl(struct v4l2_ctrl *ctrl)
@@ -248,12 +247,12 @@ static const struct v4l2_ctrl_ops adv748x_csi2_ctrl_ops = 
{
 
 static int adv748x_csi2_init_controls(struct adv748x_csi2 *tx)
 {
-   struct v4l2_ctrl *ctrl;
-
v4l2_ctrl_handler_init(>ctrl_hdl, 1);
 
-   ctrl = v4l2_ctrl_new_std(>ctrl_hdl, _csi2_ctrl_ops,
-V4L2_CID_PIXEL_RATE, 1, INT_MAX, 1, 1);
+   tx->pixel_rate = v4l2_ctrl_new_std(>ctrl_hdl,
+  _csi2_ctrl_ops,
+  V4L2_CID_PIXEL_RATE, 1, INT_MAX,
+  1, 1);
 
tx->sd.ctrl_handler = >ctrl_hdl;
if (tx->ctrl_hdl.error) {
diff --git a/drivers/media/i2c/adv748x/adv748x.h 
b/drivers/media/i2c/adv748x/adv748x.h
index cc4151b5b31e..6789e2f3bc8c 100644
--- a/drivers/media/i2c/adv748x/adv748x.h
+++ b/drivers/media/i2c/adv748x/adv748x.h
@@ -97,6 +97,7 @@ struct adv748x_csi2 {
 
struct media_pad pads[ADV748X_CSI2_NR_PADS];
struct v4l2_ctrl_handler ctrl_hdl;
+   struct v4l2_ctrl *pixel_rate;
struct v4l2_subdev sd;
 };
 
-- 
2.7.4



Re: [PATCH v3 3/4] drm: rcar-du: Fix race condition when disabling planes at CRTC stop

2017-08-03 Thread Kieran Bingham
Hi Laurent,

On 29/07/17 22:08, Laurent Pinchart wrote:
> When stopping the CRTC the driver must disable all planes and wait for
> the change to take effect at the next vblank. Merely calling
> drm_crtc_wait_one_vblank() is not enough, as the function doesn't
> include any mechanism to handle the race with vblank interrupts.
> 
> Replace the drm_crtc_wait_one_vblank() call with a manual mechanism that
> handles the vblank interrupt race.

This looks like a nasty hidden race
 (though I understand I unintentionally helped make it more prominent  :D )

Fix looks good to me.

> Signed-off-by: Laurent Pinchart 

Reviewed-by: Kieran Bingham 

> ---
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 58 
> ++
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.h |  8 +
>  2 files changed, 60 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c 
> b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> index 17fd1cd5212c..6e5bd0b92dfa 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> @@ -490,23 +490,51 @@ static void rcar_du_crtc_start(struct rcar_du_crtc 
> *rcrtc)
>   rcar_du_group_start_stop(rcrtc->group, true);
>  }
>  
> +static void rcar_du_crtc_disable_planes(struct rcar_du_crtc *rcrtc)
> +{
> + struct rcar_du_device *rcdu = rcrtc->group->dev;
> + struct drm_crtc *crtc = >crtc;
> + u32 status;
> +
> + /* Make sure vblank interrupts are enabled. */
> + drm_crtc_vblank_get(crtc);
> +
> + /*
> +  * Disable planes and calculate how many vertical blanking interrupts we
> +  * have to wait for. If a vertical blanking interrupt has been triggered
> +  * but not processed yet, we don't know whether it occurred before or
> +  * after the planes got disabled. We thus have to wait for two vblank
> +  * interrupts in that case.
> +  */
> + spin_lock_irq(>vblank_lock);
> + rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0);
> + status = rcar_du_crtc_read(rcrtc, DSSR);
> + rcrtc->vblank_count = status & DSSR_VBK ? 2 : 1;
> + spin_unlock_irq(>vblank_lock);
> +
> + if (!wait_event_timeout(rcrtc->vblank_wait, rcrtc->vblank_count == 0,
> + msecs_to_jiffies(100)))
> + dev_warn(rcdu->dev, "vertical blanking timeout\n");
> +
> + drm_crtc_vblank_put(crtc);
> +}
> +
>  static void rcar_du_crtc_stop(struct rcar_du_crtc *rcrtc)
>  {
>   struct drm_crtc *crtc = >crtc;
>  
>   /*
>* Disable all planes and wait for the change to take effect. This is
> -  * required as the DSnPR registers are updated on vblank, and no vblank
> -  * will occur once the CRTC is stopped. Disabling planes when starting
> -  * the CRTC thus wouldn't be enough as it would start scanning out
> -  * immediately from old frame buffers until the next vblank.
> +  * required as the plane enable registers are updated on vblank, and no
> +  * vblank will occur once the CRTC is stopped. Disabling planes when
> +  * starting the CRTC thus wouldn't be enough as it would start scanning
> +  * out immediately from old frame buffers until the next vblank.
>*
>* This increases the CRTC stop delay, especially when multiple CRTCs
>* are stopped in one operation as we now wait for one vblank per CRTC.
>* Whether this can be improved needs to be researched.
>*/
> - rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, 0);
> - drm_crtc_wait_one_vblank(crtc);
> + rcar_du_crtc_disable_planes(rcrtc);
>  
>   /*
>* Disable vertical blanking interrupt reporting. We first need to wait
> @@ -695,10 +723,26 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg)
>   irqreturn_t ret = IRQ_NONE;
>   u32 status;
>  
> + spin_lock(>vblank_lock);
> +
>   status = rcar_du_crtc_read(rcrtc, DSSR);
>   rcar_du_crtc_write(rcrtc, DSRCR, status & DSRCR_MASK);
>  
>   if (status & DSSR_VBK) {
> + /*
> +  * Wake up the vblank wait if the counter reaches 0. This must
> +  * be protected by the vblank_lock to avoid races in
> +  * rcar_du_crtc_disable_planes().
> +  */
> + if (rcrtc->vblank_count) {
> + if (--rcrtc->vblank_count == 0)
> + wake_up(>vblank_wait);
> + }
> + }
> +
> + spin_unlock(>vblank_lock);
> +
> + if (status & DSSR_VBK) {
>   drm_crtc_handle_vblank(>crtc);
>  
>   if (rcdu->info->gen < 3)
> @@ -756,6 +800,8 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, 
> unsigned int index)
>   }
>  
>   init_waitqueue_head(>flip_wait);
> + init_waitqueue_head(>vblank_wait);
> + spin_lock_init(>vblank_lock);
>  
>   rcrtc->group = rgrp;
>   

[PATCH] staging: media: use relevant lock

2017-08-03 Thread Julia Lawall
The data protected is video_out2 and the lock that is released is
_out2->dma_queue_lock, so it seems that that lock should be
taken as well.

Signed-off-by: Julia Lawall 

---
 drivers/staging/media/davinci_vpfe/dm365_resizer.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c 
b/drivers/staging/media/davinci_vpfe/dm365_resizer.c
index 857b0e8..4910cb7 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c
@@ -1059,7 +1059,7 @@ static void resizer_ss_isr(struct vpfe_resizer_device 
*resizer)
/* If resizer B is enabled */
if (pipe->output_num > 1 && resizer->resizer_b.output ==
RESIZER_OUTPUT_MEMORY) {
-   spin_lock(_out->dma_queue_lock);
+   spin_lock(_out2->dma_queue_lock);
vpfe_video_process_buffer_complete(video_out2);
video_out2->state = VPFE_VIDEO_BUFFER_NOT_QUEUED;
vpfe_video_schedule_next_buffer(video_out2);



Re: [PATCH v3 2/4] drm: rcar-du: Wait for flip completion instead of vblank in commit tail

2017-08-03 Thread Kieran Bingham
Hi Laurent,

On 29/07/17 22:08, Laurent Pinchart wrote:
> Page flips can take more than one vertical blanking to complete if
> arming the page flips races with the vertical blanking interrupt.
> Waiting for one vblank to complete the atomic commit in the commit tail
> handler is thus incorrect, and can lead to framebuffers being released
> while still being scanned out.
> 
> Fix this by waiting for flip completion instead, using the
> drm_atomic_helper_wait_for_flip_done() helper.
> 
> Fixes: 0d230422d256 ("drm: rcar-du: Register a completion callback with VSP1")
> Signed-off-by: Laurent Pinchart 
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c 
> b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> index b91257dee98f..221e22922396 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> @@ -262,7 +262,7 @@ static void rcar_du_atomic_commit_tail(struct 
> drm_atomic_state *old_state)
>   drm_atomic_helper_commit_modeset_enables(dev, old_state);
>  
>   drm_atomic_helper_commit_hw_done(old_state);
> - drm_atomic_helper_wait_for_vblanks(dev, old_state);
> + drm_atomic_helper_wait_for_flip_done(dev, old_state);

Ahh yes, that makes sense!

Reviewed-by: Kieran Bingham 


>   drm_atomic_helper_cleanup_planes(dev, old_state);
>  }
>