cron job: media_tree daily build: WARNINGS

2015-03-02 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:   Tue Mar  3 04:00:17 CET 2015
git branch: test
git hash:   b44b2e06ae463327334235bf160e804632b9b37c
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-41-g6c2d743
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:3.18.0-5.slh.1-amd64

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: 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: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: 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: WARNINGS
linux-3.9.2-i686: WARNINGS
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-rc1-i686: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: 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: WARNINGS
linux-3.9.2-x86_64: WARNINGS
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-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

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


[PATCH v2] drivers: media: i2c : s5c73m3: Fix null dereference

2015-03-02 Thread Tapasweni Pathak
Replace dev_err statement which dereferences a null with pr_err_once.

Move if(!spi_dev) above if(dir...) block.

Found using Coccinelle.

Signed-off-by: Tapasweni Pathak 
---
Changes since v1:
Replace pr_err with pr_err_once.
Move if(!spi_dev).
Reword commit message.
Reword subject.

 drivers/media/i2c/s5c73m3/s5c73m3-spi.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-spi.c 
b/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
index f60b265..376b78f 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-spi.c
@@ -46,16 +46,16 @@ static int spi_xmit(struct spi_device *spi_dev, void *addr, 
const int len,
.len= len,
};

+   if(!spi_dev) {
+   pr_err_once("SPI device is unintialized\n");
+   return -ENODEV;
+   }
+
if (dir == SPI_DIR_TX)
xfer.tx_buf = addr;
else
xfer.rx_buf = addr;

-   if (spi_dev == NULL) {
-   dev_err(&spi_dev->dev, "SPI device is uninitialized\n");
-   return -ENODEV;
-   }
-
spi_message_init(&msg);
spi_message_add_tail(&xfer, &msg);

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


Re: Compro S900 DVB-S2 USB

2015-03-02 Thread Nicolas Antonio Corrarello
A bit more info after attempting to initialise it through KVM

Bus 001 Device 007: ID 185b:5900 Compro
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x185b Compro
  idProduct  0x5900
  bcdDevice0.00
  iManufacturer   1 TBS-Tech
  iProduct2 DVBS2BOX
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   32
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower0mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0002  1x 2 bytes
bInterval   0
Device Qualifier (for other device speed):
  bLength10
  bDescriptorType 6
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  bNumConfigurations  1
Device Status: 0x
  (Bus Powered)

2015-03-02 19:23 GMT-03:00 Nicolas Antonio Corrarello :
> Hello Everyone,
> Has anyone stumbled upon this device?. In the wiki, it's documented as
> a clone of the Tevii s660 in the wiki
> (http://www.linuxtv.org/wiki/index.php/TeVii_S660). Still it has a
> different USB product/vendor:
>
> [root@chromebox1 media_build]# lsusb -v -s 1:4
>
> Bus 001 Device 004: ID 185b:5900 Compro
> Device Descriptor:
>   bLength18
>   bDescriptorType 1
>   bcdUSB   2.00
>   bDeviceClass  255 Vendor Specific Class
>   bDeviceSubClass   255 Vendor Specific Subclass
>   bDeviceProtocol   255 Vendor Specific Protocol
>   bMaxPacketSize064
>   idVendor   0x185b Compro
>   idProduct  0x5900
>   bcdDevice0.01
>   iManufacturer   0
>   iProduct0
>   iSerial 0
>   bNumConfigurations  1
>   Configuration Descriptor:
> bLength 9
> bDescriptorType 2
> wTotalLength  171
> bNumInterfaces  1
> bConfigurationValue 1
> iConfiguration  0
> bmAttributes 0x80
>   (Bus Powered)
> MaxPower  100mA
> Interface Descriptor:
>   bLength 9
>   bDescriptorType 4
>   bInterfaceNumber0
>   bAlternateSetting   0
>   bNumEndpoints   0
>   bInterfaceClass   255 Vendor Specific Class
>   bInterfaceSubClass255 Vendor Specific Subclass
>   bInterfaceProtocol255 Vendor Specific Protocol
>   iInterface  0
> Interface Descriptor:
>   bLength 9
>   bDescriptorType 4
>   bInterfaceNumber0
>   bAlternateSetting   1
>   bNumEndpoints   6
>   bInterfaceClass   255 Vendor Specific Class
>   bInterfaceSubClass255 Vendor Specific Subclass
>   bInterfaceProtocol255 Vendor Specific Protocol
>   iInterface  0
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x01  EP 1 OUT
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x0200  1x 512 bytes
> bInterval   0
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81  EP 1 IN
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type

Re: PCTV 800i

2015-03-02 Thread Mack Stanley
On 01/27/2015 05:48 AM, Steven Toth wrote:
>> John replied off list:
>>
>> "http://linux-media.vger.kernel.narkive.com/kAviSkda/chipset-change-for-cx88-board-pinnacle-pctv-hd-800i
>>
>> Wonder if any code was ever integrated?"
>>
>> It looks like basics of a patch was developed to support the card but
>> it was incompatible with the existing cards and nobody took the time
>> to understand how to differentiate between the older 800i and the
>> newer 800i. So, the problem fell on the floor.
>>
>> I'll look through my card library. If I have an old _AND_ new rev then
>> I'll find an hour and see if I can find an acceptable solution.
>>
>> Summary: PCTV released a new 800i (quite a while ago) changing the
>> demodulator, which is why the existing driver doesn't work.
> 
> I have a pair of 800i's with the S5H1409 demodulator, probably from
> when I did the original 800i support (2008):
> http://marc.info/?l=linux-dvb&m=120032380226094&w=2
> 
> I don't have a 800i with a s5h1411, so I can't really help without it.
> 
Dear John and Steven,

Back in 2012 I twice submitted a patch that got my pctv 800i with an s5h1411 
working.  Both times 
either my email or something along the way wrapped lines and spoiled the patch 
for testing.  I've 
patched several kernels since then, but not any very recently.  I just checked 
and that machine is running
Fedora 3.14.4-200.fc20.x86_64.  

I've attached what I believe is the patch I made then.  Since then, I've just 
edited the v4l source 
whenever and built a modified module whenever I upgraded.  I put instructions 
on fedora forum back
then: http://forums.fedoraforum.org/showthread.php?t=281161

I hope this helps.

Best, Mack Stanley

From 5d4733b79360d414eea38085abc397cd3b8131e7 Mon Sep 17 00:00:00 2001
From: Mack Stanley 
Date: Thu, 28 Jun 2012 13:50:33 -0700
Subject: [PATCH 1/1] Add support for newer PCTC HD TV 800i cards with
 S5H1411 demodulators
Cc: Linux Media Mailing List 

Testing needed on older (Pinnacle) PCTV 800i cards with S5H1409 demodulators
to check that current support for them isn't broken by this patch.

Signed-off-by: Mack Stanley 
---
 drivers/media/video/cx88/cx88-dvb.c |   40 --
 1 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 003937c..6d49672 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -501,7 +501,7 @@ static const struct cx24123_config kworld_dvbs_100_config = {
 	.lnb_polarity  = 1,
 };
 
-static const struct s5h1409_config pinnacle_pctv_hd_800i_config = {
+static const struct s5h1409_config pinnacle_pctv_hd_800i_s5h1409_config = {
 	.demod_address = 0x32 >> 1,
 	.output_mode   = S5H1409_PARALLEL_OUTPUT,
 	.gpio	   = S5H1409_GPIO_ON,
@@ -509,7 +509,7 @@ static const struct s5h1409_config pinnacle_pctv_hd_800i_config = {
 	.inversion = S5H1409_INVERSION_OFF,
 	.status_mode   = S5H1409_DEMODLOCKING,
 	.mpeg_timing   = S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,
-};
+}; 
 
 static const struct s5h1409_config dvico_hdtv5_pci_nano_config = {
 	.demod_address = 0x32 >> 1,
@@ -556,6 +556,16 @@ static const struct s5h1411_config dvico_fusionhdtv7_config = {
 	.status_mode   = S5H1411_DEMODLOCKING
 };
 
+static const struct s5h1411_config pinnacle_pctv_hd_800i_s5h1411_config = {
+  	.output_mode   = S5H1411_PARALLEL_OUTPUT,
+  	.gpio  = S5H1411_GPIO_ON,
+  	.mpeg_timing   = S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK,
+  	.qam_if= S5H1411_IF_44000,
+  	.vsb_if= S5H1411_IF_44000,
+  	.inversion = S5H1411_INVERSION_OFF,
+  	.status_mode   = S5H1411_DEMODLOCKING
+};
+
 static const struct xc5000_config dvico_fusionhdtv7_tuner_config = {
 	.i2c_address= 0xc2 >> 1,
 	.if_khz = 5380,
@@ -1297,16 +1307,22 @@ static int dvb_register(struct cx8802_dev *dev)
 		}
 		break;
 	case CX88_BOARD_PINNACLE_PCTV_HD_800i:
-		fe0->dvb.frontend = dvb_attach(s5h1409_attach,
-	   &pinnacle_pctv_hd_800i_config,
-	   &core->i2c_adap);
-		if (fe0->dvb.frontend != NULL) {
-			if (!dvb_attach(xc5000_attach, fe0->dvb.frontend,
-	&core->i2c_adap,
-	&pinnacle_pctv_hd_800i_tuner_config))
-goto frontend_detach;
-		}
-		break;
+	  	/* Try s5h1409 chip first */
+	  	fe0->dvb.frontend = dvb_attach(s5h1409_attach,  
+	&pinnacle_pctv_hd_800i_s5h1409_config,
+   	&core->i2c_adap);
+	  	/* Otherwise, try s5h1411 */
+	  	if (fe0->dvb.frontend == NULL) 
+			fe0->dvb.frontend = dvb_attach(s5h1411_attach,
+	&pinnacle_pctv_hd_800i_s5h1411_config,
+	&core->i2c_adap);
+	  	if (fe0->dvb.frontend != NULL) {
+			if (!dvb_attach(xc5000_attach, fe0->dvb.frontend,
+	&core->i2c_adap,
+					&pinnacle_pctv_hd_800i_tuner_config))
+	  			goto frontend_detach;
+	  	}
+	  	break;
 	case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
 		fe0->dvb.frontend = dvb_attach(s5h1409_attach,
 		&dvico_hdtv5_pci_nano_config,
-- 

[linuxtv-media:master 371/397] drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:704:26: error: 'struct dvb_usb_device' has no member named 'media_dev'

2015-03-02 Thread kbuild test robot
tree:   git://linuxtv.org/media_tree.git master
head:   b44b2e06ae463327334235bf160e804632b9b37c
commit: 6f6c77d8d2e2fc77395d6bb9ed670161f18b6bd4 [371/397] [media] dvb-usb-v2: 
add support for the media controller at USB driver
config: x86_64-rhel (attached as .config)
reproduce:
  git checkout 6f6c77d8d2e2fc77395d6bb9ed670161f18b6bd4
  # save the attached .config to linux build tree
  make ARCH=x86_64 

Note: the linuxtv-media/master HEAD b44b2e06ae463327334235bf160e804632b9b37c 
builds fine.
  It only hurts bisectibility.

All error/warnings:

   drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
'dvb_usbv2_adapter_frontend_init':
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:704:26: error: 'struct 
>> dvb_usb_device' has no member named 'media_dev'
 dvb_create_media_graph(d->media_dev);
 ^
   drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: At top level:
   drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: 
'dvb_usbv2_media_device_register' defined but not used [-Wunused-function]
static void dvb_usbv2_media_device_register(struct dvb_usb_device *d)
^

vim +704 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c

   698  dev_dbg(&d->udev->dev, "%s: tuner_attach() 
failed=%d\n",
   699  __func__, ret);
   700  goto err_dvb_unregister_frontend;
   701  }
   702  }
   703  
 > 704  dvb_create_media_graph(d->media_dev);
   705  
   706  return 0;
   707  

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.0.0-rc1 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_HAVE_INTEL_TXT=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx 
-fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 
-fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_FHANDLE=y
CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_AUDITSYSCALL=y
CONFIG_AUDIT_WATCH=y
CONFIG_AUDIT_TREE=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
CONFIG_GENERIC_MSI_IRQ=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
# CONFIG_NO_HZ_IDLE is not set
CONFIG_NO_HZ_FULL=y
# CONFIG_NO_HZ_FULL_ALL is not set
# CONFIG_NO_HZ_FULL_SYSIDLE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCES

Re: [PATCH 10/10] ARM: omap2: use clkdev_add_alias()

2015-03-02 Thread Tony Lindgren
* Russell King  [150302 09:10]:
> When creating aliases of existing clkdev clocks, use clkdev_add_alias()
> isntead of open coding the lookup and clk_lookup creation.

Gave this series a quick try but I get these build errors:

arch/arm/mach-omap2/omap_device.c: In function ‘_add_clkdev’:
arch/arm/mach-omap2/omap_device.c:65:58: warning: passing argument 3 of 
‘clk_add_alias’ discards ‘const’ qualifier from pointer target type
  rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL);
  ^
In file included from arch/arm/mach-omap2/omap_device.c:34:0:
include/linux/clkdev.h:44:5: note: expected ‘char *’ but argument is of type 
‘const char *’
 int clk_add_alias(const char *, const char *, char *, struct device *);
 ^
drivers/clk/clkdev.c:298:16: error: expected declaration specifiers or ‘...’ 
before ‘(’ token
 vclkdev_create((struct clk *clk, const char *con_id, const char *dev_fmt,
^
drivers/clk/clkdev.c:322:92: error: storage class specified for parameter 
‘__crc_clkdev_alloc’
 EXPORT_SYMBOL(clkdev_alloc);

^
drivers/clk/clkdev.c:322:1: warning: ‘weak’ attribute ignored [-Wattributes]
 EXPORT_SYMBOL(clkdev_alloc);
 ^
drivers/clk/clkdev.c:322:1: warning: ‘externally_visible’ attribute ignored 
[-Wattributes]
drivers/clk/clkdev.c:322:161: error: storage class specified for parameter 
‘__kcrctab_clkdev_alloc’
 EXPORT_SYMBOL(clkdev_alloc);


 ^
drivers/clk/clkdev.c:322:1: warning: ‘__used__’ attribute ignored [-Wattributes]
 EXPORT_SYMBOL(clkdev_alloc);
 ^
drivers/clk/clkdev.c:322:161: error: section attribute not allowed for 
‘__kcrctab_clkdev_alloc’
 EXPORT_SYMBOL(clkdev_alloc);


 ^
drivers/clk/clkdev.c:322:279: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token
 EXPORT_SYMBOL(clkdev_alloc);

drivers/clk/clkdev.c:274:1: warning: ‘vclkdev_alloc’ defined but not used 
[-Wunused-function]
 vclkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt,

Regards,

Tony
--
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 01/10] media: omap3isp: remove unused clkdev

2015-03-02 Thread Laurent Pinchart
Hi Russell,

On Monday 02 March 2015 23:54:35 Russell King - ARM Linux wrote:
> (Combining replies...)
> 
> On Tue, Mar 03, 2015 at 12:53:37AM +0200, Sakari Ailus wrote:
> > Hi Laurent and Russell,
> > 
> > On Tue, Mar 03, 2015 at 12:33:44AM +0200, Laurent Pinchart wrote:
> > > Sakari, does it conflict with the omap3isp DT support ? If so, how would
> > > you prefer to resolve the conflict ? Russell, would it be fine to merge
> > > this through Mauro's tree ?
> 
> As other changes will depend on this, I'd prefer not to.  The whole
> "make clk_get() return a unique struct clk" wasn't well tested, and
> several places broke - and currently clk_add_alias() is broken as a
> result of that.
> 
> I'm trying to get to the longer term solution, where clkdev internally
> uses a struct clk_hw pointer rather than a struct clk pointer, and I
> want to clean stuff up first.
> 
> If omap3isp needs to keep this code, then so be it - I'll come up with
> a different patch improving its use of clkdev instead.

I'm totally fine with removing clkdev from the omap3isp driver if that's 
easier for you, I'm just concerned about the merge conflict that will result.

-- 
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 01/10] media: omap3isp: remove unused clkdev

2015-03-02 Thread Russell King - ARM Linux
(Combining replies...)

On Tue, Mar 03, 2015 at 12:53:37AM +0200, Sakari Ailus wrote:
> Hi Laurent and Russell,
> 
> On Tue, Mar 03, 2015 at 12:33:44AM +0200, Laurent Pinchart wrote:
> > Sakari, does it conflict with the omap3isp DT support ? If so, how would 
> > you 
> > prefer to resolve the conflict ? Russell, would it be fine to merge this 
> > through Mauro's tree ?

As other changes will depend on this, I'd prefer not to.  The whole
"make clk_get() return a unique struct clk" wasn't well tested, and
several places broke - and currently clk_add_alias() is broken as a
result of that.

I'm trying to get to the longer term solution, where clkdev internally
uses a struct clk_hw pointer rather than a struct clk pointer, and I
want to clean stuff up first.

If omap3isp needs to keep this code, then so be it - I'll come up with
a different patch improving its use of clkdev instead.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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 01/10] media: omap3isp: remove unused clkdev

2015-03-02 Thread Sakari Ailus
Hi Laurent and Russell,

On Tue, Mar 03, 2015 at 12:33:44AM +0200, Laurent Pinchart wrote:
> Hi Russell,
> 
> On Monday 02 March 2015 17:06:06 Russell King wrote:
> > No merged platform supplies xclks via platform data.  As we want to
> > slightly change the clkdev interface, rather than fixing this unused
> > code, remove it instead.
> >
> > Signed-off-by: Russell King 
> 
> There are quite a few out of tree users that I know of that might be 
> impacted. 
> On the other hand, out of tree isn't an excuse, and OMAP3 platforms should 
> move to DT. The good news is that DT support for the omap3isp driver is about 
> to get submitted, and hopefully merged in v4.1. I thus have no objection to 
> this patch.
> 
> Sakari, does it conflict with the omap3isp DT support ? If so, how would you 
> prefer to resolve the conflict ? Russell, would it be fine to merge this 
> through Mauro's tree ?

I first thought it wouldn't conflict, but apparently it does. The
conflicting patches are here:

http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux.git;a=commitdiff;h=a56c38208ee9200e57421b60b770fb8249935b95>
http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux.git;a=commitdiff;h=72374c7a69a12afc76f220ef4de983be4583f164>
http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux.git;a=commitdiff;h=0f0b86d64a555e308079f985812b011866e2c8f0>

Tne entire set:

http://vihersipuli.retiisi.org.uk/cgi-bin/gitweb.cgi?p=~sailus/linux.git;a=shortlog;h=refs/heads/rm696-051-upstream>

I haven't sent that to linux-media yet but I'll do that during the coming
couple of days.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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 01/10] media: omap3isp: remove unused clkdev

2015-03-02 Thread Laurent Pinchart
Hi Russell,

On Monday 02 March 2015 17:06:06 Russell King wrote:
> No merged platform supplies xclks via platform data.  As we want to
> slightly change the clkdev interface, rather than fixing this unused
> code, remove it instead.
>
> Signed-off-by: Russell King 

There are quite a few out of tree users that I know of that might be impacted. 
On the other hand, out of tree isn't an excuse, and OMAP3 platforms should 
move to DT. The good news is that DT support for the omap3isp driver is about 
to get submitted, and hopefully merged in v4.1. I thus have no objection to 
this patch.

Sakari, does it conflict with the omap3isp DT support ? If so, how would you 
prefer to resolve the conflict ? Russell, would it be fine to merge this 
through Mauro's tree ?

Acked-by: Laurent Pinchart 

> ---
>  drivers/media/platform/omap3isp/isp.c | 18 --
>  drivers/media/platform/omap3isp/isp.h |  1 -
>  include/media/omap3isp.h  |  6 --
>  3 files changed, 25 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index deca80903c3a..4d8078b9d010
> 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -281,7 +281,6 @@ static const struct clk_init_data isp_xclk_init_data = {
> 
>  static int isp_xclk_init(struct isp_device *isp)
>  {
> - struct isp_platform_data *pdata = isp->pdata;
>   struct clk_init_data init;
>   unsigned int i;
> 
> @@ -311,20 +310,6 @@ static int isp_xclk_init(struct isp_device *isp)
>   xclk->clk = clk_register(NULL, &xclk->hw);
>   if (IS_ERR(xclk->clk))
>   return PTR_ERR(xclk->clk);
> -
> - if (pdata->xclks[i].con_id == NULL &&
> - pdata->xclks[i].dev_id == NULL)
> - continue;
> -
> - xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
> - if (xclk->lookup == NULL)
> - return -ENOMEM;
> -
> - xclk->lookup->con_id = pdata->xclks[i].con_id;
> - xclk->lookup->dev_id = pdata->xclks[i].dev_id;
> - xclk->lookup->clk = xclk->clk;
> -
> - clkdev_add(xclk->lookup);
>   }
> 
>   return 0;
> @@ -339,9 +324,6 @@ static void isp_xclk_cleanup(struct isp_device *isp)
> 
>   if (!IS_ERR(xclk->clk))
>   clk_unregister(xclk->clk);
> -
> - if (xclk->lookup)
> - clkdev_drop(xclk->lookup);
>   }
>  }
> 
> diff --git a/drivers/media/platform/omap3isp/isp.h
> b/drivers/media/platform/omap3isp/isp.h index cfdfc8714b6b..d41c98bbdfe7
> 100644
> --- a/drivers/media/platform/omap3isp/isp.h
> +++ b/drivers/media/platform/omap3isp/isp.h
> @@ -122,7 +122,6 @@ enum isp_xclk_id {
>  struct isp_xclk {
>   struct isp_device *isp;
>   struct clk_hw hw;
> - struct clk_lookup *lookup;
>   struct clk *clk;
>   enum isp_xclk_id id;
> 
> diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
> index 398279dd1922..a9798525d01e 100644
> --- a/include/media/omap3isp.h
> +++ b/include/media/omap3isp.h
> @@ -152,13 +152,7 @@ struct isp_v4l2_subdevs_group {
>   } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
>  };
> 
> -struct isp_platform_xclk {
> - const char *dev_id;
> - const char *con_id;
> -};
> -
>  struct isp_platform_data {
> - struct isp_platform_xclk xclks[2];
>   struct isp_v4l2_subdevs_group *subdevs;
>   void (*set_constraints)(struct isp_device *isp, bool enable);
>  };

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


Compro S900 DVB-S2 USB

2015-03-02 Thread Nicolas Antonio Corrarello
Hello Everyone,
Has anyone stumbled upon this device?. In the wiki, it's documented as
a clone of the Tevii s660 in the wiki
(http://www.linuxtv.org/wiki/index.php/TeVii_S660). Still it has a
different USB product/vendor:

[root@chromebox1 media_build]# lsusb -v -s 1:4

Bus 001 Device 004: ID 185b:5900 Compro
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  255 Vendor Specific Class
  bDeviceSubClass   255 Vendor Specific Subclass
  bDeviceProtocol   255 Vendor Specific Protocol
  bMaxPacketSize064
  idVendor   0x185b Compro
  idProduct  0x5900
  bcdDevice0.01
  iManufacturer   0
  iProduct0
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength  171
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   0
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass255 Vendor Specific Subclass
  bInterfaceProtocol255 Vendor Specific Protocol
  iInterface  0
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   1
  bNumEndpoints   6
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass255 Vendor Specific Subclass
  bInterfaceProtocol255 Vendor Specific Protocol
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02  EP 2 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04  EP 4 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86  EP 6 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x88  EP 8 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   2
  bNumEndpoints   6
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass255 Vendor Specific Subclass
  bInterfaceProtocol255 Vendor Specific Protocol
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 

Re: [PATCH 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Stephen Boyd
On 03/02/15 13:01, Russell King - ARM Linux wrote:
> On Mon, Mar 02, 2015 at 11:07:58AM -0800, Stephen Boyd wrote:
>> On 03/02/15 09:06, Russell King wrote:
>>> Add a helper to allocate and add a clk_lookup structure.  This can not
>>> only be used in several places in clkdev.c to simplify the code, but
>>> more importantly, can be used by callers of the clkdev code to simplify
>>> their clkdev creation and registration.
>>>
>>> Signed-off-by: Russell King 
>>> ---
>>>  drivers/clk/clkdev.c   | 52 
>>> ++
>>>  include/linux/clkdev.h |  3 +++
>>>  2 files changed, 43 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
>>> index 043fd3633373..611b9acbad78 100644
>>> --- a/drivers/clk/clkdev.c
>>> +++ b/drivers/clk/clkdev.c
>>> @@ -294,6 +294,19 @@ vclkdev_alloc(struct clk *clk, const char *con_id, 
>>> const char *dev_fmt,
>>> return &cla->cl;
>>>  }
>>>  
>>> +static struct clk_lookup *
>>> +vclkdev_create((struct clk *clk, const char *con_id, const char *dev_fmt,
>>> +   va_list ap)
>>> +{
>>> +   struct clk_lookup *cl;
>>> +
>>> +   cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
>>> +   if (cl)
>>> +   clkdev_add(cl);
>>> +
>>> +   return cl;
>>> +}
>>> +
>>>  struct clk_lookup * __init_refok
>>>  clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
>>>  {
>>> @@ -308,6 +321,28 @@ clkdev_alloc(struct clk *clk, const char *con_id, 
>>> const char *dev_fmt, ...)
>>>  }
>>>  EXPORT_SYMBOL(clkdev_alloc);
>>>  
>>> +/**
>>> + * clkdev_create - allocate and add a clkdev lookup structure
>>> + * @clk: struct clk to associate with all clk_lookups
>>> + * @con_id: connection ID string on device
>>> + * @dev_fmt: format string describing device name
>>> + *
>>> + * Returns a clk_lookup structure, which can be later unregistered and
>>> + * freed.
>> And returns NULL on failure? Any reason why we don't return an error
>> pointer on failure?
> Why should it when it's only error is "no memory" ?  It follows the
> clkdev_alloc() and memory allocator pattern.
>
> It'd also make the error handling in places like clk_add_alias() more
> difficult (how that happened, I don't know...) though that could probably
> be fixed as no one seems to bother checking the return value... maybe
> that's a reason to make it return void ;)
>

Ok, fair enough. Right now clk_add_alias() leaks if a driver decides to
add an alias and then fail probe for something like probe deferral. We
should probably make that return the clk_lookup structure too so that
drivers can clean up.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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 00/10] initial clkdev cleanups

2015-03-02 Thread Stephen Boyd
On 03/02/15 09:05, Russell King - ARM Linux wrote:
> Here's some initial clkdev cleanups.  These are targetted for the next
> merge window, and while the initial patches can be merged independently,
> I'd prefer to keep the series together as further work on solving the
> problems which unique struct clk's has introduced is needed.
>
> The initial cleanups are more about using the correct clkdev function
> than anything else: there's no point interating over a array of
> clk_lookup structs, adding each one in turn when we have had a function
> which does this since forever.

The clkdev_add_table() conversions look good.

>
> I'm also killing a chunk of seemingly unused code in the omap3isp driver.
>
> Lastly, I'm introducing a clkdev_create() helper, which combines the
> clkdev_alloc() + clkdev_add() pattern which keeps cropping up.
>

We already have a solution to that problem with clk_register_clkdev().
Andy has done some work to make clk_register_clkdev() return a struct
clk_lookup pointer[1]. Maybe we can do that instead of introducing a new
clkdev_create() function. There is some benefit to having a new function
though so that we can avoid a flag day, although it looks like the flag
day is small in this case so it might not actually matter.

[1] https://www.marc.info/?l=linux-kernel&m=142469226512289

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Russell King - ARM Linux
On Mon, Mar 02, 2015 at 11:07:58AM -0800, Stephen Boyd wrote:
> On 03/02/15 09:06, Russell King wrote:
> > Add a helper to allocate and add a clk_lookup structure.  This can not
> > only be used in several places in clkdev.c to simplify the code, but
> > more importantly, can be used by callers of the clkdev code to simplify
> > their clkdev creation and registration.
> >
> > Signed-off-by: Russell King 
> > ---
> >  drivers/clk/clkdev.c   | 52 
> > ++
> >  include/linux/clkdev.h |  3 +++
> >  2 files changed, 43 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> > index 043fd3633373..611b9acbad78 100644
> > --- a/drivers/clk/clkdev.c
> > +++ b/drivers/clk/clkdev.c
> > @@ -294,6 +294,19 @@ vclkdev_alloc(struct clk *clk, const char *con_id, 
> > const char *dev_fmt,
> > return &cla->cl;
> >  }
> >  
> > +static struct clk_lookup *
> > +vclkdev_create((struct clk *clk, const char *con_id, const char *dev_fmt,
> > +   va_list ap)
> > +{
> > +   struct clk_lookup *cl;
> > +
> > +   cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
> > +   if (cl)
> > +   clkdev_add(cl);
> > +
> > +   return cl;
> > +}
> > +
> >  struct clk_lookup * __init_refok
> >  clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
> >  {
> > @@ -308,6 +321,28 @@ clkdev_alloc(struct clk *clk, const char *con_id, 
> > const char *dev_fmt, ...)
> >  }
> >  EXPORT_SYMBOL(clkdev_alloc);
> >  
> > +/**
> > + * clkdev_create - allocate and add a clkdev lookup structure
> > + * @clk: struct clk to associate with all clk_lookups
> > + * @con_id: connection ID string on device
> > + * @dev_fmt: format string describing device name
> > + *
> > + * Returns a clk_lookup structure, which can be later unregistered and
> > + * freed.
> 
> And returns NULL on failure? Any reason why we don't return an error
> pointer on failure?

Why should it when it's only error is "no memory" ?  It follows the
clkdev_alloc() and memory allocator pattern.

It'd also make the error handling in places like clk_add_alias() more
difficult (how that happened, I don't know...) though that could probably
be fixed as no one seems to bother checking the return value... maybe
that's a reason to make it return void ;)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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 2/2] V4L: add CCF support to the v4l2_clk API

2015-03-02 Thread laurent . pinchart
Hi Mauro,

On Mon Mar 02 2015 18:55:23 GMT+0200 (EET), Mauro Carvalho Chehab wrote:
> Em Sun, 1 Feb 2015 12:12:33 +0100 (CET)
> Guennadi Liakhovetski  escreveu:
> 
> > V4L2 clocks, e.g. used by camera sensors for their master clock, do not
> > have to be supplied by a different V4L2 driver, they can also be
> > supplied by an independent source. In this case the standart kernel
> > clock API should be used to handle such clocks. This patch adds support
> > for such cases.
> > 
> > Signed-off-by: Guennadi Liakhovetski 
> > Acked-by: Laurent Pinchart 
> > ---
> > 
> > v4: sizeof(*clk) :)
> > 
> >  drivers/media/v4l2-core/v4l2-clk.c | 48 
> > +++---
> >  include/media/v4l2-clk.h   |  2 ++
> >  2 files changed, 47 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/media/v4l2-core/v4l2-clk.c 
> > b/drivers/media/v4l2-core/v4l2-clk.c
> > index 3ff0b00..9f8cb20 100644
> > --- a/drivers/media/v4l2-core/v4l2-clk.c
> > +++ b/drivers/media/v4l2-core/v4l2-clk.c
> > @@ -9,6 +9,7 @@
> >   */
> >  
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -37,6 +38,21 @@ static struct v4l2_clk *v4l2_clk_find(const char *dev_id)
> >  struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id)
> >  {
> > struct v4l2_clk *clk;
> > +   struct clk *ccf_clk = clk_get(dev, id);
> > +
> > +   if (PTR_ERR(ccf_clk) == -EPROBE_DEFER)
> > +   return ERR_PTR(-EPROBE_DEFER);
> 
> Why not do just:
>   return ccf_clk;

I find the explicit error slightly more readable, but that's a matter of taste.
 
> > +
> > +   if (!IS_ERR_OR_NULL(ccf_clk)) {
> > +   clk = kzalloc(sizeof(*clk), GFP_KERNEL);
> > +   if (!clk) {
> > +   clk_put(ccf_clk);
> > +   return ERR_PTR(-ENOMEM);
> > +   }
> > +   clk->clk = ccf_clk;
> > +
> > +   return clk;
> > +   }
> 
> The error condition here looks a little weird to me. I mean, if the
> CCF clock returns an error, shouldn't it fail instead of silently
> run some logic to find another clock source? Isn't it risky on getting
> a wrong value?

The idea is that, in the long term, everything should use CCF directly. 
However, we have clock providers on platforms where CCF isn't avalaible. V4L2 
clock has been introduced  as a  single API usable by V4L2 clock users allowing 
them to retrieve and use clocks regardless of whether the provider uses CCF or 
not. Internally it first tries CCF, and then falls back to the non-CCF 
implementation in case of failure. 
 
> If the above code is right, please add a comment there explaining
> why it is safe to discard the CCF clock error.
> 
> >  
> > mutex_lock(&clk_lock);
> > clk = v4l2_clk_find(dev_name(dev));
> > @@ -56,6 +72,12 @@ void v4l2_clk_put(struct v4l2_clk *clk)
> > if (IS_ERR(clk))
> > return;
> >  
> > +   if (clk->clk) {
> > +   clk_put(clk->clk);
> > +   kfree(clk);
> > +   return;
> > +   }
> > +
> > mutex_lock(&clk_lock);
> >  
> > list_for_each_entry(tmp, &clk_list, list)
> > @@ -93,8 +115,12 @@ static void v4l2_clk_unlock_driver(struct v4l2_clk *clk)
> >  
> >  int v4l2_clk_enable(struct v4l2_clk *clk)
> >  {
> > -   int ret = v4l2_clk_lock_driver(clk);
> > +   int ret;
> >  
> > +   if (clk->clk)
> > +   return clk_prepare_enable(clk->clk);
> > +
> > +   ret = v4l2_clk_lock_driver(clk);
> > if (ret < 0)
> > return ret;
> >  
> > @@ -120,6 +146,9 @@ void v4l2_clk_disable(struct v4l2_clk *clk)
> >  {
> > int enable;
> >  
> > +   if (clk->clk)
> > +   return clk_disable_unprepare(clk->clk);
> > +
> > mutex_lock(&clk->lock);
> >  
> > enable = --clk->enable;
> > @@ -137,8 +166,12 @@ EXPORT_SYMBOL(v4l2_clk_disable);
> >  
> >  unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk)
> >  {
> > -   int ret = v4l2_clk_lock_driver(clk);
> > +   int ret;
> > +
> > +   if (clk->clk)
> > +   return clk_get_rate(clk->clk);
> >  
> > +   ret = v4l2_clk_lock_driver(clk);
> > if (ret < 0)
> > return ret;
> >  
> > @@ -157,7 +190,16 @@ EXPORT_SYMBOL(v4l2_clk_get_rate);
> >  
> >  int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate)
> >  {
> > -   int ret = v4l2_clk_lock_driver(clk);
> > +   int ret;
> > +
> > +   if (clk->clk) {
> > +   long r = clk_round_rate(clk->clk, rate);
> > +   if (r < 0)
> > +   return r;
> > +   return clk_set_rate(clk->clk, r);
> > +   }
> > +
> > +   ret = v4l2_clk_lock_driver(clk);
> >  
> > if (ret < 0)
> > return ret;
> > diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h
> > index 928045f..3ef6e3d 100644
> > --- a/include/media/v4l2-clk.h
> > +++ b/include/media/v4l2-clk.h
> > @@ -22,6 +22,7 @@
> >  struct module;
> >  struct device;
> >  
> > +struct clk;
> >  struct v4l2_clk {
> > struct list_head list;
> > const struct v4l2_clk_ops *ops;
> > @@ -29,6 +30,7 

Re: [PATCH 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Geert Uytterhoeven
On Mon, Mar 2, 2015 at 6:46 PM, Russell King - ARM Linux
 wrote:
> On Mon, Mar 02, 2015 at 06:22:31PM +0100, Geert Uytterhoeven wrote:
>> On Mon, Mar 2, 2015 at 6:06 PM, Russell King
>>  wrote:
>> > --- a/include/linux/clkdev.h
>> > +++ b/include/linux/clkdev.h
>> > @@ -37,6 +37,9 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const 
>> > char *con_id,
>> >  void clkdev_add(struct clk_lookup *cl);
>> >  void clkdev_drop(struct clk_lookup *cl);
>> >
>> > +struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
>> > +   const char *dev_fmt, ...);
>>
>> __printf(3, 4)
>>
>> While you're at it, can you please also add the __printf attribute to
>> clkdev_alloc() and clk_register_clkdev()?
>
> What's the behaviour of __printf() with a NULL format string?  The
> clkdev interfaces permit that, normal printf() doesn't.

As expected: no warning.
Verified with gcc 4.1.2 and 4.8.2.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Stephen Boyd
On 03/02/15 09:06, Russell King wrote:
> Add a helper to allocate and add a clk_lookup structure.  This can not
> only be used in several places in clkdev.c to simplify the code, but
> more importantly, can be used by callers of the clkdev code to simplify
> their clkdev creation and registration.
>
> Signed-off-by: Russell King 
> ---
>  drivers/clk/clkdev.c   | 52 
> ++
>  include/linux/clkdev.h |  3 +++
>  2 files changed, 43 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 043fd3633373..611b9acbad78 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -294,6 +294,19 @@ vclkdev_alloc(struct clk *clk, const char *con_id, const 
> char *dev_fmt,
>   return &cla->cl;
>  }
>  
> +static struct clk_lookup *
> +vclkdev_create((struct clk *clk, const char *con_id, const char *dev_fmt,
> + va_list ap)
> +{
> + struct clk_lookup *cl;
> +
> + cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
> + if (cl)
> + clkdev_add(cl);
> +
> + return cl;
> +}
> +
>  struct clk_lookup * __init_refok
>  clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
>  {
> @@ -308,6 +321,28 @@ clkdev_alloc(struct clk *clk, const char *con_id, const 
> char *dev_fmt, ...)
>  }
>  EXPORT_SYMBOL(clkdev_alloc);
>  
> +/**
> + * clkdev_create - allocate and add a clkdev lookup structure
> + * @clk: struct clk to associate with all clk_lookups
> + * @con_id: connection ID string on device
> + * @dev_fmt: format string describing device name
> + *
> + * Returns a clk_lookup structure, which can be later unregistered and
> + * freed.

And returns NULL on failure? Any reason why we don't return an error
pointer on failure?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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] use a function for DVB media controller register

2015-03-02 Thread Tycho Lürsen

Hi Mauro,
I tested this an I've got no issues to report.

If I was in the position to do so, I'd ack these patches.

Regards,
Tycho


Op 02-03-15 om 18:37 schreef Tycho Lürsen:

Hi Mauro,
Op 02-03-15 om 18:06 schreef Mauro Carvalho Chehab:

Em Mon, 02 Mar 2015 17:54:53 +0100
Tycho Lürsen  escreveu:


Hi Mauro,
Op 02-03-15 om 15:31 schreef Mauro Carvalho Chehab:

This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c

index c739725ca7ee..367b8e77feb8 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1104,9 +1104,7 @@ static int smsdvb_hotplug(struct 
smscore_device_t *coredev,

   pr_err("dvb_register_adapter() failed %d\n", rc);
   goto adapter_error;
   }
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-client->adapter.mdev = coredev->media_dev;
-#endif
+dvb_register_media_controller(&client->adapter, 
coredev->media_dev);

  /* init dvb demux */
   client->demux.dmx.capabilities = DMX_TS_FILTERING;
diff --git a/drivers/media/dvb-core/dvbdev.h 
b/drivers/media/dvb-core/dvbdev.h

index 556c9e9d1d4e..12629b8ecb0c 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -125,8 +125,15 @@ extern void dvb_unregister_device (struct 
dvb_device *dvbdev);

  #ifdef CONFIG_MEDIA_CONTROLLER_DVB
   void dvb_create_media_graph(struct dvb_adapter *adap);
+static inline void dvb_register_media_controller(struct 
dvb_adapter *adap,

+ struct media_device *mdev)
+{
+adap->mdev = mdev;
+}
+
   #else
   static inline void dvb_create_media_graph(struct dvb_adapter 
*adap) {}

+#define dvb_register_media_controller(a, b) {}
   #endif

Does "#define dvb_register_media_controller(a, b) {}" restrict the
number of registerd controllers in any way?
I mean, I've got a couple of TBS quad adapters, 4 tuner and 4 demod
chips on each card. Will they still work with this change?
No. What the above define does is to replace the function call by 
nothing,

if MEDIA_CONTROLLER_DVB is not set.

Neither it or the current patches for the media controller on DVB should
affect the TBS quad adapters. If you're having some regressions with it,
please report.

Regards,
Mauro
Thanks for your reply, I will test this for regression as soon as it 
hits the master branch.


Regards,
Tycho.



--
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 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Russell King - ARM Linux
On Mon, Mar 02, 2015 at 06:22:31PM +0100, Geert Uytterhoeven wrote:
> On Mon, Mar 2, 2015 at 6:06 PM, Russell King
>  wrote:
> > --- a/include/linux/clkdev.h
> > +++ b/include/linux/clkdev.h
> > @@ -37,6 +37,9 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const 
> > char *con_id,
> >  void clkdev_add(struct clk_lookup *cl);
> >  void clkdev_drop(struct clk_lookup *cl);
> >
> > +struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
> > +   const char *dev_fmt, ...);
> 
> __printf(3, 4)
> 
> While you're at it, can you please also add the __printf attribute to
> clkdev_alloc() and clk_register_clkdev()?

What's the behaviour of __printf() with a NULL format string?  The
clkdev interfaces permit that, normal printf() doesn't.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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] use a function for DVB media controller register

2015-03-02 Thread Tycho Lürsen

Hi Mauro,
Op 02-03-15 om 18:06 schreef Mauro Carvalho Chehab:

Em Mon, 02 Mar 2015 17:54:53 +0100
Tycho Lürsen  escreveu:


Hi Mauro,
Op 02-03-15 om 15:31 schreef Mauro Carvalho Chehab:

This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index c739725ca7ee..367b8e77feb8 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1104,9 +1104,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
*coredev,
pr_err("dvb_register_adapter() failed %d\n", rc);
goto adapter_error;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   client->adapter.mdev = coredev->media_dev;
-#endif
+   dvb_register_media_controller(&client->adapter, coredev->media_dev);
   
   	/* init dvb demux */

client->demux.dmx.capabilities = DMX_TS_FILTERING;
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 556c9e9d1d4e..12629b8ecb0c 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -125,8 +125,15 @@ extern void dvb_unregister_device (struct dvb_device 
*dvbdev);
   
   #ifdef CONFIG_MEDIA_CONTROLLER_DVB

   void dvb_create_media_graph(struct dvb_adapter *adap);
+static inline void dvb_register_media_controller(struct dvb_adapter *adap,
+struct media_device *mdev)
+{
+   adap->mdev = mdev;
+}
+
   #else
   static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
+#define dvb_register_media_controller(a, b) {}
   #endif

Does "#define dvb_register_media_controller(a, b) {}" restrict the
number of registerd controllers in any way?
I mean, I've got a couple of TBS quad adapters, 4 tuner and 4 demod
chips on each card. Will they still work with this change?

No. What the above define does is to replace the function call by nothing,
if MEDIA_CONTROLLER_DVB is not set.

Neither it or the current patches for the media controller on DVB should
affect the TBS quad adapters. If you're having some regressions with it,
please report.

Regards,
Mauro
Thanks for your reply, I will test this for regression as soon as it 
hits the master branch.


Regards,
Tycho.

--
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] siano: avoid a linkedit error if !MC

2015-03-02 Thread Mauro Carvalho Chehab
If the media controller (MC) is not enabled, it will compile
fine, but will fail at the linkedition:

 ERROR: "media_device_unregister" [drivers/media/usb/siano/smsusb.ko] undefined!

Reported-by: kbuild test robot 
Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/usb/siano/smsusb.c b/drivers/media/usb/siano/smsusb.c
index 0b13ad3d3a8c..c945e4c2fbd4 100644
--- a/drivers/media/usb/siano/smsusb.c
+++ b/drivers/media/usb/siano/smsusb.c
@@ -440,7 +440,9 @@ static int smsusb_init_device(struct usb_interface *intf, 
int board_id)
if (rc < 0) {
pr_err("smscore_register_device(...) failed, rc %d\n", rc);
smsusb_term_device(intf);
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
media_device_unregister(mdev);
+#endif
kfree(mdev);
return rc;
}
-- 
2.1.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 06/10] ASOC: migor: use clkdev_create()

2015-03-02 Thread Mark Brown
On Mon, Mar 02, 2015 at 05:06:32PM +, Russell King wrote:
> clkdev_create() is a shorter way to write clkdev_alloc() followed by
> clkdev_add().  Use this instead.

Acked-by: Mark Brown 


signature.asc
Description: Digital signature


Re: [PATCH 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Geert Uytterhoeven
On Mon, Mar 2, 2015 at 6:06 PM, Russell King
 wrote:
> --- a/include/linux/clkdev.h
> +++ b/include/linux/clkdev.h
> @@ -37,6 +37,9 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char 
> *con_id,
>  void clkdev_add(struct clk_lookup *cl);
>  void clkdev_drop(struct clk_lookup *cl);
>
> +struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
> +   const char *dev_fmt, ...);

__printf(3, 4)

While you're at it, can you please also add the __printf attribute to
clkdev_alloc() and clk_register_clkdev()?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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/10] SH: use clkdev_add_table()

2015-03-02 Thread Geert Uytterhoeven
On Mon, Mar 2, 2015 at 6:06 PM, Russell King
 wrote:
> We have always had an efficient way of registering a table of clock
> lookups - it's called clkdev_add_table().  However, some people seem
> to really love writing inefficient and unnecessary code.
>
> Convert SH to use the correct interface.
>
> Signed-off-by: Russell King 

Thanks, looks good.

Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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: [GIT PULL] soc-camera: one delayed patch for 3.20 or 3.21

2015-03-02 Thread Mauro Carvalho Chehab
Em Sun, 15 Feb 2015 22:01:21 +0100 (CET)
Guennadi Liakhovetski  escreveu:

> Hi Mauro,
> 
> This is just a single patch for a single soc-camera host driver. No rush, 
> I presume, you're not planning another 3.20 pull request, in which case it 
> will wait until 3.21. But in case you are planning one and you find it 
> acceptable to also take this one - here goes.

The patch is simple enough and fixes an issue, so I added for 4.0 (3.20).

> I just missed this patch a 
> while ago and wanted to put it up for whatever the next possibility would 
> be. Otherwise I suddenly recalled to clean up patchwork (... :)), so, 
> instead of 120+ patches for me it now only contains 15 :) 

That's good!

> I'll be looking 
> at them as time permits and preparing more for 3.21 and sending some 
> comments to those, that I won't yet find myself sufficiently comfortable 
> about.

Ok.

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


[linuxtv-media:master 375/377] smsusb.c:undefined reference to `media_device_unregister'

2015-03-02 Thread kbuild test robot
Hi Mauro,

It's probably a bug fix that unveils the link errors.

tree:   git://linuxtv.org/media_tree.git master
head:   89a2c1d60aa2cfcf4c9f194b4c923d72182be431
commit: 480884b647c7efecb904a9ed022ee533afb9cb80 [375/377] [media] dvbdev: use 
adapter arg for dvb_create_media_graph()
config: i386-randconfig-nexs0 (attached as .config)
reproduce:
  git checkout 480884b647c7efecb904a9ed022ee533afb9cb80
  # save the attached .config to linux build tree
  make ARCH=i386 

All error/warnings:

   drivers/built-in.o: In function `smsusb_init_device':
>> smsusb.c:(.text+0x1de538): undefined reference to `media_device_unregister'

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
#
# Automatically generated file; DO NOT EDIT.
# Linux/i386 4.0.0-rc1 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf32-i386"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
# CONFIG_ZONE_DMA32 is not set
# CONFIG_AUDIT_ARCH is not set
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_X86_32_SMP=y
CONFIG_X86_HT=y
CONFIG_X86_32_LAZY_GS=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
# CONFIG_KERNEL_GZIP is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
CONFIG_KERNEL_LZO=y
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
# CONFIG_SYSVIPC is not set
# CONFIG_POSIX_MQUEUE is not set
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_FHANDLE=y
CONFIG_USELIB=y
# CONFIG_AUDIT is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ_COMMON=y
# CONFIG_HZ_PERIODIC is not set
CONFIG_NO_HZ_IDLE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
CONFIG_SRCU=y
CONFIG_TASKS_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_FANOUT=32
CONFIG_RCU_FANOUT_LEAF=16
CONFIG_RCU_FANOUT_EXACT=y
# CONFIG_RCU_FAST_NO_HZ is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_RCU_KTHREAD_PRIO=0
# CONFIG_RCU_NOCB_CPU is not set
CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
# CONFIG_IKCONFIG_PROC is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
# CONFIG_MEMCG_SWAP is not set
# CONFIG_MEMCG_KMEM is not set
CONFIG_CGROUP_HUGETLB=y
CONFIG_CGROUP_PERF=y
# CONFIG_CGROUP_SCHED is not set
CONFIG_BLK_CGROUP=y
CONFIG_DEBUG_BLK_CGROUP=y
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
CONFIG_USER_NS=y
# CONFIG_PID_NS is not set
CONFIG_NET_NS=y
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_HAVE_U

[PATCH 03/10] clk: versatile: convert Integrator IM/PD-1 to use clkdev_add_table()

2015-03-02 Thread Russell King
We have always had an efficient way of registering a table of clock
lookups - it's called clkdev_add_table().  However, some people seem
to really love writing inefficient and unnecessary code.

Convert Integrator IM-PD/1 to use the correct interface.

Signed-off-by: Russell King 
---
 drivers/clk/versatile/clk-impd1.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/versatile/clk-impd1.c 
b/drivers/clk/versatile/clk-impd1.c
index 1cc1330dc570..13e912e132d2 100644
--- a/drivers/clk/versatile/clk-impd1.c
+++ b/drivers/clk/versatile/clk-impd1.c
@@ -89,7 +89,6 @@ void integrator_impd1_clk_init(void __iomem *base, unsigned 
int id)
struct impd1_clk *imc;
struct clk *clk;
struct clk *pclk;
-   int i;
 
if (id > 3) {
pr_crit("no more than 4 LMs can be attached\n");
@@ -150,8 +149,7 @@ void integrator_impd1_clk_init(void __iomem *base, unsigned 
int id)
imc->clks[13] = clkdev_alloc(pclk, "apb_pclk", "lm%x:00600", id);
imc->clks[14] = clkdev_alloc(clk, NULL, "lm%x:00600", id);
 
-   for (i = 0; i < ARRAY_SIZE(imc->clks); i++)
-   clkdev_add(imc->clks[i]);
+   clkdev_add_table(imc->clks, ARRAY_SIZE(imc->clks));
 }
 EXPORT_SYMBOL_GPL(integrator_impd1_clk_init);
 
-- 
1.8.3.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: [PATCH] [media] use a function for DVB media controller register

2015-03-02 Thread Mauro Carvalho Chehab
Em Mon, 02 Mar 2015 17:54:53 +0100
Tycho Lürsen  escreveu:

> Hi Mauro,
> Op 02-03-15 om 15:31 schreef Mauro Carvalho Chehab:
> > This is really a simple function, but using it avoids to have
> > if's inside the drivers.
> >
> > Also, the kABI becomes a little more clearer.
> >
> > This shouldn't generate any overhead, and the type check
> > will happen when compiling with MC DVB enabled.
> >
> > So, let's do it.
> >
> > Signed-off-by: Mauro Carvalho Chehab 
> >
> > diff --git a/drivers/media/common/siano/smsdvb-main.c 
> > b/drivers/media/common/siano/smsdvb-main.c
> > index c739725ca7ee..367b8e77feb8 100644
> > --- a/drivers/media/common/siano/smsdvb-main.c
> > +++ b/drivers/media/common/siano/smsdvb-main.c
> > @@ -1104,9 +1104,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
> > *coredev,
> > pr_err("dvb_register_adapter() failed %d\n", rc);
> > goto adapter_error;
> > }
> > -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
> > -   client->adapter.mdev = coredev->media_dev;
> > -#endif
> > +   dvb_register_media_controller(&client->adapter, coredev->media_dev);
> >   
> > /* init dvb demux */
> > client->demux.dmx.capabilities = DMX_TS_FILTERING;
> > diff --git a/drivers/media/dvb-core/dvbdev.h 
> > b/drivers/media/dvb-core/dvbdev.h
> > index 556c9e9d1d4e..12629b8ecb0c 100644
> > --- a/drivers/media/dvb-core/dvbdev.h
> > +++ b/drivers/media/dvb-core/dvbdev.h
> > @@ -125,8 +125,15 @@ extern void dvb_unregister_device (struct dvb_device 
> > *dvbdev);
> >   
> >   #ifdef CONFIG_MEDIA_CONTROLLER_DVB
> >   void dvb_create_media_graph(struct dvb_adapter *adap);
> > +static inline void dvb_register_media_controller(struct dvb_adapter *adap,
> > +struct media_device *mdev)
> > +{
> > +   adap->mdev = mdev;
> > +}
> > +
> >   #else
> >   static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
> > +#define dvb_register_media_controller(a, b) {}
> >   #endif
> Does "#define dvb_register_media_controller(a, b) {}" restrict the 
> number of registerd controllers in any way?
> I mean, I've got a couple of TBS quad adapters, 4 tuner and 4 demod 
> chips on each card. Will they still work with this change?

No. What the above define does is to replace the function call by nothing,
if MEDIA_CONTROLLER_DVB is not set.

Neither it or the current patches for the media controller on DVB should
affect the TBS quad adapters. If you're having some regressions with it,
please report.

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


[PATCH 09/10] ARM: omap2: use clkdev_create()

2015-03-02 Thread Russell King
Rather than open coding the clkdev allocation, initialisation and
addition, use the clkdev_create() helper.

Signed-off-by: Russell King 
---
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c 
b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index 85e0b0c06718..b64d717bfab6 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -232,14 +232,12 @@ void omap2xxx_clkt_vps_init(void)
struct clk_hw_omap *hw = NULL;
struct clk *clk;
const char *parent_name = "mpu_ck";
-   struct clk_lookup *lookup = NULL;
 
omap2xxx_clkt_vps_late_init();
omap2xxx_clkt_vps_check_bootloader_rates();
 
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
-   lookup = kzalloc(sizeof(*lookup), GFP_KERNEL);
-   if (!hw || !lookup)
+   if (!hw)
goto cleanup;
init.name = "virt_prcm_set";
init.ops = &virt_prcm_set_ops;
@@ -249,15 +247,9 @@ void omap2xxx_clkt_vps_init(void)
hw->hw.init = &init;
 
clk = clk_register(NULL, &hw->hw);
-
-   lookup->dev_id = NULL;
-   lookup->con_id = "cpufreq_ck";
-   lookup->clk = clk;
-
-   clkdev_add(lookup);
+   clkdev_create(clk, "cpufreq_ck", NULL);
return;
 cleanup:
kfree(hw);
-   kfree(lookup);
 }
 #endif
-- 
1.8.3.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 00/10] initial clkdev cleanups

2015-03-02 Thread Russell King - ARM Linux
Here's some initial clkdev cleanups.  These are targetted for the next
merge window, and while the initial patches can be merged independently,
I'd prefer to keep the series together as further work on solving the
problems which unique struct clk's has introduced is needed.

The initial cleanups are more about using the correct clkdev function
than anything else: there's no point interating over a array of
clk_lookup structs, adding each one in turn when we have had a function
which does this since forever.

I'm also killing a chunk of seemingly unused code in the omap3isp driver.

Lastly, I'm introducing a clkdev_create() helper, which combines the
clkdev_alloc() + clkdev_add() pattern which keeps cropping up.

Individual patches copied to appropriate people, but they will all appear
on the mailing lists.

 arch/arm/mach-lpc32xx/clock.c|  5 +--
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 12 ++-
 arch/arm/mach-omap2/omap_device.c| 24 +
 arch/arm/plat-orion/common.c |  6 +---
 arch/sh/kernel/cpu/sh4a/clock-sh7734.c   |  3 +-
 arch/sh/kernel/cpu/sh4a/clock-sh7757.c   |  4 +--
 arch/sh/kernel/cpu/sh4a/clock-sh7785.c   |  4 +--
 arch/sh/kernel/cpu/sh4a/clock-sh7786.c   |  4 +--
 arch/sh/kernel/cpu/sh4a/clock-shx3.c |  4 +--
 drivers/clk/clk-s2mps11.c|  4 +--
 drivers/clk/clkdev.c | 52 +---
 drivers/clk/versatile/clk-impd1.c|  4 +--
 drivers/media/platform/omap3isp/isp.c| 18 --
 drivers/media/platform/omap3isp/isp.h|  1 -
 include/linux/clkdev.h   |  3 ++
 include/media/omap3isp.h |  6 
 sound/soc/sh/migor.c |  3 +-
 17 files changed, 68 insertions(+), 89 deletions(-)

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
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 07/10] clk: s2mps11: use clkdev_create()

2015-03-02 Thread Russell King
clkdev_create() is a shorter way to write clkdev_alloc() followed by
clkdev_add().  Use this instead.

Signed-off-by: Russell King 
---
 drivers/clk/clk-s2mps11.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index bfa1e64e267d..9b13a303d3f8 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -242,14 +242,12 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
goto err_reg;
}
 
-   s2mps11_clk->lookup = clkdev_alloc(s2mps11_clk->clk,
+   s2mps11_clk->lookup = clkdev_create(s2mps11_clk->clk,
s2mps11_name(s2mps11_clk), NULL);
if (!s2mps11_clk->lookup) {
ret = -ENOMEM;
goto err_lup;
}
-
-   clkdev_add(s2mps11_clk->lookup);
}
 
for (i = 0; i < S2MPS11_CLKS_NUM; i++) {
-- 
1.8.3.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 01/10] media: omap3isp: remove unused clkdev

2015-03-02 Thread Russell King
No merged platform supplies xclks via platform data.  As we want to
slightly change the clkdev interface, rather than fixing this unused
code, remove it instead.

Signed-off-by: Russell King 
---
 drivers/media/platform/omap3isp/isp.c | 18 --
 drivers/media/platform/omap3isp/isp.h |  1 -
 include/media/omap3isp.h  |  6 --
 3 files changed, 25 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index deca80903c3a..4d8078b9d010 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -281,7 +281,6 @@ static const struct clk_init_data isp_xclk_init_data = {
 
 static int isp_xclk_init(struct isp_device *isp)
 {
-   struct isp_platform_data *pdata = isp->pdata;
struct clk_init_data init;
unsigned int i;
 
@@ -311,20 +310,6 @@ static int isp_xclk_init(struct isp_device *isp)
xclk->clk = clk_register(NULL, &xclk->hw);
if (IS_ERR(xclk->clk))
return PTR_ERR(xclk->clk);
-
-   if (pdata->xclks[i].con_id == NULL &&
-   pdata->xclks[i].dev_id == NULL)
-   continue;
-
-   xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
-   if (xclk->lookup == NULL)
-   return -ENOMEM;
-
-   xclk->lookup->con_id = pdata->xclks[i].con_id;
-   xclk->lookup->dev_id = pdata->xclks[i].dev_id;
-   xclk->lookup->clk = xclk->clk;
-
-   clkdev_add(xclk->lookup);
}
 
return 0;
@@ -339,9 +324,6 @@ static void isp_xclk_cleanup(struct isp_device *isp)
 
if (!IS_ERR(xclk->clk))
clk_unregister(xclk->clk);
-
-   if (xclk->lookup)
-   clkdev_drop(xclk->lookup);
}
 }
 
diff --git a/drivers/media/platform/omap3isp/isp.h 
b/drivers/media/platform/omap3isp/isp.h
index cfdfc8714b6b..d41c98bbdfe7 100644
--- a/drivers/media/platform/omap3isp/isp.h
+++ b/drivers/media/platform/omap3isp/isp.h
@@ -122,7 +122,6 @@ enum isp_xclk_id {
 struct isp_xclk {
struct isp_device *isp;
struct clk_hw hw;
-   struct clk_lookup *lookup;
struct clk *clk;
enum isp_xclk_id id;
 
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
index 398279dd1922..a9798525d01e 100644
--- a/include/media/omap3isp.h
+++ b/include/media/omap3isp.h
@@ -152,13 +152,7 @@ struct isp_v4l2_subdevs_group {
} bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
 };
 
-struct isp_platform_xclk {
-   const char *dev_id;
-   const char *con_id;
-};
-
 struct isp_platform_data {
-   struct isp_platform_xclk xclks[2];
struct isp_v4l2_subdevs_group *subdevs;
void (*set_constraints)(struct isp_device *isp, bool enable);
 };
-- 
1.8.3.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 05/10] clkdev: add clkdev_create() helper

2015-03-02 Thread Russell King
Add a helper to allocate and add a clk_lookup structure.  This can not
only be used in several places in clkdev.c to simplify the code, but
more importantly, can be used by callers of the clkdev code to simplify
their clkdev creation and registration.

Signed-off-by: Russell King 
---
 drivers/clk/clkdev.c   | 52 ++
 include/linux/clkdev.h |  3 +++
 2 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 043fd3633373..611b9acbad78 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -294,6 +294,19 @@ vclkdev_alloc(struct clk *clk, const char *con_id, const 
char *dev_fmt,
return &cla->cl;
 }
 
+static struct clk_lookup *
+vclkdev_create((struct clk *clk, const char *con_id, const char *dev_fmt,
+   va_list ap)
+{
+   struct clk_lookup *cl;
+
+   cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
+   if (cl)
+   clkdev_add(cl);
+
+   return cl;
+}
+
 struct clk_lookup * __init_refok
 clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
 {
@@ -308,6 +321,28 @@ clkdev_alloc(struct clk *clk, const char *con_id, const 
char *dev_fmt, ...)
 }
 EXPORT_SYMBOL(clkdev_alloc);
 
+/**
+ * clkdev_create - allocate and add a clkdev lookup structure
+ * @clk: struct clk to associate with all clk_lookups
+ * @con_id: connection ID string on device
+ * @dev_fmt: format string describing device name
+ *
+ * Returns a clk_lookup structure, which can be later unregistered and
+ * freed.
+ */
+struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
+   const char *dev_fmt, ...)
+{
+   struct clk_lookup *cl;
+   va_list ap;
+
+   va_start(ap, dev_fmt);
+   cl = vclkdev_create(clk, con_id, dev_fmt, ap);
+   va_end(ap);
+
+   return cl;
+}
+
 int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
struct device *dev)
 {
@@ -317,12 +352,10 @@ int clk_add_alias(const char *alias, const char 
*alias_dev_name, char *id,
if (IS_ERR(r))
return PTR_ERR(r);
 
-   l = clkdev_alloc(r, alias, alias_dev_name);
+   l = vclkdev_create(r, alias, "%s", alias_dev_name);
clk_put(r);
-   if (!l)
-   return -ENODEV;
-   clkdev_add(l);
-   return 0;
+
+   return l ? 0 : -ENODEV;
 }
 EXPORT_SYMBOL(clk_add_alias);
 
@@ -362,15 +395,10 @@ int clk_register_clkdev(struct clk *clk, const char 
*con_id,
return PTR_ERR(clk);
 
va_start(ap, dev_fmt);
-   cl = vclkdev_alloc(clk, con_id, dev_fmt, ap);
+   cl = vclkdev_create(clk, con_id, dev_fmt, ap);
va_end(ap);
 
-   if (!cl)
-   return -ENOMEM;
-
-   clkdev_add(cl);
-
-   return 0;
+   return cl ? 0 : -ENOMEM;
 }
 EXPORT_SYMBOL(clk_register_clkdev);
 
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index 94bad77eeb4a..6f32f6d8b6ee 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -37,6 +37,9 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char 
*con_id,
 void clkdev_add(struct clk_lookup *cl);
 void clkdev_drop(struct clk_lookup *cl);
 
+struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
+   const char *dev_fmt, ...);
+
 void clkdev_add_table(struct clk_lookup *, size_t);
 int clk_add_alias(const char *, const char *, char *, struct device *);
 
-- 
1.8.3.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 08/10] ARM: orion: use clkdev_create()

2015-03-02 Thread Russell King
clkdev_create() is a shorter way to write clkdev_alloc() followed by
clkdev_add().  Use this instead.

Signed-off-by: Russell King 
---
 arch/arm/plat-orion/common.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index f5b00f41c4f6..2235081a04ee 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -28,11 +28,7 @@
 void __init orion_clkdev_add(const char *con_id, const char *dev_id,
 struct clk *clk)
 {
-   struct clk_lookup *cl;
-
-   cl = clkdev_alloc(clk, con_id, dev_id);
-   if (cl)
-   clkdev_add(cl);
+   clkdev_create(clk, con_id, "%s", dev_id);
 }
 
 /* Create clkdev entries for all orion platforms except kirkwood.
-- 
1.8.3.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 10/10] ARM: omap2: use clkdev_add_alias()

2015-03-02 Thread Russell King
When creating aliases of existing clkdev clocks, use clkdev_add_alias()
isntead of open coding the lookup and clk_lookup creation.

Signed-off-by: Russell King 
---
 arch/arm/mach-omap2/omap_device.c | 24 +---
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c 
b/arch/arm/mach-omap2/omap_device.c
index be9541e18650..521c32e7778e 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -47,7 +47,7 @@ static void _add_clkdev(struct omap_device *od, const char 
*clk_alias,
   const char *clk_name)
 {
struct clk *r;
-   struct clk_lookup *l;
+   int rc;
 
if (!clk_alias || !clk_name)
return;
@@ -62,21 +62,15 @@ static void _add_clkdev(struct omap_device *od, const char 
*clk_alias,
return;
}
 
-   r = clk_get(NULL, clk_name);
-   if (IS_ERR(r)) {
-   dev_err(&od->pdev->dev,
-   "clk_get for %s failed\n", clk_name);
-   return;
+   rc = clk_add_alias(clk_alias, dev_name(&od->pdev->dev), clk_name, NULL);
+   if (rc) {
+   if (rc == -ENODEV || rc == -ENOMEM)
+   dev_err(&od->pdev->dev,
+   "clkdev_alloc for %s failed\n", clk_alias);
+   else
+   dev_err(&od->pdev->dev,
+   "clk_get for %s failed\n", clk_name);
}
-
-   l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
-   if (!l) {
-   dev_err(&od->pdev->dev,
-   "clkdev_alloc for %s failed\n", clk_alias);
-   return;
-   }
-
-   clkdev_add(l);
 }
 
 /**
-- 
1.8.3.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 02/10] SH: use clkdev_add_table()

2015-03-02 Thread Russell King
We have always had an efficient way of registering a table of clock
lookups - it's called clkdev_add_table().  However, some people seem
to really love writing inefficient and unnecessary code.

Convert SH to use the correct interface.

Signed-off-by: Russell King 
---
 arch/sh/kernel/cpu/sh4a/clock-sh7734.c | 3 +--
 arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 4 ++--
 arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 4 ++--
 arch/sh/kernel/cpu/sh4a/clock-sh7786.c | 4 ++--
 arch/sh/kernel/cpu/sh4a/clock-shx3.c   | 4 ++--
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c 
b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index 1fdf1ee672de..7f54bf2f453d 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -246,8 +246,7 @@ int __init arch_clk_init(void)
for (i = 0; i < ARRAY_SIZE(main_clks); i++)
ret |= clk_register(main_clks[i]);
 
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c 
b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 9a28fdb36387..e40ec2c97ad1 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -141,8 +141,8 @@ int __init arch_clk_init(void)
 
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c 
b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 17d0ea55a5a2..8eb6e62340c9 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -164,8 +164,8 @@ int __init arch_clk_init(void)
 
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c 
b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index bec2a83f1ba5..5e50e7ebeff0 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -179,8 +179,8 @@ int __init arch_clk_init(void)
 
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c 
b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index 9a49a44f6f94..605221d1448a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -138,8 +138,8 @@ int __init arch_clk_init(void)
 
for (i = 0; i < ARRAY_SIZE(clks); i++)
ret |= clk_register(clks[i]);
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
if (!ret)
ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
-- 
1.8.3.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 04/10] ARM: lpc32xx: convert to use clkdev_add_table()

2015-03-02 Thread Russell King
We have always had an efficient way of registering a table of clock
lookups - it's called clkdev_add_table().  However, some people seem
to really love writing inefficient and unnecessary code.

Convert LPC32xx to use the correct interface.

Signed-off-by: Russell King 
---
 arch/arm/mach-lpc32xx/clock.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/clock.c b/arch/arm/mach-lpc32xx/clock.c
index dd5d6f532e8c..661c8f4b2310 100644
--- a/arch/arm/mach-lpc32xx/clock.c
+++ b/arch/arm/mach-lpc32xx/clock.c
@@ -1238,10 +1238,7 @@ static struct clk_lookup lookups[] = {
 
 static int __init clk_init(void)
 {
-   int i;
-
-   for (i = 0; i < ARRAY_SIZE(lookups); i++)
-   clkdev_add(&lookups[i]);
+   clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
/*
 * Setup muxed SYSCLK for HCLK PLL base -this selects the
-- 
1.8.3.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 06/10] ASOC: migor: use clkdev_create()

2015-03-02 Thread Russell King
clkdev_create() is a shorter way to write clkdev_alloc() followed by
clkdev_add().  Use this instead.

Signed-off-by: Russell King 
---
 sound/soc/sh/migor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c
index 82f582344fe7..672bcd4c252b 100644
--- a/sound/soc/sh/migor.c
+++ b/sound/soc/sh/migor.c
@@ -162,12 +162,11 @@ static int __init migor_init(void)
if (ret < 0)
return ret;
 
-   siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL);
+   siumckb_lookup = clkdev_create(&siumckb_clk, "siumckb_clk", NULL);
if (!siumckb_lookup) {
ret = -ENOMEM;
goto eclkdevalloc;
}
-   clkdev_add(siumckb_lookup);
 
/* Port number used on this machine: port B */
migor_snd_device = platform_device_alloc("soc-audio", 1);
-- 
1.8.3.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: [GIT PULL] soc-camera: one delayed patch for 3.20 or 3.21

2015-03-02 Thread Mauro Carvalho Chehab
Em Sun, 15 Feb 2015 22:01:21 +0100 (CET)
Guennadi Liakhovetski  escreveu:

> Hi Mauro,
> 
> This is just a single patch for a single soc-camera host driver. No rush, 
> I presume, you're not planning another 3.20 pull request, in which case it 
> will wait until 3.21. But in case you are planning one and you find it 
> acceptable to also take this one - here goes. I just missed this patch a 
> while ago and wanted to put it up for whatever the next possibility would 
> be. Otherwise I suddenly recalled to clean up patchwork (... :)), so, 
> instead of 120+ patches for me it now only contains 15 :) I'll be looking 
> at them as time permits and preparing more for 3.21 and sending some 
> comments to those, that I won't yet find myself sufficiently comfortable 
> about.
> 
> One more question to you - what about these my 2 patches:
> 
> [v4,2/2] V4L: add CCF support to the v4l2_clk API
> https://patchwork.linuxtv.org/patch/28111/
> [v3,1/2] V4L: remove clock name from v4l2_clk API
> https://patchwork.linuxtv.org/patch/28108/
> 
> Are they good enough now? Shall I include them in my next pull request or 
> would you prefer to take them yourself?

Feel free to include on your next pull request, but please see my comments
for the first one:
[v4,2/2] V4L: add CCF support to the v4l2_clk API
https://patchwork.linuxtv.org/patch/28111/

Regards,
Mauro

> 
> The following changes since commit 48b777c0833bc7392679405539bb5d3ed0900828:
> 
>   Merge branch 'patchwork' into to_next (2015-02-10 21:42:33 -0200)
> 
> are available in the git repository at:
> 
> 
>   git://linuxtv.org/gliakhovetski/v4l-dvb.git for-3.20-2
> 
> for you to fetch changes up to ed1a7b4be588c935cf31447366b005a07d73bb01:
> 
>   media: atmel-isi: increase the burst length to improve the performance 
> (2015-02-15 17:28:37 +0100)
> 
> 
> Josh Wu (1):
>   media: atmel-isi: increase the burst length to improve the performance
> 
>  drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
>  include/media/atmel-isi.h | 4 
>  2 files changed, 6 insertions(+)
> 
> Thanks
> Guennadi
> --
> 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


Re: [PATCH] [media] use a function for DVB media controller register

2015-03-02 Thread Tycho Lürsen

Hi Mauro,
Op 02-03-15 om 15:31 schreef Mauro Carvalho Chehab:

This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index c739725ca7ee..367b8e77feb8 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1104,9 +1104,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
*coredev,
pr_err("dvb_register_adapter() failed %d\n", rc);
goto adapter_error;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   client->adapter.mdev = coredev->media_dev;
-#endif
+   dvb_register_media_controller(&client->adapter, coredev->media_dev);
  
  	/* init dvb demux */

client->demux.dmx.capabilities = DMX_TS_FILTERING;
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 556c9e9d1d4e..12629b8ecb0c 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -125,8 +125,15 @@ extern void dvb_unregister_device (struct dvb_device 
*dvbdev);
  
  #ifdef CONFIG_MEDIA_CONTROLLER_DVB

  void dvb_create_media_graph(struct dvb_adapter *adap);
+static inline void dvb_register_media_controller(struct dvb_adapter *adap,
+struct media_device *mdev)
+{
+   adap->mdev = mdev;
+}
+
  #else
  static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
+#define dvb_register_media_controller(a, b) {}
  #endif
Does "#define dvb_register_media_controller(a, b) {}" restrict the 
number of registerd controllers in any way?
I mean, I've got a couple of TBS quad adapters, 4 tuner and 4 demod 
chips on each card. Will they still work with this change?
  
  extern int dvb_generic_open (struct inode *inode, struct file *file);

diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 8bf2baae387f..ff39bf22442d 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -465,9 +465,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
   dev->name, result);
goto fail_adapter;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   dvb->adapter.mdev = dev->media_dev;
-#endif
+   dvb_register_media_controller(&dvb->adapter, dev->media_dev);
  
  	/* Ensure all frontends negotiate bus access */

dvb->frontend->ops.ts_bus_ctrl = cx231xx_dvb_bus_ctrl;
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 8bd08ba4f869..f5df9eaba04f 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -429,7 +429,7 @@ static void dvb_usbv2_media_device_register(struct 
dvb_usb_adapter *adap)
return;
}
  
-	adap->dvb_adap.mdev = mdev;

+   dvb_register_media_controller(&adap->dvb_adap, mdev);
  
  	dev_info(&d->udev->dev, "media controller created\n");
  
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c

index 980d976960d9..7b7b834777b7 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -122,7 +122,7 @@ static void dvb_usb_media_device_register(struct 
dvb_usb_adapter *adap)
kfree(mdev);
return;
}
-   adap->dvb_adap.mdev = mdev;
+   dvb_register_media_controller(&adap->dvb_adap, mdev);
  
  	dev_info(&d->udev->dev, "media controller created\n");

  #endif


--
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 2/2] V4L: add CCF support to the v4l2_clk API

2015-03-02 Thread Mauro Carvalho Chehab
Em Sun, 1 Feb 2015 12:12:33 +0100 (CET)
Guennadi Liakhovetski  escreveu:

> V4L2 clocks, e.g. used by camera sensors for their master clock, do not
> have to be supplied by a different V4L2 driver, they can also be
> supplied by an independent source. In this case the standart kernel
> clock API should be used to handle such clocks. This patch adds support
> for such cases.
> 
> Signed-off-by: Guennadi Liakhovetski 
> Acked-by: Laurent Pinchart 
> ---
> 
> v4: sizeof(*clk) :)
> 
>  drivers/media/v4l2-core/v4l2-clk.c | 48 
> +++---
>  include/media/v4l2-clk.h   |  2 ++
>  2 files changed, 47 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-clk.c 
> b/drivers/media/v4l2-core/v4l2-clk.c
> index 3ff0b00..9f8cb20 100644
> --- a/drivers/media/v4l2-core/v4l2-clk.c
> +++ b/drivers/media/v4l2-core/v4l2-clk.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -37,6 +38,21 @@ static struct v4l2_clk *v4l2_clk_find(const char *dev_id)
>  struct v4l2_clk *v4l2_clk_get(struct device *dev, const char *id)
>  {
>   struct v4l2_clk *clk;
> + struct clk *ccf_clk = clk_get(dev, id);
> +
> + if (PTR_ERR(ccf_clk) == -EPROBE_DEFER)
> + return ERR_PTR(-EPROBE_DEFER);

Why not do just:
return ccf_clk;

> +
> + if (!IS_ERR_OR_NULL(ccf_clk)) {
> + clk = kzalloc(sizeof(*clk), GFP_KERNEL);
> + if (!clk) {
> + clk_put(ccf_clk);
> + return ERR_PTR(-ENOMEM);
> + }
> + clk->clk = ccf_clk;
> +
> + return clk;
> + }

The error condition here looks a little weird to me. I mean, if the
CCF clock returns an error, shouldn't it fail instead of silently
run some logic to find another clock source? Isn't it risky on getting
a wrong value?

If the above code is right, please add a comment there explaining
why it is safe to discard the CCF clock error.

>  
>   mutex_lock(&clk_lock);
>   clk = v4l2_clk_find(dev_name(dev));
> @@ -56,6 +72,12 @@ void v4l2_clk_put(struct v4l2_clk *clk)
>   if (IS_ERR(clk))
>   return;
>  
> + if (clk->clk) {
> + clk_put(clk->clk);
> + kfree(clk);
> + return;
> + }
> +
>   mutex_lock(&clk_lock);
>  
>   list_for_each_entry(tmp, &clk_list, list)
> @@ -93,8 +115,12 @@ static void v4l2_clk_unlock_driver(struct v4l2_clk *clk)
>  
>  int v4l2_clk_enable(struct v4l2_clk *clk)
>  {
> - int ret = v4l2_clk_lock_driver(clk);
> + int ret;
>  
> + if (clk->clk)
> + return clk_prepare_enable(clk->clk);
> +
> + ret = v4l2_clk_lock_driver(clk);
>   if (ret < 0)
>   return ret;
>  
> @@ -120,6 +146,9 @@ void v4l2_clk_disable(struct v4l2_clk *clk)
>  {
>   int enable;
>  
> + if (clk->clk)
> + return clk_disable_unprepare(clk->clk);
> +
>   mutex_lock(&clk->lock);
>  
>   enable = --clk->enable;
> @@ -137,8 +166,12 @@ EXPORT_SYMBOL(v4l2_clk_disable);
>  
>  unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk)
>  {
> - int ret = v4l2_clk_lock_driver(clk);
> + int ret;
> +
> + if (clk->clk)
> + return clk_get_rate(clk->clk);
>  
> + ret = v4l2_clk_lock_driver(clk);
>   if (ret < 0)
>   return ret;
>  
> @@ -157,7 +190,16 @@ EXPORT_SYMBOL(v4l2_clk_get_rate);
>  
>  int v4l2_clk_set_rate(struct v4l2_clk *clk, unsigned long rate)
>  {
> - int ret = v4l2_clk_lock_driver(clk);
> + int ret;
> +
> + if (clk->clk) {
> + long r = clk_round_rate(clk->clk, rate);
> + if (r < 0)
> + return r;
> + return clk_set_rate(clk->clk, r);
> + }
> +
> + ret = v4l2_clk_lock_driver(clk);
>  
>   if (ret < 0)
>   return ret;
> diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h
> index 928045f..3ef6e3d 100644
> --- a/include/media/v4l2-clk.h
> +++ b/include/media/v4l2-clk.h
> @@ -22,6 +22,7 @@
>  struct module;
>  struct device;
>  
> +struct clk;
>  struct v4l2_clk {
>   struct list_head list;
>   const struct v4l2_clk_ops *ops;
> @@ -29,6 +30,7 @@ struct v4l2_clk {
>   int enable;
>   struct mutex lock; /* Protect the enable count */
>   atomic_t use_count;
> + struct clk *clk;
>   void *priv;
>  };
>  
--
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


Confidential Letter

2015-03-02 Thread Mr. Juan Sebastian Morato
Dear Friend, 

I am Mr. Juan Sebastian Morato, the Auditor General of Unicaja Bank Madrid. In 
the course of my auditing, I discovered a floating fund in an account, which 
was opened in 1990 at Cam Bank before it was bought over by Unicaja Group which 
I am the auditor belonging to a dead foreigner Mr. Kenny who died in 2004. 
Every effort made to track any member of his family or next of kin has since 
failed; hence I got in contact with you to stand as his next of kin since you 
bear the same last name. He died leaving no heir or a will.

My intention is to transfer this sum of 5.5M in the aforementioned account to a 
safe account. I am therefore proposing that you quietly partner with me and 
provide an account or set up a new one that will serve the purpose of receiving 
this fund. For your assistance in this venture, I am ready to part with a good 
percentage of the entire funds. After going through the deceased person's 
records and files, I discovered that:

(1) No one has operated this account since 2004
(2) He died without an heir; hence the money has been floating.
(3) No other person knows about this account and there was no known beneficiary.

If I do not remit this money urgently, it would be forfeited and subsequently 
converted to company's funds, which will benefit only the directors of my firm. 
This money can be approved to you legally as with all the necessary documentary 
approvals in your name. However, you would be required to show some proof of 
claim, which I will provide you with and also guide you on how to make your 
applications.

Please do give me a reply on my private e-mail juan.mora...@1email.eu or fax 00 
34 917 692 656 so that I can send you detailed information on the modalities of 
my proposition. I completely trust you to keep this proposition absolutely 
confidential. Kindly forward your telephone number where I can reach you 
easily. I look forward to your prompt response.

Best Regards,
Mr. Juan Sebastian Morato
Fax: 00 34 917 692 656
--
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 375/377] ERROR: "media_device_unregister" [drivers/media/usb/siano/smsusb.ko] undefined!

2015-03-02 Thread kbuild test robot
Hi Mauro,

First bad commit (maybe != root cause):

tree:   git://linuxtv.org/media_tree.git master
head:   89a2c1d60aa2cfcf4c9f194b4c923d72182be431
commit: 480884b647c7efecb904a9ed022ee533afb9cb80 [375/377] [media] dvbdev: use 
adapter arg for dvb_create_media_graph()
config: x86_64-randconfig-nexs0 (attached as .config)
reproduce:
  git checkout 480884b647c7efecb904a9ed022ee533afb9cb80
  # save the attached .config to linux build tree
  make ARCH=x86_64 

All error/warnings:

>> ERROR: "media_device_unregister" [drivers/media/usb/siano/smsusb.ko] 
>> undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 4.0.0-rc1 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx 
-fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 
-fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
# CONFIG_KERNEL_GZIP is not set
CONFIG_KERNEL_BZIP2=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
CONFIG_POSIX_MQUEUE=y
CONFIG_CROSS_MEMORY_ATTACH=y
CONFIG_FHANDLE=y
CONFIG_USELIB=y
# CONFIG_AUDIT is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y
CONFIG_IRQ_DOMAIN=y
# CONFIG_IRQ_DOMAIN_DEBUG is not set
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y

#
# RCU Subsystem
#
CONFIG_PREEMPT_RCU=y
CONFIG_SRCU=y
# CONFIG_TASKS_RCU is not set
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
CONFIG_RCU_FANOUT_EXACT=y
CONFIG_TREE_RCU_TRACE=y
# CONFIG_RCU_BOOST is not set
CONFIG_RCU_KTHREAD_PRIO=0
CONFIG_RCU_NOCB_CPU=y
# CONFIG_RCU_NOCB_CPU_NONE is not set
CONFIG_RCU_NOCB_CPU_ZERO=y
# CONFIG_RCU_NOCB_CPU_ALL is not set
CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_SUPPORTS_INT128=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
# CONFIG_CPUSETS is not set
# CONFIG_CGROUP_CPUACCT is not set
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
# CONFIG_CGROUP_HUGETLB is not set
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_SCHED=y
# CONFIG_FAIR_GROUP_SCHED is not set
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_IPC_NS is not set
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
# CONFIG_NET_NS is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
C

Re: [PATCH] [media] soc_camera: fix devm_kfree warning on error path

2015-03-02 Thread Guennadi Liakhovetski
Hi Axel,

On Mon, 2 Mar 2015, Axel Haslam wrote:

> sorry, i had not seen the thread with Geert about this issue,
> i guess it is fixed allready!

Np, thanks for your version too! It is identical to Geert's one, yes, 
which is good! It means the chances for the patch to be corect become even 
higher! :) Yes, I pushed the patch out, but I'm not sure whether Mauro has 
already pulled and forwarded it. If not, he might add your "Acked-by" to 
that patch, I think.

Thanks
Guennadi

> 
> Regards
> Axel
> 
> 
> 
> On Mon, Mar 2, 2015 at 5:16 PM,  wrote:
> 
> > From: Axel Haslam 
> >
> > Free the original allocated address to take
> > care of the following warning seen on boot:
> >
> > WARNING: CPU: 0 PID: 1 at drivers/base/devres.c:887 devm_kfree+0x30/0x40()
> > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.0.0-rc1-dirty #9
> > Hardware name: Generic R8A7790 (Flattened Device Tree)
> > Backtrace:
> > [] (dump_backtrace) from [] (show_stack+0x18/0x1c)
> >  r7:c058ab5d r6:ee0309c0 r5:0009 r4:
> > [] (show_stack) from [] (dump_stack+0x78/0x94)
> > [] (dump_stack) from []
> > (warn_slowpath_common+0x88/0xb4)
> >  r5:0009 r4:
> > [] (warn_slowpath_common) from []
> > (warn_slowpath_null+0x24/0x2c)
> >  r9:ee148028 r8:ee7dc4b4 r7:ed7e5e10 r6:ed7ee220 r5:fffa r4:ee148010
> > [] (warn_slowpath_null) from [] (devm_kfree+0x30/0x40)
> > [] (devm_kfree) from []
> > (soc_of_bind.isra.14+0x194/0x1d4)
> > [] (soc_of_bind.isra.14) from []
> > (soc_camera_host_register+0x208/0x31c)
> >  r9:006a r8:ee7e22c8 r7:ee295a10 r6: r5:ee7e1f44 r4:ed7ee220
> > [] (soc_camera_host_register) from []
> > (rcar_vin_probe+0x1f8/0x23c)
> >  r9:006a r8:ee295a00 r7:0008 r6:ee295a10 r5:ed7ee210 r4:c07db534
> > [] (rcar_vin_probe) from []
> > (platform_drv_probe+0x50/0xa0)
> >  r10: r9:c07db27c r8: r7:c080ae40 r6:c07db27c r5:ee295a10
> >  r4:ffef
> > [] (platform_drv_probe) from []
> > (driver_probe_device+0xc4/0x208)
> >  r7:c080ae40 r6:c080ae34 r5: r4:ee295a10
> > [] (driver_probe_device) from []
> > (__driver_attach+0x70/0x94)
> >  r9:c07e7740 r8: r7:c07d3b60 r6:c07db27c r5:ee295a44 r4:ee295a10
> > [] (__driver_attach) from []
> > (bus_for_each_dev+0x74/0x98)
> >  r7:c07d3b60 r6:c0257024 r5:c07db27c r4:
> > [] (bus_for_each_dev) from [] (driver_attach+0x20/0x28)
> >  r6:ed9af600 r5: r4:c07db27c
> > [] (driver_attach) from [] (bus_add_driver+0xdc/0x1c4)
> > [] (bus_add_driver) from [] (driver_register+0xa4/0xe8)
> >  r7:c0600410 r6:c0600410 r5:c05e73a4 r4:c07db27c
> > [] (driver_register) from []
> > (__platform_driver_register+0x50/0x64)
> >  r5:c05e73a4 r4:ed7e6b00
> > [] (__platform_driver_register) from []
> > (rcar_vin_driver_init+0x18/0x20)
> > [] (rcar_vin_driver_init) from []
> > (do_one_initcall+0x10c/0x1bc)
> > [] (do_one_initcall) from []
> > (kernel_init_freeable+0x118/0x1e0)
> >  r8:c07e7740 r7:c0608f80 r6:c0600c3c r5:00ad r4:0006
> > [] (kernel_init_freeable) from []
> > (kernel_init+0x14/0xec)
> >  r9: r8: r7: r6: r5:c0487004 r4:c07e7740
> > [] (kernel_init) from [] (ret_from_fork+0x14/0x34)
> >  r5:c0487004 r4:
> >
> > Signed-off-by: Axel Haslam 
> > ---
> >  drivers/media/platform/soc_camera/soc_camera.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/soc_camera/soc_camera.c
> > b/drivers/media/platform/soc_camera/soc_camera.c
> > index cee7b56..66634b4 100644
> > --- a/drivers/media/platform/soc_camera/soc_camera.c
> > +++ b/drivers/media/platform/soc_camera/soc_camera.c
> > @@ -1665,7 +1665,7 @@ eclkreg:
> >  eaddpdev:
> > platform_device_put(sasc->pdev);
> >  eallocpdev:
> > -   devm_kfree(ici->v4l2_dev.dev, sasc);
> > +   devm_kfree(ici->v4l2_dev.dev, info);
> > dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret);
> >
> > return ret;
> > --
> > 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] soc_camera: fix devm_kfree warning on error path

2015-03-02 Thread ahaslam
From: Axel Haslam 

Free the original allocated address to take
care of the following warning seen on boot:

WARNING: CPU: 0 PID: 1 at drivers/base/devres.c:887 devm_kfree+0x30/0x40()
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.0.0-rc1-dirty #9
Hardware name: Generic R8A7790 (Flattened Device Tree)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
 r7:c058ab5d r6:ee0309c0 r5:0009 r4:
[] (show_stack) from [] (dump_stack+0x78/0x94)
[] (dump_stack) from [] (warn_slowpath_common+0x88/0xb4)
 r5:0009 r4:
[] (warn_slowpath_common) from [] 
(warn_slowpath_null+0x24/0x2c)
 r9:ee148028 r8:ee7dc4b4 r7:ed7e5e10 r6:ed7ee220 r5:fffa r4:ee148010
[] (warn_slowpath_null) from [] (devm_kfree+0x30/0x40)
[] (devm_kfree) from [] (soc_of_bind.isra.14+0x194/0x1d4)
[] (soc_of_bind.isra.14) from [] 
(soc_camera_host_register+0x208/0x31c)
 r9:006a r8:ee7e22c8 r7:ee295a10 r6: r5:ee7e1f44 r4:ed7ee220
[] (soc_camera_host_register) from [] 
(rcar_vin_probe+0x1f8/0x23c)
 r9:006a r8:ee295a00 r7:0008 r6:ee295a10 r5:ed7ee210 r4:c07db534
[] (rcar_vin_probe) from [] (platform_drv_probe+0x50/0xa0)
 r10: r9:c07db27c r8: r7:c080ae40 r6:c07db27c r5:ee295a10
 r4:ffef
[] (platform_drv_probe) from [] 
(driver_probe_device+0xc4/0x208)
 r7:c080ae40 r6:c080ae34 r5: r4:ee295a10
[] (driver_probe_device) from [] (__driver_attach+0x70/0x94)
 r9:c07e7740 r8: r7:c07d3b60 r6:c07db27c r5:ee295a44 r4:ee295a10
[] (__driver_attach) from [] (bus_for_each_dev+0x74/0x98)
 r7:c07d3b60 r6:c0257024 r5:c07db27c r4:
[] (bus_for_each_dev) from [] (driver_attach+0x20/0x28)
 r6:ed9af600 r5: r4:c07db27c
[] (driver_attach) from [] (bus_add_driver+0xdc/0x1c4)
[] (bus_add_driver) from [] (driver_register+0xa4/0xe8)
 r7:c0600410 r6:c0600410 r5:c05e73a4 r4:c07db27c
[] (driver_register) from [] 
(__platform_driver_register+0x50/0x64)
 r5:c05e73a4 r4:ed7e6b00
[] (__platform_driver_register) from [] 
(rcar_vin_driver_init+0x18/0x20)
[] (rcar_vin_driver_init) from [] 
(do_one_initcall+0x10c/0x1bc)
[] (do_one_initcall) from [] 
(kernel_init_freeable+0x118/0x1e0)
 r8:c07e7740 r7:c0608f80 r6:c0600c3c r5:00ad r4:0006
[] (kernel_init_freeable) from [] (kernel_init+0x14/0xec)
 r9: r8: r7: r6: r5:c0487004 r4:c07e7740
[] (kernel_init) from [] (ret_from_fork+0x14/0x34)
 r5:c0487004 r4:

Signed-off-by: Axel Haslam 
---
 drivers/media/platform/soc_camera/soc_camera.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c 
b/drivers/media/platform/soc_camera/soc_camera.c
index cee7b56..66634b4 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1665,7 +1665,7 @@ eclkreg:
 eaddpdev:
platform_device_put(sasc->pdev);
 eallocpdev:
-   devm_kfree(ici->v4l2_dev.dev, sasc);
+   devm_kfree(ici->v4l2_dev.dev, info);
dev_err(ici->v4l2_dev.dev, "group probe failed: %d\n", ret);
 
return ret;
-- 
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: i2c: ths7303: drop module param debug

2015-03-02 Thread Lad Prabhakar
From: "Lad, Prabhakar" 

this patch drops module param 'debug' as it was never used.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/i2c/ths7303.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c
index ed9ae88..9f7fdb6 100644
--- a/drivers/media/i2c/ths7303.c
+++ b/drivers/media/i2c/ths7303.c
@@ -52,10 +52,6 @@ MODULE_DESCRIPTION("TI THS7303 video amplifier driver");
 MODULE_AUTHOR("Chaithrika U S");
 MODULE_LICENSE("GPL");
 
-static int debug;
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Debug level 0-1");
-
 static inline struct ths7303_state *to_state(struct v4l2_subdev *sd)
 {
return container_of(sd, struct ths7303_state, sd);
-- 
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


Re: 0.led_name 2.other.led.name in /sysfs Re: [PATCH/RFC v11 01/20] leds: flash: document sysfs interface

2015-03-02 Thread Pavel Machek
Hi!

> > Of course the relevant sysfs group could be initialized only with
> > the needed number of sync leds attributes, but still this is less
> > than optimal design.
> > 
> > It looks like this interface indeed doesn't fit for sysfs.
> > 
> > I am leaning towards removing the support for synchronized flash LEDs
> > from the LED subsystem entirely and leave it only to V4L2.
> 
> Perfectly fine for me as well, I guess the synchronised strobe has mostly
> use on V4L2. It could always be added later on if needed.

Makes sense...
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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] media: i2c: s5c73m3: make sure we destroy the mutex

2015-03-02 Thread Lad Prabhakar
From: "Lad, Prabhakar" 

Make sure to call mutex_destroy() in case of probe failure or module
unload.

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/i2c/s5c73m3/s5c73m3-core.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c 
b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ee0f57e..da0b3a3 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1658,7 +1658,6 @@ static int s5c73m3_probe(struct i2c_client *client,
if (ret < 0)
return ret;
 
-   mutex_init(&state->lock);
sd = &state->sensor_sd;
oif_sd = &state->oif_sd;
 
@@ -1695,6 +1694,8 @@ static int s5c73m3_probe(struct i2c_client *client,
if (ret < 0)
return ret;
 
+   mutex_init(&state->lock);
+
ret = s5c73m3_configure_gpios(state);
if (ret)
goto out_err;
@@ -1754,6 +1755,7 @@ out_err1:
s5c73m3_unregister_spi_driver(state);
 out_err:
media_entity_cleanup(&sd->entity);
+   mutex_destroy(&state->lock);
return ret;
 }
 
@@ -1772,6 +1774,7 @@ static int s5c73m3_remove(struct i2c_client *client)
media_entity_cleanup(&sensor_sd->entity);
 
s5c73m3_unregister_spi_driver(state);
+   mutex_destroy(&state->lock);
 
return 0;
 }
-- 
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: drop call to v4l2_device_unregister_subdev()

2015-03-02 Thread Lad Prabhakar
From: "Lad, Prabhakar" 

These drivers are moved to support asynchronous probing,
v4l2_async_unregister_subdev() unregisters the subdev so
there isn't a need to explicitly call v4l2_device_unregister_subdev().

Signed-off-by: Lad, Prabhakar 
---
 drivers/media/i2c/adv7343.c| 1 -
 drivers/media/i2c/adv7604.c| 1 -
 drivers/media/i2c/mt9v032.c| 1 -
 drivers/media/i2c/soc_camera/mt9m111.c | 1 -
 drivers/media/i2c/ths8200.c| 1 -
 drivers/media/i2c/tvp514x.c| 1 -
 drivers/media/i2c/tvp7002.c| 1 -
 drivers/media/platform/soc_camera/sh_mobile_csi2.c | 1 -
 8 files changed, 8 deletions(-)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index 9d38f7b..7c50833 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -506,7 +506,6 @@ static int adv7343_remove(struct i2c_client *client)
struct adv7343_state *state = to_state(sd);
 
v4l2_async_unregister_subdev(&state->sd);
-   v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&state->hdl);
 
return 0;
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index d228b7c..af6363d 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2879,7 +2879,6 @@ static int adv7604_remove(struct i2c_client *client)
cancel_delayed_work(&state->delayed_work_enable_hotplug);
destroy_workqueue(state->work_queues);
v4l2_async_unregister_subdev(sd);
-   v4l2_device_unregister_subdev(sd);
media_entity_cleanup(&sd->entity);
adv7604_unregister_clients(to_state(sd));
v4l2_ctrl_handler_free(sd->ctrl_handler);
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index bd3f979..3267c18 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -1016,7 +1016,6 @@ static int mt9v032_remove(struct i2c_client *client)
 
v4l2_async_unregister_subdev(subdev);
v4l2_ctrl_handler_free(&mt9v032->ctrls);
-   v4l2_device_unregister_subdev(subdev);
media_entity_cleanup(&subdev->entity);
 
return 0;
diff --git a/drivers/media/i2c/soc_camera/mt9m111.c 
b/drivers/media/i2c/soc_camera/mt9m111.c
index 5992ea9..441e0fd 100644
--- a/drivers/media/i2c/soc_camera/mt9m111.c
+++ b/drivers/media/i2c/soc_camera/mt9m111.c
@@ -1016,7 +1016,6 @@ static int mt9m111_remove(struct i2c_client *client)
 
v4l2_async_unregister_subdev(&mt9m111->subdev);
v4l2_clk_put(mt9m111->clk);
-   v4l2_device_unregister_subdev(&mt9m111->subdev);
v4l2_ctrl_handler_free(&mt9m111->hdl);
 
return 0;
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 4ebd329..73fc42b 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -479,7 +479,6 @@ static int ths8200_remove(struct i2c_client *client)
 
ths8200_s_power(sd, false);
v4l2_async_unregister_subdev(&decoder->sd);
-   v4l2_device_unregister_subdev(sd);
 
return 0;
 }
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 2042042..c6b3dc5 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -1209,7 +1209,6 @@ static int tvp514x_remove(struct i2c_client *client)
struct tvp514x_decoder *decoder = to_decoder(sd);
 
v4l2_async_unregister_subdev(&decoder->sd);
-   v4l2_device_unregister_subdev(sd);
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&decoder->sd.entity);
 #endif
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index fe4870e..9233194 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -1116,7 +1116,6 @@ static int tvp7002_remove(struct i2c_client *c)
 #if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&device->sd.entity);
 #endif
-   v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&device->hdl);
return 0;
 }
diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c 
b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
index c4e7aa0..cd93241 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
@@ -380,7 +380,6 @@ static int sh_csi2_remove(struct platform_device *pdev)
struct sh_csi2 *priv = container_of(subdev, struct sh_csi2, subdev);
 
v4l2_async_unregister_subdev(&priv->subdev);
-   v4l2_device_unregister_subdev(subdev);
pm_runtime_disable(&pdev->dev);
 
return 0;
-- 
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


Re: [PATCH 1/2] [media] dvbdev: use adapter arg for dvb_create_media_graph()

2015-03-02 Thread Mauro Carvalho Chehab
Em Mon, 02 Mar 2015 15:06:59 +0100
Hans Verkuil  escreveu:

> Hi Mauro,
> 
> Small nitpick:
> 
> >  extern void dvb_unregister_device (struct dvb_device *dvbdev);
> > -void dvb_create_media_graph(struct media_device *mdev);
> > +
> > +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
> > +void dvb_create_media_graph(struct dvb_adapter *adap);
> > +#else
> > +static inline void dvb_create_media_graph(struct dvb_adapter *adap) {};
> 
> Unnecessary trailing ';'.
> 
> Regards,
> 
>   Hans
>
Fixed, thanks!

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


[PATCH] [media] use a function for DVB media controller register

2015-03-02 Thread Mauro Carvalho Chehab
This is really a simple function, but using it avoids to have
if's inside the drivers.

Also, the kABI becomes a little more clearer.

This shouldn't generate any overhead, and the type check
will happen when compiling with MC DVB enabled.

So, let's do it.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index c739725ca7ee..367b8e77feb8 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1104,9 +1104,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
*coredev,
pr_err("dvb_register_adapter() failed %d\n", rc);
goto adapter_error;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   client->adapter.mdev = coredev->media_dev;
-#endif
+   dvb_register_media_controller(&client->adapter, coredev->media_dev);
 
/* init dvb demux */
client->demux.dmx.capabilities = DMX_TS_FILTERING;
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 556c9e9d1d4e..12629b8ecb0c 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -125,8 +125,15 @@ extern void dvb_unregister_device (struct dvb_device 
*dvbdev);
 
 #ifdef CONFIG_MEDIA_CONTROLLER_DVB
 void dvb_create_media_graph(struct dvb_adapter *adap);
+static inline void dvb_register_media_controller(struct dvb_adapter *adap,
+struct media_device *mdev)
+{
+   adap->mdev = mdev;
+}
+
 #else
 static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
+#define dvb_register_media_controller(a, b) {}
 #endif
 
 extern int dvb_generic_open (struct inode *inode, struct file *file);
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 8bf2baae387f..ff39bf22442d 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -465,9 +465,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
   dev->name, result);
goto fail_adapter;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   dvb->adapter.mdev = dev->media_dev;
-#endif
+   dvb_register_media_controller(&dvb->adapter, dev->media_dev);
 
/* Ensure all frontends negotiate bus access */
dvb->frontend->ops.ts_bus_ctrl = cx231xx_dvb_bus_ctrl;
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 8bd08ba4f869..f5df9eaba04f 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -429,7 +429,7 @@ static void dvb_usbv2_media_device_register(struct 
dvb_usb_adapter *adap)
return;
}
 
-   adap->dvb_adap.mdev = mdev;
+   dvb_register_media_controller(&adap->dvb_adap, mdev);
 
dev_info(&d->udev->dev, "media controller created\n");
 
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c 
b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index 980d976960d9..7b7b834777b7 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -122,7 +122,7 @@ static void dvb_usb_media_device_register(struct 
dvb_usb_adapter *adap)
kfree(mdev);
return;
}
-   adap->dvb_adap.mdev = mdev;
+   dvb_register_media_controller(&adap->dvb_adap, mdev);
 
dev_info(&d->udev->dev, "media controller created\n");
 #endif
-- 
2.1.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/2] [media] dvbdev: use adapter arg for dvb_create_media_graph()

2015-03-02 Thread Hans Verkuil
Hi Mauro,

Small nitpick:

On 03/02/2015 03:02 PM, Mauro Carvalho Chehab wrote:
> Instead of using media_dev argument for dvb_create_media_graph(),
> use the adapter.
> 
> That allows to create a stub for this function, if compiled
> without DVB support, avoiding to add extra if's at the drivers.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> 
> diff --git a/drivers/media/common/siano/smsdvb-main.c 
> b/drivers/media/common/siano/smsdvb-main.c
> index dd3c1516013f..387db145d37e 100644
> --- a/drivers/media/common/siano/smsdvb-main.c
> +++ b/drivers/media/common/siano/smsdvb-main.c
> @@ -1185,7 +1185,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
> *coredev,
>   if (smsdvb_debugfs_create(client) < 0)
>   pr_info("failed to create debugfs node\n");
>  
> - dvb_create_media_graph(coredev->media_dev);
> + dvb_create_media_graph(&client->adapter);
>  
>   pr_info("DVB interface registered.\n");
>   return 0;
> diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
> index 0af9d0c5f889..13bb57f0457f 100644
> --- a/drivers/media/dvb-core/dvbdev.c
> +++ b/drivers/media/dvb-core/dvbdev.c
> @@ -381,9 +381,10 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
>  EXPORT_SYMBOL(dvb_unregister_device);
>  
>  
> -void dvb_create_media_graph(struct media_device *mdev)
> -{
>  #ifdef CONFIG_MEDIA_CONTROLLER_DVB
> +void dvb_create_media_graph(struct dvb_adapter *adap)
> +{
> + struct media_device *mdev = adap->mdev;
>   struct media_entity *entity, *tuner = NULL, *fe = NULL;
>   struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
>  
> @@ -421,9 +422,9 @@ void dvb_create_media_graph(struct media_device *mdev)
>  
>   if (demux && ca)
>   media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
> -#endif
>  }
>  EXPORT_SYMBOL_GPL(dvb_create_media_graph);
> +#endif
>  
>  static int dvbdev_check_free_adapter_num(int num)
>  {
> diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
> index 467c1311bd4c..caf4d4791a8b 100644
> --- a/drivers/media/dvb-core/dvbdev.h
> +++ b/drivers/media/dvb-core/dvbdev.h
> @@ -122,7 +122,12 @@ extern int dvb_register_device (struct dvb_adapter *adap,
>   int type);
>  
>  extern void dvb_unregister_device (struct dvb_device *dvbdev);
> -void dvb_create_media_graph(struct media_device *mdev);
> +
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
> +void dvb_create_media_graph(struct dvb_adapter *adap);
> +#else
> +static inline void dvb_create_media_graph(struct dvb_adapter *adap) {};

Unnecessary trailing ';'.

Regards,

Hans

> +#endif
>  
>  extern int dvb_generic_open (struct inode *inode, struct file *file);
>  extern int dvb_generic_release (struct inode *inode, struct file *file);
> diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
> b/drivers/media/usb/cx231xx/cx231xx-dvb.c
> index 44229a2c2d32..8bf2baae387f 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
> @@ -540,9 +540,8 @@ static int register_dvb(struct cx231xx_dvb *dvb,
>  
>   /* register network adapter */
>   dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
> - dvb_create_media_graph(dev->media_dev);
> -#endif
> + dvb_create_media_graph(&dvb->adapter);
> +
>   return 0;
>  
>  fail_fe_conn:
> diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
> b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> index 0666c8f33ac7..08a3cd1c8b44 100644
> --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> @@ -702,7 +702,7 @@ static int dvb_usbv2_adapter_frontend_init(struct 
> dvb_usb_adapter *adap)
>   }
>   }
>  
> - dvb_create_media_graph(adap->dvb_adap.mdev);
> + dvb_create_media_graph(&adap->dvb_adap);
>  
>   return 0;
>  
> diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c 
> b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
> index a7bc4535c58f..6c9f5ecf949c 100644
> --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
> +++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
> @@ -320,7 +320,7 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter 
> *adap)
>   adap->num_frontends_initialized++;
>   }
>  
> - dvb_create_media_graph(adap->dvb_adap.mdev);
> + dvb_create_media_graph(&adap->dvb_adap);
>  
>   return 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] dvb: fix compilation errors/warnings ifndef CONFIG_MEDIA_CONTROLLER_DVB

2015-03-02 Thread Hans Verkuil
Hi Mauro,

On 03/02/2015 03:01 PM, Mauro Carvalho Chehab wrote:
> Em Fri, 27 Feb 2015 09:31:51 +0100
> Hans Verkuil  escreveu:
> 
>> This patches fixes the following compilation warnings and errors if
>> CONFIG_MEDIA_CONTROLLER_DVB is not defined:
>>
>> drivers/media/common/siano/smsdvb-main.c: In function 
>> ‘smsdvb_media_device_unregister’:
>> drivers/media/common/siano/smsdvb-main.c:614:27: warning: unused variable 
>> ‘coredev’ [-Wunused-variable]
>>   struct smscore_device_t *coredev = client->coredev;
>>^
>> drivers/media/common/siano/smsdvb-main.c: In function ‘smsdvb_hotplug’:
>> drivers/media/common/siano/smsdvb-main.c:1188:32: error: ‘struct 
>> smscore_device_t’ has no member named ‘media_dev’
>>   dvb_create_media_graph(coredev->media_dev);
>> ^
>> drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function 
>> ‘dvb_usb_adapter_frontend_init’:
>> drivers/media/usb/dvb-usb/dvb-usb-dvb.c:323:39: error: ‘struct dvb_adapter’ 
>> has no member named ‘mdev’
>>   dvb_create_media_graph(adap->dvb_adap.mdev);
>>^
>> drivers/media/usb/dvb-usb/dvb-usb-dvb.c: At top level:
>> drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: 
>> ‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
>>  static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
>>  ^
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
>> ‘dvb_usbv2_adapter_dvb_exit’:
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable 
>> ‘d’ [-Wunused-variable]
>>   struct dvb_usb_device *d = adap_to_d(adap);
>>  ^
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
>> ‘dvb_usbv2_adapter_frontend_init’:
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:705:39: error: ‘struct 
>> dvb_adapter’ has no member named ‘mdev’
>>   dvb_create_media_graph(adap->dvb_adap.mdev);
>>^
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: At top level:
>> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: 
>> ‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
>>  static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)
>>  ^
>>
>> Signed-off-by: Hans Verkuil 
>>
>> diff --git a/drivers/media/common/siano/smsdvb-main.c 
>> b/drivers/media/common/siano/smsdvb-main.c
>> index dd3c151..28f764d 100644
>> --- a/drivers/media/common/siano/smsdvb-main.c
>> +++ b/drivers/media/common/siano/smsdvb-main.c
>> @@ -611,9 +611,9 @@ static int smsdvb_onresponse(void *context, struct 
>> smscore_buffer_t *cb)
>>  
>>  static void smsdvb_media_device_unregister(struct smsdvb_client_t *client)
>>  {
>> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>>  struct smscore_device_t *coredev = client->coredev;
>>  
>> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>>  if (!coredev->media_dev)
>>  return;
>>  media_device_unregister(coredev->media_dev);
>> @@ -1185,7 +1185,9 @@ static int smsdvb_hotplug(struct smscore_device_t 
>> *coredev,
>>  if (smsdvb_debugfs_create(client) < 0)
>>  pr_info("failed to create debugfs node\n");
>>  
>> +#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
>>  dvb_create_media_graph(coredev->media_dev);
>> +#endif
> 
> Nah, adding more ifs here is not a good idea. I'll create a stub for 
> dvb_create_media_graph() if media controller is not found. I'll need to
> change the arguments, but this is likely needed anyway, in order to
> better support multi-adapter boards.

No problem. This was a quick 'n dirty patch to get things to compile :-)

Regards,

Hans

> 
>>  
>>  pr_info("DVB interface registered.\n");
>>  return 0;
>> diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
>> b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
>> index 0666c8f..caf7fd9 100644
>> --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
>> +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
>> @@ -400,9 +400,9 @@ skip_feed_stop:
>>  return ret;
>>  }
>>  
>> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>>  static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)
>>  {
>> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>>  struct media_device *mdev;
>>  struct dvb_usb_device *d = adap_to_d(adap);
>>  struct usb_device *udev = d->udev;
>> @@ -433,8 +433,8 @@ static void dvb_usbv2_media_device_register(struct 
>> dvb_usb_adapter *adap)
>>  
>>  dev_info(&d->udev->dev, "media controller created\n");
>>  
>> -#endif
>>  }
>> +#endif
> 
> Nah, the best is to remove the "if" before calling 
> dvb_usbv2_media_device_register().
> 
> I have already two patches fixing the errors/warnings when compiling
> without the media controller.
> 
> I'll submit them in a few.
> 
> Thanks,
> Mauro
> 
>>  
>>  static void dvb_usbv2_media_device_unregister(struct dvb_usb_adapter *adap)
>>  {
>> @@ -528,8 +528,6 @@ err_dvb_register_adapter:
>>  
>>  static int dvb_usbv2

[PATCH 2/2] [media] dvb: Avoid warnings when compiled without the media controller

2015-03-02 Thread Mauro Carvalho Chehab
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
‘dvb_usbv2_adapter_dvb_exit’:
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable 
‘d’ [-Wunused-variable]
  struct dvb_usb_device *d = adap_to_d(adap);
 ^
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: 
‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)

drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: 
‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
 static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
 ^

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index 387db145d37e..c739725ca7ee 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -611,9 +611,9 @@ static int smsdvb_onresponse(void *context, struct 
smscore_buffer_t *cb)
 
 static void smsdvb_media_device_unregister(struct smsdvb_client_t *client)
 {
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
struct smscore_device_t *coredev = client->coredev;
 
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
if (!coredev->media_dev)
return;
media_device_unregister(coredev->media_dev);
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 08a3cd1c8b44..8bd08ba4f869 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -467,9 +467,7 @@ static int dvb_usbv2_adapter_dvb_init(struct 
dvb_usb_adapter *adap)
 
adap->dvb_adap.priv = adap;
 
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
dvb_usbv2_media_device_register(adap);
-#endif
 
if (d->props->read_mac_address) {
ret = d->props->read_mac_address(adap,
@@ -528,8 +526,6 @@ err_dvb_register_adapter:
 
 static int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
 {
-   struct dvb_usb_device *d = adap_to_d(adap);
-
dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
adap->id);
 
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c 
b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index 6c9f5ecf949c..980d976960d9 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -153,9 +153,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, 
short *adapter_nums)
}
adap->dvb_adap.priv = adap;
 
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
dvb_usb_media_device_register(adap);
-#endif
 
if (adap->dev->props.read_mac_address) {
if 
(adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0)
-- 
2.1.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 1/2] [media] dvbdev: use adapter arg for dvb_create_media_graph()

2015-03-02 Thread Mauro Carvalho Chehab
Instead of using media_dev argument for dvb_create_media_graph(),
use the adapter.

That allows to create a stub for this function, if compiled
without DVB support, avoiding to add extra if's at the drivers.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/common/siano/smsdvb-main.c 
b/drivers/media/common/siano/smsdvb-main.c
index dd3c1516013f..387db145d37e 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1185,7 +1185,7 @@ static int smsdvb_hotplug(struct smscore_device_t 
*coredev,
if (smsdvb_debugfs_create(client) < 0)
pr_info("failed to create debugfs node\n");
 
-   dvb_create_media_graph(coredev->media_dev);
+   dvb_create_media_graph(&client->adapter);
 
pr_info("DVB interface registered.\n");
return 0;
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 0af9d0c5f889..13bb57f0457f 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -381,9 +381,10 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
 EXPORT_SYMBOL(dvb_unregister_device);
 
 
-void dvb_create_media_graph(struct media_device *mdev)
-{
 #ifdef CONFIG_MEDIA_CONTROLLER_DVB
+void dvb_create_media_graph(struct dvb_adapter *adap)
+{
+   struct media_device *mdev = adap->mdev;
struct media_entity *entity, *tuner = NULL, *fe = NULL;
struct media_entity *demux = NULL, *dvr = NULL, *ca = NULL;
 
@@ -421,9 +422,9 @@ void dvb_create_media_graph(struct media_device *mdev)
 
if (demux && ca)
media_entity_create_link(demux, 1, ca, 0, MEDIA_LNK_FL_ENABLED);
-#endif
 }
 EXPORT_SYMBOL_GPL(dvb_create_media_graph);
+#endif
 
 static int dvbdev_check_free_adapter_num(int num)
 {
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 467c1311bd4c..caf4d4791a8b 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -122,7 +122,12 @@ extern int dvb_register_device (struct dvb_adapter *adap,
int type);
 
 extern void dvb_unregister_device (struct dvb_device *dvbdev);
-void dvb_create_media_graph(struct media_device *mdev);
+
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
+void dvb_create_media_graph(struct dvb_adapter *adap);
+#else
+static inline void dvb_create_media_graph(struct dvb_adapter *adap) {};
+#endif
 
 extern int dvb_generic_open (struct inode *inode, struct file *file);
 extern int dvb_generic_release (struct inode *inode, struct file *file);
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 44229a2c2d32..8bf2baae387f 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -540,9 +540,8 @@ static int register_dvb(struct cx231xx_dvb *dvb,
 
/* register network adapter */
dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx);
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-   dvb_create_media_graph(dev->media_dev);
-#endif
+   dvb_create_media_graph(&dvb->adapter);
+
return 0;
 
 fail_fe_conn:
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 0666c8f33ac7..08a3cd1c8b44 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -702,7 +702,7 @@ static int dvb_usbv2_adapter_frontend_init(struct 
dvb_usb_adapter *adap)
}
}
 
-   dvb_create_media_graph(adap->dvb_adap.mdev);
+   dvb_create_media_graph(&adap->dvb_adap);
 
return 0;
 
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c 
b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
index a7bc4535c58f..6c9f5ecf949c 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c
@@ -320,7 +320,7 @@ int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter 
*adap)
adap->num_frontends_initialized++;
}
 
-   dvb_create_media_graph(adap->dvb_adap.mdev);
+   dvb_create_media_graph(&adap->dvb_adap);
 
return 0;
 }
-- 
2.1.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] dvb: fix compilation errors/warnings ifndef CONFIG_MEDIA_CONTROLLER_DVB

2015-03-02 Thread Mauro Carvalho Chehab
Em Fri, 27 Feb 2015 09:31:51 +0100
Hans Verkuil  escreveu:

> This patches fixes the following compilation warnings and errors if
> CONFIG_MEDIA_CONTROLLER_DVB is not defined:
> 
> drivers/media/common/siano/smsdvb-main.c: In function 
> ‘smsdvb_media_device_unregister’:
> drivers/media/common/siano/smsdvb-main.c:614:27: warning: unused variable 
> ‘coredev’ [-Wunused-variable]
>   struct smscore_device_t *coredev = client->coredev;
>^
> drivers/media/common/siano/smsdvb-main.c: In function ‘smsdvb_hotplug’:
> drivers/media/common/siano/smsdvb-main.c:1188:32: error: ‘struct 
> smscore_device_t’ has no member named ‘media_dev’
>   dvb_create_media_graph(coredev->media_dev);
> ^
> drivers/media/usb/dvb-usb/dvb-usb-dvb.c: In function 
> ‘dvb_usb_adapter_frontend_init’:
> drivers/media/usb/dvb-usb/dvb-usb-dvb.c:323:39: error: ‘struct dvb_adapter’ 
> has no member named ‘mdev’
>   dvb_create_media_graph(adap->dvb_adap.mdev);
>^
> drivers/media/usb/dvb-usb/dvb-usb-dvb.c: At top level:
> drivers/media/usb/dvb-usb/dvb-usb-dvb.c:97:13: warning: 
> ‘dvb_usb_media_device_register’ defined but not used [-Wunused-function]
>  static void dvb_usb_media_device_register(struct dvb_usb_adapter *adap)
>  ^
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
> ‘dvb_usbv2_adapter_dvb_exit’:
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:531:25: warning: unused variable 
> ‘d’ [-Wunused-variable]
>   struct dvb_usb_device *d = adap_to_d(adap);
>  ^
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: In function 
> ‘dvb_usbv2_adapter_frontend_init’:
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:705:39: error: ‘struct 
> dvb_adapter’ has no member named ‘mdev’
>   dvb_create_media_graph(adap->dvb_adap.mdev);
>^
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c: At top level:
> drivers/media/usb/dvb-usb-v2/dvb_usb_core.c:403:13: warning: 
> ‘dvb_usbv2_media_device_register’ defined but not used [-Wunused-function]
>  static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)
>  ^
> 
> Signed-off-by: Hans Verkuil 
> 
> diff --git a/drivers/media/common/siano/smsdvb-main.c 
> b/drivers/media/common/siano/smsdvb-main.c
> index dd3c151..28f764d 100644
> --- a/drivers/media/common/siano/smsdvb-main.c
> +++ b/drivers/media/common/siano/smsdvb-main.c
> @@ -611,9 +611,9 @@ static int smsdvb_onresponse(void *context, struct 
> smscore_buffer_t *cb)
>  
>  static void smsdvb_media_device_unregister(struct smsdvb_client_t *client)
>  {
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>   struct smscore_device_t *coredev = client->coredev;
>  
> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>   if (!coredev->media_dev)
>   return;
>   media_device_unregister(coredev->media_dev);
> @@ -1185,7 +1185,9 @@ static int smsdvb_hotplug(struct smscore_device_t 
> *coredev,
>   if (smsdvb_debugfs_create(client) < 0)
>   pr_info("failed to create debugfs node\n");
>  
> +#if defined(CONFIG_MEDIA_CONTROLLER_DVB)
>   dvb_create_media_graph(coredev->media_dev);
> +#endif

Nah, adding more ifs here is not a good idea. I'll create a stub for 
dvb_create_media_graph() if media controller is not found. I'll need to
change the arguments, but this is likely needed anyway, in order to
better support multi-adapter boards.

>  
>   pr_info("DVB interface registered.\n");
>   return 0;
> diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
> b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> index 0666c8f..caf7fd9 100644
> --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
> @@ -400,9 +400,9 @@ skip_feed_stop:
>   return ret;
>  }
>  
> +#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>  static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)
>  {
> -#ifdef CONFIG_MEDIA_CONTROLLER_DVB
>   struct media_device *mdev;
>   struct dvb_usb_device *d = adap_to_d(adap);
>   struct usb_device *udev = d->udev;
> @@ -433,8 +433,8 @@ static void dvb_usbv2_media_device_register(struct 
> dvb_usb_adapter *adap)
>  
>   dev_info(&d->udev->dev, "media controller created\n");
>  
> -#endif
>  }
> +#endif

Nah, the best is to remove the "if" before calling 
dvb_usbv2_media_device_register().

I have already two patches fixing the errors/warnings when compiling
without the media controller.

I'll submit them in a few.

Thanks,
Mauro

>  
>  static void dvb_usbv2_media_device_unregister(struct dvb_usb_adapter *adap)
>  {
> @@ -528,8 +528,6 @@ err_dvb_register_adapter:
>  
>  static int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
>  {
> - struct dvb_usb_device *d = adap_to_d(adap);
> -
>   dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
>   adap->id);
>  
> @@ -702,7 +700,9 @@ static int dvb_usbv2_adapter_frontend_init(struct

Re: 0.led_name 2.other.led.name in /sysfs Re: [PATCH/RFC v11 01/20] leds: flash: document sysfs interface

2015-03-02 Thread Jacek Anaszewski

On 03/02/2015 01:54 PM, Sakari Ailus wrote:

Hi Jacek,

On Fri, Feb 27, 2015 at 03:34:22PM +0100, Jacek Anaszewski wrote:

Hi Sakari,

On 02/21/2015 11:57 AM, Sakari Ailus wrote:

Hi Pavel and Greg,

On Fri, Feb 20, 2015 at 09:57:38PM +0100, Pavel Machek wrote:

On Fri 2015-02-20 07:36:16, Greg KH wrote:

On Fri, Feb 20, 2015 at 08:56:11AM +0100, Jacek Anaszewski wrote:

On 02/19/2015 10:40 PM, Greg KH wrote:

On Thu, Feb 19, 2015 at 11:02:04AM +0200, Sakari Ailus wrote:

On Wed, Feb 18, 2015 at 11:47:47PM +0100, Pavel Machek wrote:


On Wed 2015-02-18 17:20:22, Jacek Anaszewski wrote:

Add a documentation of LED Flash class specific sysfs attributes.

Signed-off-by: Jacek Anaszewski 
Acked-by: Kyungmin Park 
Cc: Bryan Wu 
Cc: Richard Purdie 


NAK-ed-by: Pavel Machek


+What:  /sys/class/leds//available_sync_leds
+Date:  February 2015
+KernelVersion: 3.20
+Contact:   Jacek Anaszewski 
+Description:   read/write
+   Space separated list of LEDs available for flash strobe
+   synchronization, displayed in the format:
+
+   led1_id.led1_name led2_id.led2_name led3_id.led3_name etc.


Multiple values per file, with all the problems we had in /proc. I
assume led_id is an integer? What prevents space or dot in led name?


Very good point. How about using a newline instead? That'd be a little bit
easier to parse, too.


No, please make it one value per-file, which is what sysfs requires.


The purpose of this attribute is only to provide an information about
the range of valid identifiers that can be written to the
flash_sync_strobe attribute. Wouldn't splitting this to many attributes
be an unnecessary inflation of sysfs files?


Ok a list of allowed values to write is acceptable, as long as it is not
hard to parse and always is space separated.


Well, this one is list of LED numbers and LED names.


It'd be nice if these names would match the V4L2 sub-device names. We don't


 From the discussion on IRC it turned out that one of components of the
V4L2 sub-device name will be a media controller identifier.

This implies that if support for V4L2 Flash devices will be turned off
in the kernel config the LED name will have to differ from the case
when the support is on. I think that this is undesired.


Well... the media entity names need to be unique in the Media controller
device. In the future we may have just a single Media controller device in
the system, possibly depending on the driver so that some drivers can make
use of that while some will have one on their own, mostly older drivers that
is.

I think what Laurent proposed to refer to an ID was the hardware device, so
that in the future the hardware device / media entity name would be unique.
That'd be a much more manageable and easier to verify for correctness than a
global name that is defined by a driver.

Older drivers wouldn't be affected. Old user space might not work with new
drivers without taking the hwdev field into account.

So the hwdev (name or ID) would be part of the struct media_entity_desc, but
*not* a part of the name field in the struct.


The origin of this discussion was your statement:

>>> It'd be nice if these names would match the V4L2 sub-device names.
>>> We don't have any rules for them other than they must be unique,
>>> and there's the established practice that an I2C address follows
>>> the component name.

Has the naming scheme been already agreed?



Cc Laurent and Hans.


have any rules for them other than they must be unique, and there's the
established practice that an I2C address follows the component name. We're
about to discuss the matter on Monday on #v4l (11:00 Finnish time), but I
don't think we can generally guarantee any of the names won't have spaces.



Separate files, then?


I tried to split this to separate files but it turned out to be awkward.
Since the number of LEDs to synchronize can vary from device to device,
the number of the related sysfs attributes cannot be fixed.

As far as I know allocating the sysfs attributes dynamically is unsafe,


How so? I think most implementations use static variables because that's all
they need.


I was thinking about the need for freeing the memory allocated for
attributes on remove and races with udev.


and thus the maximum allowed number of synchronized LEDs would have to
be agreed on for the whole led-class-flash and the relevant number of
similar struct attribute instances and related callbacks would have to
be created statically for every LED Flash class device, no matter if
a device would need them.


This could be handled in the framework instead.


Of course the relevant sysfs group could be initialized only with
the needed number of sync leds attributes, but still this is less
than optimal design.

It looks like this interface indeed doesn't fit for sysfs.

I am leaning towards removing the support for synchronized flash LEDs
from the LED subsystem entirely and leave it only to V4L2.


Perfectly fine

[PULL fixes for 4.0]: gspca build fixes

2015-03-02 Thread Hans de Goede

Hi Mauro,

Here is a small build-fix for gspca for 4.0.

The following changes since commit a3dfc6d925ca1bbd1a228253acb93f08657bad25:

  [media] dvb-usb: create one media_dev per adapter (2015-02-26 09:52:26 -0300)

are available in the git repository at:

  git://linuxtv.org/hgoede/gspca.git media-for_v4.0

for you to fetch changes up to 4bc25799cb52f3e5f3084adb7be8cd2186905282:

  media: fix gspca drivers build dependencies (2015-03-02 14:23:49 +0100)


Randy Dunlap (1):
  media: fix gspca drivers build dependencies

 drivers/media/usb/gspca/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Thanks & Regards,

Hans
--
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: 0.led_name 2.other.led.name in /sysfs Re: [PATCH/RFC v11 01/20] leds: flash: document sysfs interface

2015-03-02 Thread Sakari Ailus
Hi Jacek,

On Fri, Feb 27, 2015 at 03:34:22PM +0100, Jacek Anaszewski wrote:
> Hi Sakari,
> 
> On 02/21/2015 11:57 AM, Sakari Ailus wrote:
> >Hi Pavel and Greg,
> >
> >On Fri, Feb 20, 2015 at 09:57:38PM +0100, Pavel Machek wrote:
> >>On Fri 2015-02-20 07:36:16, Greg KH wrote:
> >>>On Fri, Feb 20, 2015 at 08:56:11AM +0100, Jacek Anaszewski wrote:
> On 02/19/2015 10:40 PM, Greg KH wrote:
> >On Thu, Feb 19, 2015 at 11:02:04AM +0200, Sakari Ailus wrote:
> >>On Wed, Feb 18, 2015 at 11:47:47PM +0100, Pavel Machek wrote:
> >>>
> >>>On Wed 2015-02-18 17:20:22, Jacek Anaszewski wrote:
> Add a documentation of LED Flash class specific sysfs attributes.
> 
> Signed-off-by: Jacek Anaszewski 
> Acked-by: Kyungmin Park 
> Cc: Bryan Wu 
> Cc: Richard Purdie 
> >>>
> >>>NAK-ed-by: Pavel Machek
> >>>
> +What:/sys/class/leds//available_sync_leds
> +Date:February 2015
> +KernelVersion:   3.20
> +Contact: Jacek Anaszewski 
> +Description: read/write
> + Space separated list of LEDs available for flash strobe
> + synchronization, displayed in the format:
> +
> + led1_id.led1_name led2_id.led2_name led3_id.led3_name 
> etc.
> >>>
> >>>Multiple values per file, with all the problems we had in /proc. I
> >>>assume led_id is an integer? What prevents space or dot in led name?
> >>
> >>Very good point. How about using a newline instead? That'd be a little 
> >>bit
> >>easier to parse, too.
> >
> >No, please make it one value per-file, which is what sysfs requires.
> 
> The purpose of this attribute is only to provide an information about
> the range of valid identifiers that can be written to the
> flash_sync_strobe attribute. Wouldn't splitting this to many attributes
> be an unnecessary inflation of sysfs files?
> >>>
> >>>Ok a list of allowed values to write is acceptable, as long as it is not
> >>>hard to parse and always is space separated.
> >>
> >>Well, this one is list of LED numbers and LED names.
> >
> >It'd be nice if these names would match the V4L2 sub-device names. We don't
> 
> From the discussion on IRC it turned out that one of components of the
> V4L2 sub-device name will be a media controller identifier.
> 
> This implies that if support for V4L2 Flash devices will be turned off
> in the kernel config the LED name will have to differ from the case
> when the support is on. I think that this is undesired.

Well... the media entity names need to be unique in the Media controller
device. In the future we may have just a single Media controller device in
the system, possibly depending on the driver so that some drivers can make
use of that while some will have one on their own, mostly older drivers that
is.

I think what Laurent proposed to refer to an ID was the hardware device, so
that in the future the hardware device / media entity name would be unique.
That'd be a much more manageable and easier to verify for correctness than a
global name that is defined by a driver.

Older drivers wouldn't be affected. Old user space might not work with new
drivers without taking the hwdev field into account.

So the hwdev (name or ID) would be part of the struct media_entity_desc, but
*not* a part of the name field in the struct.

Cc Laurent and Hans.

> >have any rules for them other than they must be unique, and there's the
> >established practice that an I2C address follows the component name. We're
> >about to discuss the matter on Monday on #v4l (11:00 Finnish time), but I
> >don't think we can generally guarantee any of the names won't have spaces.
> 
> >Separate files, then?
> 
> I tried to split this to separate files but it turned out to be awkward.
> Since the number of LEDs to synchronize can vary from device to device,
> the number of the related sysfs attributes cannot be fixed.
> 
> As far as I know allocating the sysfs attributes dynamically is unsafe,

How so? I think most implementations use static variables because that's all
they need.

> and thus the maximum allowed number of synchronized LEDs would have to
> be agreed on for the whole led-class-flash and the relevant number of
> similar struct attribute instances and related callbacks would have to
> be created statically for every LED Flash class device, no matter if
> a device would need them.

This could be handled in the framework instead.

> Of course the relevant sysfs group could be initialized only with
> the needed number of sync leds attributes, but still this is less
> than optimal design.
> 
> It looks like this interface indeed doesn't fit for sysfs.
> 
> I am leaning towards removing the support for synchronized flash LEDs
> from the LED subsystem entirely and leave it only to V4L2.

Perfectly fine for me as well, I guess the synchronised strobe has mostl

Re: [PATCH V2 0/8] [media] exynos-gsc: Fixup PM support

2015-03-02 Thread Ulf Hansson
On 19 January 2015 at 14:22, Ulf Hansson  wrote:
> Changes in v2:
> - Rebase patches.
> - Adapt to changes for the PM core. Especially, the Kconfig option for
>   CONFIG_PM_RUNTIME has been removed and the runtime PM core is now
>   build for CONFIG_PM.
>
> This patchset fixup the PM support and adds some minor improvements to
> potentially save some more power at runtime PM suspend.
>
>
> Ulf Hansson (8):
>   [media] exynos-gsc: Simplify clock management
>   [media] exynos-gsc: Convert gsc_m2m_resume() from int to void
>   [media] exynos-gsc: Make driver functional when CONFIG_PM is unset
>   [media] exynos-gsc: Make runtime PM callbacks available for CONFIG_PM
>   [media] exynos-gsc: Fixup clock management at ->remove()
>   [media] exynos-gsc: Do full clock gating at runtime PM suspend
>   [media] exynos-gsc: Make system PM callbacks available for
> CONFIG_PM_SLEEP
>   [media] exynos-gsc: Simplify system PM
>
>  drivers/media/platform/exynos-gsc/gsc-core.c | 183 
> +++
>  drivers/media/platform/exynos-gsc/gsc-core.h |   3 -
>  2 files changed, 72 insertions(+), 114 deletions(-)
>
> --
> 1.9.1
>

I guess you guys have been busy, but it would be nice to get some
feedback of these patches.

Kind regards
Uffe
--
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: SMS / DVB / media_graph issue - tip fails to compile

2015-03-02 Thread Mauro Carvalho Chehab
Em Sun, 1 Mar 2015 14:09:53 -0500
Steven Toth  escreveu:

> Someone broke tip.

The quick solution is to enable MEDIA_CONTROLLER_DVB.

Hans sent already a fix patch, but I think that the best is to solve
it on a different way.

I'll be preparing a patch for it latter, likely today.

> 
>   CC [M]  drivers/media/common/siano/smsdvb-main.o
> drivers/media/common/siano/smsdvb-main.c: In function
> ‘smsdvb_media_device_unregister’:
> drivers/media/common/siano/smsdvb-main.c:614:27: warning: unused
> variable ‘coredev’ [-Wunused-variable]
>   struct smscore_device_t *coredev = client->coredev;
>^
> 
> drivers/media/common/siano/smsdvb-main.c: In function ‘smsdvb_hotplug’:
> drivers/media/common/siano/smsdvb-main.c:1188:32: error: ‘struct
> smscore_device_t’ has no member named ‘media_dev’
>   dvb_create_media_graph(coredev->media_dev);
> ^
> 
> make[4]: *** [drivers/media/common/siano/smsdvb-main.o] Error 1
> make[3]: *** [drivers/media/common/siano] Error 2
> make[2]: *** [drivers/media/common] Error 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


Re: [PATCH 1/7] v4l2-subdev: replace v4l2_subdev_fh by v4l2_subdev_pad_config

2015-03-02 Thread Sakari Ailus
On Fri, Feb 13, 2015 at 12:30:00PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> If a subdevice pad op is called from a bridge driver, then there is
> no v4l2_subdev_fh struct that can be passed to the subdevice. This
> made it hard to use such subdevs from a bridge driver.
> 
> This patch replaces the v4l2_subdev_fh pointer by a v4l2_subdev_pad_config
> pointer in the pad ops. This allows bridge drivers to use the various
> try_ pad ops by creating a v4l2_subdev_pad_config struct and passing it
> along to the pad op.
> 
> The v4l2_subdev_get_try_* macros had to be changed because of this, so
> I also took the opportunity to use the full name of the v4l2_subdev_get_try_*
> functions in the __V4L2_SUBDEV_MK_GET_TRY macro arguments: if you now do
> 'git grep v4l2_subdev_get_try_format' you will actually find the header
> where it is defined.
> 
> One remark regarding the drivers/staging/media/davinci_vpfe patches: the
> *_init_formats() functions assumed that fh could be NULL. However, that's
> not true for this driver, it's always set. This is almost certainly a copy
> and paste from the omap3isp driver. I've updated the code to reflect the
> fact that fh is never NULL.
> 
> Signed-off-by: Hans Verkuil 
> Cc: Lad, Prabhakar 

Thanks! For smiapp:

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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