Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Andy Shevchenko
On Wed, Nov 18, 2015 at 5:51 PM, Arnd Bergmann  wrote:
> On Wednesday 18 November 2015 17:43:04 Andy Shevchenko wrote:
>> >
>> > I assume that the sst-firmware.c case is a mistake, it should just use a
>> > plain DMA_SLAVE and not DMA_MEMCPY.
>>
>> Other way around.
>>
>
> Ok, I see. In that case I guess it also shouldn't call
> dmaengine_slave_config(), right? I don't think that's valid
> on a MEMCPY channel.

Hmm… That's right, though I suspect still one thing why it's done this
way. Let's ask Vinod and Liam about that.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[linuxtv-media:master 1801/1806] drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:40: error: expected ')' before ';' token

2015-11-18 Thread kbuild test robot
tree:   git://linuxtv.org/media_tree.git master
head:   769b640929046f1207b928d194a855d759ad0a06
commit: f934a94bb566a629b7e0be52d087a686145d1f14 [1801/1806] [media] s5c73m3: 
Export OF module alias information
config: x86_64-randconfig-s4-11182347 (attached as .config)
reproduce:
git checkout f934a94bb566a629b7e0be52d087a686145d1f14
# save the attached .config to linux build tree
make ARCH=x86_64 

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

   In file included from drivers/media/i2c/s5c73m3/s5c73m3-spi.c:22:0:
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:40: error: expected ')' before 
>> ';' token
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
   ^
   include/linux/module.h:223:21: note: in definition of macro 
'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table  \
^
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:40: error: pasting ";" and 
>> "_device_table" does not give a valid preprocessing token
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
   ^
   include/linux/module.h:223:45: note: in definition of macro 
'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table  \
^
>> include/linux/module.h:223:51: warning: data definition has no type or 
>> storage class
extern const typeof(name) __mod_##type##__##name##_device_table  \
  ^
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: note: in expansion of macro 
>> 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
^
>> include/linux/module.h:223:51: error: type defaults to 'int' in declaration 
>> of '_device_table' [-Werror=implicit-int]
extern const typeof(name) __mod_##type##__##name##_device_table  \
  ^
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: note: in expansion of macro 
>> 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
^
>> include/linux/module.h:223:51: error: '_device_table' defined both normally 
>> and as 'alias' attribute
extern const typeof(name) __mod_##type##__##name##_device_table  \
  ^
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: note: in expansion of macro 
>> 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
^
   cc1: some warnings being treated as errors

vim +40 drivers/media/i2c/s5c73m3/s5c73m3-spi.c

16   */
17  
18  #include 
19  #include 
20  #include 
21  #include 
  > 22  #include 
23  #include 
24  #include 
25  
26  #include "s5c73m3.h"
27  
28  #define S5C73M3_SPI_DRV_NAME "S5C73M3-SPI"
29  
30  static const struct of_device_id s5c73m3_spi_ids[] = {
31  { .compatible = "samsung,s5c73m3" },
32  { }
33  };
34  MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids);
35  
36  enum spi_direction {
37  SPI_DIR_RX,
38  SPI_DIR_TX
39  };
  > 40  MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
41  
42  static int spi_xmit(struct spi_device *spi_dev, void *addr, const int 
len,
43  enum 
spi_direction dir)

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


.config.gz
Description: Binary data


Re: [PATCH 2/9] [media] tvp5150: add userspace subdev API

2015-11-18 Thread kbuild test robot
Hi Philipp,

[auto build test ERROR on: v4.4-rc1]
[also build test ERROR on: next-20151118]
[cannot apply to: linuxtv-media/master]

url:
https://github.com/0day-ci/linux/commits/Lucas-Stach/tvp5150-convert-register-access-to-regmap/20151119-005732
config: x86_64-randconfig-x018-11181928 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

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

   drivers/media/i2c/tvp5150.c: In function 'tvp5150_get_pad_format':
>> drivers/media/i2c/tvp5150.c:1062:10: error: implicit declaration of function 
>> 'v4l2_subdev_get_try_format' [-Werror=implicit-function-declaration]
  return v4l2_subdev_get_try_format(sd, cfg, pad);
 ^
>> drivers/media/i2c/tvp5150.c:1062:10: warning: return makes pointer from 
>> integer without a cast [-Wint-conversion]
   drivers/media/i2c/tvp5150.c: In function 'tvp5150_get_pad_crop':
>> drivers/media/i2c/tvp5150.c:1077:10: error: implicit declaration of function 
>> 'v4l2_subdev_get_try_crop' [-Werror=implicit-function-declaration]
  return v4l2_subdev_get_try_crop(sd, cfg, pad);
 ^
   drivers/media/i2c/tvp5150.c:1077:10: warning: return makes pointer from 
integer without a cast [-Wint-conversion]
   drivers/media/i2c/tvp5150.c: In function 'tvp5150_open':
>> drivers/media/i2c/tvp5150.c:1180:27: warning: passing argument 2 of 
>> 'tvp5150_set_default' makes pointer from integer without a cast 
>> [-Wint-conversion]
 tvp5150_set_default(std, v4l2_subdev_get_try_crop(fh, 0),
  ^
   drivers/media/i2c/tvp5150.c:1152:13: note: expected 'struct v4l2_rect *' but 
argument is of type 'int'
static void tvp5150_set_default(v4l2_std_id std, struct v4l2_rect *crop,
^
   drivers/media/i2c/tvp5150.c:1181:6: warning: passing argument 3 of 
'tvp5150_set_default' makes pointer from integer without a cast 
[-Wint-conversion]
 v4l2_subdev_get_try_format(fh, 0));
 ^
   drivers/media/i2c/tvp5150.c:1152:13: note: expected 'struct 
v4l2_mbus_framefmt *' but argument is of type 'int'
static void tvp5150_set_default(v4l2_std_id std, struct v4l2_rect *crop,
^
   drivers/media/i2c/tvp5150.c: In function 'tvp5150_probe':
>> drivers/media/i2c/tvp5150.c:1340:4: error: 'struct v4l2_subdev' has no 
>> member named 'entity'
 sd->entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
   ^
   drivers/media/i2c/tvp5150.c:1342:29: error: 'struct v4l2_subdev' has no 
member named 'entity'
 res = media_entity_init(>entity, 1, >pad, 0);
^
   cc1: some warnings being treated as errors

vim +/v4l2_subdev_get_try_format +1062 drivers/media/i2c/tvp5150.c

  1056  tvp5150_get_pad_format(struct tvp5150 *decoder, struct v4l2_subdev *sd,
  1057   struct v4l2_subdev_pad_config *cfg, unsigned 
int pad,
  1058   enum v4l2_subdev_format_whence which)
  1059  {
  1060  switch (which) {
  1061  case V4L2_SUBDEV_FORMAT_TRY:
> 1062  return v4l2_subdev_get_try_format(sd, cfg, pad);
  1063  case V4L2_SUBDEV_FORMAT_ACTIVE:
  1064  return >format;
  1065  default:
  1066  return NULL;
  1067  }
  1068  }
  1069  
  1070  static struct v4l2_rect *
  1071  tvp5150_get_pad_crop(struct tvp5150 *decoder, struct v4l2_subdev *sd,
  1072 struct v4l2_subdev_pad_config *cfg, unsigned int 
pad,
  1073 enum v4l2_subdev_format_whence which)
  1074  {
  1075  switch (which) {
  1076  case V4L2_SUBDEV_FORMAT_TRY:
> 1077  return v4l2_subdev_get_try_crop(sd, cfg, pad);
  1078  case V4L2_SUBDEV_FORMAT_ACTIVE:
  1079  return >rect;
  1080  default:
  1081  return NULL;
  1082  }
  1083  }
  1084  
  1085  static int tvp5150_enum_frame_size(struct v4l2_subdev *sd,
  1086 struct v4l2_subdev_pad_config *cfg,
  1087 struct v4l2_subdev_frame_size_enum 
*fse)
  1088  {
  1089  struct tvp5150 *decoder = to_tvp5150(sd);
  1090  v4l2_std_id std;
  1091  
  1092  if (fse->index > 0 || fse->code != MEDIA_BUS_FMT_UYVY8_2X8)
  1093  return -EINVAL;
  1094  
  1095  fse->min_width = TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT;
  1096  fse->max_width = TVP5150_H_MAX;
  1097  
  1098  /* Calculate height based on current standard */
  1099  if (decoder->norm == V4L2_STD_ALL)
  1100  std = tvp5150_read_std(sd);
  1101  else
  1102  std = decoder->norm;
  1103  
  1104  if (std & V4L2_STD_525_60) {
  1105  fse->min_height = TVP5150_V_M

Re: [PATCH 1/6] mt2060: add i2c bindings

2015-11-18 Thread Antti Palosaari

On 11/18/2015 05:01 PM, Mauro Carvalho Chehab wrote:

Em Mon, 27 Jul 2015 14:22:05 +0300
Antti Palosaari  escreveu:


Add proper i2c driver model bindings.


Hi Antti,

What's the status of this patch series? You submitted them on July, but
never sent me a pull request...


I noticed I2C adapter has nowadays (or has it been always there) some 
configuration logic for I2C message sizes (see struct 
i2c_adapter_quirks). I would like to test those, which means I have to 
make some changes to these patches in order to implement message 
splitting way I2C core supports.


Whole thing is for for ZyDAS ZD1301 DVB-T chip driver related, which is 
~10 years old and near zero users nowadays - so no need to hurry at all :D


regards
Antti

--
http://palosaari.fi/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/9] [media] tvp5150: add userspace subdev API

2015-11-18 Thread kbuild test robot
Hi Philipp,

[auto build test ERROR on: v4.4-rc1]
[also build test ERROR on: next-20151118]
[cannot apply to: linuxtv-media/master]

url:
https://github.com/0day-ci/linux/commits/Lucas-Stach/tvp5150-convert-register-access-to-regmap/20151119-005732
config: x86_64-randconfig-x017-11181928 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

Note: the 
linux-review/Lucas-Stach/tvp5150-convert-register-access-to-regmap/20151119-005732
 HEAD bda9ffd30fce12dfa1b1964094311ae5dd780461 builds fine.
  It only hurts bisectibility.

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

   drivers/media/i2c/tvp5150.c: In function 'tvp5150_open':
>> drivers/media/i2c/tvp5150.c:1180:52: warning: passing argument 1 of 
>> 'v4l2_subdev_get_try_crop' from incompatible pointer type 
>> [-Wincompatible-pointer-types]
 tvp5150_set_default(std, v4l2_subdev_get_try_crop(fh, 0),
   ^
   In file included from include/media/v4l2-device.h:25:0,
from drivers/media/i2c/tvp5150.c:15:
   include/media/v4l2-subdev.h:769:37: note: expected 'struct v4l2_subdev *' 
but argument is of type 'struct v4l2_subdev_fh *'
__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, v4l2_subdev_get_try_crop, try_crop)
^
   include/media/v4l2-subdev.h:760:2: note: in definition of macro 
'__V4L2_SUBDEV_MK_GET_TRY'
 fun_name(struct v4l2_subdev *sd,\
 ^
>> drivers/media/i2c/tvp5150.c:1180:27: error: too few arguments to function 
>> 'v4l2_subdev_get_try_crop'
 tvp5150_set_default(std, v4l2_subdev_get_try_crop(fh, 0),
  ^
   In file included from include/media/v4l2-device.h:25:0,
from drivers/media/i2c/tvp5150.c:15:
   include/media/v4l2-subdev.h:769:37: note: declared here
__V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, v4l2_subdev_get_try_crop, try_crop)
^
   include/media/v4l2-subdev.h:760:2: note: in definition of macro 
'__V4L2_SUBDEV_MK_GET_TRY'
 fun_name(struct v4l2_subdev *sd,\
 ^
>> drivers/media/i2c/tvp5150.c:1181:33: warning: passing argument 1 of 
>> 'v4l2_subdev_get_try_format' from incompatible pointer type 
>> [-Wincompatible-pointer-types]
 v4l2_subdev_get_try_format(fh, 0));
^
   In file included from include/media/v4l2-device.h:25:0,
from drivers/media/i2c/tvp5150.c:15:
   include/media/v4l2-subdev.h:768:46: note: expected 'struct v4l2_subdev *' 
but argument is of type 'struct v4l2_subdev_fh *'
__V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, v4l2_subdev_get_try_format, 
try_fmt)
 ^
   include/media/v4l2-subdev.h:760:2: note: in definition of macro 
'__V4L2_SUBDEV_MK_GET_TRY'
 fun_name(struct v4l2_subdev *sd,\
 ^
>> drivers/media/i2c/tvp5150.c:1181:6: error: too few arguments to function 
>> 'v4l2_subdev_get_try_format'
 v4l2_subdev_get_try_format(fh, 0));
 ^
   In file included from include/media/v4l2-device.h:25:0,
from drivers/media/i2c/tvp5150.c:15:
   include/media/v4l2-subdev.h:768:46: note: declared here
__V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, v4l2_subdev_get_try_format, 
try_fmt)
 ^
   include/media/v4l2-subdev.h:760:2: note: in definition of macro 
'__V4L2_SUBDEV_MK_GET_TRY'
 fun_name(struct v4l2_subdev *sd,\
 ^

vim +/v4l2_subdev_get_try_crop +1180 drivers/media/i2c/tvp5150.c

  1174  
  1175  if (decoder->norm == V4L2_STD_ALL)
  1176  std = tvp5150_read_std(sd);
  1177  else
  1178  std = decoder->norm;
  1179  
> 1180  tvp5150_set_default(std, v4l2_subdev_get_try_crop(fh, 0),
> 1181   v4l2_subdev_get_try_format(fh, 0));
  1182  return 0;
  1183  }
  1184  

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


.config.gz
Description: Binary data


[PATCH 3/9] [media] tvp5150: determine BT.656 or YUV 4:2:2 mode from device tree

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

By looking at the endpoint flags, it can be determined whether the link
should be of V4L2_MBUS_PARALLEL or V4L2_MBUS_BT656 type. Disable the
dedicated HSYNC/VSYNC outputs in BT.656 mode.

For devices that are not instantiated through DT the current behavior
is preserved.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 34 --
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 8670b478dcd6..21cde350e385 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -11,10 +11,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include "tvp5150_reg.h"
 
@@ -38,6 +40,7 @@ struct tvp5150 {
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler hdl;
+   enum v4l2_mbus_type bus_type;
struct v4l2_mbus_framefmt format;
struct v4l2_rect rect;
struct regmap *regmap;
@@ -424,8 +427,6 @@ static const struct i2c_reg_value tvp5150_init_enable[] = {
TVP5150_MISC_CTL, 0x6f
},{ /* Activates video std autodetection for all standards */
TVP5150_AUTOSW_MSK, 0x0
-   },{ /* Default format: 0x47. For 4:2:2: 0x40 */
-   TVP5150_DATA_RATE_SEL, 0x47
},{
TVP5150_CHROMA_PROC_CTL_1, 0x0c
},{
@@ -760,6 +761,25 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
/* Initializes TVP5150 to stream enabled values */
tvp5150_write_inittab(sd, tvp5150_init_enable);
 
+   switch (decoder->bus_type) {
+   case V4L2_MBUS_BT656:
+   /* 8-bit ITU BT.656 */
+   regmap_update_bits(decoder->regmap, TVP5150_DATA_RATE_SEL,
+  0x7, 0x7);
+   /* disable HSYNC, VSYNC/PALI, AVID, and FID/GLCO */
+   regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0x4, 0x0);
+   break;
+   case V4L2_MBUS_PARALLEL:
+   /* 8-bit YUV 4:2:2 */
+   regmap_update_bits(decoder->regmap, TVP5150_DATA_RATE_SEL,
+  0x7, 0x0);
+   /* enable HSYNC, VSYNC/PALI, AVID, and FID/GLCO */
+   regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0x4, 0x4);
+   break;
+   default:
+   return -EINVAL;
+   }
+
/* Initialize image preferences */
v4l2_ctrl_handler_setup(>hdl);
 
@@ -1315,6 +1335,8 @@ static struct regmap_config tvp5150_config = {
 static int tvp5150_probe(struct i2c_client *c,
 const struct i2c_device_id *id)
 {
+   struct v4l2_of_endpoint bus_cfg;
+   struct device_node *endpoint;
struct tvp5150 *core;
struct v4l2_subdev *sd;
struct regmap *map;
@@ -1375,6 +1397,14 @@ static int tvp5150_probe(struct i2c_client *c,
}
}
 
+   endpoint = of_graph_get_next_endpoint(c->dev.of_node, NULL);
+   if (endpoint) {
+   v4l2_of_parse_endpoint(endpoint, _cfg);
+   core->bus_type = bus_cfg.bus_type;
+   } else {
+   core->bus_type = V4L2_MBUS_BT656;
+   }
+
core->norm = V4L2_STD_ALL;  /* Default is autodetect */
core->input = TVP5150_COMPOSITE1;
core->enable = 1;
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/9] [media] tvp5150: trigger autodetection on subdev open to reset cropping

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

If cropping isn't set explicitly by userspace, reset it to the maximum
possible rectangle in subdevice open if a standard change is detected.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index b6328353404f..791572737ee3 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -46,6 +46,7 @@ struct tvp5150 {
struct regmap *regmap;
 
v4l2_std_id norm;   /* Current set standard */
+   v4l2_std_id detected_norm;
u32 input;
u32 output;
int enable;
@@ -1206,13 +1207,19 @@ static int tvp5150_open(struct v4l2_subdev *sd, struct 
v4l2_subdev_fh *fh)
struct tvp5150 *decoder = to_tvp5150(sd);
v4l2_std_id std;
 
-   if (decoder->norm == V4L2_STD_ALL)
+   if (decoder->norm == V4L2_STD_ALL) {
std = tvp5150_read_std(sd);
-   else
-   std = decoder->norm;
+   if (std != decoder->detected_norm) {
+   decoder->detected_norm = std;
+
+   if (std & V4L2_STD_525_60)
+   decoder->rect.height = TVP5150_V_MAX_525_60;
+   else
+   decoder->rect.height = TVP5150_V_MAX_OTHERS;
+   decoder->format.height = decoder->rect.height;
+   }
+   }
 
-   tvp5150_set_default(std, v4l2_subdev_get_try_crop(fh, 0),
-v4l2_subdev_get_try_format(fh, 0));
return 0;
 }
 
@@ -1420,6 +1427,7 @@ static int tvp5150_probe(struct i2c_client *c,
}
 
core->norm = V4L2_STD_ALL;  /* Default is autodetect */
+   core->detected_norm = V4L2_STD_UNKNOWN;
core->input = TVP5150_COMPOSITE1;
core->enable = 1;
 
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/9] [media] tvp5150: fix standard autodetection

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

Make sure to not overwrite decoder->norm when setting the standard
in hardware, but only when instructed by V4L2 API calls.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 56 +
 1 file changed, 31 insertions(+), 25 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 21cde350e385..b943b9cc24c8 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -703,8 +703,6 @@ static int tvp5150_set_std(struct v4l2_subdev *sd, 
v4l2_std_id std)
struct tvp5150 *decoder = to_tvp5150(sd);
int fmt = 0;
 
-   decoder->norm = std;
-
/* First tests should be against specific std */
 
if (std == V4L2_STD_NTSC_443) {
@@ -741,13 +739,37 @@ static int tvp5150_s_std(struct v4l2_subdev *sd, 
v4l2_std_id std)
else
decoder->rect.height = TVP5150_V_MAX_OTHERS;
 
+   decoder->norm = std;
 
return tvp5150_set_std(sd, std);
 }
 
+static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd)
+{
+   int val = tvp5150_read(sd, TVP5150_STATUS_REG_5);
+
+   switch (val & 0x0F) {
+   case 0x01:
+   return V4L2_STD_NTSC;
+   case 0x03:
+   return V4L2_STD_PAL;
+   case 0x05:
+   return V4L2_STD_PAL_M;
+   case 0x07:
+   return V4L2_STD_PAL_N | V4L2_STD_PAL_Nc;
+   case 0x09:
+   return V4L2_STD_NTSC_443;
+   case 0xb:
+   return V4L2_STD_SECAM;
+   default:
+   return V4L2_STD_UNKNOWN;
+   }
+}
+
 static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
 {
struct tvp5150 *decoder = to_tvp5150(sd);
+   v4l2_std_id std;
 
/* Initializes TVP5150 to its default values */
tvp5150_write_inittab(sd, tvp5150_init_default);
@@ -783,7 +805,13 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
/* Initialize image preferences */
v4l2_ctrl_handler_setup(>hdl);
 
-   tvp5150_set_std(sd, decoder->norm);
+   if (decoder->norm == V4L2_STD_ALL)
+   std = tvp5150_read_std(sd);
+   else
+   std = decoder->norm;
+
+   /* Disable autoswitch mode */
+   tvp5150_set_std(sd, std);
return 0;
 };
 
@@ -808,28 +836,6 @@ static int tvp5150_s_ctrl(struct v4l2_ctrl *ctrl)
return -EINVAL;
 }
 
-static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd)
-{
-   int val = tvp5150_read(sd, TVP5150_STATUS_REG_5);
-
-   switch (val & 0x0F) {
-   case 0x01:
-   return V4L2_STD_NTSC;
-   case 0x03:
-   return V4L2_STD_PAL;
-   case 0x05:
-   return V4L2_STD_PAL_M;
-   case 0x07:
-   return V4L2_STD_PAL_N | V4L2_STD_PAL_Nc;
-   case 0x09:
-   return V4L2_STD_NTSC_443;
-   case 0xb:
-   return V4L2_STD_SECAM;
-   default:
-   return V4L2_STD_UNKNOWN;
-   }
-}
-
 static int tvp5150_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/9] [media] tvp5150: split reset/enable routine

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

To trigger standard autodetection only the reset part of the routine
is necessary. Split this out to make it callable on its own.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index b943b9cc24c8..b6328353404f 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -768,9 +768,6 @@ static v4l2_std_id tvp5150_read_std(struct v4l2_subdev *sd)
 
 static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
 {
-   struct tvp5150 *decoder = to_tvp5150(sd);
-   v4l2_std_id std;
-
/* Initializes TVP5150 to its default values */
tvp5150_write_inittab(sd, tvp5150_init_default);
 
@@ -780,6 +777,14 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
/* Selects decoder input */
tvp5150_selmux(sd);
 
+   return 0;
+}
+
+static int tvp5150_enable(struct v4l2_subdev *sd)
+{
+   struct tvp5150 *decoder = to_tvp5150(sd);
+   v4l2_std_id std;
+
/* Initializes TVP5150 to stream enabled values */
tvp5150_write_inittab(sd, tvp5150_init_enable);
 
@@ -844,6 +849,7 @@ static int tvp5150_enum_mbus_code(struct v4l2_subdev *sd,
return -EINVAL;
 
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
+
return 0;
 }
 
@@ -1166,8 +1172,10 @@ static int tvp5150_set_format(struct v4l2_subdev *sd,
 
format->format = *mbus_format;
 
-   if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
+   if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
tvp5150_reset(sd, 0);
+   tvp5150_enable(sd);
+   }
 
v4l2_dbg(1, debug, sd, "width = %d, height = %d\n", mbus_format->width,
mbus_format->height);
@@ -1431,6 +1439,7 @@ static int tvp5150_probe(struct i2c_client *c,
}
v4l2_ctrl_handler_setup(>hdl);
 
+   tvp5150_reset(sd, 0);
/* Default is no cropping */
tvp5150_set_default(tvp5150_read_std(sd), >rect, >format);
 
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/9] [media] tvp5150: Add sync lock interrupt handling

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

This patch adds an optional interrupt handler to handle the sync
lock interrupt and sync lock status.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 103 ++--
 drivers/media/i2c/tvp5150_reg.h |   2 +
 2 files changed, 100 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index abea26eb6fe0..9e006bf36e67 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -44,12 +45,14 @@ struct tvp5150 {
struct v4l2_mbus_framefmt format;
struct v4l2_rect rect;
struct regmap *regmap;
+   int irq;
 
v4l2_std_id norm;   /* Current set standard */
v4l2_std_id detected_norm;
u32 input;
u32 output;
int enable;
+   bool lock;
 };
 
 static inline struct tvp5150 *to_tvp5150(struct v4l2_subdev *sd)
@@ -716,6 +719,15 @@ static int tvp5150_set_std(struct v4l2_subdev *sd, 
v4l2_std_id std)
return 0;
 }
 
+static int tvp5150_g_std(struct v4l2_subdev *sd, v4l2_std_id *std)
+{
+   struct tvp5150 *decoder = to_tvp5150(sd);
+
+   *std = decoder->norm;
+
+   return 0;
+}
+
 static int tvp5150_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
 {
struct tvp5150 *decoder = to_tvp5150(sd);
@@ -758,14 +770,25 @@ static v4l2_std_id tvp5150_read_std(struct v4l2_subdev 
*sd)
 
 static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
 {
+   struct tvp5150 *decoder = to_tvp5150(sd);
+   struct regmap *map = decoder->regmap;
+
/* Initializes TVP5150 to its default values */
tvp5150_write_inittab(sd, tvp5150_init_default);
 
-   /* Configure pins: FID, VSYNC, GPCL/VBLK, SCLK */
-   regmap_write(map, TVP5150_CONF_SHARED_PIN, 0x2);
-   /* Keep interrupt polarity active low */
-   regmap_write(map, TVP5150_INT_CONF, TVP5150_VDPOE);
-   regmap_write(map, TVP5150_INTT_CONFIG_REG_B, 0x0);
+   if (decoder->irq) {
+   /* Configure pins: FID, VSYNC, INTREQ, SCLK */
+   regmap_write(map, TVP5150_CONF_SHARED_PIN, 0x0);
+   /* Set interrupt polarity to active high */
+   regmap_write(map, TVP5150_INT_CONF, TVP5150_VDPOE | 0x1);
+   regmap_write(map, TVP5150_INTT_CONFIG_REG_B, 0x1);
+   } else {
+   /* Configure pins: FID, VSYNC, GPCL/VBLK, SCLK */
+   regmap_write(map, TVP5150_CONF_SHARED_PIN, 0x2);
+   /* Keep interrupt polarity active low */
+   regmap_write(map, TVP5150_INT_CONF, TVP5150_VDPOE);
+   regmap_write(map, TVP5150_INTT_CONFIG_REG_B, 0x0);
+   }
 
/* Initializes VDP registers */
tvp5150_vdp_init(sd, vbi_ram_default);
@@ -776,6 +799,33 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
return 0;
 }
 
+static irqreturn_t tvp5150_isr(int irq, void *dev_id)
+{
+   struct tvp5150 *decoder = dev_id;
+   struct regmap *map = decoder->regmap;
+   unsigned int active = 0, status = 0;
+
+   regmap_read(map, TVP5150_INT_STATUS_REG_A, );
+   if (status) {
+   regmap_write(map, TVP5150_INT_STATUS_REG_A, status);
+
+   if (status & TVP5150_INT_A_LOCK)
+   decoder->lock = !!(status & TVP5150_INT_A_LOCK_STATUS);
+
+   return IRQ_HANDLED;
+   }
+
+   regmap_read(map, TVP5150_INT_ACTIVE_REG_B, );
+   if (active) {
+   status = 0;
+   regmap_read(map, TVP5150_INT_STATUS_REG_B, );
+   if (status)
+   regmap_write(map, TVP5150_INT_RESET_REG_B, status);
+   }
+
+   return IRQ_HANDLED;
+}
+
 static int tvp5150_enable(struct v4l2_subdev *sd)
 {
struct tvp5150 *decoder = to_tvp5150(sd);
@@ -939,6 +989,35 @@ static int tvp5150_g_crop(struct v4l2_subdev *sd, struct 
v4l2_crop *a)
return 0;
 }
 
+static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable)
+{
+   struct tvp5150 *decoder = container_of(sd, struct tvp5150, sd);
+
+   if (enable) {
+   /* Enable YUV(OUT7:0), clock */
+   regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0xd,
+   (decoder->bus_type == V4L2_MBUS_BT656) ? 0x9 : 0xd);
+   if (decoder->irq) {
+   /* Enable lock interrupt */
+   regmap_update_bits(decoder->regmap,
+  TVP5150_INT_ENABLE_REG_A,
+  TVP5150_INT_A_LOCK,
+  TVP5150_INT_A_LOCK);
+   }
+   } else {
+   /* Disable YUV(OUT7:0), SYNC, clock */
+   regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0xd, 0x0);
+

[PATCH 1/9] [media] tvp5150: convert register access to regmap

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

Regmap provides built in debugging, caching and provides dedicated accessors
for bit manipulations in registers, which make the following changes a lot
simpler.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 194 ++--
 1 file changed, 133 insertions(+), 61 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 3c5fb2509c47..a7495d2856c3 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +38,7 @@ struct tvp5150 {
struct v4l2_subdev sd;
struct v4l2_ctrl_handler hdl;
struct v4l2_rect rect;
+   struct regmap *regmap;
 
v4l2_std_id norm;   /* Current set standard */
u32 input;
@@ -56,30 +58,14 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl 
*ctrl)
 
 static int tvp5150_read(struct v4l2_subdev *sd, unsigned char addr)
 {
-   struct i2c_client *c = v4l2_get_subdevdata(sd);
-   int rc;
-
-   rc = i2c_smbus_read_byte_data(c, addr);
-   if (rc < 0) {
-   v4l2_err(sd, "i2c i/o error: rc == %d\n", rc);
-   return rc;
-   }
-
-   v4l2_dbg(2, debug, sd, "tvp5150: read 0x%02x = 0x%02x\n", addr, rc);
-
-   return rc;
-}
+   struct tvp5150 *decoder = to_tvp5150(sd);
+   int ret, val;
 
-static inline void tvp5150_write(struct v4l2_subdev *sd, unsigned char addr,
-unsigned char value)
-{
-   struct i2c_client *c = v4l2_get_subdevdata(sd);
-   int rc;
+   ret = regmap_read(decoder->regmap, addr, );
+   if (ret < 0)
+   return ret;
 
-   v4l2_dbg(2, debug, sd, "tvp5150: writing 0x%02x 0x%02x\n", addr, value);
-   rc = i2c_smbus_write_byte_data(c, addr, value);
-   if (rc < 0)
-   v4l2_dbg(0, debug, sd, "i2c i/o error: rc == %d\n", rc);
+   return val;
 }
 
 static void dump_reg_range(struct v4l2_subdev *sd, char *s, u8 init,
@@ -266,8 +252,8 @@ static inline void tvp5150_selmux(struct v4l2_subdev *sd)
decoder->input, decoder->output,
input, opmode);
 
-   tvp5150_write(sd, TVP5150_OP_MODE_CTL, opmode);
-   tvp5150_write(sd, TVP5150_VD_IN_SRC_SEL_1, input);
+   regmap_write(decoder->regmap, TVP5150_OP_MODE_CTL, opmode);
+   regmap_write(decoder->regmap, TVP5150_VD_IN_SRC_SEL_1, input);
 
/* Svideo should enable YCrCb output and disable GPCL output
 * For Composite and TV, it should be the reverse
@@ -282,7 +268,7 @@ static inline void tvp5150_selmux(struct v4l2_subdev *sd)
val = (val & ~0x40) | 0x10;
else
val = (val & ~0x10) | 0x40;
-   tvp5150_write(sd, TVP5150_MISC_CTL, val);
+   regmap_write(decoder->regmap, TVP5150_MISC_CTL, val);
 };
 
 struct i2c_reg_value {
@@ -553,8 +539,10 @@ static struct i2c_vbi_ram_value vbi_ram_default[] =
 static int tvp5150_write_inittab(struct v4l2_subdev *sd,
const struct i2c_reg_value *regs)
 {
+   struct tvp5150 *decoder = to_tvp5150(sd);
+
while (regs->reg != 0xff) {
-   tvp5150_write(sd, regs->reg, regs->value);
+   regmap_write(decoder->regmap, regs->reg, regs->value);
regs++;
}
return 0;
@@ -563,22 +551,24 @@ static int tvp5150_write_inittab(struct v4l2_subdev *sd,
 static int tvp5150_vdp_init(struct v4l2_subdev *sd,
const struct i2c_vbi_ram_value *regs)
 {
+   struct tvp5150 *decoder = to_tvp5150(sd);
+   struct regmap *map = decoder->regmap;
unsigned int i;
 
/* Disable Full Field */
-   tvp5150_write(sd, TVP5150_FULL_FIELD_ENA, 0);
+   regmap_write(map, TVP5150_FULL_FIELD_ENA, 0);
 
/* Before programming, Line mode should be at 0xff */
for (i = TVP5150_LINE_MODE_INI; i <= TVP5150_LINE_MODE_END; i++)
-   tvp5150_write(sd, i, 0xff);
+   regmap_write(map, i, 0xff);
 
/* Load Ram Table */
while (regs->reg != (u16)-1) {
-   tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_HIGH, regs->reg >> 8);
-   tvp5150_write(sd, TVP5150_CONF_RAM_ADDR_LOW, regs->reg);
+   regmap_write(map, TVP5150_CONF_RAM_ADDR_HIGH, regs->reg >> 8);
+   regmap_write(map, TVP5150_CONF_RAM_ADDR_LOW, regs->reg);
 
for (i = 0; i < 16; i++)
-   tvp5150_write(sd, TVP5150_VDP_CONF_RAM_DATA, 
regs->values[i]);
+   regmap_write(map, TVP5150_VDP_CONF_RAM_DATA, 
regs->values[i]);
 
regs++;
}
@@ -658,11 +648,11 @@ static int tvp5150_set_vbi(struct v4l2_subdev *sd,
reg=((line-6)<<1)+TVP5150_LINE_MODE_INI;
 
if 

[PATCH 9/9] [media] tvp5150: disable output while signal not locked

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

To avoid short frames on stream start, keep output pins at high impedance
while we are not properly locked onto the input signal.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 9e006bf36e67..9d03496d0af4 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -51,6 +51,7 @@ struct tvp5150 {
v4l2_std_id detected_norm;
u32 input;
u32 output;
+   u32 oe;
int enable;
bool lock;
 };
@@ -809,8 +810,11 @@ static irqreturn_t tvp5150_isr(int irq, void *dev_id)
if (status) {
regmap_write(map, TVP5150_INT_STATUS_REG_A, status);
 
-   if (status & TVP5150_INT_A_LOCK)
+   if (status & TVP5150_INT_A_LOCK) {
decoder->lock = !!(status & TVP5150_INT_A_LOCK_STATUS);
+   regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL,
+  0xd, decoder->lock ? decoder->oe : 
0);
+   }
 
return IRQ_HANDLED;
}
@@ -841,6 +845,7 @@ static int tvp5150_enable(struct v4l2_subdev *sd)
   0x7, 0x7);
/* disable HSYNC, VSYNC/PALI, AVID, and FID/GLCO */
regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0x4, 0x0);
+   decoder->oe = 0x9;
break;
case V4L2_MBUS_PARALLEL:
/* 8-bit YUV 4:2:2 */
@@ -848,6 +853,7 @@ static int tvp5150_enable(struct v4l2_subdev *sd)
   0x7, 0x0);
/* enable HSYNC, VSYNC/PALI, AVID, and FID/GLCO */
regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0x4, 0x4);
+   decoder->oe = 0xd;
break;
default:
return -EINVAL;
@@ -994,9 +1000,9 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int 
enable)
struct tvp5150 *decoder = container_of(sd, struct tvp5150, sd);
 
if (enable) {
-   /* Enable YUV(OUT7:0), clock */
+   /* Enable YUV(OUT7:0), (SYNC), clock signal, if locked */
regmap_update_bits(decoder->regmap, TVP5150_MISC_CTL, 0xd,
-   (decoder->bus_type == V4L2_MBUS_BT656) ? 0x9 : 0xd);
+  decoder->lock ? decoder->oe : 0);
if (decoder->irq) {
/* Enable lock interrupt */
regmap_update_bits(decoder->regmap,
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/9] [media] tvp5150: remove pin configuration from initialization tables

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

To allow optional interrupt support, we want to configure the pin settings
dynamically. Move those register accesses out of the static initialization
tables.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 19 +++
 drivers/media/i2c/tvp5150_reg.h |  1 +
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 791572737ee3..abea26eb6fe0 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -323,9 +323,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = {
{ /* 0x0e */
TVP5150_LUMA_PROC_CTL_3,0x00
},
-   { /* 0x0f */
-   TVP5150_CONF_SHARED_PIN,0x08
-   },
{ /* 0x11 */
TVP5150_ACT_VD_CROP_ST_MSB,0x00
},
@@ -362,9 +359,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = {
{ /* 0x1d */
TVP5150_INT_ENABLE_REG_B,0x00
},
-   { /* 0x1e */
-   TVP5150_INTT_CONFIG_REG_B,0x00
-   },
{ /* 0x28 */
TVP5150_VIDEO_STD,0x00
},
@@ -383,9 +377,6 @@ static const struct i2c_reg_value tvp5150_init_default[] = {
{ /* 0xc1 */
TVP5150_INT_ENABLE_REG_A,0x00
},
-   { /* 0xc2 */
-   TVP5150_INT_CONF,0x04
-   },
{ /* 0xc8 */
TVP5150_FIFO_INT_THRESHOLD,0x80
},
@@ -420,9 +411,7 @@ static const struct i2c_reg_value tvp5150_init_default[] = {
 
 /* Default values as sugested at TVP5150AM1 datasheet */
 static const struct i2c_reg_value tvp5150_init_enable[] = {
-   {
-   TVP5150_CONF_SHARED_PIN, 2
-   },{ /* Automatic offset and AGC enabled */
+   {   /* Automatic offset and AGC enabled */
TVP5150_ANAL_CHL_CTL, 0x15
},{ /* Activate YCrCb output 0x9 or 0xd ? */
TVP5150_MISC_CTL, 0x6f
@@ -772,6 +761,12 @@ static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
/* Initializes TVP5150 to its default values */
tvp5150_write_inittab(sd, tvp5150_init_default);
 
+   /* Configure pins: FID, VSYNC, GPCL/VBLK, SCLK */
+   regmap_write(map, TVP5150_CONF_SHARED_PIN, 0x2);
+   /* Keep interrupt polarity active low */
+   regmap_write(map, TVP5150_INT_CONF, TVP5150_VDPOE);
+   regmap_write(map, TVP5150_INTT_CONFIG_REG_B, 0x0);
+
/* Initializes VDP registers */
tvp5150_vdp_init(sd, vbi_ram_default);
 
diff --git a/drivers/media/i2c/tvp5150_reg.h b/drivers/media/i2c/tvp5150_reg.h
index 25a994944918..fc3bcb26413a 100644
--- a/drivers/media/i2c/tvp5150_reg.h
+++ b/drivers/media/i2c/tvp5150_reg.h
@@ -117,6 +117,7 @@
 #define TVP5150_INT_STATUS_REG_A0xc0 /* Interrupt status register A */
 #define TVP5150_INT_ENABLE_REG_A0xc1 /* Interrupt enable register A */
 #define TVP5150_INT_CONF0xc2 /* Interrupt configuration */
+#define   TVP5150_VDPOE BIT(2)
 #define TVP5150_VDP_CONF_RAM_DATA   0xc3 /* VDP configuration RAM data */
 #define TVP5150_CONF_RAM_ADDR_LOW   0xc4 /* Configuration RAM address low byte 
*/
 #define TVP5150_CONF_RAM_ADDR_HIGH  0xc5 /* Configuration RAM address high 
byte */
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/9] [media] tvp5150: add userspace subdev API

2015-11-18 Thread Lucas Stach
From: Philipp Zabel 

This patch adds userspace V4L2 subdevice API support.

Signed-off-by: Philipp Zabel 
Signed-off-by: Lucas Stach 
---
 drivers/media/i2c/tvp5150.c | 259 ++--
 1 file changed, 200 insertions(+), 59 deletions(-)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index a7495d2856c3..8670b478dcd6 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -36,7 +36,9 @@ MODULE_PARM_DESC(debug, "Debug level (0-2)");
 
 struct tvp5150 {
struct v4l2_subdev sd;
+   struct media_pad pad;
struct v4l2_ctrl_handler hdl;
+   struct v4l2_mbus_framefmt format;
struct v4l2_rect rect;
struct regmap *regmap;
 
@@ -819,38 +821,68 @@ static int tvp5150_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
 }
 
-static int tvp5150_fill_fmt(struct v4l2_subdev *sd,
-   struct v4l2_subdev_pad_config *cfg,
-   struct v4l2_subdev_format *format)
+static void tvp5150_try_crop(struct tvp5150 *decoder, struct v4l2_rect *rect,
+  v4l2_std_id std)
 {
-   struct v4l2_mbus_framefmt *f;
-   struct tvp5150 *decoder = to_tvp5150(sd);
+   unsigned int hmax;
 
-   if (!format || format->pad)
-   return -EINVAL;
+   /* Clamp the crop rectangle boundaries to tvp5150 limits */
+   rect->left = clamp(rect->left, 0, TVP5150_MAX_CROP_LEFT);
+   rect->width = clamp(rect->width,
+   TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect->left,
+   TVP5150_H_MAX - rect->left);
+   rect->top = clamp(rect->top, 0, TVP5150_MAX_CROP_TOP);
 
-   f = >format;
+   /* tvp5150 has some special limits */
+   rect->left = clamp(rect->left, 0, TVP5150_MAX_CROP_LEFT);
+   rect->width = clamp_t(unsigned int, rect->width,
+ TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - 
rect->left,
+ TVP5150_H_MAX - rect->left);
+   rect->top = clamp(rect->top, 0, TVP5150_MAX_CROP_TOP);
 
-   tvp5150_reset(sd, 0);
+   /* Calculate height based on current standard */
+   if (std & V4L2_STD_525_60)
+   hmax = TVP5150_V_MAX_525_60;
+   else
+   hmax = TVP5150_V_MAX_OTHERS;
 
-   f->width = decoder->rect.width;
-   f->height = decoder->rect.height;
+   rect->height = clamp(rect->height,
+hmax - TVP5150_MAX_CROP_TOP - rect->top,
+hmax - rect->top);
+}
 
-   f->code = MEDIA_BUS_FMT_UYVY8_2X8;
-   f->field = V4L2_FIELD_SEQ_TB;
-   f->colorspace = V4L2_COLORSPACE_SMPTE170M;
+static void tvp5150_set_crop(struct tvp5150 *decoder, struct v4l2_rect *rect,
+  v4l2_std_id std)
+{
+   struct regmap *map = decoder->regmap;
+   unsigned int hmax;
 
-   v4l2_dbg(1, debug, sd, "width = %d, height = %d\n", f->width,
-   f->height);
-   return 0;
+   if (std & V4L2_STD_525_60)
+   hmax = TVP5150_V_MAX_525_60;
+   else
+   hmax = TVP5150_V_MAX_OTHERS;
+
+   regmap_write(map, TVP5150_VERT_BLANKING_START, rect->top);
+   regmap_write(map, TVP5150_VERT_BLANKING_STOP,
+rect->top + rect->height - hmax);
+   regmap_write(map, TVP5150_ACT_VD_CROP_ST_MSB,
+rect->left >> TVP5150_CROP_SHIFT);
+   regmap_write(map, TVP5150_ACT_VD_CROP_ST_LSB,
+rect->left | (1 << TVP5150_CROP_SHIFT));
+   regmap_write(map, TVP5150_ACT_VD_CROP_STP_MSB,
+(rect->left + rect->width - TVP5150_MAX_CROP_LEFT) >>
+TVP5150_CROP_SHIFT);
+   regmap_write(map, TVP5150_ACT_VD_CROP_STP_LSB,
+rect->left + rect->width - TVP5150_MAX_CROP_LEFT);
+
+   decoder->rect = *rect;
 }
 
 static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
 {
-   struct v4l2_rect rect = a->c;
struct tvp5150 *decoder = to_tvp5150(sd);
+   struct v4l2_rect rect = a->c;
v4l2_std_id std;
-   unsigned int hmax;
 
v4l2_dbg(1, debug, sd, "%s left=%d, top=%d, width=%d, height=%d\n",
__func__, rect.left, rect.top, rect.width, rect.height);
@@ -858,42 +890,13 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const 
struct v4l2_crop *a)
if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
 
-   /* tvp5150 has some special limits */
-   rect.left = clamp(rect.left, 0, TVP5150_MAX_CROP_LEFT);
-   rect.width = clamp_t(unsigned int, rect.width,
-TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect.left,
-TVP5150_H_MAX - rect.left);
-   rect.top = clamp(rect.top, 0, TVP5150_MAX_CROP_TOP);
-
-   /* Calculate height based on current standard */
  

[linuxtv-media:master 1801/1806] drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: type defaults to 'int' in declaration of '_device_table'

2015-11-18 Thread kbuild test robot
tree:   git://linuxtv.org/media_tree.git master
head:   769b640929046f1207b928d194a855d759ad0a06
commit: f934a94bb566a629b7e0be52d087a686145d1f14 [1801/1806] [media] s5c73m3: 
Export OF module alias information
config: tile-allmodconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f934a94bb566a629b7e0be52d087a686145d1f14
# save the attached .config to linux build tree
make.cross ARCH=tile 

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

   drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: expected ')' before ';' 
token
   drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: pasting ";" and 
"_device_table" does not give a valid preprocessing token
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: warning: data definition has 
>> no type or storage class [enabled by default]
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: type defaults to 'int' 
>> in declaration of '_device_table'
>> drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: '_device_table' defined 
>> both normally and as 'alias' attribute
   cc1: some warnings being treated as errors

vim +40 drivers/media/i2c/s5c73m3/s5c73m3-spi.c

34  MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids);
35  
36  enum spi_direction {
37  SPI_DIR_RX,
38  SPI_DIR_TX
39  };
  > 40  MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids;);
41  
42  static int spi_xmit(struct spi_device *spi_dev, void *addr, const int 
len,
43  enum 
spi_direction dir)

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


.config.gz
Description: Binary data


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Andy Shevchenko
On Wed, Nov 18, 2015 at 4:21 PM, Peter Ujfalusi  wrote:
> Hi Vinod,
>
> bringing this old thread back to life as I just started to work on this.

What I remember we need to convert drivers to use new API meanwhile it
is good to keep old one to avoid patch storm which does nothing useful
(IIRC Russel's opinion).

On the other hand there are a lot of drivers that are used on the set
of platforms starting from legacy and abandoned ones (like AVR32) to
relatively new and newest.

And I'm not a fan of those thousands of API calls either.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: cx23885: use pci_set_dma_mask insted of pci_dma_supported

2015-11-18 Thread Christoph Hellwig
Hi Tycho,

please try the patch below - Andrew should be sending it on to Linux soon.

---
>From 4c03a9f77104b04af45833e0424954191ca94a12 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Wed, 11 Nov 2015 18:13:09 +0100
Subject: various: fix pci_set_dma_mask return value checking

pci_set_dma_mask returns a negative errno value, not a bool
like pci_dma_supported.  This of course was just a giant test
for attention :)

Reported-by: Jongman Heo 
Tested-by: Jongman Heo [pcnet32]
Signed-off-by: Christoph Hellwig 
---
 drivers/media/pci/cx23885/cx23885-core.c   | 4 ++--
 drivers/media/pci/cx25821/cx25821-core.c   | 3 ++-
 drivers/media/pci/cx88/cx88-alsa.c | 4 ++--
 drivers/media/pci/cx88/cx88-mpeg.c | 3 ++-
 drivers/media/pci/cx88/cx88-video.c| 4 ++--
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +-
 drivers/media/pci/saa7134/saa7134-core.c   | 4 ++--
 drivers/media/pci/saa7164/saa7164-core.c   | 4 ++--
 drivers/media/pci/tw68/tw68-core.c | 4 ++--
 drivers/net/ethernet/amd/pcnet32.c | 5 +++--
 10 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
b/drivers/media/pci/cx23885/cx23885-core.c
index 35759a9..e8f8472 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -1992,9 +1992,9 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
(unsigned long long)pci_resource_start(pci_dev, 0));
 
pci_set_master(pci_dev);
-   if (!pci_set_dma_mask(pci_dev, 0x)) {
+   err = pci_set_dma_mask(pci_dev, 0x);
+   if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
-   err = -EIO;
goto fail_context;
}
 
diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
b/drivers/media/pci/cx25821/cx25821-core.c
index dbc695f..0042803 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1319,7 +1319,8 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
dev->pci_lat, (unsigned long long)dev->base_io_addr);
 
pci_set_master(pci_dev);
-   if (!pci_set_dma_mask(pci_dev, 0x)) {
+   err = pci_set_dma_mask(pci_dev, 0x);
+   if (err) {
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail_irq;
diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 0ed1b65..1b5268f 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -890,9 +890,9 @@ static int snd_cx88_create(struct snd_card *card, struct 
pci_dev *pci,
return err;
}
 
-   if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
+   err = pci_set_dma_mask(pci,DMA_BIT_MASK(32));
+   if (err) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
-   err = -EIO;
cx88_core_put(core, pci);
return err;
}
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index 9db7767..f34c229 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -393,7 +393,8 @@ static int cx8802_init_common(struct cx8802_dev *dev)
if (pci_enable_device(dev->pci))
return -EIO;
pci_set_master(dev->pci);
-   if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
+   err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32));
+   if (err) {
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
return -EIO;
}
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 0de1ad5..aef9acf 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1314,9 +1314,9 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
   dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
 
pci_set_master(pci_dev);
-   if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
+   err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
+   if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
-   err = -EIO;
goto fail_core;
}
dev->alloc_ctx = vb2_dma_sg_init_ctx(_dev->dev);
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c 
b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 60b2d46..3fdbd81 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
"%s(): board vendor 0x%x, revision 

Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Arnd Bergmann
On Wednesday 18 November 2015 16:41:35 Peter Ujfalusi wrote:
> On 11/18/2015 04:29 PM, Arnd Bergmann wrote:
> > On Wednesday 18 November 2015 16:21:26 Peter Ujfalusi wrote:
> >> 2. non slave channel requests, where only the functionality matters, like
> >> memcpy, interleaved, memset, etc.
> >> We could have a simple:
> >> dma_request_channel(mask);
> >>
> >> But looking at the drivers using dmaengine legacy dma_request_channel() 
> >> API:
> >> Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE:
> >> drivers/misc/carma/carma-fpga.c 
> >> DMA_INTERRUPT|DMA_SLAVE|DMA_SG
> >> drivers/misc/carma/carma-fpga-program.c DMA_MEMCPY|DMA_SLAVE|DMA_SG
> >> drivers/media/platform/soc_camera/mx3_camera.c  DMA_SLAVE|DMA_PRIVATE
> >> sound/soc/intel/common/sst-firmware.c   DMA_SLAVE|DMA_MEMCPY
> >>
> >> as examples.
> >> Not sure how valid are these...

I just had a look myself. carma has been removed fortunately in linux-next,
so we don't have to worry about that any more.

I assume that the sst-firmware.c case is a mistake, it should just use a
plain DMA_SLAVE and not DMA_MEMCPY.

Aside from these, everyone else uses either DMA_CYCLIC in addition to
DMA_SLAVE, which seems valid, or they use DMA_PRIVATE, which I think is
redundant in slave drivers and can be removed.

> > It's usually not much harder to separate out the legacy case from
> > the normal dma_request_slave_channel_reason(), so those drivers don't
> > really need to use the unified compat API.
> 
> The current dma_request_slave_channel()/_reason() is not the 'legacy' API.
> Currently there is no way to get the reason why the dma channel request fails
> when using the _compat() version of the API, which is used by drivers which
> can be used in DT or in legacy mode as well. Sure, they all could have local
> if(){}else{} for handling this, but it is not a nice thing.
> 
> As it was discussed instead of adding the _reason() version for the _compat
> call, we should simplify the dmaengine API for getting the channel and at the
> same time we will have ERR_PTR returned instead of NULL.

What I meant was that we don't need to handle them with the unified
simple interface. The users of DMA_CYCLIC can just keep using
an internal helper that only deals with the legacy case, or use
dma_request_slave() or whatever is the new API for the DT case.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Andy Shevchenko
On Wed, Nov 18, 2015 at 5:07 PM, Arnd Bergmann  wrote:
> On Wednesday 18 November 2015 16:41:35 Peter Ujfalusi wrote:
>> On 11/18/2015 04:29 PM, Arnd Bergmann wrote:
>> > On Wednesday 18 November 2015 16:21:26 Peter Ujfalusi wrote:
>> >> 2. non slave channel requests, where only the functionality matters, like
>> >> memcpy, interleaved, memset, etc.
>> >> We could have a simple:
>> >> dma_request_channel(mask);
>> >>
>> >> But looking at the drivers using dmaengine legacy dma_request_channel() 
>> >> API:
>> >> Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE:
>> >> drivers/misc/carma/carma-fpga.c 
>> >> DMA_INTERRUPT|DMA_SLAVE|DMA_SG
>> >> drivers/misc/carma/carma-fpga-program.c 
>> >> DMA_MEMCPY|DMA_SLAVE|DMA_SG
>> >> drivers/media/platform/soc_camera/mx3_camera.c  DMA_SLAVE|DMA_PRIVATE
>> >> sound/soc/intel/common/sst-firmware.c   DMA_SLAVE|DMA_MEMCPY
>> >>
>> >> as examples.
>> >> Not sure how valid are these...
>
> I just had a look myself. carma has been removed fortunately in linux-next,
> so we don't have to worry about that any more.
>
> I assume that the sst-firmware.c case is a mistake, it should just use a
> plain DMA_SLAVE and not DMA_MEMCPY.

Other way around.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] TechniSat SkyStar S2 - problem tuning DVB-S2 channels

2015-11-18 Thread Jemma Denson

Hi Robert,

On 18/11/15 15:03, Robert wrote:

Hello,

I am using a "TechniSat SkyStar S2" DVB-S2 card. Drivers for this card
are included in the kernel tree since 4.2. Unfortunately, i can't tune
to ANY DVB-S2 channels with this new in-tree driver. DVB-S channels are
working fine. Id[1] of the commit which introduced support for this card.

Before 4.2 arrived i have used this[2] patch with which DVB-S2 channels
where tuneable without any problems. This patch works even with 4.3
after i have converted the fe_ structs to enums.

If you need anything to debug this behaviour, i will be at your disposal.




What program are you using to try and tune? Is it trying to tune in 
using DVB-S2? The "other" driver was done quite some while ago, and 
included some clunky code to fallback to S2 if DVB-S tuning failed as it 
was developed before the DVB API had support for supplying DVB-S2 as a 
delivery system and this was the only way of supporting S2 back then.
This was removed in the in-tree driver as it isn't needed anymore, but 
this does mean that the tuning program needs to supply the correct 
delivery system.


Have you tried it with dvbv5-scan & dvbv5-zap?

Regards,

Jemma
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Vinod Koul
On Wed, Nov 18, 2015 at 04:51:54PM +0100, Arnd Bergmann wrote:
> On Wednesday 18 November 2015 17:43:04 Andy Shevchenko wrote:
> > >
> > > I assume that the sst-firmware.c case is a mistake, it should just use a
> > > plain DMA_SLAVE and not DMA_MEMCPY.
> > 
> > Other way around.
> > 
> 
> Ok, I see. In that case I guess it also shouldn't call
> dmaengine_slave_config(), right? I don't think that's valid
> on a MEMCPY channel.

Yes it is not valid. In this case the dma driver should invoke a generic memcpy
and not need slave parameters, knowing the hw and reason for this (firmware
download to DSP memory), this doesn't qualify for slave case.
In fact filter function doesn't need a channel, any channel in this
controller will be good

-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


saa7134 card help request

2015-11-18 Thread Alec Rusanda
Hello, i have trouble installing a saa7134 card who is a pain in the
grr..
My board is a AOP-9104A with chipset PI7C8140A MA 0514BT with 4 channels.

I`m running a FedoraCore 23 64bit (4.2.3-300.fc23.x86_64) at the
moment (i can change it on whatever is need less windows) and have
tried to set in /etc/modprobe.d/saa7134.conf

" options saa7134 card=21,21,21,21   || also 33,42,61,81,109  "

but on each one i get " saa7134: saa7134[1]: Huh, no eeprom present (err=-5)? "

I have also found on internet a script for probing each card model:

#!/bin/bash
card=1
while [ $card -lt 175 ] ; do
/etc/init.d/motion stop
lsmod | cut -d ' ' -f 1 | grep saa713 | xargs rmmod
modprobe saa7134 card=$card,$card,$card,$card
/etc/init.d/motion restart
echo "Give it a shot for card $card"
read junk
/etc/init.d/motion stop
card=$(($card+1))
done

Unfortunately, on this one i got also errors :
rmmod: ERROR: Module saa7134_alsa is in use
rmmod: ERROR: Module saa7134 is in use by: saa7134_alsa

Also on rmmod --force i get :

rmmod: ERROR: could not remove 'saa7134_alsa': Device or resource busy
rmmod: ERROR: could not remove module saa7134_alsa: Device or resource busy
rmmod: ERROR: could not remove 'saa7134': Resource temporarily unavailable
rmmod: ERROR: could not remove module saa7134: Resource temporarily unavailable

# lsmod | grep saa713
saa7134_alsa   20480   -1
saa7134   188416   1  saa7134_alsa
videobuf2_core 491521  saa7134
videobuf2_dma_sg   204801  saa7134
tveeprom   24576   1  saa7134
rc_core  28672   1  saa7134
v4l2_common   163842  saa7134,videobuf2_core
videodev   163840  3  saa7134,v4l2_common,videobuf2_core
snd_pcm   114688  5
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,saa7134_alsa,snd_hda_core
snd77824  11 snd_hda_codec_realtek ,
snd_hwdep,snd_timer, snd_hda_codec_hdmi,
   snd_pcm,snd_seq,
snd_hda_codec_generic,  snd_hda_codec,  snd_hda_intel,
snd_seq_device, saa7134_alsa


Thank you in advanced, and wish a great day all.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Arnd Bergmann
On Wednesday 18 November 2015 17:43:04 Andy Shevchenko wrote:
> >
> > I assume that the sst-firmware.c case is a mistake, it should just use a
> > plain DMA_SLAVE and not DMA_MEMCPY.
> 
> Other way around.
> 

Ok, I see. In that case I guess it also shouldn't call
dmaengine_slave_config(), right? I don't think that's valid
on a MEMCPY channel.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: cx23885: use pci_set_dma_mask insted of pci_dma_supported

2015-11-18 Thread Tycho Lürsen

Hi Christoph,
thanks, will do and report back shortly.

Op 18-11-15 om 16:08 schreef Christoph Hellwig:

Hi Tycho,

please try the patch below - Andrew should be sending it on to Linux soon.

---
 From 4c03a9f77104b04af45833e0424954191ca94a12 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Wed, 11 Nov 2015 18:13:09 +0100
Subject: various: fix pci_set_dma_mask return value checking

pci_set_dma_mask returns a negative errno value, not a bool
like pci_dma_supported.  This of course was just a giant test
for attention :)

Reported-by: Jongman Heo 
Tested-by: Jongman Heo   [pcnet32]
Signed-off-by: Christoph Hellwig 
---
  drivers/media/pci/cx23885/cx23885-core.c   | 4 ++--
  drivers/media/pci/cx25821/cx25821-core.c   | 3 ++-
  drivers/media/pci/cx88/cx88-alsa.c | 4 ++--
  drivers/media/pci/cx88/cx88-mpeg.c | 3 ++-
  drivers/media/pci/cx88/cx88-video.c| 4 ++--
  drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +-
  drivers/media/pci/saa7134/saa7134-core.c   | 4 ++--
  drivers/media/pci/saa7164/saa7164-core.c   | 4 ++--
  drivers/media/pci/tw68/tw68-core.c | 4 ++--
  drivers/net/ethernet/amd/pcnet32.c | 5 +++--
  10 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
b/drivers/media/pci/cx23885/cx23885-core.c
index 35759a9..e8f8472 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -1992,9 +1992,9 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
(unsigned long long)pci_resource_start(pci_dev, 0));
  
  	pci_set_master(pci_dev);

-   if (!pci_set_dma_mask(pci_dev, 0x)) {
+   err = pci_set_dma_mask(pci_dev, 0x);
+   if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
-   err = -EIO;
goto fail_context;
}
  
diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c

index dbc695f..0042803 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1319,7 +1319,8 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
dev->pci_lat, (unsigned long long)dev->base_io_addr);
  
  	pci_set_master(pci_dev);

-   if (!pci_set_dma_mask(pci_dev, 0x)) {
+   err = pci_set_dma_mask(pci_dev, 0x);
+   if (err) {
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO;
goto fail_irq;
diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 0ed1b65..1b5268f 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -890,9 +890,9 @@ static int snd_cx88_create(struct snd_card *card, struct 
pci_dev *pci,
return err;
}
  
-	if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {

+   err = pci_set_dma_mask(pci,DMA_BIT_MASK(32));
+   if (err) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
-   err = -EIO;
cx88_core_put(core, pci);
return err;
}
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index 9db7767..f34c229 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -393,7 +393,8 @@ static int cx8802_init_common(struct cx8802_dev *dev)
if (pci_enable_device(dev->pci))
return -EIO;
pci_set_master(dev->pci);
-   if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
+   err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32));
+   if (err) {
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
return -EIO;
}
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 0de1ad5..aef9acf 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1314,9 +1314,9 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
   dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
  
  	pci_set_master(pci_dev);

-   if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
+   err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
+   if (err) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
-   err = -EIO;
goto fail_core;
}
dev->alloc_ctx = vb2_dma_sg_init_ctx(_dev->dev);
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c 
b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 60b2d46..3fdbd81 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -810,7 +810,7 @@ static int 

[help request] saa7134 card drivers

2015-11-18 Thread Alec Rusanda
Hello, i have trouble installing a saa7134 card who is a pain in the
grr..
My board is a AOP-9104A with chipset PI7C8140A MA 0514BT with 4 channels.

I`m running a FedoraCore 23 64bit (4.2.3-300.fc23.x86_64) at the
moment (i can change it on whatever is need less windows) and have
tried to set in /etc/modprobe.d/saa7134.conf

" options saa7134 card=21,21,21,21   || also 33,42,61,81,109  "

but on each one i get " saa7134: saa7134[1]: Huh, no eeprom present (err=-5)? "

I have also found on internet a script for probing each card model:

#!/bin/bash
card=1
while [ $card -lt 175 ] ; do
/etc/init.d/motion stop
lsmod | cut -d ' ' -f 1 | grep saa713 | xargs rmmod
modprobe saa7134 card=$card,$card,$card,$card
/etc/init.d/motion restart
echo "Give it a shot for card $card"
read junk
/etc/init.d/motion stop
card=$(($card+1))
done

Unfortunately, on this one i got also errors :
rmmod: ERROR: Module saa7134_alsa is in use
rmmod: ERROR: Module saa7134 is in use by: saa7134_alsa

Also on rmmod --force i get :

rmmod: ERROR: could not remove 'saa7134_alsa': Device or resource busy
rmmod: ERROR: could not remove module saa7134_alsa: Device or resource busy
rmmod: ERROR: could not remove 'saa7134': Resource temporarily unavailable
rmmod: ERROR: could not remove module saa7134: Resource temporarily unavailable

# lsmod | grep saa713
saa7134_alsa   20480   -1
saa7134   188416   1  saa7134_alsa
videobuf2_core 491521  saa7134
videobuf2_dma_sg   204801  saa7134
tveeprom   24576   1  saa7134
rc_core  28672   1  saa7134
v4l2_common   163842  saa7134,videobuf2_core
videodev   163840  3  saa7134,v4l2_common,videobuf2_core
snd_pcm   114688  5
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,saa7134_alsa,snd_hda_core
snd77824  11 snd_hda_codec_realtek ,
snd_hwdep,snd_timer, snd_hda_codec_hdmi,
   snd_pcm,snd_seq,
snd_hda_codec_generic,  snd_hda_codec,  snd_hda_intel,
snd_seq_device, saa7134_alsa


Thank you in advanced, and wish a great day all.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] mt2060: add i2c bindings

2015-11-18 Thread Mauro Carvalho Chehab
Em Wed, 18 Nov 2015 19:49:08 +0200
Antti Palosaari  escreveu:

> On 11/18/2015 05:01 PM, Mauro Carvalho Chehab wrote:
> > Em Mon, 27 Jul 2015 14:22:05 +0300
> > Antti Palosaari  escreveu:
> >
> >> Add proper i2c driver model bindings.
> >
> > Hi Antti,
> >
> > What's the status of this patch series? You submitted them on July, but
> > never sent me a pull request...
> 
> I noticed I2C adapter has nowadays (or has it been always there) some 
> configuration logic for I2C message sizes (see struct 
> i2c_adapter_quirks). I would like to test those, which means I have to 
> make some changes to these patches in order to implement message 
> splitting way I2C core supports.
> 
> Whole thing is for for ZyDAS ZD1301 DVB-T chip driver related, which is 
> ~10 years old and near zero users nowadays - so no need to hurry at all :D

OK!

I'll mark those patches as RFC.

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: cx23885: use pci_set_dma_mask insted of pci_dma_supported

2015-11-18 Thread Tycho Lürsen

Hi Christoph,
that additional patch fixed the problem indeed.
Thanks again.

Regards, Tycho

Op 18-11-15 om 17:34 schreef Tycho Lürsen:

Hi Christoph,
thanks, will do and report back shortly.

Op 18-11-15 om 16:08 schreef Christoph Hellwig:

Hi Tycho,

please try the patch below - Andrew should be sending it on to Linux 
soon.


---
 From 4c03a9f77104b04af45833e0424954191ca94a12 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig 
Date: Wed, 11 Nov 2015 18:13:09 +0100
Subject: various: fix pci_set_dma_mask return value checking

pci_set_dma_mask returns a negative errno value, not a bool
like pci_dma_supported.  This of course was just a giant test
for attention :)

Reported-by: Jongman Heo 
Tested-by: Jongman Heo  [pcnet32]
Signed-off-by: Christoph Hellwig 
---
  drivers/media/pci/cx23885/cx23885-core.c   | 4 ++--
  drivers/media/pci/cx25821/cx25821-core.c   | 3 ++-
  drivers/media/pci/cx88/cx88-alsa.c | 4 ++--
  drivers/media/pci/cx88/cx88-mpeg.c | 3 ++-
  drivers/media/pci/cx88/cx88-video.c| 4 ++--
  drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 +-
  drivers/media/pci/saa7134/saa7134-core.c   | 4 ++--
  drivers/media/pci/saa7164/saa7164-core.c   | 4 ++--
  drivers/media/pci/tw68/tw68-core.c | 4 ++--
  drivers/net/ethernet/amd/pcnet32.c | 5 +++--
  10 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/drivers/media/pci/cx23885/cx23885-core.c 
b/drivers/media/pci/cx23885/cx23885-core.c

index 35759a9..e8f8472 100644
--- a/drivers/media/pci/cx23885/cx23885-core.c
+++ b/drivers/media/pci/cx23885/cx23885-core.c
@@ -1992,9 +1992,9 @@ static int cx23885_initdev(struct pci_dev 
*pci_dev,

  (unsigned long long)pci_resource_start(pci_dev, 0));
pci_set_master(pci_dev);
-if (!pci_set_dma_mask(pci_dev, 0x)) {
+err = pci_set_dma_mask(pci_dev, 0x);
+if (err) {
  printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
-err = -EIO;
  goto fail_context;
  }
  diff --git a/drivers/media/pci/cx25821/cx25821-core.c 
b/drivers/media/pci/cx25821/cx25821-core.c

index dbc695f..0042803 100644
--- a/drivers/media/pci/cx25821/cx25821-core.c
+++ b/drivers/media/pci/cx25821/cx25821-core.c
@@ -1319,7 +1319,8 @@ static int cx25821_initdev(struct pci_dev 
*pci_dev,

  dev->pci_lat, (unsigned long long)dev->base_io_addr);
pci_set_master(pci_dev);
-if (!pci_set_dma_mask(pci_dev, 0x)) {
+err = pci_set_dma_mask(pci_dev, 0x);
+if (err) {
  pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
  err = -EIO;
  goto fail_irq;
diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c

index 0ed1b65..1b5268f 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -890,9 +890,9 @@ static int snd_cx88_create(struct snd_card *card, 
struct pci_dev *pci,

  return err;
  }
  -if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
+err = pci_set_dma_mask(pci,DMA_BIT_MASK(32));
+if (err) {
  dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
-err = -EIO;
  cx88_core_put(core, pci);
  return err;
  }
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c

index 9db7767..f34c229 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -393,7 +393,8 @@ static int cx8802_init_common(struct cx8802_dev 
*dev)

  if (pci_enable_device(dev->pci))
  return -EIO;
  pci_set_master(dev->pci);
-if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
+err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32));
+if (err) {
  printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
  return -EIO;
  }
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c

index 0de1ad5..aef9acf 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1314,9 +1314,9 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 dev->pci_lat,(unsigned long 
long)pci_resource_start(pci_dev,0));

pci_set_master(pci_dev);
-if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
+err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32));
+if (err) {
  printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
-err = -EIO;
  goto fail_core;
  }
  dev->alloc_ctx = vb2_dma_sg_init_ctx(_dev->dev);
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c 
b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c

index 60b2d46..3fdbd81 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -810,7 +810,7 @@ static int 

Re: [BUG] TechniSat SkyStar S2 - problem tuning DVB-S2 channels

2015-11-18 Thread Robert
Hi Jemma,

On 18.11.2015 17:18, Jemma Denson wrote:
> What program are you using to try and tune? Is it trying to tune in
> using DVB-S2? The "other" driver was done quite some while ago, and
> included some clunky code to fallback to S2 if DVB-S tuning failed as it
> was developed before the DVB API had support for supplying DVB-S2 as a
> delivery system and this was the only way of supporting S2 back then.
> This was removed in the in-tree driver as it isn't needed anymore, but
> this does mean that the tuning program needs to supply the correct
> delivery system.
> 
> Have you tried it with dvbv5-scan & dvbv5-zap?

Normally i'm using kaffeine, but i have tried dvbv5-scan now.
Unfortunately it segfaults. I have attached the full output including
the backtrace [1]


Greetings,
Robert


[1]
https://paste.linuxlounge.net/?c3886ef444f9aa37#2ah2g19a9CfJMA/pBDikwoWj7S4AG2slhacWjXy8jEo=




--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [BUG] TechniSat SkyStar S2 - problem tuning DVB-S2 channels

2015-11-18 Thread David Jedelsky
Robert,

I'm not sure whether it helps, but if your card is based on az6027, as
is my USB TechniSat SkyStar 2 HD CI, then attached patch could be
helpful. I had to create it to get DVB-S2 working on my device.
http://djed.cz/az6027-i2c.patch

Regards,
David

PS: trying to send once more with link instead of attachment (as
linuxmedia list rejected my previous mail)

On Wed, Nov 18, 2015 at 8:08 PM, Robert  wrote:
> Hi Jemma,
>
> On 18.11.2015 17:18, Jemma Denson wrote:
>> What program are you using to try and tune? Is it trying to tune in
>> using DVB-S2? The "other" driver was done quite some while ago, and
>> included some clunky code to fallback to S2 if DVB-S tuning failed as it
>> was developed before the DVB API had support for supplying DVB-S2 as a
>> delivery system and this was the only way of supporting S2 back then.
>> This was removed in the in-tree driver as it isn't needed anymore, but
>> this does mean that the tuning program needs to supply the correct
>> delivery system.
>>
>> Have you tried it with dvbv5-scan & dvbv5-zap?
>
> Normally i'm using kaffeine, but i have tried dvbv5-scan now.
> Unfortunately it segfaults. I have attached the full output including
> the backtrace [1]
>
>
> Greetings,
> Robert
>
>
> [1]
> https://paste.linuxlounge.net/?c3886ef444f9aa37#2ah2g19a9CfJMA/pBDikwoWj7S4AG2slhacWjXy8jEo=
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Patch v5 0/2] media: v4l: ti-vpe: Add CAL v4l2 camera capture driver

2015-11-18 Thread Benoit Parrot
The Camera Adaptation Layer (CAL) is a block which consists of a dual
port CSI2/MIPI camera capture engine.
This camera engine is currently found on DRA72xx family of devices.

Port #0 can handle CSI2 camera connected to up to 4 data lanes.
Port #1 can handle CSI2 camera connected to up to 2 data lanes.

The driver implements the required API/ioctls to be V4L2 compliant.
Driver supports the following:
- V4L2 API using DMABUF/MMAP buffer access based on videobuf2 api
- Asynchronous sensor sub device registration
- DT support

Currently each port is designed to connect to a single sub-device.
In other words port aggregation is not currently supported.

Changes since v4:
- Corrected dt bindings per review comment.
- Applied related dt bindings changes to driver code.
- Folded in coccinelle generated patches.
- Corrected checkpatch.pl --strict warnings.

Changes since v3:
- Nothing really I messed up the previous format-patch with the
  wrong commit-id. Sorry about the repeat.

Changes since v2:
- Rework Kconfig options and added COMPILE_TEST
- Merged in provided vb2 buffer rework
- Rebase on tip of lmm master and fixe vb2 split related changes

Changes since v1:
- Remove unnecessary format description
- Reworked how transient frame format is maintained
  in order to make it easier to use the fill helper functions
- Added a per port list of active frame format
- Reworked an added missing vb2 cleanup code
- Fix a module load/unload kernel oops
- Switch to use proper int64 get function for pixel rate control

=

Here is a sample output of the v4l2-compliance tool:

# ./v4l2-compliance -f -s -v -d /dev/video0 
Driver Info:
Driver name   : cal
Card type : cal
Bus info : platform:cal-000

Capabilities  : 0x8521
Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x0521
Video Capture
Read/Write
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

Control ioctls:
info: checking v4l2_queryctrl of control 'User Controls' 
(0x00980001)
info: checking v4l2_queryctrl of control 'Horizontal Flip' 
(0x00980914)
info: checking v4l2_queryctrl of control 'Vertical Flip' 
(0x00980915)
info: checking v4l2_queryctrl of control 'Image Processing 
Controls' (0x009f0001)
info: checking v4l2_queryctrl of control 'Pixel Rate' 
(0x009f0902)
info: checking v4l2_queryctrl of control 'Horizontal Flip' 
(0x00980914)
info: checking v4l2_queryctrl of control 'Vertical Flip' 
(0x00980915)
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
info: checking control 'User Controls' (0x00980001)
info: checking control 'Horizontal Flip' (0x00980914)
info: checking control 'Vertical Flip' (0x00980915)
info: checking control 'Image Processing Controls' (0x009f0001)
info: checking control 'Pixel Rate' (0x009f0902)
test VIDIOC_G/S_CTRL: OK
info: checking extended control 'User Controls' (0x00980001)
info: checking extended control 'Horizontal Flip' (0x00980914)
info: checking extended control 'Vertical Flip' (0x00980915)
info: checking extended control 'Image Processing Controls' 
(0x009f0001)
info: checking extended control 'Pixel Rate' (0x009f0902)
test 

[Patch v5 1/2] media: v4l: ti-vpe: Add CAL v4l2 camera capture driver

2015-11-18 Thread Benoit Parrot
The Camera Adaptation Layer (CAL) is a block which consists of a dual
port CSI2/MIPI camera capture engine.
Port #0 can handle CSI2 camera connected to up to 4 data lanes.
Port #1 can handle CSI2 camera connected to up to 2 data lanes.
The driver implements the required API/ioctls to be V4L2 compliant.
Driver supports the following:
- V4L2 API using DMABUF/MMAP buffer access based on videobuf2 api
- Asynchronous sensor sub device registration

Signed-off-by: Benoit Parrot 
Signed-off-by: Hans Verkuil 
---
 drivers/media/platform/Kconfig   |   12 +
 drivers/media/platform/Makefile  |2 +
 drivers/media/platform/ti-vpe/Makefile   |4 +
 drivers/media/platform/ti-vpe/cal.c  | 2143 ++
 drivers/media/platform/ti-vpe/cal_regs.h |  779 +++
 5 files changed, 2940 insertions(+)
 create mode 100644 drivers/media/platform/ti-vpe/cal.c
 create mode 100644 drivers/media/platform/ti-vpe/cal_regs.h

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 0c53805dff0e..db052f5a627a 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -120,6 +120,18 @@ source "drivers/media/platform/s5p-tv/Kconfig"
 source "drivers/media/platform/am437x/Kconfig"
 source "drivers/media/platform/xilinx/Kconfig"
 
+config VIDEO_TI_CAL
+   tristate "TI CAL (Camera Adaptation Layer) driver"
+   depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
+   depends on SOC_DRA7XX || COMPILE_TEST
+   select VIDEOBUF2_DMA_CONTIG
+   default n
+   ---help---
+ Support for the TI CAL (Camera Adaptation Layer) block
+ found on DRA72X SoC.
+ In TI Technical Reference Manual this module is referred as
+ Camera Interface Subsystem (CAMSS).
+
 endif # V4L_PLATFORM_DRIVERS
 
 menuconfig V4L_MEM2MEM_DRIVERS
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index efa0295af87b..028a7233096b 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -18,6 +18,8 @@ obj-$(CONFIG_VIDEO_VIM2M) += vim2m.o
 
 obj-$(CONFIG_VIDEO_TI_VPE) += ti-vpe/
 
+obj-$(CONFIG_VIDEO_TI_CAL) += ti-vpe/
+
 obj-$(CONFIG_VIDEO_MX2_EMMAPRP)+= mx2_emmaprp.o
 obj-$(CONFIG_VIDEO_CODA)   += coda/
 
diff --git a/drivers/media/platform/ti-vpe/Makefile 
b/drivers/media/platform/ti-vpe/Makefile
index be680f839e77..e236059a60ad 100644
--- a/drivers/media/platform/ti-vpe/Makefile
+++ b/drivers/media/platform/ti-vpe/Makefile
@@ -3,3 +3,7 @@ obj-$(CONFIG_VIDEO_TI_VPE) += ti-vpe.o
 ti-vpe-y := vpe.o sc.o csc.o vpdma.o
 
 ccflags-$(CONFIG_VIDEO_TI_VPE_DEBUG) += -DDEBUG
+
+obj-$(CONFIG_VIDEO_TI_CAL) += ti-cal.o
+
+ti-cal-y := cal.o
diff --git a/drivers/media/platform/ti-vpe/cal.c 
b/drivers/media/platform/ti-vpe/cal.c
new file mode 100644
index ..61cd5b9bd8f6
--- /dev/null
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -0,0 +1,2143 @@
+/*
+ * TI CAL camera interface driver
+ *
+ * Copyright (c) 2015 Texas Instruments Inc.
+ * Benoit Parrot, 
+ *
+ * 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
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "cal_regs.h"
+
+#define CAL_MODULE_NAME "cal"
+
+#define MAX_WIDTH 1920
+#define MAX_HEIGHT 1200
+
+#define CAL_VERSION "0.1.0"
+
+MODULE_DESCRIPTION("TI CAL driver");
+MODULE_AUTHOR("Benoit Parrot, ");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION(CAL_VERSION);
+
+static unsigned video_nr = -1;
+module_param(video_nr, uint, 0644);
+MODULE_PARM_DESC(video_nr, "videoX start number, -1 is autodetect");
+
+static unsigned debug;
+module_param(debug, uint, 0644);
+MODULE_PARM_DESC(debug, "activates debug info");
+
+/* timeperframe: min/max and default */
+static const struct v4l2_fract
+   tpf_default = {.numerator = 1001,   .denominator = 3};
+
+#define cal_dbg(level, caldev, fmt, arg...)\
+   v4l2_dbg(level, debug, >v4l2_dev, fmt, ##arg)
+#define cal_info(caldev, fmt, arg...)  \
+   v4l2_info(>v4l2_dev, fmt, ##arg)
+#define cal_err(caldev, fmt, arg...)   \
+   v4l2_err(>v4l2_dev, fmt, ##arg)
+
+#define ctx_dbg(level, ctx, fmt, arg...)   \
+   v4l2_dbg(level, debug, >v4l2_dev, fmt, ##arg)
+#define ctx_info(ctx, fmt, arg...) \
+   v4l2_info(>v4l2_dev, fmt, ##arg)
+#define ctx_err(ctx, fmt, arg...)  \
+   v4l2_err(>v4l2_dev, fmt, ##arg)
+
+#define CAL_NUM_INPUT 1
+#define CAL_NUM_CONTEXT 2
+
+/* 

[Patch v5 2/2] media: v4l: ti-vpe: Document DRA72 CAL h/w module

2015-11-18 Thread Benoit Parrot
Device Tree bindings for the DRA72 Camera Adaptation Layer (CAL)
H/W module.

Signed-off-by: Benoit Parrot 
---
 Documentation/devicetree/bindings/media/ti-cal.txt | 72 ++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/ti-cal.txt

diff --git a/Documentation/devicetree/bindings/media/ti-cal.txt 
b/Documentation/devicetree/bindings/media/ti-cal.txt
new file mode 100644
index ..ae9b52f37576
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/ti-cal.txt
@@ -0,0 +1,72 @@
+Texas Instruments DRA72x CAMERA ADAPTATION LAYER (CAL)
+--
+
+The Camera Adaptation Layer (CAL) is a key component for image capture
+applications. The capture module provides the system interface and the
+processing capability to connect CSI2 image-sensor modules to the
+DRA72x device.
+
+Required properties:
+- compatible: must be "ti,dra72-cal"
+- reg: CAL Top level, Receiver Core #0, Receiver Core #1 and Camera RX
+   control address space
+- reg-names: cal_top, cal_rx_core0, cal_rx_core1, and camerrx_control
+registers
+- interrupts: should contain IRQ line for the CAL;
+
+CAL supports 2 camera port nodes on MIPI bus. Each CSI2 camera port nodes
+should contain a 'port' child node with child 'endpoint' node. Please
+refer to the bindings defined in
+Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+   cal: cal@4845b000 {
+   compatible = "ti,dra72-cal";
+   ti,hwmods = "cal";
+   reg = <0x4845B000 0x400>,
+ <0x4845B800 0x40>,
+ <0x4845B900 0x40>,
+ <0x4A002e94 0x4>;
+   reg-names = "cal_top",
+   "cal_rx_core0",
+   "cal_rx_core1",
+   "camerrx_control";
+   interrupts = ;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   csi2_0: port@0 {
+   reg = <0>;
+   endpoint {
+   slave-mode;
+   remote-endpoint = <_1>;
+   };
+   };
+   csi2_1: port@1 {
+   reg = <1>;
+   };
+   };
+   };
+
+   i2c5: i2c@4807c000 {
+   ar0330@10 {
+   compatible = "ti,ar0330";
+   reg = <0x10>;
+
+   port {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ar0330_1: endpoint {
+   reg = <0>;
+   clock-lanes = <1>;
+   data-lanes = <0 2 3 4>;
+   remote-endpoint = <_0>;
+   };
+   };
+   };
+   };
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ANNOUNCE DRAFT] Kernel Summit Media Workshop 2015 report - Seoul

2015-11-18 Thread Mauro Carvalho Chehab
Em Thu, 12 Nov 2015 17:53:29 -0200
Mauro Carvalho Chehab  escreveu:

> That's the first draft of the KS workshop that we had in Seoul.
> 
> It is based on the notes we took on Etherpad, but I had to add several things
> from my memory and from Hans slide deck.
> 
> A graph version of this draft is at:
>   http://linuxtv.org/news.php?entry=2015-11-12.mchehab
> 
> TODO:
>   Add group photo and links to the presentations
>   Fix some visual issues at the web.
> 

I updated today the LinuxTV entry with the second version, with the
Group Photo and a link to the Hans slidedeck. The visual issues on
v1 was fixed too.

The only pending item is the slidedeck from Pawel.

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usbvision fix overflow of interfaces array

2015-11-18 Thread Vladis Dronov
An HTTP URL for the alternate patch mentioned:

http://www.spinics.net/lists/linux-media/msg94831.html

Best regards,
Vladis Dronov | Red Hat, Inc. | Product Security Engineer
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/4] scripts/kernel-doc: Replacing highlights hash by an array

2015-11-18 Thread Mauro Carvalho Chehab
Em Tue, 17 Nov 2015 17:21:32 -0700
Jonathan Corbet  escreveu:

> On Tue, 17 Nov 2015 13:29:49 -0200
> Mauro Carvalho Chehab  wrote:
> 
> > The enclosed patch should do the trick. I tested it with perl 5.10 and 
> > perl 5.22 it worked fine with both versions.
> 
> Indeed it seems to work - thanks!  Applied to the docs tree, I'll get it
> upstream before too long.

Thanks, Jon!

Regards,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Peter Ujfalusi
On 11/18/2015 04:29 PM, Arnd Bergmann wrote:
> On Wednesday 18 November 2015 16:21:26 Peter Ujfalusi wrote:
>> 2. non slave channel requests, where only the functionality matters, like
>> memcpy, interleaved, memset, etc.
>> We could have a simple:
>> dma_request_channel(mask);
>>
>> But looking at the drivers using dmaengine legacy dma_request_channel() API:
>> Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE:
>> drivers/misc/carma/carma-fpga.c 
>> DMA_INTERRUPT|DMA_SLAVE|DMA_SG
>> drivers/misc/carma/carma-fpga-program.c DMA_MEMCPY|DMA_SLAVE|DMA_SG
>> drivers/media/platform/soc_camera/mx3_camera.c  DMA_SLAVE|DMA_PRIVATE
>> sound/soc/intel/common/sst-firmware.c   DMA_SLAVE|DMA_MEMCPY
>>
>> as examples.
>> Not sure how valid are these...
> 
> It's usually not much harder to separate out the legacy case from
> the normal dma_request_slave_channel_reason(), so those drivers don't
> really need to use the unified compat API.

The current dma_request_slave_channel()/_reason() is not the 'legacy' API.
Currently there is no way to get the reason why the dma channel request fails
when using the _compat() version of the API, which is used by drivers which
can be used in DT or in legacy mode as well. Sure, they all could have local
if(){}else{} for handling this, but it is not a nice thing.

As it was discussed instead of adding the _reason() version for the _compat
call, we should simplify the dmaengine API for getting the channel and at the
same time we will have ERR_PTR returned instead of NULL.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] fix dvb_frontend_sleep_until() logic

2015-11-18 Thread Mauro Carvalho Chehab
As pointed by Laurent Navet:
"Calling ktime_add_us() seems useless as is only useful
 for it's return value which is ignored."

That's reported by coverity CID 1309761.

Laurent proposed to just remove ktime_add_us, but the fact is that
the logic of this function is broken. Instead, we need to use the
value of the timeout, and ensure that it will work on the loops
to emulate the legacy DiSEqC ioctl (FE_DISHNETWORK_SEND_LEGACY_CMD).

Please notice that the logic was also broken if, for any reason,
msleep() would sleep a little less than what it was expected, as
newdelta would be smaller than delta, and udelay() would not be called.

It should also be noticed that nobody noticed that trouble before
likely because the FE_DISHNETWORK_SEND_LEGACY_CMD is not used
anymore by modern DVB applications.

Reported-by: Laurent Navet 
Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/dvb-core/dvb_frontend.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c 
b/drivers/media/dvb-core/dvb_frontend.c
index 0b52cfc2d53d..291093b8cd05 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -899,14 +899,13 @@ static void dvb_frontend_stop(struct dvb_frontend *fe)
  */
 void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)
 {
-   s32 delta, newdelta;
+   s32 delta;
 
-   ktime_add_us(*waketime, add_usec);
+   *waketime = ktime_add_us(*waketime, add_usec);
delta = ktime_us_delta(ktime_get_real(), *waketime);
if (delta > 2500) {
msleep((delta - 1500) / 1000);
-   newdelta = ktime_us_delta(ktime_get_real(), *waketime);
-   delta = (newdelta > delta) ? 0 : newdelta;
+   delta = ktime_us_delta(ktime_get_real(), *waketime);
}
if (delta > 0)
udelay(delta);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] mt2060: add i2c bindings

2015-11-18 Thread Mauro Carvalho Chehab
Em Mon, 27 Jul 2015 14:22:05 +0300
Antti Palosaari  escreveu:

> Add proper i2c driver model bindings.

Hi Antti,

What's the status of this patch series? You submitted them on July, but
never sent me a pull request...

Regards,
Mauro

> 
> Signed-off-by: Antti Palosaari 
> ---
>  drivers/media/tuners/mt2060.c  | 83 
> ++
>  drivers/media/tuners/mt2060.h  | 20 +
>  drivers/media/tuners/mt2060_priv.h |  2 +
>  3 files changed, 105 insertions(+)
> 
> diff --git a/drivers/media/tuners/mt2060.c b/drivers/media/tuners/mt2060.c
> index b87b254..aa8280a 100644
> --- a/drivers/media/tuners/mt2060.c
> +++ b/drivers/media/tuners/mt2060.c
> @@ -397,6 +397,89 @@ struct dvb_frontend * mt2060_attach(struct dvb_frontend 
> *fe, struct i2c_adapter
>  }
>  EXPORT_SYMBOL(mt2060_attach);
>  
> +static int mt2060_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + struct mt2060_platform_data *pdata = client->dev.platform_data;
> + struct dvb_frontend *fe;
> + struct mt2060_priv *dev;
> + int ret;
> + u8 chip_id;
> +
> + dev_dbg(>dev, "\n");
> +
> + if (!pdata) {
> + dev_err(>dev, "Cannot proceed without platform data\n");
> + ret = -EINVAL;
> + goto err;
> + }
> +
> + dev = devm_kzalloc(>dev, sizeof(*dev), GFP_KERNEL);
> + if (!dev) {
> + ret = -ENOMEM;
> + goto err;
> + }
> +
> + fe = pdata->dvb_frontend;
> + dev->config.i2c_address = client->addr;
> + dev->config.clock_out = pdata->clock_out;
> + dev->cfg = >config;
> + dev->i2c = client->adapter;
> + dev->if1_freq = pdata->if1 ? pdata->if1 : 1220;
> + dev->client = client;
> +
> + ret = mt2060_readreg(dev, REG_PART_REV, _id);
> + if (ret) {
> + ret = -ENODEV;
> + goto err;
> + }
> +
> + dev_dbg(>dev, "chip id=%02x\n", chip_id);
> +
> + if (chip_id != PART_REV) {
> + ret = -ENODEV;
> + goto err;
> + }
> +
> + dev_info(>dev, "Microtune MT2060 successfully identified\n");
> + memcpy(>ops.tuner_ops, _tuner_ops, 
> sizeof(fe->ops.tuner_ops));
> + fe->ops.tuner_ops.release = NULL;
> + fe->tuner_priv = dev;
> + i2c_set_clientdata(client, dev);
> +
> + mt2060_calibrate(dev);
> +
> + return 0;
> +err:
> + dev_dbg(>dev, "failed=%d\n", ret);
> + return ret;
> +}
> +
> +static int mt2060_remove(struct i2c_client *client)
> +{
> + dev_dbg(>dev, "\n");
> +
> + return 0;
> +}
> +
> +static const struct i2c_device_id mt2060_id_table[] = {
> + {"mt2060", 0},
> + {}
> +};
> +MODULE_DEVICE_TABLE(i2c, mt2060_id_table);
> +
> +static struct i2c_driver mt2060_driver = {
> + .driver = {
> + .name = "mt2060",
> + .suppress_bind_attrs = true,
> + },
> + .probe  = mt2060_probe,
> + .remove = mt2060_remove,
> + .id_table   = mt2060_id_table,
> +};
> +
> +module_i2c_driver(mt2060_driver);
> +
>  MODULE_AUTHOR("Olivier DANET");
>  MODULE_DESCRIPTION("Microtune MT2060 silicon tuner driver");
>  MODULE_LICENSE("GPL");
> diff --git a/drivers/media/tuners/mt2060.h b/drivers/media/tuners/mt2060.h
> index 6efed35..05c0d55 100644
> --- a/drivers/media/tuners/mt2060.h
> +++ b/drivers/media/tuners/mt2060.h
> @@ -25,6 +25,26 @@
>  struct dvb_frontend;
>  struct i2c_adapter;
>  
> +/*
> + * I2C address
> + * 0x60, ...
> + */
> +
> +/**
> + * struct mt2060_platform_data - Platform data for the mt2060 driver
> + * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = 
> CLK/1.
> + * @if1: First IF used [MHz]. 0 defaults to 1220.
> + * @dvb_frontend: DVB frontend.
> + */
> +
> +struct mt2060_platform_data {
> + u8 clock_out;
> + u16 if1;
> + struct dvb_frontend *dvb_frontend;
> +};
> +
> +
> +/* configuration struct for mt2060_attach() */
>  struct mt2060_config {
>   u8 i2c_address;
>   u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
> diff --git a/drivers/media/tuners/mt2060_priv.h 
> b/drivers/media/tuners/mt2060_priv.h
> index 2b60de6..dfc4a06 100644
> --- a/drivers/media/tuners/mt2060_priv.h
> +++ b/drivers/media/tuners/mt2060_priv.h
> @@ -95,6 +95,8 @@
>  struct mt2060_priv {
>   struct mt2060_config *cfg;
>   struct i2c_adapter   *i2c;
> + struct i2c_client *client;
> + struct mt2060_config config;
>  
>   u32 frequency;
>   u16 if1_freq;
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[BUG] TechniSat SkyStar S2 - problem tuning DVB-S2 channels

2015-11-18 Thread Robert
Hello,

I am using a "TechniSat SkyStar S2" DVB-S2 card. Drivers for this card
are included in the kernel tree since 4.2. Unfortunately, i can't tune
to ANY DVB-S2 channels with this new in-tree driver. DVB-S channels are
working fine. Id[1] of the commit which introduced support for this card.

Before 4.2 arrived i have used this[2] patch with which DVB-S2 channels
where tuneable without any problems. This patch works even with 4.3
after i have converted the fe_ structs to enums.

If you need anything to debug this behaviour, i will be at your disposal.

Thanks,
Robert

[1] 5afc9a25be8d4e627cf07aa8a7500eafe3664b94
[2] http://vdr-portal.de/index.php?page=Attachment=34585
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Arnd Bergmann
On Wednesday 18 November 2015 16:21:26 Peter Ujfalusi wrote:
> 2. non slave channel requests, where only the functionality matters, like
> memcpy, interleaved, memset, etc.
> We could have a simple:
> dma_request_channel(mask);
> 
> But looking at the drivers using dmaengine legacy dma_request_channel() API:
> Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE:
> drivers/misc/carma/carma-fpga.c DMA_INTERRUPT|DMA_SLAVE|DMA_SG
> drivers/misc/carma/carma-fpga-program.c DMA_MEMCPY|DMA_SLAVE|DMA_SG
> drivers/media/platform/soc_camera/mx3_camera.c  DMA_SLAVE|DMA_PRIVATE
> sound/soc/intel/common/sst-firmware.c   DMA_SLAVE|DMA_MEMCPY
> 
> as examples.
> Not sure how valid are these...

It's usually not much harder to separate out the legacy case from
the normal dma_request_slave_channel_reason(), so those drivers don't
really need to use the unified compat API.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cx23885: use pci_set_dma_mask insted of pci_dma_supported

2015-11-18 Thread Tycho Lürsen

Hi Christoph,
I own a couple of DVBSky T982 cards, and with your latest patch I can't 
use them anymore.

When the driver loads, it spits this:

[   16.851869] cx23885 driver version 0.0.4 loaded
[   16.852012] CORE cx23885[0]: subsystem: 4254:0982, board: DVBSky T982 
[card=51,autodetected]
[   17.080771] cx25840 11-0044: cx23885 A/V decoder found @ 0x88 
(cx23885[0])
[   17.713272] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw firmware 
(16382 bytes)

[   17.728982] cx23885_dvb_register() allocating 1 frontend(s)
[   17.728986] cx23885[0]: cx23885 based dvb card
[   17.730007] i2c i2c-10: Added multiplexed i2c bus 12
[   17.730009] si2168 10-0064: Silicon Labs Si2168 successfully attached
[   17.731970] si2157 12-0060: Silicon Labs Si2147/2148/2157/2158 
successfully attached

[   17.731976] DVB: registering new adapter (cx23885[0])
[   17.731979] cx23885 :02:00.0: DVB: registering adapter 1 frontend 
0 (Silicon Labs Si2168)...

[   17.760401] DVBSky T982 port 1 MAC address: 00:17:42:54:09:87
[   17.760404] cx23885_dvb_register() allocating 1 frontend(s)
[   17.760406] cx23885[0]: cx23885 based dvb card
[   17.761028] i2c i2c-9: Added multiplexed i2c bus 13
[   17.761030] si2168 9-0064: Silicon Labs Si2168 successfully attached
[   17.762782] si2157 13-0060: Silicon Labs Si2147/2148/2157/2158 
successfully attached

[   17.762791] DVB: registering new adapter (cx23885[0])
[   17.762794] cx23885 :02:00.0: DVB: registering adapter 2 frontend 
0 (Silicon Labs Si2168)...

[   17.791455] DVBSky T982 port 2 MAC address: 00:17:42:54:09:88
[   17.791461] cx23885_dev_checkrevision() Hardware revision = 0xa5
[   17.791465] cx23885[0]/0: found at :02:00.0, rev: 4, irq: 19, 
latency: 0, mmio: 0xf780

[   17.791469] cx23885[0]/0: Oops: no 32bit PCI DMA ???
[   17.795970] cx23885: probe of :02:00.0 failed with error -5

I guess your patch is ok, so what could be going on?
Kind regards,
Tycho Lürsen

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-11-18 Thread Peter Ujfalusi
Hi Vinod,

bringing this old thread back to life as I just started to work on this.

On 06/24/2015 07:24 PM, Vinod Koul wrote:

>> We would end up with the following APIs, all returning with error code on 
>> failure:
>> dma_request_slave_channel(dev, name);
>> dma_request_channel_legacy(mask, fn, fn_param);
>> dma_request_slave_channel_compat(mask, fn, fn_param, dev, name);
>> dma_request_any_channel(mask);
> This is good idea but still we end up with 4 APIs. Why not just converge to
> two API, one legacy + memcpy + filer fn and one untimate API for slave?

Looked at the current API and it's use and, well, it is a bit confusing.

What I hoped that we can separate users to two category:
1. Slave channel requests, where we request a specific channel to handle HW
requests/triggers.
For this we could have:
dma_request_slave_channel(dev, name, fn, fn_param);

In DT/ACPI only drivers we can NULL out the fn and fn_param, in pure legacy
mode we null out the name, I would keep the dev so we could print dev specific
error in dmaengine core, but it could be optional, IN case of drivers used
both DT/ACPI and legacy mode all parameter can be filled and the core will
decide what to do.
For the legacy needs the dmaengine code would provide the mask dows with
DMA_SLAVE flag set.

2. non slave channel requests, where only the functionality matters, like
memcpy, interleaved, memset, etc.
We could have a simple:
dma_request_channel(mask);

But looking at the drivers using dmaengine legacy dma_request_channel() API:
Some sets DMA_INTERRUPT or DMA_PRIVATE or DMA_SG along with DMA_SLAVE:
drivers/misc/carma/carma-fpga.c DMA_INTERRUPT|DMA_SLAVE|DMA_SG
drivers/misc/carma/carma-fpga-program.c DMA_MEMCPY|DMA_SLAVE|DMA_SG
drivers/media/platform/soc_camera/mx3_camera.c  DMA_SLAVE|DMA_PRIVATE
sound/soc/intel/common/sst-firmware.c   DMA_SLAVE|DMA_MEMCPY

as examples.
Not sure how valid are these...

Some drivers do pass fn and fn_param when requesting channel for DMA_MEMCPY
drivers/misc/mic/host/mic_device.h
drivers/mtd/nand/fsmc_nand.c
sound/soc/intel/common/sst-firmware.c (well, this request DMA_SLAVE capability
at the same time).

Some driver sets the fn_param w/o fn, which means fn_param is ignored.

So the
dma_request_slave_channel(dev, name, fn, fn_param);
dma_request_channel(mask);

almost covers the current users and would be pretty clean ;)

If we add the mask to the slave channel API - which will become universal,
drop in replacement for dma_request_channel, and we might have only one API:

dma_request_channel(dev, name, mask, fn, fn_param);

> 
> Internally we may have 4 APIs for cleaner handling...
> 
> Thoughts... ??

Yes, as we need to arrange the code internally to keep things neat.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND RFC/PATCH 1/8] dt-bindings: Add a binding for Mediatek Video Processor Unit

2015-11-18 Thread andrew-ct chen
On Tue, 2015-11-17 at 14:13 +, Mark Rutland wrote:
> On Tue, Nov 17, 2015 at 08:54:38PM +0800, Tiffany Lin wrote:
> > From: Andrew-CT Chen 
> > 
> > Add a DT binding documentation of Video Processor Unit for the
> > MT8173 SoC from Mediatek.
> > 
> > Signed-off-by: Andrew-CT Chen 
> > ---
> >  .../devicetree/bindings/media/mediatek-vpu.txt |   27 
> > 
> >  1 file changed, 27 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/mediatek-vpu.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/media/mediatek-vpu.txt 
> > b/Documentation/devicetree/bindings/media/mediatek-vpu.txt
> > new file mode 100644
> > index 000..99a4e5e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/mediatek-vpu.txt
> > @@ -0,0 +1,27 @@
> > +* Mediatek Video Processor Unit
> > +
> > +Video Processor Unit is a HW video controller. It controls HW Codec 
> > including
> > +H.264/VP8/VP9 Decode, H.264/VP8 Encode and Image Processor 
> > (scale/rotate/color convert).
> > +
> > +Required properties:
> > +  - compatible: "mediatek,mt8173-vpu"
> > +  - reg: Must contain an entry for each entry in reg-names.
> > +  - reg-names: Must include the following entries:
> > +"sram": SRAM base
> > +"cfg_reg": Main configuration registers base
> > +  - interrupts: interrupt number to the cpu.
> > +  - clocks : clock name from clock manager
> > +  - clock-names: the clocks of the VPU H/W
> 
> You need to explicitly define the set of clock-names you expect here.
> 
> Mark.

Sorry, only one clock to enable VPU hardware.
We will modify to
- clocks : must contain one entry for each clock-names.
- clock-names : must be "main", It is the main clock of VPU.

Thanks..

> 
> > +  - iommus : phandle and IOMMU spcifier for the IOMMU that serves the VPU.
> > +
> > +Example:
> > +   vpu: vpu@1002 {
> > +   compatible = "mediatek,mt8173-vpu";
> > +   reg = <0 0x1002 0 0x3>,
> > + <0 0x1005 0 0x100>;
> > +   reg-names = "sram", "cfg_reg";
> > +   interrupts = ;
> > +   clocks = < TOP_SCP_SEL>;
> > +   clock-names = "main";
> > +   iommus = < M4U_PORT_VENC_RCPU>;
> > +   };
> > -- 
> > 1.7.9.5
> > 


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: ERRORS

2015-11-18 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:   Thu Nov 19 04:00:27 CET 2015
git branch: test
git hash:   203e942d20ab62f777360ae18c429237efef682b
gcc version:i686-linux-gcc (GCC) 5.1.0
sparse version: v0.5.0
smatch version: host hardware:  x86_64
host os:4.2.0-164

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: 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.32.27-i686: ERRORS
linux-2.6.33.7-i686: ERRORS
linux-2.6.34.7-i686: ERRORS
linux-2.6.35.9-i686: ERRORS
linux-2.6.36.4-i686: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.38.8-i686: ERRORS
linux-2.6.39.4-i686: ERRORS
linux-3.0.60-i686: ERRORS
linux-3.1.10-i686: ERRORS
linux-3.2.37-i686: ERRORS
linux-3.3.8-i686: ERRORS
linux-3.4.27-i686: ERRORS
linux-3.5.7-i686: ERRORS
linux-3.6.11-i686: ERRORS
linux-3.7.4-i686: ERRORS
linux-3.8-i686: ERRORS
linux-3.9.2-i686: ERRORS
linux-3.10.1-i686: ERRORS
linux-3.11.1-i686: ERRORS
linux-3.12.23-i686: ERRORS
linux-3.13.11-i686: ERRORS
linux-3.14.9-i686: ERRORS
linux-3.15.2-i686: ERRORS
linux-3.16.7-i686: ERRORS
linux-3.17.8-i686: ERRORS
linux-3.18.7-i686: ERRORS
linux-3.19-i686: ERRORS
linux-4.0-i686: ERRORS
linux-4.1.1-i686: OK
linux-4.2-i686: OK
linux-4.3-i686: OK
linux-4.4-rc1-i686: OK
linux-2.6.32.27-x86_64: ERRORS
linux-2.6.33.7-x86_64: ERRORS
linux-2.6.34.7-x86_64: ERRORS
linux-2.6.35.9-x86_64: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-x86_64: ERRORS
linux-2.6.39.4-x86_64: ERRORS
linux-3.0.60-x86_64: ERRORS
linux-3.1.10-x86_64: ERRORS
linux-3.2.37-x86_64: ERRORS
linux-3.3.8-x86_64: ERRORS
linux-3.4.27-x86_64: ERRORS
linux-3.5.7-x86_64: ERRORS
linux-3.6.11-x86_64: ERRORS
linux-3.7.4-x86_64: ERRORS
linux-3.8-x86_64: ERRORS
linux-3.9.2-x86_64: ERRORS
linux-3.10.1-x86_64: ERRORS
linux-3.11.1-x86_64: ERRORS
linux-3.12.23-x86_64: ERRORS
linux-3.13.11-x86_64: ERRORS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-x86_64: ERRORS
linux-3.16.7-x86_64: ERRORS
linux-3.17.8-x86_64: ERRORS
linux-3.18.7-x86_64: ERRORS
linux-3.19-x86_64: ERRORS
linux-4.0-x86_64: ERRORS
linux-4.1.1-x86_64: OK
linux-4.2-x86_64: OK
linux-4.3-x86_64: OK
linux-4.4-rc1-x86_64: OK
apps: WARNINGS
spec-git: OK
sparse: ERRORS
smatch: OK

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND RFC/PATCH 0/8] Add MT8173 Video Encoder Driver and VPU Driver

2015-11-18 Thread Hans Verkuil
On 11/17/2015 01:54 PM, Tiffany Lin wrote:
> ==
>  Introduction
> ==
> 
> The purpose of this RFC is to discuss the driver for a hw video codec
> embedded in the Mediatek's MT8173 SoCs. Mediatek Video Codec is able to
> handle video encoding of in a range of formats.
> 
> This RFC also include VPU driver. Mediatek Video Codec driver rely on
> VPU driver to load, communicate with VPU.
> 
> Internally the driver uses videobuf2 framework and MTK IOMMU and MTK SMI.
> MTK IOMMU and MTK SMI have not yet been merged, but we wanted to start
> discussion about the driver earlier so it could be merged sooner. The
> driver posted here is the initial version, so I suppose it will require
> more work.

I plan on reviewing this patch series (at least the non-dt parts). It's busy,
though, and I don't know exactly when I get the chance. But just so you know
that someone will be reviewing it.

Regards,

Hans

> 
> [1]http://lists.infradead.org/pipermail/linux-mediatek/2015-October/002525.html
> 
> ==
>  Device interface
> ==
> 
> In principle the driver bases on memory-to-memory framework:
> it provides a single video node and each opened file handle gets its own
> private context with separate buffer queues. Each context consist of 2
> buffer queues: OUTPUT (for source buffers, i.e. raw video frames)
> and CAPTURE (for destination buffers, i.e. encoded video frames).
> 
> The process of encoding video data from stream is a bit more complicated
> than typical memory-to-memory processing. We base on memory-to-memory
> framework and add the complicated part in our vb2 and v4l2 callback 
> functionss. So we can base on well done m2m memory-to-memory framework, 
> reduce duplicate code and make our driver code simple.
> 
> ==
>  VPU (Video Processor Unit)
> ==
> The VPU driver for hw video codec embedded in Mediatek's MT8173 SOCs.
> It is able to handle video decoding/encoding of in a range of formats.
> The driver provides with VPU firmware download, memory management and
> the communication interface between CPU and VPU.
> For VPU initialization, it will create virtual memory for CPU access and
> IOMMU address for vcodec hw device access. When a decode/encode instance
> opens a device node, vpu driver will download vpu firmware to the device.
> A decode/encode instant will decode/encode a frame using VPU 
> interface to interrupt vpu to handle decoding/encoding jobs.
> 
> Please have a look at the code and comments will be very much appreciated.
> 
> Andrew-CT Chen (3):
>   dt-bindings: Add a binding for Mediatek Video Processor Unit
>   arm64: dts: mediatek: Add node for Mediatek Video Processor Unit
>   media: platform: mtk-vpu: Support Mediatek VPU
> 
> Daniel Hsiao (1):
>   media: platform: mtk-vcodec: Add Mediatek VP8 Video Encoder Driver
> 
> Tiffany Lin (4):
>   dt-bindings: Add a binding for Mediatek Video Encoder
>   arm64: dts: mediatek: Add Video Encoder for MT8173
>   media: platform: mtk-vcodec: Add Mediatek V4L2 Video Encoder Driver
>   media: platform: mtk-vcodec: Add Mediatek H264 Video Encoder Driver
> 
>  .../devicetree/bindings/media/mediatek-vcodec.txt  |   58 +
>  .../devicetree/bindings/media/mediatek-vpu.txt |   27 +
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi   |   58 +
>  drivers/media/platform/Kconfig |   19 +
>  drivers/media/platform/Makefile|5 +
>  drivers/media/platform/mtk-vcodec/Kconfig  |5 +
>  drivers/media/platform/mtk-vcodec/Makefile |   12 +
>  drivers/media/platform/mtk-vcodec/common/Makefile  |   12 +
>  .../media/platform/mtk-vcodec/common/venc_drv_if.c |  159 ++
>  .../media/platform/mtk-vcodec/h264_enc/Makefile|9 +
>  .../platform/mtk-vcodec/h264_enc/venc_h264_if.c|  529 ++
>  .../platform/mtk-vcodec/h264_enc/venc_h264_if.h|   53 +
>  .../platform/mtk-vcodec/h264_enc/venc_h264_vpu.c   |  341 
>  .../platform/mtk-vcodec/include/venc_drv_base.h|   68 +
>  .../platform/mtk-vcodec/include/venc_drv_if.h  |  187 +++
>  .../platform/mtk-vcodec/include/venc_ipi_msg.h |  212 +++
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h |  441 +
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 1773 
> 
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h |   28 +
>  .../media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c |  535 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c  |  122 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_intr.c|  110 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_intr.h|   30 +
>  drivers/media/platform/mtk-vcodec/mtk_vcodec_pm.h  |   26 +
>  .../media/platform/mtk-vcodec/mtk_vcodec_util.c|  106 ++
>  .../media/platform/mtk-vcodec/mtk_vcodec_util.h|   66 +
>  drivers/media/platform/mtk-vcodec/vp8_enc/Makefile |9 +
>  .../platform/mtk-vcodec/vp8_enc/venc_vp8_if.c  |  371 
>