[PATCH v2] media: rc: reduce size of struct ir_raw_event

2016-03-18 Thread Heiner Kallweit
struct ir_raw_event currently has a size of 12 bytes on most (all?)
architectures. This can be reduced to 8 bytes whilst maintaining
full backwards compatibility.
This saves 2KB in size of struct ir_raw_event_ctrl (as element
kfifo is reduced by 512 * 4 bytes) and it allows to copy the
full struct ir_raw_event with a single 64 bit operation.

Successfully tested with the Nuvoton driver and successfully
compile-tested with the ene_ir driver (as it uses the carrier /
duty_cycle elements).

Signed-off-by: Heiner Kallweit 
---
v2:
- don't change type of bit field members
---
 include/media/rc-core.h | 18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 0f77b3d..f6f55b7 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -215,12 +215,9 @@ enum raw_event_type {
 struct ir_raw_event {
union {
u32 duration;
-
-   struct {
-   u32 carrier;
-   u8  duty_cycle;
-   };
+   u32 carrier;
};
+   u8  duty_cycle;
 
unsignedpulse:1;
unsignedreset:1;
@@ -228,13 +225,7 @@ struct ir_raw_event {
unsignedcarrier_report:1;
 };
 
-#define DEFINE_IR_RAW_EVENT(event) \
-   struct ir_raw_event event = { \
-   { .duration = 0 } , \
-   .pulse = 0, \
-   .reset = 0, \
-   .timeout = 0, \
-   .carrier_report = 0 }
+#define DEFINE_IR_RAW_EVENT(event) struct ir_raw_event event = {}
 
 static inline void init_ir_raw_event(struct ir_raw_event *ev)
 {
@@ -256,8 +247,7 @@ void ir_raw_event_set_idle(struct rc_dev *dev, bool idle);
 
 static inline void ir_raw_event_reset(struct rc_dev *dev)
 {
-   DEFINE_IR_RAW_EVENT(ev);
-   ev.reset = true;
+   struct ir_raw_event ev = { .reset = true };
 
ir_raw_event_store(dev, &ev);
ir_raw_event_handle(dev);
-- 
2.7.3


--
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 v4 0/2] media: soc_camera: rcar_vin: add fallback and r8a7792 bindings

2016-03-18 Thread Laurent Pinchart
Hi Simon,

Thank you for the patches.

For the whole series,

Acked-by: Laurent Pinchart 

On Tuesday 15 March 2016 09:40:25 Simon Horman wrote:
> Hi,
> 
> this short series adds add fallback and r8a7792 bindings to rcar_vin.
> 
> Based on media-tree/master
> 
> Changes since v3:
> * Add Acks
> * Correct typo in changelog
> 
> Simon Horman (1):
>   media: soc_camera: rcar_vin: add device tree support for r8a7792
> 
> Yoshihiro Kaneko (1):
>   media: soc_camera: rcar_vin: add R-Car Gen 2 and 3 fallback
> compatibility strings
> 
>  Documentation/devicetree/bindings/media/rcar_vin.txt | 12 ++--
>  drivers/media/platform/soc_camera/rcar_vin.c |  2 ++
>  2 files changed, 12 insertions(+), 2 deletions(-)

-- 
Regards,

Laurent Pinchart

--
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] media: rc: reduce size of struct ir_raw_event

2016-03-18 Thread Heiner Kallweit
Am 16.03.2016 um 23:28 schrieb Sean Young:
> On Wed, Mar 16, 2016 at 10:18:38PM +0100, Heiner Kallweit wrote:
>> struct ir_raw_event currently has a size of 12 bytes on most (all?)
>> architectures. This can be reduced to 8 bytes whilst maintaining
>> full backwards compatibility.
>> This saves 2KB in size of struct ir_raw_event_ctrl (as element
>> kfifo is reduced by 512 * 4 bytes) and it allows to copy the
>> full struct ir_raw_event with a single 64 bit operation.
>>
>> Successfully tested with the Nuvoton driver and successfully
>> compile-tested with the ene_ir driver (as it uses the carrier /
>> duty_cycle elements).
>>
>> Signed-off-by: Heiner Kallweit 
>> ---
>>  include/media/rc-core.h | 26 --
>>  1 file changed, 8 insertions(+), 18 deletions(-)
>>
>> diff --git a/include/media/rc-core.h b/include/media/rc-core.h
>> index 0f77b3d..b8f27c9 100644
>> --- a/include/media/rc-core.h
>> +++ b/include/media/rc-core.h
>> @@ -214,27 +214,17 @@ enum raw_event_type {
>>  
>>  struct ir_raw_event {
>>  union {
>> -u32 duration;
>> -
>> -struct {
>> -u32 carrier;
>> -u8  duty_cycle;
>> -};
>> +u32 duration;
>> +u32 carrier;
>>  };
>> -
>> -unsignedpulse:1;
>> -unsignedreset:1;
>> -unsignedtimeout:1;
>> -unsignedcarrier_report:1;
>> +u8  duty_cycle;
> 
> Moving duty_cycle does indeed reduce the structure size from 12 to 8.
> 
>> +u8  pulse:1;
>> +u8  reset:1;
>> +u8  timeout:1;
>> +u8  carrier_report:1;
> 
> Why are you changing the type of the bitfields? 
> 
I did this to make sure that the compiler uses one byte for
the bit field. When testing gcc also used just one byte when
keeping the original "unsigned" type for the bit field members.
Therefore it wouldn't be strictly neeeded.

But I'm not sure whether it's guaranteed that the compiler packs a
bit field to the smallest possible data type and we can rely on it.
AFAIK C99 is a little more specific about this implementation detail of
bit fields but C89/C90 is used for kernel compilation.

Heiner

>>  };
>>  
>> -#define DEFINE_IR_RAW_EVENT(event) \
>> -struct ir_raw_event event = { \
>> -{ .duration = 0 } , \
>> -.pulse = 0, \
>> -.reset = 0, \
>> -.timeout = 0, \
>> -.carrier_report = 0 }
>> +#define DEFINE_IR_RAW_EVENT(event) struct ir_raw_event event = {}
> 
> Seems fine. I've always kinda wondered why this macro is needed.
> 
> 
> Sean
> 

--
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


[PATCHv13 04/17] input.h: add BUS_CEC type

2016-03-18 Thread Hans Verkuil
Inputs can come in over the HDMI CEC bus, so add a new type for this.

Signed-off-by: Hans Verkuil 
Acked-by: Dmitry Torokhov 
---
 include/uapi/linux/input.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index 2758687..4f8c813 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -246,6 +246,7 @@ struct input_mask {
 #define BUS_GSC0x1A
 #define BUS_ATARI  0x1B
 #define BUS_SPI0x1C
+#define BUS_CEC0x1D
 
 /*
  * MT_TOOL types
-- 
2.7.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


[PATCH] az6027: Add support for Elgato EyeTV Sat v3

2016-03-18 Thread Olli Salonen
Another version of Elgato EyeTV Sat USB DVB-S2 adapter needs just
a USB ID addition.

Signed-off-by: Christian Knippel 
Reported-by: Olli Salonen 

---
 drivers/media/dvb-core/dvb-usb-ids.h | 1 +
 drivers/media/usb/dvb-usb/az6027.c   | 7 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb-usb-ids.h 
b/drivers/media/dvb-core/dvb-usb-ids.h
index 0afad39..f94e58f 100644
--- a/drivers/media/dvb-core/dvb-usb-ids.h
+++ b/drivers/media/dvb-core/dvb-usb-ids.h
@@ -373,6 +373,7 @@
 #define USB_PID_ELGATO_EYETV_DTT_Dlx   0x0020
 #define USB_PID_ELGATO_EYETV_SAT   0x002a
 #define USB_PID_ELGATO_EYETV_SAT_V20x0025
+#define USB_PID_ELGATO_EYETV_SAT_V30x0036
 #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD0x5000
 #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM0x5001
 #define USB_PID_FRIIO_WHITE0x0001
diff --git a/drivers/media/usb/dvb-usb/az6027.c 
b/drivers/media/usb/dvb-usb/az6027.c
index 92e47d6..2e71136 100644
--- a/drivers/media/usb/dvb-usb/az6027.c
+++ b/drivers/media/usb/dvb-usb/az6027.c
@@ -1090,6 +1090,7 @@ static struct usb_device_id az6027_usb_table[] = {
{ USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) },
{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT) },
{ USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT_V2) },
+   { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT_V3) },
{ },
 };
 
@@ -1138,7 +1139,7 @@ static struct dvb_usb_device_properties az6027_properties 
= {
 
.i2c_algo = &az6027_i2c_algo,
 
-   .num_device_descs = 7,
+   .num_device_descs = 8,
.devices = {
{
.name = "AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)",
@@ -1168,6 +1169,10 @@ static struct dvb_usb_device_properties 
az6027_properties = {
.name = "Elgato EyeTV Sat",
.cold_ids = { &az6027_usb_table[6], NULL },
.warm_ids = { NULL },
+   }, {
+   .name = "Elgato EyeTV Sat",
+   .cold_ids = { &az6027_usb_table[7], NULL },
+   .warm_ids = { NULL },
},
{ NULL },
}
-- 
1.9.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


[PATCH] [media] m88ds3103: fix undefined division

2016-03-18 Thread Peter Rosin
From: Peter Rosin 

s32tmp in the below code may be negative, and dev->mclk_khz is an
unsigned type.

s32tmp = 0x1 * (tuner_frequency - c->frequency);
s32tmp = DIV_ROUND_CLOSEST(s32tmp, dev->mclk_khz);

This is undefined, as DIV_ROUND_CLOSEST is undefined for negative
dividends when the divisor is of unsigned type.

So, change mclk_khz to be signed (s32).

Signed-off-by: Peter Rosin 
---
 drivers/media/dvb-frontends/m88ds3103_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Note, this was found by code inspection, I don't have the hardware,
I don't know what the consequences of a garbage result are at this
point in the code and the patch has only been build-tested. It looks
obvious enough though. It should probably go to stable as well...

Cheers,
Peter

diff --git a/drivers/media/dvb-frontends/m88ds3103_priv.h 
b/drivers/media/dvb-frontends/m88ds3103_priv.h
index eee8c22c51ec..651e005146b2 100644
--- a/drivers/media/dvb-frontends/m88ds3103_priv.h
+++ b/drivers/media/dvb-frontends/m88ds3103_priv.h
@@ -46,7 +46,7 @@ struct m88ds3103_dev {
/* auto detect chip id to do different config */
u8 chip_id;
/* main mclk is calculated for M88RS6000 dynamically */
-   u32 mclk_khz;
+   s32 mclk_khz;
u64 post_bit_error;
u64 post_bit_count;
 };
-- 
2.1.4

--
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 4/5] [media] media-device: use kref for media_device instance

2016-03-18 Thread Shuah Khan
On 03/16/2016 06:04 AM, Mauro Carvalho Chehab wrote:
> Now that the media_device can be used by multiple drivers,
> via devres, we need to be sure that it will be dropped only
> when all drivers stop using it.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/media/media-device.c | 48 
> +++-
>  include/media/media-device.h |  3 +++
>  2 files changed, 37 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index c32fa15cc76e..38e6c319fe6e 100644
> --- a/drivers/media/media-device.c
> +++ b/drivers/media/media-device.c
> @@ -721,6 +721,15 @@ int __must_check __media_device_register(struct 
> media_device *mdev,
>  {
>   int ret;
>  
> + /* Check if mdev was ever registered at all */
> + mutex_lock(&mdev->graph_mutex);
> + if (media_devnode_is_registered(&mdev->devnode)) {
> + kref_get(&mdev->kref);
> + mutex_unlock(&mdev->graph_mutex);
> + return 0;
> + }
> + kref_init(&mdev->kref);
> +
>   /* Register the device node. */
>   mdev->devnode.fops = &media_device_fops;
>   mdev->devnode.parent = mdev->dev;
> @@ -730,8 +739,10 @@ int __must_check __media_device_register(struct 
> media_device *mdev,
>   mdev->topology_version = 0;
>  
>   ret = media_devnode_register(&mdev->devnode, owner);
> - if (ret < 0)
> + if (ret < 0) {
> + media_devnode_unregister(&mdev->devnode);
>   return ret;
> + }
>  
>   ret = device_create_file(&mdev->devnode.dev, &dev_attr_model);
>   if (ret < 0) {
> @@ -739,6 +750,7 @@ int __must_check __media_device_register(struct 
> media_device *mdev,
>   return ret;
>   }
>  
> + mutex_unlock(&mdev->graph_mutex);
>   dev_dbg(mdev->dev, "Media device registered\n");
>  
>   return 0;
> @@ -773,23 +785,15 @@ void media_device_unregister_entity_notify(struct 
> media_device *mdev,
>  }
>  EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
>  
> -void media_device_unregister(struct media_device *mdev)
> +static void do_media_device_unregister(struct kref *kref)
>  {
> + struct media_device *mdev;
>   struct media_entity *entity;
>   struct media_entity *next;
>   struct media_interface *intf, *tmp_intf;
>   struct media_entity_notify *notify, *nextp;
>  
> - if (mdev == NULL)
> - return;
> -
> - mutex_lock(&mdev->graph_mutex);
> -
> - /* Check if mdev was ever registered at all */
> - if (!media_devnode_is_registered(&mdev->devnode)) {
> - mutex_unlock(&mdev->graph_mutex);
> - return;
> - }
> + mdev = container_of(kref, struct media_device, kref);
>  
>   /* Remove all entities from the media device */
>   list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list)
> @@ -807,13 +811,26 @@ void media_device_unregister(struct media_device *mdev)
>   kfree(intf);
>   }
>  
> - mutex_unlock(&mdev->graph_mutex);
> + /* Check if mdev devnode was registered */
> + if (!media_devnode_is_registered(&mdev->devnode))
> + return;
>  
>   device_remove_file(&mdev->devnode.dev, &dev_attr_model);
>   media_devnode_unregister(&mdev->devnode);

Patch looks good.

Reviewed-by: Shuah Khan 

Please see a few comments below that aren't related to this patch.

The above is unprotected and could be done twice when two drivers
call media_device_unregister(). I think we still mark the media
device unregistered in media_devnode_unregister(). We have to
protect these two steps still.

I attempted to do this with a unregister in progress flag which
gets set at the beginning in media_device_unregister(). That
does ensure media_device_unregister() runs only once. If that
approach isn't desirable, we have to find another way.

-- Shuah
>  
>   dev_dbg(mdev->dev, "Media device unregistered\n");
>  }
> +
> +void media_device_unregister(struct media_device *mdev)
> +{
> + if (mdev == NULL)
> + return;
> +
> + mutex_lock(&mdev->graph_mutex);
> + kref_put(&mdev->kref, do_media_device_unregister);
> + mutex_unlock(&mdev->graph_mutex);
> +
> +}
>  EXPORT_SYMBOL_GPL(media_device_unregister);
>  
>  static void media_device_release_devres(struct device *dev, void *res)
> @@ -825,13 +842,16 @@ struct media_device *media_device_get_devres(struct 
> device *dev)
>   struct media_device *mdev;
>  
>   mdev = devres_find(dev, media_device_release_devres, NULL, NULL);
> - if (mdev)
> + if (mdev) {
> + kref_get(&mdev->kref);
>   return mdev;
> + }
>  
>   mdev = devres_alloc(media_device_release_devres,
>   sizeof(struct media_device), GFP_KERNEL);
>   if (!mdev)
>   return NULL;
> +
>   return devres_get(dev, mdev, NULL, NULL);
>  }
>  EXPORT_SYMBOL_GPL(media_device_get_devres);
> diff --git a/include/med

Re: [PATCH 5/5] [media] media-device: make media_device_cleanup() static

2016-03-18 Thread Javier Martinez Canillas
Hello Mauro,

The patch looks mostly good to me, I just have a question below:

On Wed, Mar 16, 2016 at 9:04 AM, Mauro Carvalho Chehab
 wrote:

[snip]

>
> -void media_device_cleanup(struct media_device *mdev)
> +static void media_device_cleanup(struct media_device *mdev)
>  {
> ida_destroy(&mdev->entity_internal_idx);
> mdev->entity_internal_idx_max = 0;
> media_entity_graph_walk_cleanup(&mdev->pm_count_walk);
> -   mutex_destroy(&mdev->graph_mutex);

Any reason why this is removed? mutex_init() is still called in
media_device_init() so I believe the destroy should be kept here.

Reviewed-by: Javier Martinez Canillas 

Best regards,
Javier
--
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


[PATCHv13 15/17] cobalt: add cec support

2016-03-18 Thread Hans Verkuil
Add CEC support to the cobalt driver.

Signed-off-by: Hans Verkuil 
---
 drivers/media/pci/cobalt/Kconfig |   1 +
 drivers/media/pci/cobalt/cobalt-driver.c | 115 +++-
 drivers/media/pci/cobalt/cobalt-driver.h |   2 +
 drivers/media/pci/cobalt/cobalt-irq.c|   3 +
 drivers/media/pci/cobalt/cobalt-v4l2.c   | 126 ---
 drivers/media/pci/cobalt/cobalt-v4l2.h   |   2 +
 6 files changed, 223 insertions(+), 26 deletions(-)

diff --git a/drivers/media/pci/cobalt/Kconfig b/drivers/media/pci/cobalt/Kconfig
index a01f0cc..9125747 100644
--- a/drivers/media/pci/cobalt/Kconfig
+++ b/drivers/media/pci/cobalt/Kconfig
@@ -4,6 +4,7 @@ config VIDEO_COBALT
depends on PCI_MSI && MTD_COMPLEX_MAPPINGS
depends on GPIOLIB || COMPILE_TEST
depends on SND
+   select MEDIA_CEC
select I2C_ALGOBIT
select VIDEO_ADV7604
select VIDEO_ADV7511
diff --git a/drivers/media/pci/cobalt/cobalt-driver.c 
b/drivers/media/pci/cobalt/cobalt-driver.c
index 8d6f04f..adae989 100644
--- a/drivers/media/pci/cobalt/cobalt-driver.c
+++ b/drivers/media/pci/cobalt/cobalt-driver.c
@@ -76,6 +76,7 @@ static u8 edid[256] = {
0x0A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68,
+
0x02, 0x03, 0x1a, 0xc0, 0x48, 0xa2, 0x10, 0x04,
0x02, 0x01, 0x21, 0x14, 0x13, 0x23, 0x09, 0x07,
0x07, 0x65, 0x03, 0x0c, 0x00, 0x10, 0x00, 0xe2,
@@ -149,17 +150,51 @@ static void cobalt_notify(struct v4l2_subdev *sd,
struct cobalt *cobalt = to_cobalt(sd->v4l2_dev);
unsigned sd_nr = cobalt_get_sd_nr(sd);
struct cobalt_stream *s = &cobalt->streams[sd_nr];
-   bool hotplug = arg ? *((int *)arg) : false;
+   struct v4l2_subdev_cec_tx_done *tx_done = arg;
 
-   if (s->is_output)
+   switch (notification) {
+   case V4L2_SUBDEV_CEC_TX_DONE:
+   cec_transmit_done(s->cec_adap, tx_done->status,
+ tx_done->arb_lost_cnt, tx_done->nack_cnt,
+ tx_done->low_drive_cnt, tx_done->error_cnt);
+   return;
+   case V4L2_SUBDEV_CEC_RX_MSG:
+   cec_received_msg(s->cec_adap, arg);
+   return;
+   case V4L2_SUBDEV_CEC_CONN_INPUTS:
+   cec_connected_inputs(s->cec_adap, *(u16 *)arg);
+   return;
+   default:
+   break;
+   }
+
+   if (s->is_output) {
+   switch (notification) {
+   case ADV7511_EDID_DETECT: {
+   struct adv7511_edid_detect *ed = arg;
+
+   cec_set_phys_addr(s->cec_adap, ed->phys_addr);
+   /* Unconfigure the CEC adapter if the EDID disappears */
+   if (!ed->present && s->cec_adap &&
+   s->cec_adap->is_configured)
+   cec_claim_log_addrs(s->cec_adap, NULL, false);
+   break;
+   }
+   }
return;
+   }
 
switch (notification) {
-   case ADV76XX_HOTPLUG:
+   case ADV76XX_HOTPLUG: {
+   bool hotplug = arg ? *((int *)arg) : false;
+
cobalt_s_bit_sysctrl(cobalt,
COBALT_SYS_CTRL_HPD_TO_CONNECTOR_BIT(sd_nr), hotplug);
+   if (s->cec_adap)
+   cec_connected_inputs(s->cec_adap, hotplug);
cobalt_dbg(1, "Set hotplug for adv %d to %d\n", sd_nr, hotplug);
break;
+   }
case V4L2_DEVICE_NOTIFY_EVENT:
cobalt_dbg(1, "Format changed for adv %d\n", sd_nr);
v4l2_event_queue(&s->vdev, arg);
@@ -438,12 +473,15 @@ static void cobalt_stream_struct_init(struct cobalt 
*cobalt)
 
for (i = 0; i < COBALT_NUM_STREAMS; i++) {
struct cobalt_stream *s = &cobalt->streams[i];
+   struct video_device *vdev = &s->vdev;
 
s->cobalt = cobalt;
s->flags = 0;
s->is_audio = false;
s->is_output = false;
s->is_dummy = true;
+   snprintf(vdev->name, sizeof(vdev->name),
+"%s-%d", cobalt->v4l2_dev.name, i);
 
/* The Memory DMA channels will always get a lower channel
 * number than the FIFO DMA. Video input should map to the
@@ -485,6 +523,23 @@ static void cobalt_stream_struct_init(struct cobalt 
*cobalt)
}
 }
 
+static int cobalt_create_cec_adap(struct cobalt_stream *s)
+{
+   u32 caps = CEC_CAP_TRANSMIT | CEC_CAP_LOG_ADDRS |
+   CEC_CAP_PASSTHROUGH | CEC_CAP_RC |
+   CEC_CAP_ARC | CEC_CAP_VENDOR_ID;
+   u8 nsinks = 0;
+
+   if (s->is_output)
+   caps |= CEC_CAP_IS_SOURCE | CEC_CAP_CDC_HPD;
+   else
+   nsinks = 1;
+   s->cec_adap = cec_create

cron job: media_tree daily build: ERRORS

2016-03-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:   Sat Mar 19 04:00:36 CET 2016
git branch: test
git hash:   c2f555fe3ce4515a8bf1393af5b9a48ce60ebbfe
gcc version:i686-linux-gcc (GCC) 5.3.0
sparse version: v0.5.0-51-ga53cea2
smatch version: v0.5.0-3228-g5cf65ab
host hardware:  x86_64
host os:4.4.0-164

linux-git-arm-at91: ERRORS
linux-git-arm-davinci: ERRORS
linux-git-arm-exynos: ERRORS
linux-git-arm-mx: ERRORS
linux-git-arm-omap: ERRORS
linux-git-arm-omap1: ERRORS
linux-git-arm-pxa: ERRORS
linux-git-blackfin-bf561: ERRORS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: ERRORS
linux-git-powerpc64: OK
linux-git-sh: ERRORS
linux-git-x86_64: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16.7-i686: OK
linux-3.17.8-i686: OK
linux-3.18.7-i686: OK
linux-3.19-i686: OK
linux-4.0-i686: OK
linux-4.1.1-i686: OK
linux-4.2-i686: OK
linux-4.3-i686: OK
linux-4.4-i686: OK
linux-4.5-i686: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16.7-x86_64: OK
linux-3.17.8-x86_64: OK
linux-3.18.7-x86_64: OK
linux-3.19-x86_64: OK
linux-4.0-x86_64: OK
linux-4.1.1-x86_64: OK
linux-4.2-x86_64: OK
linux-4.3-x86_64: OK
linux-4.4-x86_64: OK
linux-4.5-x86_64: OK
apps: OK
spec-git: OK
sparse: ERRORS
ABI WARNING: change for i686
ABI WARNING: change for m32r
ABI WARNING: change for powerpc64
ABI WARNING: change for x86_64
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.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


media: rc: make raw event fifo size a module parameter

2016-03-18 Thread Heiner Kallweit
Currently the fifo size is 512 elements. After a recent patch the size
of struct ir_raw_event is down to 8 bytes, so the fifo still consumes
4KB. In most cases a much smaller fifo is sufficient, e.g. nuvoton-cir
triggers event processing after 24 events latest. However the needed
fifo size may also depend on system performance.

Therefore make the fifo size a module parameter with the current value
of 512 being the default.

Signed-off-by: Heiner Kallweit 
---
 drivers/media/rc/rc-core-priv.h |  2 +-
 drivers/media/rc/rc-ir-raw.c| 20 +---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
index 585d5e5..ae6f81e 100644
--- a/drivers/media/rc/rc-core-priv.h
+++ b/drivers/media/rc/rc-core-priv.h
@@ -39,7 +39,7 @@ struct ir_raw_event_ctrl {
struct task_struct  *thread;
spinlock_t  lock;
/* fifo for the pulse/space durations */
-   DECLARE_KFIFO(kfifo, struct ir_raw_event, MAX_IR_EVENT_SIZE);
+   DECLARE_KFIFO_PTR(kfifo, struct ir_raw_event);
ktime_t last_event; /* when last event 
occurred */
enum raw_event_type last_type;  /* last event type */
struct rc_dev   *dev;   /* pointer to the 
parent rc_dev */
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
index 144304c..620b036 100644
--- a/drivers/media/rc/rc-ir-raw.c
+++ b/drivers/media/rc/rc-ir-raw.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "rc-core-priv.h"
 
 /* Used to keep track of IR raw clients, protected by ir_raw_handler_lock */
@@ -28,6 +29,9 @@ static DEFINE_MUTEX(ir_raw_handler_lock);
 static LIST_HEAD(ir_raw_handler_list);
 static u64 available_protocols;
 
+/* module param */
+static unsigned int ir_raw_event_fifo_size = MAX_IR_EVENT_SIZE;
+
 static int ir_raw_event_thread(void *data)
 {
struct ir_raw_event ev;
@@ -262,7 +266,7 @@ int ir_raw_event_register(struct rc_dev *dev)
int rc;
struct ir_raw_handler *handler;
 
-   if (!dev)
+   if (!dev || !ir_raw_event_fifo_size)
return -EINVAL;
 
dev->raw = kzalloc(sizeof(*dev->raw), GFP_KERNEL);
@@ -271,7 +275,10 @@ int ir_raw_event_register(struct rc_dev *dev)
 
dev->raw->dev = dev;
dev->change_protocol = change_protocol;
-   INIT_KFIFO(dev->raw->kfifo);
+
+   rc = kfifo_alloc(&dev->raw->kfifo, ir_raw_event_fifo_size, GFP_KERNEL);
+   if (rc)
+   goto out;
 
spin_lock_init(&dev->raw->lock);
dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw,
@@ -279,7 +286,7 @@ int ir_raw_event_register(struct rc_dev *dev)
 
if (IS_ERR(dev->raw->thread)) {
rc = PTR_ERR(dev->raw->thread);
-   goto out;
+   goto out_kfifo;
}
 
mutex_lock(&ir_raw_handler_lock);
@@ -291,6 +298,8 @@ int ir_raw_event_register(struct rc_dev *dev)
 
return 0;
 
+out_kfifo:
+   kfifo_free(&dev->raw->kfifo);
 out:
kfree(dev->raw);
dev->raw = NULL;
@@ -313,6 +322,7 @@ void ir_raw_event_unregister(struct rc_dev *dev)
handler->raw_unregister(dev);
mutex_unlock(&ir_raw_handler_lock);
 
+   kfifo_free(&dev->raw->kfifo);
kfree(dev->raw);
dev->raw = NULL;
 }
@@ -353,3 +363,7 @@ void ir_raw_handler_unregister(struct ir_raw_handler 
*ir_raw_handler)
mutex_unlock(&ir_raw_handler_lock);
 }
 EXPORT_SYMBOL(ir_raw_handler_unregister);
+
+module_param_named(fifo_size, ir_raw_event_fifo_size, uint, S_IRUGO);
+MODULE_PARM_DESC(fifo_size,
+   "raw event fifo size, will be rounded up to next power of 2");
-- 
2.7.3

--
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 v2] [media] media-device: use kref for media_device instance

2016-03-18 Thread Mauro Carvalho Chehab
Now that the media_device can be used by multiple drivers,
via devres, we need to be sure that it will be dropped only
when all drivers stop using it.

Signed-off-by: Mauro Carvalho Chehab 
---

v2: The kref is now used only when media_device is allocated via 
the media_device*_devress. This warrants that other drivers won't be
affected, and that we can keep media_device_cleanup() balanced with
media_device_init().

 drivers/media/media-device.c   | 117 +
 drivers/media/usb/au0828/au0828-core.c |   3 +-
 include/media/media-device.h   |  28 
 sound/usb/media.c  |   3 +-
 4 files changed, 118 insertions(+), 33 deletions(-)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index c32fa15cc76e..4a97d92a7e7d 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -707,11 +707,16 @@ void media_device_init(struct media_device *mdev)
 }
 EXPORT_SYMBOL_GPL(media_device_init);
 
-void media_device_cleanup(struct media_device *mdev)
+static void __media_device_cleanup(struct media_device *mdev)
 {
ida_destroy(&mdev->entity_internal_idx);
mdev->entity_internal_idx_max = 0;
media_entity_graph_walk_cleanup(&mdev->pm_count_walk);
+}
+
+void media_device_cleanup(struct media_device *mdev)
+{
+   __media_device_cleanup(mdev);
mutex_destroy(&mdev->graph_mutex);
 }
 EXPORT_SYMBOL_GPL(media_device_cleanup);
@@ -721,6 +726,9 @@ int __must_check __media_device_register(struct 
media_device *mdev,
 {
int ret;
 
+   /* Check if mdev was ever registered at all */
+   mutex_lock(&mdev->graph_mutex);
+
/* Register the device node. */
mdev->devnode.fops = &media_device_fops;
mdev->devnode.parent = mdev->dev;
@@ -731,17 +739,19 @@ int __must_check __media_device_register(struct 
media_device *mdev,
 
ret = media_devnode_register(&mdev->devnode, owner);
if (ret < 0)
-   return ret;
+   goto err;
 
ret = device_create_file(&mdev->devnode.dev, &dev_attr_model);
if (ret < 0) {
media_devnode_unregister(&mdev->devnode);
-   return ret;
+   goto err;
}
 
dev_dbg(mdev->dev, "Media device registered\n");
 
-   return 0;
+err:
+   mutex_unlock(&mdev->graph_mutex);
+   return ret;
 }
 EXPORT_SYMBOL_GPL(__media_device_register);
 
@@ -773,24 +783,13 @@ void media_device_unregister_entity_notify(struct 
media_device *mdev,
 }
 EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
 
-void media_device_unregister(struct media_device *mdev)
+static void __media_device_unregister(struct media_device *mdev)
 {
struct media_entity *entity;
struct media_entity *next;
struct media_interface *intf, *tmp_intf;
struct media_entity_notify *notify, *nextp;
 
-   if (mdev == NULL)
-   return;
-
-   mutex_lock(&mdev->graph_mutex);
-
-   /* Check if mdev was ever registered at all */
-   if (!media_devnode_is_registered(&mdev->devnode)) {
-   mutex_unlock(&mdev->graph_mutex);
-   return;
-   }
-
/* Remove all entities from the media device */
list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list)
__media_device_unregister_entity(entity);
@@ -807,38 +806,98 @@ void media_device_unregister(struct media_device *mdev)
kfree(intf);
}
 
-   mutex_unlock(&mdev->graph_mutex);
-
-   device_remove_file(&mdev->devnode.dev, &dev_attr_model);
-   media_devnode_unregister(&mdev->devnode);
+   /* Check if mdev devnode was registered */
+   if (media_devnode_is_registered(&mdev->devnode)) {
+   device_remove_file(&mdev->devnode.dev, &dev_attr_model);
+   media_devnode_unregister(&mdev->devnode);
+   }
 
dev_dbg(mdev->dev, "Media device unregistered\n");
 }
+
+void media_device_unregister(struct media_device *mdev)
+{
+   if (mdev == NULL)
+   return;
+
+   mutex_lock(&mdev->graph_mutex);
+   __media_device_unregister(mdev);
+   mutex_unlock(&mdev->graph_mutex);
+}
 EXPORT_SYMBOL_GPL(media_device_unregister);
 
 static void media_device_release_devres(struct device *dev, void *res)
 {
 }
 
-struct media_device *media_device_get_devres(struct device *dev)
+static void do_media_device_unregister_devres(struct kref *kref)
 {
+   struct media_device_devres *mdev_devres;
struct media_device *mdev;
+   int ret;
 
-   mdev = devres_find(dev, media_device_release_devres, NULL, NULL);
-   if (mdev)
-   return mdev;
+   mdev_devres = container_of(kref, struct media_device_devres, kref);
 
-   mdev = devres_alloc(media_device_release_devres,
-   sizeof(struct media_device), GFP_KERNEL);
-   if (!mdev)
+   if (!mdev_devres)
+  

Re: [PATCH] sound/usb: fix to release stream resources from media_snd_device_delete()

2016-03-18 Thread Mauro Carvalho Chehab
Em Fri, 18 Mar 2016 20:50:31 -0600
Shuah Khan  escreveu:

> Fix to release stream resources from media_snd_device_delete() before
> media device is unregistered. Without this change, stream resource free
> is attempted after the media device is unregistered which would result
> in use-after-free errors.
> 
> Signed-off-by: Shuah Khan 
> ---
> 
> - Ran bind/unbind loop (1000 iteration) test on snd-usb-audio
>   while running mc_nextgen_test loop (1000 iterations) in parallel.
> - Ran bind/unbind and rmmod/modprobe tests on both drivers. Also
>   generated graphs when after bind/unbind, rmmod/modprobe. Graphs
>   look good.
> - Note: Please apply the following patch to fix memory leak:
>   sound/usb: Fix memory leak in media_snd_stream_delete() during unbind
>   https://lkml.org/lkml/2016/3/16/1050
> 
>  sound/usb/media.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/usb/media.c b/sound/usb/media.c
> index de4a815..e35af88 100644
> --- a/sound/usb/media.c
> +++ b/sound/usb/media.c
> @@ -301,6 +301,13 @@ int media_snd_device_create(struct snd_usb_audio *chip,
>  void media_snd_device_delete(struct snd_usb_audio *chip)
>  {
>   struct media_device *mdev = chip->media_dev;
> + struct snd_usb_stream *stream;
> +
> + /* release resources */
> + list_for_each_entry(stream, &chip->pcm_list, list) {
> + media_snd_stream_delete(&stream->substream[0]);
> + media_snd_stream_delete(&stream->substream[1]);

I'll look on it better tomorrow, but it sounds weird to hardcode
substream[0] and [1] here... are you sure that this is valid for
*all* devices supported by snd-usb-audio?

Regards,
Mauro

> + }
>  
>   media_snd_mixer_delete(chip);
>  


-- 
Thanks,
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: [PATCHv13 01/17] dts: exynos4*: add HDMI CEC pin definition to pinctrl

2016-03-18 Thread Krzysztof Kozlowski
On Fri, Mar 18, 2016 at 03:07:00PM +0100, Hans Verkuil wrote:
> From: Kamil Debski 
> 
> Add pinctrl nodes for the HDMI CEC device to the Exynos4210 and
> Exynos4x12 SoCs. These are required by the HDMI CEC device.
> 
> Signed-off-by: Kamil Debski 
> Signed-off-by: Hans Verkuil 
> Acked-by: Krzysztof Kozlowski 
> ---
>  arch/arm/boot/dts/exynos4210-pinctrl.dtsi | 7 +++
>  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 7 +++
>  2 files changed, 14 insertions(+)

Hi Hans,

I see you have been carrying these three patches for a long time.
Initially I thought that there are some dependencies... but maybe there
are not?

Can I take these Exynos DTS patches to samsung-soc?

Best regards,
Krzysztof
--
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] [media] media-device: use kref for media_device instance

2016-03-18 Thread Shuah Khan
On 03/18/2016 06:42 PM, Mauro Carvalho Chehab wrote:
> Now that the media_device can be used by multiple drivers,
> via devres, we need to be sure that it will be dropped only
> when all drivers stop using it.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Looks good. Tested it doing bind/unbind, rmmod/modprobe on both
au0828 and snd-usb-audio drivers. Also generated graphs when after
bind/unbind, rmmod/modprobe. Graphs look good.

Tested-by: Shuah Khan 

thanks,
-- Shuah

> ---
> 
> v2: The kref is now used only when media_device is allocated via 
> the media_device*_devress. This warrants that other drivers won't be
> affected, and that we can keep media_device_cleanup() balanced with
> media_device_init().
> 
>  drivers/media/media-device.c   | 117 
> +
>  drivers/media/usb/au0828/au0828-core.c |   3 +-
>  include/media/media-device.h   |  28 
>  sound/usb/media.c  |   3 +-
>  4 files changed, 118 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> index c32fa15cc76e..4a97d92a7e7d 100644
> --- a/drivers/media/media-device.c
> +++ b/drivers/media/media-device.c
> @@ -707,11 +707,16 @@ void media_device_init(struct media_device *mdev)
>  }
>  EXPORT_SYMBOL_GPL(media_device_init);
>  
> -void media_device_cleanup(struct media_device *mdev)
> +static void __media_device_cleanup(struct media_device *mdev)
>  {
>   ida_destroy(&mdev->entity_internal_idx);
>   mdev->entity_internal_idx_max = 0;
>   media_entity_graph_walk_cleanup(&mdev->pm_count_walk);
> +}
> +
> +void media_device_cleanup(struct media_device *mdev)
> +{
> + __media_device_cleanup(mdev);
>   mutex_destroy(&mdev->graph_mutex);
>  }
>  EXPORT_SYMBOL_GPL(media_device_cleanup);
> @@ -721,6 +726,9 @@ int __must_check __media_device_register(struct 
> media_device *mdev,
>  {
>   int ret;
>  
> + /* Check if mdev was ever registered at all */
> + mutex_lock(&mdev->graph_mutex);
> +
>   /* Register the device node. */
>   mdev->devnode.fops = &media_device_fops;
>   mdev->devnode.parent = mdev->dev;
> @@ -731,17 +739,19 @@ int __must_check __media_device_register(struct 
> media_device *mdev,
>  
>   ret = media_devnode_register(&mdev->devnode, owner);
>   if (ret < 0)
> - return ret;
> + goto err;
>  
>   ret = device_create_file(&mdev->devnode.dev, &dev_attr_model);
>   if (ret < 0) {
>   media_devnode_unregister(&mdev->devnode);
> - return ret;
> + goto err;
>   }
>  
>   dev_dbg(mdev->dev, "Media device registered\n");
>  
> - return 0;
> +err:
> + mutex_unlock(&mdev->graph_mutex);
> + return ret;
>  }
>  EXPORT_SYMBOL_GPL(__media_device_register);
>  
> @@ -773,24 +783,13 @@ void media_device_unregister_entity_notify(struct 
> media_device *mdev,
>  }
>  EXPORT_SYMBOL_GPL(media_device_unregister_entity_notify);
>  
> -void media_device_unregister(struct media_device *mdev)
> +static void __media_device_unregister(struct media_device *mdev)
>  {
>   struct media_entity *entity;
>   struct media_entity *next;
>   struct media_interface *intf, *tmp_intf;
>   struct media_entity_notify *notify, *nextp;
>  
> - if (mdev == NULL)
> - return;
> -
> - mutex_lock(&mdev->graph_mutex);
> -
> - /* Check if mdev was ever registered at all */
> - if (!media_devnode_is_registered(&mdev->devnode)) {
> - mutex_unlock(&mdev->graph_mutex);
> - return;
> - }
> -
>   /* Remove all entities from the media device */
>   list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list)
>   __media_device_unregister_entity(entity);
> @@ -807,38 +806,98 @@ void media_device_unregister(struct media_device *mdev)
>   kfree(intf);
>   }
>  
> - mutex_unlock(&mdev->graph_mutex);
> -
> - device_remove_file(&mdev->devnode.dev, &dev_attr_model);
> - media_devnode_unregister(&mdev->devnode);
> + /* Check if mdev devnode was registered */
> + if (media_devnode_is_registered(&mdev->devnode)) {
> + device_remove_file(&mdev->devnode.dev, &dev_attr_model);
> + media_devnode_unregister(&mdev->devnode);
> + }
>  
>   dev_dbg(mdev->dev, "Media device unregistered\n");
>  }
> +
> +void media_device_unregister(struct media_device *mdev)
> +{
> + if (mdev == NULL)
> + return;
> +
> + mutex_lock(&mdev->graph_mutex);
> + __media_device_unregister(mdev);
> + mutex_unlock(&mdev->graph_mutex);
> +}
>  EXPORT_SYMBOL_GPL(media_device_unregister);
>  
>  static void media_device_release_devres(struct device *dev, void *res)
>  {
>  }
>  
> -struct media_device *media_device_get_devres(struct device *dev)
> +static void do_media_device_unregister_devres(struct kref *kref)
>  {
> + struct media_device_devres *mdev_devres;
>   

[PATCH] sound/usb: fix to release stream resources from media_snd_device_delete()

2016-03-18 Thread Shuah Khan
Fix to release stream resources from media_snd_device_delete() before
media device is unregistered. Without this change, stream resource free
is attempted after the media device is unregistered which would result
in use-after-free errors.

Signed-off-by: Shuah Khan 
---

- Ran bind/unbind loop (1000 iteration) test on snd-usb-audio
  while running mc_nextgen_test loop (1000 iterations) in parallel.
- Ran bind/unbind and rmmod/modprobe tests on both drivers. Also
  generated graphs when after bind/unbind, rmmod/modprobe. Graphs
  look good.
- Note: Please apply the following patch to fix memory leak:
  sound/usb: Fix memory leak in media_snd_stream_delete() during unbind
  https://lkml.org/lkml/2016/3/16/1050

 sound/usb/media.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/sound/usb/media.c b/sound/usb/media.c
index de4a815..e35af88 100644
--- a/sound/usb/media.c
+++ b/sound/usb/media.c
@@ -301,6 +301,13 @@ int media_snd_device_create(struct snd_usb_audio *chip,
 void media_snd_device_delete(struct snd_usb_audio *chip)
 {
struct media_device *mdev = chip->media_dev;
+   struct snd_usb_stream *stream;
+
+   /* release resources */
+   list_for_each_entry(stream, &chip->pcm_list, list) {
+   media_snd_stream_delete(&stream->substream[0]);
+   media_snd_stream_delete(&stream->substream[1]);
+   }
 
media_snd_mixer_delete(chip);
 
-- 
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