Re: [PATCH V5 7/7] dt-bindings: add document for dw-hdmi
Nice work. This patch should move the binding from Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt to the location instead of making a new file and leaving the old one in place. And use git format-patch -M to highlight any changes. Regards ZubairLK On 08/11/14 05:32, Andy Yan wrote: > Signed-off-by: Andy Yan > --- > .../devicetree/bindings/drm/bridge/dw-hdmi.txt | 38 > ++ > 1 file changed, 38 insertions(+) > create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt > > diff --git a/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt > b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt > new file mode 100644 > index 000..aa7ed17 > --- /dev/null > +++ b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt > @@ -0,0 +1,38 @@ > +DesignWare HDMI bridge bindings > + > +Required properities: > +- compatibel: platform specific such as "fsl,imx6q-hdmi","fsl,imx6dl-hdmi" > + "rockchip,rk3288-dw-hdmi" > +- reg: physical base address of the controller and length > +- ddc-i2c-bus: the ddc i2c bus > +- interrupts: The interrupt number to the cpu > + > +Optional properties > +- reg-io-width: the width of the reg:1,4, default set to 1 if not present > + > +Example: > + hdmi: hdmi@012 { > + compatible = "fsl,imx6q-hdmi"; > + reg = <0x0012 0x9000>; > + interrupts = <0 115 0x04>; > + gpr = <&gpr>; > + clocks = <&clks 123>, <&clks 124>; > + clock-names = "iahb", "isfr"; > + ddc-i2c-bus = <&i2c2>; > + > + port@0 { > + reg = <0>; > + > + hdmi_mux_0: endpoint { > + remote-endpoint = <&ipu1_di0_hdmi>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + > + hdmi_mux_1: endpoint { > + remote-endpoint = <&ipu1_di1_hdmi>; > + }; > + }; > + }; > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 3/7] dw-hdmi: make checkpatch happy
Hi Andy, In 3.18 rc4, I cannot find checkpatch errors in imx-hdmi.c Have these errors come during the previous 2 patches. If yes, then these changes need to be squashed into the previous patches. No patch should add a checkpatch error and then fix it in a later patch. Regards ZubairLK On 08/11/14 05:29, Andy Yan wrote: > CHECK: Alignment should match open parenthesis > + if ((hdmi->vic == 10) || (hdmi->vic == 11) || > + (hdmi->vic == 12) || (hdmi->vic == 13) || > > CHECK: braces {} should be used on all arms of this statement > + if (hdmi->hdmi_data.video_mode.mdvi) > [...] > + else { > [...] > > Signed-off-by: Andy Yan > --- > drivers/gpu/drm/bridge/dw_hdmi.c | 97 > > 1 file changed, 48 insertions(+), 49 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 3/7] dw-hdmi: make checkpatch happy
Hi ZubairLK: On 2014年11月10日 17:22, Zubair Lutfullah Kakakhel wrote: Hi Andy, In 3.18 rc4, I cannot find checkpatch errors in imx-hdmi.c Have these errors come during the previous 2 patches. If yes, then these changes need to be squashed into the previous patches. No patch should add a checkpatch error and then fix it in a later patch. Regards ZubairLK i use checkpatch with --subjective On 08/11/14 05:29, Andy Yan wrote: CHECK: Alignment should match open parenthesis + if ((hdmi->vic == 10) || (hdmi->vic == 11) || + (hdmi->vic == 12) || (hdmi->vic == 13) || CHECK: braces {} should be used on all arms of this statement + if (hdmi->hdmi_data.video_mode.mdvi) [...] + else { [...] Signed-off-by: Andy Yan --- drivers/gpu/drm/bridge/dw_hdmi.c | 97 1 file changed, 48 insertions(+), 49 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 3/7] dw-hdmi: make checkpatch happy
Hi ZubairLK: On 2014年11月10日 17:22, Zubair Lutfullah Kakakhel wrote: Hi Andy, In 3.18 rc4, I cannot find checkpatch errors in imx-hdmi.c Have these errors come during the previous 2 patches. If yes, then these changes need to be squashed into the previous patches. No patch should add a checkpatch error and then fix it in a later patch. Regards ZubairLK I use checkpatch with --subjective On 08/11/14 05:29, Andy Yan wrote: CHECK: Alignment should match open parenthesis + if ((hdmi->vic == 10) || (hdmi->vic == 11) || + (hdmi->vic == 12) || (hdmi->vic == 13) || CHECK: braces {} should be used on all arms of this statement + if (hdmi->hdmi_data.video_mode.mdvi) [...] + else { [...] Signed-off-by: Andy Yan --- drivers/gpu/drm/bridge/dw_hdmi.c | 97 1 file changed, 48 insertions(+), 49 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: Inconsistent lock state with Hyper-V memory balloon?
> -Original Message- > From: Peter Zijlstra [mailto:pet...@infradead.org] > Sent: Monday, November 10, 2014 1:44 AM > To: Sitsofe Wheeler > Cc: KY Srinivasan; Haiyang Zhang; de...@linuxdriverproject.org; Ingo Molnar; > linux-ker...@vger.kernel.org > Subject: Re: Inconsistent lock state with Hyper-V memory balloon? > > On Sat, Nov 08, 2014 at 02:36:54PM +, Sitsofe Wheeler wrote: > > I've been trying to use the Hyper-V balloon driver to allow the host > > to reclaim unused memory but have been hitting issues. With a Hyper-V > > 2012 > > R2 guest with 4GBytes of RAM, dynamic memory on, 1GByte minimum > > 10GByte maximum, 8 vcpus, running a 3.18.0-rc3 kernel with no swap > > configured the following lockdep splat occurred: > > > > = > > [ INFO: inconsistent lock state ] > > 3.18.0-rc3.x86_64 #159 Not tainted > > - > > inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. > > swapper/0/0 [HC0[0]:SC1[1]:HE1:SE0] takes: > > (bdev_lock){+.?...}, at: [] > > nr_blockdev_pages+0x1c/0x80 {SOFTIRQ-ON-W} state was registered at: > > [] __lock_acquire+0x87d/0x1c60 > > [] lock_acquire+0xfc/0x150 > > [] _raw_spin_lock+0x39/0x50 > > [] nr_blockdev_pages+0x1c/0x80 > > [] si_meminfo+0x47/0x70 > > [] eventpoll_init+0x11/0x10a > > [] do_one_initcall+0xf9/0x1a7 > > [] kernel_init_freeable+0x1d4/0x268 > > [] kernel_init+0xe/0x100 > > [] ret_from_fork+0x7c/0xb0 irq event stamp: > > 2660283708 hardirqs last enabled at (2660283708): > > [] free_hot_cold_page+0x175/0x190 hardirqs last > > disabled at (2660283707): [] > > free_hot_cold_page+0xa5/0x190 softirqs last enabled at (2660132034): > > [] _local_bh_enable+0x4a/0x50 softirqs last disabled > > at (2660132035): [] irq_exit+0x58/0xc0 > > > > might help us debug this: > > Possible unsafe locking scenario: > > > >CPU0 > > > > lock(bdev_lock); > > > > lock(bdev_lock); > > > > * > > > > no locks held by swapper/0/0. > > > > > > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.18.0-rc3.x86_64 #159 > > Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, > > BIOS 090006 05/23/2012 > > 8266ac90 880107403af8 816db3ef > > 81c134c0 880107403b58 816d6fd3 0001 > > 0001 8801 81010e6f 0046 > > Call Trace: > >[] dump_stack+0x4e/0x68 > > [] print_usage_bug+0x1f3/0x204 [] > > ? save_stack_trace+0x2f/0x50 [] ? > > print_irq_inversion_bug+0x200/0x200 > > [] mark_lock+0x176/0x2e0 [] > > __lock_acquire+0x7c3/0x1c60 [] ? > > lookup_address+0x28/0x30 [] ? > > _lookup_address_cpa.isra.3+0x3b/0x40 > > [] ? __debug_check_no_obj_freed+0x89/0x220 > > [] lock_acquire+0xfc/0x150 [] ? > > nr_blockdev_pages+0x1c/0x80 [] > > _raw_spin_lock+0x39/0x50 [] ? > > nr_blockdev_pages+0x1c/0x80 [] > > nr_blockdev_pages+0x1c/0x80 [] > si_meminfo+0x47/0x70 > > [] post_status.isra.3+0x6d/0x190 > > [] ? trace_hardirqs_on+0xd/0x10 > > [] ? __free_pages+0x2f/0x60 [] ? > > free_balloon_pages.isra.5+0x8f/0xb0 > > [] balloon_onchannelcallback+0x212/0x380 > > [] vmbus_on_event+0x173/0x1d0 [] > > tasklet_action+0x127/0x160 [] > > __do_softirq+0x18a/0x340 [] irq_exit+0x58/0xc0 > > [] hyperv_vector_handler+0x45/0x60 > > [] hyperv_callback_vector+0x72/0x80 > > [] ? native_safe_halt+0x6/0x10 [] > > ? trace_hardirqs_on+0xd/0x10 [] > > default_idle+0x51/0xf0 [] arch_cpu_idle+0xf/0x20 > > [] cpu_startup_entry+0x217/0x3f0 > > [] rest_init+0xc9/0xd0 [] ? > > rest_init+0x5/0xd0 [] start_kernel+0x438/0x445 > > [] ? set_init_arg+0x57/0x57 [] ? > > early_idt_handlers+0x120/0x120 [] > > x86_64_start_reservations+0x2a/0x2c > > [] x86_64_start_kernel+0x13e/0x14d > > > > Any help deciphering the above is greatly appreciated! > > Its fairly simple, the first trace shows where bdev_lock was taken with > softirqs enabled, and the second trace shows where its taken from softirqs. > Combine the two and you've got a recursive deadlock. > > I don't know the block layer very well, but a quick glance at the code shows > its bdev_lock isn't meant to be used from softirq context, therefore the > hyperv stuff is broken. > > So complain to the hyperv people. Sitsofe, I am on vacation in India till the the 17th of November. I will look at this and fix this issue when I get back. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 7/7] dt-bindings: add document for dw-hdmi
On 10/11/14 09:44, Andy Yan wrote: > Hi ZubairLK > On 2014年11月10日 17:17, Zubair Lutfullah Kakakhel wrote: >> Nice work. >> >> This patch should move the binding from >> >> Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt >> to the location instead of making a new file and leaving the old >> one in place. >> >> And use git format-patch -M to highlight any changes. >> >> Regards >> ZubairLK >I add these bindings for dw-hdmi core, because > properities like reg, interrupts, ddc-i2c-bus, reg-io-width are used > by dw-hdmi core, but properities like compatible, gpr,clk, are platform > specific , they are handled by the platform code like dw_hdmi-imx.c > and described in platform specific dt binds like /imx-drm/hdmi.txt I understand. Are there any changes to imx-drm/hdmi.txt? Some properties for imx-drm/hdmi.txt would become optional/inherited from the parent hdmi drm binding? The changes should be highlighted in the commit message. Or we'll be confused which is which.. ZubairLK >> On 08/11/14 05:32, Andy Yan wrote: >>> Signed-off-by: Andy Yan >>> --- >>> .../devicetree/bindings/drm/bridge/dw-hdmi.txt | 38 >>> ++ >>> 1 file changed, 38 insertions(+) >>> create mode 100644 >>> Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt >>> >>> diff --git a/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt >>> b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt >>> new file mode 100644 >>> index 000..aa7ed17 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt >>> @@ -0,0 +1,38 @@ >>> +DesignWare HDMI bridge bindings >>> + >>> +Required properities: >>> +- compatibel: platform specific such as "fsl,imx6q-hdmi","fsl,imx6dl-hdmi" spellcheck. compatible >>> + "rockchip,rk3288-dw-hdmi" >>> +- reg: physical base address of the controller and length >>> +- ddc-i2c-bus: the ddc i2c bus >>> +- interrupts: The interrupt number to the cpu >>> + >>> +Optional properties >>> +- reg-io-width: the width of the reg:1,4, default set to 1 if not present >>> + >>> +Example: >>> +hdmi: hdmi@012 { >>> +compatible = "fsl,imx6q-hdmi"; >>> +reg = <0x0012 0x9000>; >>> +interrupts = <0 115 0x04>; >>> +gpr = <&gpr>; >>> +clocks = <&clks 123>, <&clks 124>; >>> +clock-names = "iahb", "isfr"; >>> +ddc-i2c-bus = <&i2c2>; >>> + >>> +port@0 { >>> +reg = <0>; >>> + >>> +hdmi_mux_0: endpoint { >>> +remote-endpoint = <&ipu1_di0_hdmi>; >>> +}; >>> +}; >>> + >>> +port@1 { >>> +reg = <1>; >>> + >>> +hdmi_mux_1: endpoint { >>> +remote-endpoint = <&ipu1_di1_hdmi>; >>> +}; >>> +}; >>> +}; >>> >> >> > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 7/7] dt-bindings: add document for dw-hdmi
On 2014年11月10日 17:53, Zubair Lutfullah Kakakhel wrote: On 10/11/14 09:44, Andy Yan wrote: Hi ZubairLK On 2014年11月10日 17:17, Zubair Lutfullah Kakakhel wrote: Nice work. This patch should move the binding from Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt to the location instead of making a new file and leaving the old one in place. And use git format-patch -M to highlight any changes. Regards ZubairLK I add these bindings for dw-hdmi core, because properities like reg, interrupts, ddc-i2c-bus, reg-io-width are used by dw-hdmi core, but properities like compatible, gpr,clk, are platform specific , they are handled by the platform code like dw_hdmi-imx.c and described in platform specific dt binds like /imx-drm/hdmi.txt I understand. Are there any changes to imx-drm/hdmi.txt? Some properties for imx-drm/hdmi.txt would become optional/inherited from the parent hdmi drm binding? The changes should be highlighted in the commit message. Or we'll be confused which is which.. ZubairLK to keep compatible for imx, no changes for imx-drm/hdmi.txt the only added properties is reg-io-width, and it is optional On 08/11/14 05:32, Andy Yan wrote: Signed-off-by: Andy Yan --- .../devicetree/bindings/drm/bridge/dw-hdmi.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt diff --git a/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt new file mode 100644 index 000..aa7ed17 --- /dev/null +++ b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt @@ -0,0 +1,38 @@ +DesignWare HDMI bridge bindings + +Required properities: +- compatibel: platform specific such as "fsl,imx6q-hdmi","fsl,imx6dl-hdmi" spellcheck. compatible + "rockchip,rk3288-dw-hdmi" +- reg: physical base address of the controller and length +- ddc-i2c-bus: the ddc i2c bus +- interrupts: The interrupt number to the cpu + +Optional properties +- reg-io-width: the width of the reg:1,4, default set to 1 if not present + +Example: +hdmi: hdmi@012 { +compatible = "fsl,imx6q-hdmi"; +reg = <0x0012 0x9000>; +interrupts = <0 115 0x04>; +gpr = <&gpr>; +clocks = <&clks 123>, <&clks 124>; +clock-names = "iahb", "isfr"; +ddc-i2c-bus = <&i2c2>; + +port@0 { +reg = <0>; + +hdmi_mux_0: endpoint { +remote-endpoint = <&ipu1_di0_hdmi>; +}; +}; + +port@1 { +reg = <1>; + +hdmi_mux_1: endpoint { +remote-endpoint = <&ipu1_di1_hdmi>; +}; +}; +}; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 7/7] dt-bindings: add document for dw-hdmi
Hi ZubairLK On 2014年11月10日 17:17, Zubair Lutfullah Kakakhel wrote: Nice work. This patch should move the binding from Documentation/devicetree/bindings/staging/imx-drm/hdmi.txt to the location instead of making a new file and leaving the old one in place. And use git format-patch -M to highlight any changes. Regards ZubairLK I add these bindings for dw-hdmi core, because properities like reg, interrupts, ddc-i2c-bus, reg-io-width are used by dw-hdmi core, but properities like compatible, gpr,clk, are platform specific , they are handled by the platform code like dw_hdmi-imx.c and described in platform specific dt binds like /imx-drm/hdmi.txt On 08/11/14 05:32, Andy Yan wrote: Signed-off-by: Andy Yan --- .../devicetree/bindings/drm/bridge/dw-hdmi.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt diff --git a/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt new file mode 100644 index 000..aa7ed17 --- /dev/null +++ b/Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt @@ -0,0 +1,38 @@ +DesignWare HDMI bridge bindings + +Required properities: +- compatibel: platform specific such as "fsl,imx6q-hdmi","fsl,imx6dl-hdmi" + "rockchip,rk3288-dw-hdmi" +- reg: physical base address of the controller and length +- ddc-i2c-bus: the ddc i2c bus +- interrupts: The interrupt number to the cpu + +Optional properties +- reg-io-width: the width of the reg:1,4, default set to 1 if not present + +Example: + hdmi: hdmi@012 { + compatible = "fsl,imx6q-hdmi"; + reg = <0x0012 0x9000>; + interrupts = <0 115 0x04>; + gpr = <&gpr>; + clocks = <&clks 123>, <&clks 124>; + clock-names = "iahb", "isfr"; + ddc-i2c-bus = <&i2c2>; + + port@0 { + reg = <0>; + + hdmi_mux_0: endpoint { + remote-endpoint = <&ipu1_di0_hdmi>; + }; + }; + + port@1 { + reg = <1>; + + hdmi_mux_1: endpoint { + remote-endpoint = <&ipu1_di1_hdmi>; + }; + }; + }; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Inconsistent lock state with Hyper-V memory balloon?
On Sat, Nov 08, 2014 at 02:36:54PM +, Sitsofe Wheeler wrote: > I've been trying to use the Hyper-V balloon driver to allow the host to > reclaim unused memory but have been hitting issues. With a Hyper-V 2012 > R2 guest with 4GBytes of RAM, dynamic memory on, 1GByte minimum 10GByte > maximum, 8 vcpus, running a 3.18.0-rc3 kernel with no swap configured > the following lockdep splat occurred: > > = > [ INFO: inconsistent lock state ] > 3.18.0-rc3.x86_64 #159 Not tainted > - > inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. > swapper/0/0 [HC0[0]:SC1[1]:HE1:SE0] takes: > (bdev_lock){+.?...}, at: [] nr_blockdev_pages+0x1c/0x80 > {SOFTIRQ-ON-W} state was registered at: > [] __lock_acquire+0x87d/0x1c60 > [] lock_acquire+0xfc/0x150 > [] _raw_spin_lock+0x39/0x50 > [] nr_blockdev_pages+0x1c/0x80 > [] si_meminfo+0x47/0x70 > [] eventpoll_init+0x11/0x10a > [] do_one_initcall+0xf9/0x1a7 > [] kernel_init_freeable+0x1d4/0x268 > [] kernel_init+0xe/0x100 > [] ret_from_fork+0x7c/0xb0 > irq event stamp: 2660283708 > hardirqs last enabled at (2660283708): [] > free_hot_cold_page+0x175/0x190 > hardirqs last disabled at (2660283707): [] > free_hot_cold_page+0xa5/0x190 > softirqs last enabled at (2660132034): [] > _local_bh_enable+0x4a/0x50 > softirqs last disabled at (2660132035): [] > irq_exit+0x58/0xc0 > > might help us debug this: > Possible unsafe locking scenario: > >CPU0 > > lock(bdev_lock); > > lock(bdev_lock); > > * > > no locks held by swapper/0/0. > > > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.18.0-rc3.x86_64 #159 > Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS > 090006 05/23/2012 > 8266ac90 880107403af8 816db3ef > 81c134c0 880107403b58 816d6fd3 0001 > 0001 8801 81010e6f 0046 > Call Trace: >[] dump_stack+0x4e/0x68 > [] print_usage_bug+0x1f3/0x204 > [] ? save_stack_trace+0x2f/0x50 > [] ? print_irq_inversion_bug+0x200/0x200 > [] mark_lock+0x176/0x2e0 > [] __lock_acquire+0x7c3/0x1c60 > [] ? lookup_address+0x28/0x30 > [] ? _lookup_address_cpa.isra.3+0x3b/0x40 > [] ? __debug_check_no_obj_freed+0x89/0x220 > [] lock_acquire+0xfc/0x150 > [] ? nr_blockdev_pages+0x1c/0x80 > [] _raw_spin_lock+0x39/0x50 > [] ? nr_blockdev_pages+0x1c/0x80 > [] nr_blockdev_pages+0x1c/0x80 > [] si_meminfo+0x47/0x70 > [] post_status.isra.3+0x6d/0x190 > [] ? trace_hardirqs_on+0xd/0x10 > [] ? __free_pages+0x2f/0x60 > [] ? free_balloon_pages.isra.5+0x8f/0xb0 > [] balloon_onchannelcallback+0x212/0x380 > [] vmbus_on_event+0x173/0x1d0 > [] tasklet_action+0x127/0x160 > [] __do_softirq+0x18a/0x340 > [] irq_exit+0x58/0xc0 > [] hyperv_vector_handler+0x45/0x60 > [] hyperv_callback_vector+0x72/0x80 >[] ? native_safe_halt+0x6/0x10 > [] ? trace_hardirqs_on+0xd/0x10 > [] default_idle+0x51/0xf0 > [] arch_cpu_idle+0xf/0x20 > [] cpu_startup_entry+0x217/0x3f0 > [] rest_init+0xc9/0xd0 > [] ? rest_init+0x5/0xd0 > [] start_kernel+0x438/0x445 > [] ? set_init_arg+0x57/0x57 > [] ? early_idt_handlers+0x120/0x120 > [] x86_64_start_reservations+0x2a/0x2c > [] x86_64_start_kernel+0x13e/0x14d > > Any help deciphering the above is greatly appreciated! Its fairly simple, the first trace shows where bdev_lock was taken with softirqs enabled, and the second trace shows where its taken from softirqs. Combine the two and you've got a recursive deadlock. I don't know the block layer very well, but a quick glance at the code shows its bdev_lock isn't meant to be used from softirq context, therefore the hyperv stuff is broken. So complain to the hyperv people. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 2/7] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter
drm driver may probe before the i2c bus, so the driver should defer probing until it is available Signed-off-by: Andy Yan --- Changes in v6: None Changes in v5: None Changes in v4: - defer probe ddc i2c adapter Changes in v3: None Changes in v2: None drivers/staging/imx-drm/imx-hdmi.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index 79daec4..c2b035a 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -1611,8 +1611,11 @@ static int imx_hdmi_bind(struct device *dev, struct device *master, void *data) ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node); - if (!hdmi->ddc) + if (!hdmi->ddc) { dev_dbg(hdmi->dev, "failed to read ddc node\n"); + of_node_put(ddc_node); + return -EPROBE_DEFER; + } of_node_put(ddc_node); } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 3/7] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
imx6 and rockchip rk3288 and JZ4780 (Ingenic Xburst/MIPS) use the interface compatible Designware HDMI IP, but they also have some lightly difference, such as phy pll configuration, register width, 4K support, clk useage, and the crtc mux configuration is also platform specific. To reuse the imx hdmi driver, split the platform specific code out to dw_hdmi-imx.c. Signed-off-by: Andy Yan --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/staging/imx-drm/Makefile | 2 +- drivers/staging/imx-drm/dw_hdmi-imx.c | 214 drivers/staging/imx-drm/imx-hdmi.c| 257 -- drivers/staging/imx-drm/imx-hdmi.h| 43 ++ 4 files changed, 320 insertions(+), 196 deletions(-) create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c diff --git a/drivers/staging/imx-drm/Makefile b/drivers/staging/imx-drm/Makefile index 582c438..809027d 100644 --- a/drivers/staging/imx-drm/Makefile +++ b/drivers/staging/imx-drm/Makefile @@ -9,4 +9,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o obj-$(CONFIG_DRM_IMX_IPUV3)+= imx-ipuv3-crtc.o -obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o +obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o dw_hdmi-imx.o diff --git a/drivers/staging/imx-drm/dw_hdmi-imx.c b/drivers/staging/imx-drm/dw_hdmi-imx.c new file mode 100644 index 000..5422679 --- /dev/null +++ b/drivers/staging/imx-drm/dw_hdmi-imx.c @@ -0,0 +1,214 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include + +#include "imx-drm.h" +#include "imx-hdmi.h" + +struct imx_hdmi_priv { + struct device *dev; + struct clk *isfr_clk; + struct clk *iahb_clk; + struct regmap *regmap; +}; + +static const struct mpll_config imx_mpll_cfg[] = { + { + 4525, { + { 0x01e0, 0x }, + { 0x21e1, 0x }, + { 0x41e2, 0x } + }, + }, { + 9250, { + { 0x0140, 0x0005 }, + { 0x2141, 0x0005 }, + { 0x4142, 0x0005 }, + }, + }, { + 14850, { + { 0x00a0, 0x000a }, + { 0x20a1, 0x000a }, + { 0x40a2, 0x000a }, + }, + }, { + ~0UL, { + { 0x00a0, 0x000a }, + { 0x2001, 0x000f }, + { 0x4002, 0x000f }, + }, + } +}; + +static const struct curr_ctrl imx_cur_ctr[] = { + /* pixelclk bpp8bpp10 bpp12 */ + { + 5400, { 0x091c, 0x091c, 0x06dc }, + }, { + 5840, { 0x091c, 0x06dc, 0x06dc }, + }, { + 7200, { 0x06dc, 0x06dc, 0x091c }, + }, { + 7425, { 0x06dc, 0x0b5c, 0x091c }, + }, { + 11880, { 0x091c, 0x091c, 0x06dc }, + }, { + 21600, { 0x06dc, 0x0b5c, 0x091c }, + } +}; + +static int imx_hdmi_parse_dt(struct imx_hdmi_priv *hdmi) +{ + struct device_node *np = hdmi->dev->of_node; + + hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "gpr"); + if (IS_ERR(hdmi->regmap)) { + dev_err(hdmi->dev, "Unable to get gpr\n"); + return PTR_ERR(hdmi->regmap); + } + + hdmi->isfr_clk = devm_clk_get(hdmi->dev, "isfr"); + if (IS_ERR(hdmi->isfr_clk)) { + dev_err(hdmi->dev, "Unable to get HDMI isfr clk\n"); + return PTR_ERR(hdmi->isfr_clk); + } + + hdmi->iahb_clk = devm_clk_get(hdmi->dev, "iahb"); + if (IS_ERR(hdmi->iahb_clk)) { + dev_err(hdmi->dev, "Unable to get HDMI iahb clk\n"); + return PTR_ERR(hdmi->iahb_clk); + } + + return 0; +} + +static void *imx_hdmi_imx_setup(struct platform_device *pdev) +{ + struct imx_hdmi_priv *hdmi; + int ret; + + hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); + if (!hdmi) + return ERR_PTR(-ENOMEM); + hdmi->dev = &pdev->dev; + + ret = imx_hdmi_parse_dt(hdmi); + if (ret < 0) + return ERR_PTR(ret); + ret = clk_prepare_enable(hdmi->isfr_clk); + if (ret) { + dev_err(hdmi->dev, + "Cannot enable HDMI isfr clock: %d\n", ret); + return ERR_PTR(ret); + } + + ret = clk_prepare_enable(hdmi->iahb_clk); + if (ret) { + dev_err(hdmi->dev, + "Cannot enable HDMI iahb clock: %d\n", ret); + return ERR_PTR(ret); + } + + return hdmi; +} +
[PATCH v6 1/7] staging: imx-drm: imx-hdmi: make checkpatch happy
CHECK: Alignment should match open parenthesis + if ((hdmi->vic == 10) || (hdmi->vic == 11) || + (hdmi->vic == 12) || (hdmi->vic == 13) || CHECK: braces {} should be used on all arms of this statement + if (hdmi->hdmi_data.video_mode.mdvi) [...] + else { [...] Signed-off-by: Andy Yan --- Changes in v5: None Changes in v4: - fix checkpatch CHECK Changes in v3: None Changes in v2: None drivers/staging/imx-drm/imx-hdmi.c | 97 +++--- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index aaec6b2..79daec4 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -163,7 +163,7 @@ static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 mask, unsigned reg) } static void hdmi_mask_writeb(struct imx_hdmi *hdmi, u8 data, unsigned int reg, - u8 shift, u8 mask) +u8 shift, u8 mask) { hdmi_modb(hdmi, data << shift, mask, reg); } @@ -327,7 +327,7 @@ static unsigned int hdmi_compute_cts(unsigned int freq, unsigned long pixel_clk, } static void hdmi_set_clk_regenerator(struct imx_hdmi *hdmi, - unsigned long pixel_clk) +unsigned long pixel_clk) { unsigned int clk_n, clk_cts; @@ -338,7 +338,7 @@ static void hdmi_set_clk_regenerator(struct imx_hdmi *hdmi, if (!clk_cts) { dev_dbg(hdmi->dev, "%s: pixel clock not supported: %lu\n", -__func__, pixel_clk); + __func__, pixel_clk); return; } @@ -477,13 +477,11 @@ static void imx_hdmi_update_csc_coeffs(struct imx_hdmi *hdmi) u16 coeff_b = (*csc_coeff)[1][i]; u16 coeff_c = (*csc_coeff)[2][i]; - hdmi_writeb(hdmi, coeff_a & 0xff, - HDMI_CSC_COEF_A1_LSB + i * 2); + hdmi_writeb(hdmi, coeff_a & 0xff, HDMI_CSC_COEF_A1_LSB + i * 2); hdmi_writeb(hdmi, coeff_a >> 8, HDMI_CSC_COEF_A1_MSB + i * 2); hdmi_writeb(hdmi, coeff_b & 0xff, HDMI_CSC_COEF_B1_LSB + i * 2); hdmi_writeb(hdmi, coeff_b >> 8, HDMI_CSC_COEF_B1_MSB + i * 2); - hdmi_writeb(hdmi, coeff_c & 0xff, - HDMI_CSC_COEF_C1_LSB + i * 2); + hdmi_writeb(hdmi, coeff_c & 0xff, HDMI_CSC_COEF_C1_LSB + i * 2); hdmi_writeb(hdmi, coeff_c >> 8, HDMI_CSC_COEF_C1_MSB + i * 2); } @@ -535,21 +533,22 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi) struct hdmi_data_info *hdmi_data = &hdmi->hdmi_data; u8 val, vp_conf; - if (hdmi_data->enc_out_format == RGB - || hdmi_data->enc_out_format == YCBCR444) { - if (!hdmi_data->enc_color_depth) + if (hdmi_data->enc_out_format == RGB || + hdmi_data->enc_out_format == YCBCR444) { + if (!hdmi_data->enc_color_depth) { output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; - else if (hdmi_data->enc_color_depth == 8) { + } else if (hdmi_data->enc_color_depth == 8) { color_depth = 4; output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; - } else if (hdmi_data->enc_color_depth == 10) + } else if (hdmi_data->enc_color_depth == 10) { color_depth = 5; - else if (hdmi_data->enc_color_depth == 12) + } else if (hdmi_data->enc_color_depth == 12) { color_depth = 6; - else if (hdmi_data->enc_color_depth == 16) + } else if (hdmi_data->enc_color_depth == 16) { color_depth = 7; - else + } else { return; + } } else if (hdmi_data->enc_out_format == YCBCR422_8BITS) { if (!hdmi_data->enc_color_depth || hdmi_data->enc_color_depth == 8) @@ -561,8 +560,9 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi) else return; output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_YCC422; - } else + } else { return; + } /* set the packetizer registers */ val = ((color_depth << HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET) & @@ -623,34 +623,34 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi) } static inline void hdmi_phy_test_clear(struct imx_hdmi *hdmi, - unsigned char bit) + unsigned char bit) { hdmi_modb(hdmi, bit << HDMI_PHY_TST0_TSTCLR_OFFSET, HDMI_PHY_TST0_TSTCLR_MASK, HDMI_PHY_TST0); } static inline void hdmi_phy_test_enable(struct imx_hdmi *hdmi, -
[PATCH v6 0/7] dw-hdmi: convert imx hdmi to bridge/dw-hdmi
We found freescale imx6 and rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS) use the interface compatible Designware HDMI IP, but they also have some lightly difference, such as phy pll configuration, register width(imx hdmi register is one byte, but rk3288 is 4 bytes width and can only access by word), 4K support(imx6 doesn't support 4k, but rk3288 does). To reuse the imx-hdmi driver, we do this patch set: (1): fix some codingstyle warning to make checkpatch happy (2): split out imx-soc code from imx-hdmi to dw_hdmi-imx.c (3): move imx-hdmi to bridge/dw-hdmi, and convert it to a drm_bridge driver And we will add rockchip platform specific code dw_hdmi-rockchip.c later, this is depend on drm-rockchip. Changes in v6: - rearrange the patch order - move some modification from patch#5 to patch#6 - refactor register access without reg_shift Changes in v5: - refactor reg-io-width Changes in v4: - fix checkpatch CHECK - defer probe ddc i2c adapter Changes in v3: - split multi register access to one indepent patch Changes in v2: - use git format -M to generate these patch Andy Yan (6): staging: imx-drm: imx-hdmi: make checkpatch happy staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw-hdmi drm: bridge/dw-hdmi: add support for multi byte register width access dt-bindings: add document for dw-hdmi Yakir Yang (1): drm: bridge/dw-hdmi: convert dw-hdmi to drm_bridge mode .../devicetree/bindings/drm/bridge/dw-hdmi.txt | 38 ++ drivers/gpu/drm/bridge/Kconfig | 5 + drivers/gpu/drm/bridge/Makefile| 1 + .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 725 + .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}| 5 +- drivers/staging/imx-drm/Kconfig| 1 + drivers/staging/imx-drm/Makefile | 2 +- drivers/staging/imx-drm/dw_hdmi-imx.c | 263 include/drm/bridge/dw_hdmi.h | 52 ++ 9 files changed, 668 insertions(+), 424 deletions(-) create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw-hdmi.txt rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c} (71%) rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h} (99%) create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c create mode 100644 include/drm/bridge/dw_hdmi.h -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 4/7] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw-hdmi
the original imx hdmi driver is under staging/imx-drm, which depends on imx-drm, so move the imx hdmi drvier out to drm/bridge and rename imx-hdmi to dw-hdmi Signed-off-by: Andy Yan --- Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - use git format -M to generate these patch drivers/gpu/drm/bridge/Kconfig | 5 + drivers/gpu/drm/bridge/Makefile| 1 + .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 281 +++-- .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}| 46 +--- drivers/staging/imx-drm/Kconfig| 1 + drivers/staging/imx-drm/Makefile | 2 +- drivers/staging/imx-drm/dw_hdmi-imx.c | 70 ++--- include/drm/bridge/dw_hdmi.h | 57 + 8 files changed, 243 insertions(+), 220 deletions(-) rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c} (83%) rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h} (97%) create mode 100644 include/drm/bridge/dw_hdmi.h diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 884923f..26162ef 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -3,3 +3,8 @@ config DRM_PTN3460 depends on DRM select DRM_KMS_HELPER ---help--- + +config DRM_DW_HDMI + bool "Synopsys DesignWare High-Definition Multimedia Interface" + depends on DRM + select DRM_KMS_HELPER diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index b4733e1..d8a8cfd 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -1,3 +1,4 @@ ccflags-y := -Iinclude/drm obj-$(CONFIG_DRM_PTN3460) += ptn3460.o +obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c similarity index 83% rename from drivers/staging/imx-drm/imx-hdmi.c rename to drivers/gpu/drm/bridge/dw_hdmi.c index 054ed8e..e9e73a7 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/gpu/drm/bridge/dw_hdmi.c @@ -6,8 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * SH-Mobile High-Definition Multimedia Interface (HDMI) driver - * for SLISHDMI13T and SLIPHDMIT IP cores + * Designware High-Definition Multimedia Interface (HDMI) driver * * Copyright (C) 2010, Guennadi Liakhovetski */ @@ -23,8 +22,9 @@ #include #include #include +#include -#include "imx-hdmi.h" +#include "dw_hdmi.h" #define HDMI_EDID_LEN 512 @@ -100,17 +100,17 @@ struct hdmi_data_info { struct hdmi_vmode video_mode; }; -struct imx_hdmi { +struct dw_hdmi { struct drm_connector connector; struct drm_encoder encoder; - enum imx_hdmi_devtype dev_type; + enum dw_hdmi_devtype dev_type; struct device *dev; struct clk *isfr_clk; struct clk *iahb_clk; struct hdmi_data_info hdmi_data; - const struct imx_hdmi_plat_data *plat_data; + const struct dw_hdmi_plat_data *plat_data; void *priv; int vic; @@ -128,17 +128,17 @@ struct imx_hdmi { int ratio; }; -static inline void hdmi_writeb(struct imx_hdmi *hdmi, u8 val, int offset) +static inline void hdmi_writeb(struct dw_hdmi *hdmi, u8 val, int offset) { writeb(val, hdmi->regs + offset); } -static inline u8 hdmi_readb(struct imx_hdmi *hdmi, int offset) +static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset) { return readb(hdmi->regs + offset); } -static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 mask, unsigned reg) +static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg) { u8 val = hdmi_readb(hdmi, reg) & ~mask; @@ -146,13 +146,13 @@ static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 mask, unsigned reg) hdmi_writeb(hdmi, val, reg); } -static void hdmi_mask_writeb(struct imx_hdmi *hdmi, u8 data, unsigned int reg, +static void hdmi_mask_writeb(struct dw_hdmi *hdmi, u8 data, unsigned int reg, u8 shift, u8 mask) { hdmi_modb(hdmi, data << shift, mask, reg); } -static void hdmi_set_clock_regenerator_n(struct imx_hdmi *hdmi, +static void hdmi_set_clock_regenerator_n(struct dw_hdmi *hdmi, unsigned int value) { hdmi_writeb(hdmi, value & 0xff, HDMI_AUD_N1); @@ -163,7 +163,7 @@ static void hdmi_set_clock_regenerator_n(struct imx_hdmi *hdmi, hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_N_SHIFT_MASK, HDMI_AUD_CTS3); } -static void hdmi_regenerate_cts(struct imx_hdmi *hdmi, unsigned int cts) +static void hdmi_regenerate_cts(struct dw_hdmi *hdmi, unsigned int cts) { /* Must be set/cleared first */ hdmi_modb(hdmi, 0, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3); @@ -310,7 +310,7 @@ static unsigned int hdmi_compute_
[PATCH v6 6/7] drm: bridge/dw-hdmi: convert dw-hdmi to drm_bridge mode
From: Yakir Yang handle encoder in dw_hdmi-imx.c, keep the connector & birdge in dw_hdmi.c Signed-off-by: Andy Yan Signed-off-by: Yakir Yang --- Changes in v6: - move some modification from patch#5 Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/bridge/dw_hdmi.c | 228 +++--- drivers/staging/imx-drm/dw_hdmi-imx.c | 145 ++--- include/drm/bridge/dw_hdmi.h | 13 +- 3 files changed, 199 insertions(+), 187 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c index c15c86e..25f2caf 100644 --- a/drivers/gpu/drm/bridge/dw_hdmi.c +++ b/drivers/gpu/drm/bridge/dw_hdmi.c @@ -11,7 +11,6 @@ * Copyright (C) 2010, Guennadi Liakhovetski */ -#include #include #include #include @@ -107,7 +106,8 @@ union dw_reg_ptr { struct dw_hdmi { struct drm_connector connector; - struct drm_encoder encoder; + struct drm_encoder *encoder; + struct drm_bridge *bridge; enum dw_hdmi_devtype dev_type; struct device *dev; @@ -1319,6 +1319,50 @@ static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) dw_hdmi_phy_disable(hdmi); } +static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge, + struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + struct dw_hdmi *hdmi = bridge->driver_private; + + dw_hdmi_setup(hdmi, mode); + + /* Store the display mode for plugin/DKMS poweron events */ + memcpy(&hdmi->previous_mode, mode, sizeof(hdmi->previous_mode)); +} + +static bool dw_hdmi_bridge_mode_fixup(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) +{ + return true; +} + +static void dw_hdmi_bridge_disable(struct drm_bridge *bridge) +{ + struct dw_hdmi *hdmi = bridge->driver_private; + + dw_hdmi_poweroff(hdmi); +} + +static void dw_hdmi_bridge_enable(struct drm_bridge *bridge) +{ + struct dw_hdmi *hdmi = bridge->driver_private; + + dw_hdmi_poweron(hdmi); +} + +static void dw_hdmi_bridge_destroy(struct drm_bridge *bridge) +{ + drm_bridge_cleanup(bridge); + kfree(bridge); +} + +static void dw_hdmi_bridge_nope(struct drm_bridge *bridge) +{ + /* do nothing */ +} + static enum drm_connector_status dw_hdmi_connector_detect(struct drm_connector *connector, bool force) { @@ -1360,60 +1404,7 @@ static struct drm_encoder *dw_hdmi_connector_best_encoder(struct drm_connector struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); - return &hdmi->encoder; -} - -static void dw_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder); - - dw_hdmi_setup(hdmi, mode); - - /* Store the display mode for plugin/DKMS poweron events */ - memcpy(&hdmi->previous_mode, mode, sizeof(hdmi->previous_mode)); -} - -static bool dw_hdmi_encoder_mode_fixup(struct drm_encoder *encoder, - const struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - return true; -} - -static void dw_hdmi_encoder_disable(struct drm_encoder *encoder) -{ -} - -static void dw_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode) -{ - struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder); - - if (mode) - dw_hdmi_poweroff(hdmi); - else - dw_hdmi_poweron(hdmi); -} - -static void dw_hdmi_encoder_prepare(struct drm_encoder *encoder) -{ - struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder); - - dw_hdmi_poweroff(hdmi); - - if (hdmi->plat_data->encoder_prepare) - hdmi->plat_data->encoder_prepare(&hdmi->connector, encoder); -} - -static void dw_hdmi_encoder_commit(struct drm_encoder *encoder) -{ - struct dw_hdmi *hdmi = container_of(encoder, struct dw_hdmi, encoder); - - if (hdmi->plat_data->encoder_commit) - hdmi->plat_data->encoder_commit(hdmi->priv, encoder); - - dw_hdmi_poweron(hdmi); + return hdmi->encoder; } void dw_hdmi_connector_destroy(struct drm_connector *connector) @@ -1422,19 +1413,6 @@ void dw_hdmi_connector_destroy(struct drm_connector *connector) drm_connector_cleanup(connector); } -static struct drm_encoder_funcs dw_hdmi_encoder_funcs = { - .destroy = drm_encoder_cleanup, -}; - -static struct drm_encoder_helper_funcs dw_hdmi_encoder_helper_funcs = { - .dpms = dw_hdmi_encoder_dpms, - .prepa
Re: [PATCH V5 1/7] imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
Hi Andy, A few comments inline. On 08/11/14 05:28, Andy Yan wrote: > imx6 and rockchip rk3288 and JZ4780 (Ingenic Xburst/MIPS) > use the interface compatible Designware HDMI IP, but they > also have some lightly difference, such as phy pll configuration, > register width, 4K support, clk useage, and the crtc mux configuration > is also platform specific. > > To reuse the imx hdmi driver, split the platform specific code out > to dw_hdmi-imx.c. > > Signed-off-by: Andy Yan > --- > drivers/staging/imx-drm/Makefile | 2 +- > drivers/staging/imx-drm/dw_hdmi-imx.c | 214 > drivers/staging/imx-drm/imx-hdmi.c| 257 > -- > drivers/staging/imx-drm/imx-hdmi.h| 43 ++ > 4 files changed, 320 insertions(+), 196 deletions(-) > create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c > > diff --git a/drivers/staging/imx-drm/Makefile > b/drivers/staging/imx-drm/Makefile > index 582c438..809027d 100644 > --- a/drivers/staging/imx-drm/Makefile > +++ b/drivers/staging/imx-drm/Makefile > @@ -9,4 +9,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o > > imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o > obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o > -obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o > +obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o dw_hdmi-imx.o > diff --git a/drivers/staging/imx-drm/dw_hdmi-imx.c > b/drivers/staging/imx-drm/dw_hdmi-imx.c > new file mode 100644 > index 000..5422679 > --- /dev/null > +++ b/drivers/staging/imx-drm/dw_hdmi-imx.c > @@ -0,0 +1,214 @@ > +/* > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ Please add the old freescale copyrights and a comment on how this file is derived from. And a note on platform specific file for imx hdmi using dwc hdmi drm bridge. > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "imx-drm.h" > +#include "imx-hdmi.h" > + > +struct imx_hdmi_priv { > + struct device *dev; > + struct clk *isfr_clk; > + struct clk *iahb_clk; > + struct regmap *regmap; > +}; > + > +static const struct mpll_config imx_mpll_cfg[] = { > + { > + 4525, { > + { 0x01e0, 0x }, > + { 0x21e1, 0x }, > + { 0x41e2, 0x } > + }, > + }, { > + 9250, { > + { 0x0140, 0x0005 }, > + { 0x2141, 0x0005 }, > + { 0x4142, 0x0005 }, > + }, > + }, { > + 14850, { > + { 0x00a0, 0x000a }, > + { 0x20a1, 0x000a }, > + { 0x40a2, 0x000a }, > + }, > + }, { > + ~0UL, { > + { 0x00a0, 0x000a }, > + { 0x2001, 0x000f }, > + { 0x4002, 0x000f }, > + }, > + } > +}; > + > +static const struct curr_ctrl imx_cur_ctr[] = { > + /* pixelclk bpp8bpp10 bpp12 */ > + { > + 5400, { 0x091c, 0x091c, 0x06dc }, > + }, { > + 5840, { 0x091c, 0x06dc, 0x06dc }, > + }, { > + 7200, { 0x06dc, 0x06dc, 0x091c }, > + }, { > + 7425, { 0x06dc, 0x0b5c, 0x091c }, > + }, { > + 11880, { 0x091c, 0x091c, 0x06dc }, > + }, { > + 21600, { 0x06dc, 0x0b5c, 0x091c }, > + } > +}; These pll clocks. Are they completely different? I assume they are dependent on display resolutions. The old ones should remain the same. With new additions for 4K clock rates e.g. > + > +static int imx_hdmi_parse_dt(struct imx_hdmi_priv *hdmi) > +{ > + struct device_node *np = hdmi->dev->of_node; > + > + hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "gpr"); > + if (IS_ERR(hdmi->regmap)) { > + dev_err(hdmi->dev, "Unable to get gpr\n"); > + return PTR_ERR(hdmi->regmap); > + } > + > + hdmi->isfr_clk = devm_clk_get(hdmi->dev, "isfr"); > + if (IS_ERR(hdmi->isfr_clk)) { > + dev_err(hdmi->dev, "Unable to get HDMI isfr clk\n"); > + return PTR_ERR(hdmi->isfr_clk); > + } > + > + hdmi->iahb_clk = devm_clk_get(hdmi->dev, "iahb"); > + if (IS_ERR(hdmi->iahb_clk)) { > + dev_err(hdmi->dev, "Unable to get HDMI iahb clk\n"); > + return PTR_ERR(hdmi->iahb_clk); > + } > + These two clocks. This is how they are structured on the jz4780 as well. >From an earlier patch series "yes, this IP core need to be clocked. But different Soc has different usage of the clk, on freescale imx platform one clk is used for isfr, one is used for iahb, but on rockchip rk3288, one clk is used for control logic , the another is used for hdcp. I am not sure how are the clocks on jz4780" They might
Re: [PATCH v5 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
On 11/08/2014 04:47 PM, Boris Brezillon wrote: > Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel > users don't have access to these definitions. > > We have to keep this definition for user-space users even though they're > encouraged to move to the new media_bus_format enum. > > Signed-off-by: Boris Brezillon > Acked-by: Sakari Ailus > --- > include/uapi/linux/v4l2-mediabus.h | 45 > -- > 1 file changed, 28 insertions(+), 17 deletions(-) > > diff --git a/include/uapi/linux/v4l2-mediabus.h > b/include/uapi/linux/v4l2-mediabus.h > index d712df8..5c9410d 100644 > --- a/include/uapi/linux/v4l2-mediabus.h > +++ b/include/uapi/linux/v4l2-mediabus.h > @@ -15,6 +15,33 @@ > #include > #include > > +/** > + * struct v4l2_mbus_framefmt - frame format on the media bus > + * @width: frame width > + * @height: frame height > + * @code:data format code (from enum v4l2_mbus_pixelcode) > + * @field: used interlacing type (from enum v4l2_field) > + * @colorspace: colorspace of the data (from enum v4l2_colorspace) > + */ > +struct v4l2_mbus_framefmt { > + __u32 width; > + __u32 height; > + __u32 code; > + __u32 field; > + __u32 colorspace; > + __u32 reserved[7]; > +}; > + > +#ifndef __KERNEL__ > +/* > + * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and > + * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be > + * used instead. > + * > + * New defines should only be added to media-bus-format.h. The > + * v4l2_mbus_pixelcode enum is frozen. > + */ > + > #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ > MEDIA_BUS_FMT_ ## name = V4L2_MBUS_FMT_ ## name Shouldn't this be the other way around? V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name Regards, Hans > > @@ -102,22 +129,6 @@ enum v4l2_mbus_pixelcode { > > V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV_1X32), > }; > - > -/** > - * struct v4l2_mbus_framefmt - frame format on the media bus > - * @width: frame width > - * @height: frame height > - * @code:data format code (from enum v4l2_mbus_pixelcode) > - * @field: used interlacing type (from enum v4l2_field) > - * @colorspace: colorspace of the data (from enum v4l2_colorspace) > - */ > -struct v4l2_mbus_framefmt { > - __u32 width; > - __u32 height; > - __u32 code; > - __u32 field; > - __u32 colorspace; > - __u32 reserved[7]; > -}; > +#endif /* __KERNEL__ */ > > #endif > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V5 1/7] imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
Hi Zubair: thanks very much for your comments. On 2014年11月10日 18:51, Zubair Lutfullah Kakakhel wrote: Hi Andy, A few comments inline. On 08/11/14 05:28, Andy Yan wrote: imx6 and rockchip rk3288 and JZ4780 (Ingenic Xburst/MIPS) use the interface compatible Designware HDMI IP, but they also have some lightly difference, such as phy pll configuration, register width, 4K support, clk useage, and the crtc mux configuration is also platform specific. To reuse the imx hdmi driver, split the platform specific code out to dw_hdmi-imx.c. Signed-off-by: Andy Yan --- drivers/staging/imx-drm/Makefile | 2 +- drivers/staging/imx-drm/dw_hdmi-imx.c | 214 drivers/staging/imx-drm/imx-hdmi.c| 257 -- drivers/staging/imx-drm/imx-hdmi.h| 43 ++ 4 files changed, 320 insertions(+), 196 deletions(-) create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c diff --git a/drivers/staging/imx-drm/Makefile b/drivers/staging/imx-drm/Makefile index 582c438..809027d 100644 --- a/drivers/staging/imx-drm/Makefile +++ b/drivers/staging/imx-drm/Makefile @@ -9,4 +9,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o -obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o +obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o dw_hdmi-imx.o diff --git a/drivers/staging/imx-drm/dw_hdmi-imx.c b/drivers/staging/imx-drm/dw_hdmi-imx.c new file mode 100644 index 000..5422679 --- /dev/null +++ b/drivers/staging/imx-drm/dw_hdmi-imx.c @@ -0,0 +1,214 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ Please add the old freescale copyrights and a comment on how this file is derived from. ok, I will add it in V7 And a note on platform specific file for imx hdmi using dwc hdmi drm bridge. sorry, I am not clear which specific file you means. Would you please tell me more about the note? +#include +#include +#include +#include +#include +#include +#include + +#include "imx-drm.h" +#include "imx-hdmi.h" + +struct imx_hdmi_priv { + struct device *dev; + struct clk *isfr_clk; + struct clk *iahb_clk; + struct regmap *regmap; +}; + +static const struct mpll_config imx_mpll_cfg[] = { + { + 4525, { + { 0x01e0, 0x }, + { 0x21e1, 0x }, + { 0x41e2, 0x } + }, + }, { + 9250, { + { 0x0140, 0x0005 }, + { 0x2141, 0x0005 }, + { 0x4142, 0x0005 }, + }, + }, { + 14850, { + { 0x00a0, 0x000a }, + { 0x20a1, 0x000a }, + { 0x40a2, 0x000a }, + }, + }, { + ~0UL, { + { 0x00a0, 0x000a }, + { 0x2001, 0x000f }, + { 0x4002, 0x000f }, + }, + } +}; + +static const struct curr_ctrl imx_cur_ctr[] = { + /* pixelclk bpp8bpp10 bpp12 */ + { + 5400, { 0x091c, 0x091c, 0x06dc }, + }, { + 5840, { 0x091c, 0x06dc, 0x06dc }, + }, { + 7200, { 0x06dc, 0x06dc, 0x091c }, + }, { + 7425, { 0x06dc, 0x0b5c, 0x091c }, + }, { + 11880, { 0x091c, 0x091c, 0x06dc }, + }, { + 21600, { 0x06dc, 0x0b5c, 0x091c }, + } +}; These pll clocks. Are they completely different? I assume they are dependent on display resolutions. The old ones should remain the same. With new additions for 4K clock rates e.g. even the 1080P on rockchip platform, we need a different configuration, otherwise we can't get the best SI. + +static int imx_hdmi_parse_dt(struct imx_hdmi_priv *hdmi) +{ + struct device_node *np = hdmi->dev->of_node; + + hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "gpr"); + if (IS_ERR(hdmi->regmap)) { + dev_err(hdmi->dev, "Unable to get gpr\n"); + return PTR_ERR(hdmi->regmap); + } + + hdmi->isfr_clk = devm_clk_get(hdmi->dev, "isfr"); + if (IS_ERR(hdmi->isfr_clk)) { + dev_err(hdmi->dev, "Unable to get HDMI isfr clk\n"); + return PTR_ERR(hdmi->isfr_clk); + } + + hdmi->iahb_clk = devm_clk_get(hdmi->dev, "iahb"); + if (IS_ERR(hdmi->iahb_clk)) { + dev_err(hdmi->dev, "Unable to get HDMI iahb clk\n"); + return PTR_ERR(hdmi->iahb_clk); + } + These two clocks. This is how they are structured on the jz4780 as well. >From an earlier patch series "yes, this IP core need to be clocked. But different Soc has different usage
Re: [PATCH 0/3] Tools: hv: vssdaemon: freeze/thaw logic improvement for the failure case
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Saturday, November 8, 2014 1:09 AM >> To: KY Srinivasan; Haiyang Zhang; Greg Kroah-Hartman >> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Dexuan Cui >> Subject: [PATCH 0/3] Tools: hv: vssdaemon: freeze/thaw logic improvement >> for the failure case >> >> This patch series addresses the following issues: >> - Wrong error reporting for multiple filesystems case. >> - Skip all readonly-mounted filesystems instead of skipping iso9660. >> - Thaw all filesystems after an unsuccessful freeze attempt. >> >> Vitaly Kuznetsov (3): >> Tools: hv: vssdaemon: consult with errno in case of failure only >> Tools: hv: vssdaemon: skip all filesystems mounted readonly >> Tools: hv: vssdaemon: thaw everything in case of freeze failure >> >> tools/hv/hv_vss_daemon.c | 14 -- >> 1 file changed, 12 insertions(+), 2 deletions(-) > > Hi Vitaly, > Thanks for your patchset! > > FYI: Greg checked in a patch of mine several hours ago -- my patch > implemented "thaw all filesytems on a failure of freeze" too. :-) Ah, sorry for stepping on your toes :-) > > Please see my patch in Greg's char-misc-next tree: > https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-misc.git/commit/?h=char-misc-next&id=4f689190bb55d171d2f6614f8a6cbd4b868e48bd > > Can you please rebase your patch(es) on Greg's tree? Sure, I'll throw away my patch#3, rebase, and repost. > > Thanks, > -- Dexuan -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue
Hi Maurice, Would you be able to point to a complete piece of test code that exhibits this failure? Martyn Welch Lead Software Engineer GE Intelligent Platforms Embedded Systems T +44 (0) 1327 322748 F +44 (0) 1327 322817 E martyn.we...@ge.com Tove Valley Business Park Towcester, Northants, NN12 6PF, United Kingdom GE Intelligent Platforms Ltd GE imagination at work GE Intelligent Platforms Ltd, registered in England and Wales (3828642) at 100 Barbirolli Square, Manchester, M2 3AB, VAT GB 927 5591 89 > -Original Message- > From: Maurice Moss [mailto:eightplusc...@gmail.com] > Sent: 08 November 2014 00:33 > To: Welch, Martyn (GE Intelligent Platforms) > Cc: Manohar Vanga; dan.carpen...@oracle.com; driverdev- > de...@linuxdriverproject.org > Subject: Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) > vme_user issue > > Hi Manohar/Dan, > > Any idea regarding this? > > Cheers, > Maurice > > On Mon, Nov 3, 2014 at 5:25 PM, Maurice Moss > wrote: > > Hi Martyn, > > > > Thanks for your help from previous emails. I managed to talk to my > > board using a VME-USB board. Now I am back to working with an SBC, and > > I have a different setup this time around, let me describe it: > > > > 1. SBC in slot 0 of a VME64 chassis (with 2 slots), and the bottom one > > being a slot for an SBC. The SBC is has a Universe-II and when I load > > the kernel module manually, everything seems fine, and I see this in > > dmesg: > > [ 76.192738] vme_ca91cx42 :02:04.0: enabling device (0140 -> 0143) > > [ 76.192893] vme_ca91cx42 :02:04.0: Board is the VME system > controller > > [ 76.192902] vme_ca91cx42 :02:04.0: Slot ID is 0 > > [ 76.192907] vme_ca91cx42 :02:04.0: CR/CSR Offset: 0 > > [ 76.192911] vme_ca91cx42 :02:04.0: Slot number is unset, not > > configuring CR/CSR space > > [ 76.195956] vme_ca91cx42 :02:04.0: CR/CSR configuration failed. > > > > I don't intend to use CR/CSR feature. The linux kernel I am running > > is 3.13, the board is essentially this: > > http://www.onestopsystems.com/documents/OSS-PCIe-KIT-6400.pdf > > > > 2. Now I would like to talk to a passive Slave board in slot 1 (I am > > not sure about this numbering, basically the board in the other slot). > > This slave board essentially talks only A24 and D16 in > > user/super/data. It's address space internally begins at 0x114000. In > > my test code, I essentially have the following: > > > > master.enable = 1; > > //master.vme_addr = 0x114000; > > master.vme_addr = 0x114000; > > master.size = 0x1; > > master.aspace = 0x2; // VME_A24 > > master.cycle = 0x2000 | 0x8000;// user/data access > > master.dwidth = 0x2; // 16 bit word access > > retval = ioctl(fd, VME_SET_MASTER, &master); > > > > The call doesn't fail, and when I make a pread, all I get are 0xff s > > on every byte. > > I feel like I just can't seem to get the vme_addr to point in the > > right direction. I know it's not the slave board, as I have verified > > that it works with the VME-to-USB. > > > > In my mind, I have to set the SBC as a VME master and make a read at > > A24 address. However, in vme_user.c I notice that the master resource > > is allocated as A32. Which is why I just can't seem to get the whole > > addressing schema right! > > > > Here is my lspci -v > > > > 02:04.0 Bridge: Tundra Semiconductor Corp. CA91C042 [Universe] (rev 02) > > Flags: medium devsel, IRQ 16 > > Memory at f7d0 (32-bit, non-prefetchable) [size=4K] > > I/O ports at e000 [size=4K] > > Kernel driver in use: vme_ca91cx42 > > 08:00.0 PCI bridge: Tundra Semiconductor Corp. Device 8113 (rev 01) > > (prog-if 01 [Subtractive decode]) > > Flags: bus master, fast devsel, latency 0 > > Bus: primary=08, secondary=09, subordinate=09, sec-latency=64 > > Memory behind bridge: f700-f78f > > Prefetchable memory behind bridge: f600- > f6ff > > Capabilities: > > > > Any help is as usual thoroughly appreciated. And in addition thanks > > for all your help already! > > > > Cheers, > > Maurice > > > > > > > > > > > > On Thu, Jul 24, 2014 at 1:45 AM, Martyn Welch > wrote: > >> On 23/07/14 03:09, Maurice Moss wrote: > >>> > >>> Hi Martyn, > >>> > >>> Thanks for your patience with me. I have a couple of questions for you: > >>> > >>> 0. I put the SBC with the right settings for Geographical addressing. > >>> I did 2 tests by setting the board in each of the 2 slots available > >>> on my rack and the geo address was detected as 0 in both the cases. > >>> This means my backplane isn't working or that my SBC isn't talking > >>> to the backplane. > >> > >> > >> What settings did you apply to "set" geographical addressing? Is this > >> the drivers or something board specific? > >> > >>> 1. Is there a way I can test whether the PCI bridge is working? > >> > >> > >> I assume you mean wh
[PATCH] staging: unisys: fix CamelCase methods/variables in virthba.c
This patch fixes the CamelCase checks for methods/variables in virthba.c found with the checkpatch script. Signed-off-by: Ken Depro --- drivers/staging/unisys/virthba/virthba.c | 122 +++--- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index d7a629b..f537754 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -107,7 +107,7 @@ static void virthba_slave_destroy(struct scsi_device *scsidev); static int process_incoming_rsps(void *); static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); -static void doDiskAddRemove(struct work_struct *work); +static void do_disk_add_remove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); @@ -119,7 +119,7 @@ static ssize_t enable_ints_write(struct file *file, /*/ static int rsltq_wait_usecs = 4000;/* Default 4ms */ -static unsigned int MaxBuffLen; +static unsigned int max_buff_len; /* Module options */ static char *virthba_options = "NONE"; @@ -193,7 +193,7 @@ struct virthba_info { struct virtdisk_info head; }; -/* Work Data for DARWorkQ */ +/* Work Data for dar_work_queue */ struct diskaddremove { u8 add; /* 0-remove, 1-add */ struct Scsi_Host *shost; /* Scsi Host for this virthba instance */ @@ -244,7 +244,7 @@ static const struct file_operations debugfs_enable_ints_fops = { #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ -static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct virthba_devices_open virthbas_open[VIRTHBASOPENMAX]; static struct dentry *virthba_debugfs_dir; /*/ @@ -318,30 +318,30 @@ del_scsipending_entry(struct virthba_info *vhbainfo, uintptr_t del) return sent; } -/* DARWorkQ (Disk Add/Remove) */ -static struct work_struct DARWorkQ; -static struct diskaddremove *DARWorkQHead; -static spinlock_t DARWorkQLock; -static unsigned short DARWorkQSched; +/* dar_work_q (Disk Add/Remove) */ +static struct work_struct dar_work_queue; +static struct diskaddremove *dar_work_queue_head; +static spinlock_t dar_work_queue_lock; +static unsigned short dar_work_queue_sched; #define QUEUE_DISKADDREMOVE(dar) { \ - spin_lock_irqsave(&DARWorkQLock, flags); \ - if (!DARWorkQHead) { \ - DARWorkQHead = dar; \ + spin_lock_irqsave(&dar_work_queue_lock, flags); \ + if (!dar_work_queue_head) { \ + dar_work_queue_head = dar; \ dar->next = NULL; \ } \ else { \ - dar->next = DARWorkQHead; \ - DARWorkQHead = dar; \ + dar->next = dar_work_queue_head; \ + dar_work_queue_head = dar; \ } \ - if (!DARWorkQSched) { \ - schedule_work(&DARWorkQ); \ - DARWorkQSched = 1; \ + if (!dar_work_queue_sched) { \ + schedule_work(&dar_work_queue); \ + dar_work_queue_sched = 1; \ } \ - spin_unlock_irqrestore(&DARWorkQLock, flags); \ + spin_unlock_irqrestore(&dar_work_queue_lock, flags); \ } static inline void -SendDiskAddRemove(struct diskaddremove *dar) +send_disk_add_remove(struct diskaddremove *dar) { struct scsi_device *sdev; int error; @@ -365,31 +365,31 @@ SendDiskAddRemove(struct diskaddremove *dar) } /*/ -/* DARWorkQ Handler Thread */ +/* dar_work_queue Handler Thread */ /*/ static void -doDiskAddRemove(struct work_struct *work) +do_disk_add_remove(struct work_struct *work) { struct diskaddremove *dar; struct diskaddremove *tmphead; int i = 0; unsigned long flags; - spin_lock_irqsave(&DARWorkQLock, flags); - tmphead = DARWorkQHead; - DARWorkQHead = NULL; - DARWorkQSched = 0; - spin_unlock_irqrestore(&DARWorkQLock, flags); + spin_lock_irqsave(&dar_work_queue_lock, flags); + tmphead = dar_work_queue_head; + dar_work_queue_head = NULL; + dar_work_queue_sched = 0; + spin_unlock_irqrestore(&dar_work_queue_lock, flags); while (tmphead) { dar = tmphead; tmphead = dar->next; - SendDiskAddRemove(dar); + send_disk_add_remove(dar); i++; } } /*/ -/* Routine to add entry to DARWorkQ *
[PATCH] staging: unisys: add comment to spinlock in struct charqueue
Add a comment to the charqueue's spinlock to explain that it is a lock for the structure. Now with spaces! :) Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorutil/charqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorutil/charqueue.c b/drivers/staging/unisys/visorutil/charqueue.c index 1ce7003..ac7acb7 100644 --- a/drivers/staging/unisys/visorutil/charqueue.c +++ b/drivers/staging/unisys/visorutil/charqueue.c @@ -28,7 +28,7 @@ struct charqueue { int alloc_size; int nslots; - spinlock_t lock; + spinlock_t lock; /* read/write lock for this structure */ int head, tail; unsigned char buf[0]; }; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: unisys: remove unused types from visorchipset.h
Delete the following unused types, and unused function prototypes: VISORCHIPSET_SWITCH_INFO VISORCHIPSET_EXTERNALPORT_INFO VISORCHIPSET_INTERNALPORT_INFO visorchipset_get_switch_info() visorchipset_get_externalport_info() Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/visorchipset.h | 55 -- 1 file changed, 55 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h b/drivers/staging/unisys/visorchipset/visorchipset.h index 46dad63..98f3ba4 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset.h +++ b/drivers/staging/unisys/visorchipset/visorchipset.h @@ -158,61 +158,6 @@ findbus(struct list_head *list, u32 bus_no) return NULL; } -/** Attributes for a particular Supervisor switch. - */ -struct visorchipset_switch_info { - u32 switch_no; - struct visorchipset_state state; - uuid_le switch_type_uuid; - u8 *authservice1; - u8 *authservice2; - u8 *authservice3; - u8 *security_context; - u64 reserved; - u32 reserved2; /* control_vm_id */ - struct device dev; - BOOL dev_exists; - struct controlvm_message_header pending_msg_hdr; -}; - -/** Attributes for a particular Supervisor external port, which is connected - * to a specific switch. - */ -struct visorchipset_externalport_info { - u32 switch_no; - u32 external_port_no; - struct visorchipset_state state; - uuid_le network_zone_uuid; - int pd_port; - u8 *ip; - u8 *ip_netmask; - u8 *ip_broadcast; - u8 *ip_network; - u8 *ip_gateway; - u8 *ip_dns; - u64 reserved1; - u32 reserved2; /* control_vm_id */ - struct device dev; - BOOL dev_exists; - struct controlvm_message_header pending_msg_hdr; -}; - -/** Attributes for a particular Supervisor internal port, which is how a - * device connects to a particular switch. - */ -struct visorchipset_internalport_info { - u32 switch_no; - u32 internal_port_no; - struct visorchipset_state state; - u32 bus_no; /* valid only when state.attached == 1 */ - u32 dev_no; /* valid only when state.attached == 1 */ - u64 reserved1; - u32 reserved2; /* CONTROLVM_ID */ - struct controlvm_message_header pending_msg_hdr; - MYPROCOBJECT *proc_object; - -}; - /* These functions will be called from within visorchipset when certain * events happen. (The implementation of these functions is outside of * visorchipset.) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] Tools: hv: vssdaemon: freeze/thaw logic improvement for the failure case
This patch series addresses the following issues: - Verbosely report errors during freeze (mountpoint, exact error); - Skip all readonly-mounted filesystems instead of skipping iso9660 only. Changes since v1: - Rebase on top of 'char-misc-next'; - "Tools: hv: vssdaemon: thaw everything in case of freeze" was thrown away as Dexuan's "Tools: hv: vssdaemon: ignore the EBUSY on multiple freezing the same partition" contains the same change; - "Tools: hv: vssdaemon: consult with errno in case of failure only" was replaced with "Tools: hv: vssdaemon: report freeze errors". Vitaly Kuznetsov (2): Tools: hv: vssdaemon: report freeze errors Tools: hv: vssdaemon: skip all filesystems mounted readonly tools/hv/hv_vss_daemon.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] Tools: hv: vssdaemon: skip all filesystems mounted readonly
Instead of making a list of exceptions for readonly filesystems in addition to iso9660 we already have it is better to skip freeze operation for all readonly-mounted filesystems. Signed-off-by: Vitaly Kuznetsov --- tools/hv/hv_vss_daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index ee44f0d..5e63f70 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c @@ -102,7 +102,7 @@ static int vss_operate(int operation) while ((ent = getmntent(mounts))) { if (strncmp(ent->mnt_fsname, match, strlen(match))) continue; - if (strcmp(ent->mnt_type, "iso9660") == 0) + if (hasmntopt(ent, MNTOPT_RO) != NULL) continue; if (strcmp(ent->mnt_type, "vfat") == 0) continue; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] Tools: hv: vssdaemon: report freeze errors
When ioctl(fd, FIFREEZE, 0) results in an error we cannot report it to syslog instantly since that can cause write to a frozen disk. However, the name of the filesystem which caused the error and errno are valuable and we would like to get a nice human-readable message in the log. Save errno before calling vss_operate(VSS_OP_THAW) and report the error right after. Unfortunately, FITHAW errors cannot be reported the same way as we need to finish thawing all filesystems before calling syslog(). We should also avoid calling endmntent() for the second time in case we encountered an error during freezing of '/' as it usually results in SEGSEGV. Signed-off-by: Vitaly Kuznetsov --- tools/hv/hv_vss_daemon.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c index b720d8f..ee44f0d 100644 --- a/tools/hv/hv_vss_daemon.c +++ b/tools/hv/hv_vss_daemon.c @@ -82,7 +82,7 @@ static int vss_operate(int operation) FILE *mounts; struct mntent *ent; unsigned int cmd; - int error = 0, root_seen = 0; + int error = 0, root_seen = 0, save_errno = 0; switch (operation) { case VSS_OP_FREEZE: @@ -114,7 +114,6 @@ static int vss_operate(int operation) if (error && operation == VSS_OP_FREEZE) goto err; } - endmntent(mounts); if (root_seen) { error |= vss_do_freeze("/", cmd); @@ -122,10 +121,19 @@ static int vss_operate(int operation) goto err; } - return error; + goto out; err: - endmntent(mounts); + save_errno = errno; vss_operate(VSS_OP_THAW); + /* Call syslog after we thaw all filesystems */ + if (ent) + syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s", + ent->mnt_dir, save_errno, strerror(save_errno)); + else + syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno, + strerror(save_errno)); +out: + endmntent(mounts); return error; } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
On Mon, 10 Nov 2014 12:09:19 +0100 Hans Verkuil wrote: > On 11/08/2014 04:47 PM, Boris Brezillon wrote: > > Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel > > users don't have access to these definitions. > > > > We have to keep this definition for user-space users even though they're > > encouraged to move to the new media_bus_format enum. > > > > Signed-off-by: Boris Brezillon > > Acked-by: Sakari Ailus > > --- > > include/uapi/linux/v4l2-mediabus.h | 45 > > -- > > 1 file changed, 28 insertions(+), 17 deletions(-) > > > > diff --git a/include/uapi/linux/v4l2-mediabus.h > > b/include/uapi/linux/v4l2-mediabus.h > > index d712df8..5c9410d 100644 > > --- a/include/uapi/linux/v4l2-mediabus.h > > +++ b/include/uapi/linux/v4l2-mediabus.h > > @@ -15,6 +15,33 @@ > > #include > > #include > > > > +/** > > + * struct v4l2_mbus_framefmt - frame format on the media bus > > + * @width: frame width > > + * @height:frame height > > + * @code: data format code (from enum v4l2_mbus_pixelcode) > > + * @field: used interlacing type (from enum v4l2_field) > > + * @colorspace:colorspace of the data (from enum v4l2_colorspace) > > + */ > > +struct v4l2_mbus_framefmt { > > + __u32 width; > > + __u32 height; > > + __u32 code; > > + __u32 field; > > + __u32 colorspace; > > + __u32 reserved[7]; > > +}; > > + > > +#ifndef __KERNEL__ > > +/* > > + * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and > > + * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be > > + * used instead. > > + * > > + * New defines should only be added to media-bus-format.h. The > > + * v4l2_mbus_pixelcode enum is frozen. > > + */ > > + > > #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ > > MEDIA_BUS_FMT_ ## name = V4L2_MBUS_FMT_ ## name > > Shouldn't this be the other way around? > > V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name Argh! Absolutely, I'll fix that. > > Regards, > > Hans > > > > > @@ -102,22 +129,6 @@ enum v4l2_mbus_pixelcode { > > > > V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV_1X32), > > }; > > - > > -/** > > - * struct v4l2_mbus_framefmt - frame format on the media bus > > - * @width: frame width > > - * @height:frame height > > - * @code: data format code (from enum v4l2_mbus_pixelcode) > > - * @field: used interlacing type (from enum v4l2_field) > > - * @colorspace:colorspace of the data (from enum v4l2_colorspace) > > - */ > > -struct v4l2_mbus_framefmt { > > - __u32 width; > > - __u32 height; > > - __u32 code; > > - __u32 field; > > - __u32 colorspace; > > - __u32 reserved[7]; > > -}; > > +#endif /* __KERNEL__ */ > > > > #endif > > > -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 09/10] gpu: ipu-v3: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in the ipu-v3 driver. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Philipp Zabel Acked-by: Sakari Ailus --- drivers/gpu/ipu-v3/ipu-csi.c | 66 ++-- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c index d6f56471..752cdd2 100644 --- a/drivers/gpu/ipu-v3/ipu-csi.c +++ b/drivers/gpu/ipu-v3/ipu-csi.c @@ -227,83 +227,83 @@ static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk, static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code) { switch (mbus_code) { - case V4L2_MBUS_FMT_BGR565_2X8_BE: - case V4L2_MBUS_FMT_BGR565_2X8_LE: - case V4L2_MBUS_FMT_RGB565_2X8_BE: - case V4L2_MBUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_BGR565_2X8_BE: + case MEDIA_BUS_FMT_BGR565_2X8_LE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: + case MEDIA_BUS_FMT_RGB565_2X8_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB565; cfg->mipi_dt = MIPI_DT_RGB565; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE: - case V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE: + case MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB444; cfg->mipi_dt = MIPI_DT_RGB444; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB555; cfg->mipi_dt = MIPI_DT_RGB555; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_16; break; - case V4L2_MBUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_16; break; - case V4L2_MBUS_FMT_SBGGR8_1X8: - case V4L2_MBUS_FMT_SGBRG8_1X8: - case V4L2_MBUS_FMT_SGRBG8_1X8: - case V4L2_MBUS_FMT_SRGGB8_1X8: + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGBRG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SRGGB8_1X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW8; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE: + case MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW10; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_SBGGR10_1X10: - case V4L2_MBUS_FMT_SGBRG10_1X10: - case V4L2_MBUS_FMT_SGRBG10_1X10: - case V4L2_MBUS_FMT_SRGGB10_1X10: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: + case M
[PATCH v6 04/10] [media] i2c: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definitions to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in i2c drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/i2c/adv7170.c | 16 +++ drivers/media/i2c/adv7175.c | 16 +++ drivers/media/i2c/adv7180.c | 6 +-- drivers/media/i2c/adv7183.c | 6 +-- drivers/media/i2c/adv7604.c | 72 +++ drivers/media/i2c/adv7842.c | 6 +-- drivers/media/i2c/ak881x.c| 8 ++-- drivers/media/i2c/cx25840/cx25840-core.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c| 6 +-- drivers/media/i2c/ml86v7667.c | 6 +-- drivers/media/i2c/mt9m032.c | 6 +-- drivers/media/i2c/mt9p031.c | 8 ++-- drivers/media/i2c/mt9t001.c | 8 ++-- drivers/media/i2c/mt9v011.c | 6 +-- drivers/media/i2c/mt9v032.c | 12 +++--- drivers/media/i2c/noon010pc30.c | 12 +++--- drivers/media/i2c/ov7670.c| 16 +++ drivers/media/i2c/ov9650.c| 10 ++--- drivers/media/i2c/s5c73m3/s5c73m3.h | 6 +-- drivers/media/i2c/s5k4ecgx.c | 4 +- drivers/media/i2c/s5k5baf.c | 14 +++--- drivers/media/i2c/s5k6a3.c| 2 +- drivers/media/i2c/s5k6aa.c| 8 ++-- drivers/media/i2c/saa6752hs.c | 6 +-- drivers/media/i2c/saa7115.c | 2 +- drivers/media/i2c/saa717x.c | 2 +- drivers/media/i2c/smiapp/smiapp-core.c| 32 +++--- drivers/media/i2c/soc_camera/imx074.c | 8 ++-- drivers/media/i2c/soc_camera/mt9m001.c| 14 +++--- drivers/media/i2c/soc_camera/mt9m111.c| 70 +++--- drivers/media/i2c/soc_camera/mt9t031.c| 10 ++--- drivers/media/i2c/soc_camera/mt9t112.c| 22 +- drivers/media/i2c/soc_camera/mt9v022.c| 26 +-- drivers/media/i2c/soc_camera/ov2640.c | 54 +++ drivers/media/i2c/soc_camera/ov5642.c | 8 ++-- drivers/media/i2c/soc_camera/ov6650.c | 58 - drivers/media/i2c/soc_camera/ov772x.c | 20 - drivers/media/i2c/soc_camera/ov9640.c | 40 - drivers/media/i2c/soc_camera/ov9740.c | 12 +++--- drivers/media/i2c/soc_camera/rj54n1cb0c.c | 54 +++ drivers/media/i2c/soc_camera/tw9910.c | 10 ++--- drivers/media/i2c/sr030pc30.c | 14 +++--- drivers/media/i2c/tvp514x.c | 12 +++--- drivers/media/i2c/tvp5150.c | 6 +-- drivers/media/i2c/tvp7002.c | 10 ++--- drivers/media/i2c/vs6624.c| 18 46 files changed, 382 insertions(+), 382 deletions(-) diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c index 04bb297..40a1a95 100644 --- a/drivers/media/i2c/adv7170.c +++ b/drivers/media/i2c/adv7170.c @@ -63,9 +63,9 @@ static inline struct adv7170 *to_adv7170(struct v4l2_subdev *sd) static char *inputs[] = { "pass_through", "play_back" }; -static enum v4l2_mbus_pixelcode adv7170_codes[] = { - V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_UYVY8_1X16, +static u32 adv7170_codes[] = { + MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_UYVY8_1X16, }; /* --- */ @@ -263,7 +263,7 @@ static int adv7170_s_routing(struct v4l2_subdev *sd, } static int adv7170_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) + u32 *code) { if (index >= ARRAY_SIZE(adv7170_codes)) return -EINVAL; @@ -278,9 +278,9 @@ static int adv7170_g_fmt(struct v4l2_subdev *sd, u8 val = adv7170_read(sd, 0x7); if ((val & 0x40) == (1 << 6)) - mf->code = V4L2_MBUS_FMT_UYVY8_1X16; + mf->code = MEDIA_BUS_FMT_UYVY8_1X16; else - mf->code = V4L2_MBUS_FMT_UYVY8_2X8; + mf->code = MEDIA_BUS_FMT_UYVY8_2X8; mf->colorspace = V4L2_COLORSPACE_SMPTE170M; mf->width = 0; @@ -297,11 +297,11 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd, int ret; switch (mf->code) { - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: val &= ~0x40; break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: val |= 0x40; break; diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c index b88f3b3..d220af5 100644 --- a/drivers/media/i2c/adv7175.c +++ b/drivers/media/i2c/adv7175.c @@ -60,9 +60,9 @@ stati
[PATCH v6 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel users don't have access to these definitions. We have to keep this definition for user-space users even though they're encouraged to move to the new media_bus_format enum. Signed-off-by: Boris Brezillon Acked-by: Sakari Ailus --- include/uapi/linux/v4l2-mediabus.h | 45 -- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index d712df8..5c9410d 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h @@ -15,6 +15,33 @@ #include #include +/** + * struct v4l2_mbus_framefmt - frame format on the media bus + * @width: frame width + * @height:frame height + * @code: data format code (from enum v4l2_mbus_pixelcode) + * @field: used interlacing type (from enum v4l2_field) + * @colorspace:colorspace of the data (from enum v4l2_colorspace) + */ +struct v4l2_mbus_framefmt { + __u32 width; + __u32 height; + __u32 code; + __u32 field; + __u32 colorspace; + __u32 reserved[7]; +}; + +#ifndef __KERNEL__ +/* + * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and + * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be + * used instead. + * + * New defines should only be added to media-bus-format.h. The + * v4l2_mbus_pixelcode enum is frozen. + */ + #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ MEDIA_BUS_FMT_ ## name = V4L2_MBUS_FMT_ ## name @@ -102,22 +129,6 @@ enum v4l2_mbus_pixelcode { V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV_1X32), }; - -/** - * struct v4l2_mbus_framefmt - frame format on the media bus - * @width: frame width - * @height:frame height - * @code: data format code (from enum v4l2_mbus_pixelcode) - * @field: used interlacing type (from enum v4l2_field) - * @colorspace:colorspace of the data (from enum v4l2_colorspace) - */ -struct v4l2_mbus_framefmt { - __u32 width; - __u32 height; - __u32 code; - __u32 field; - __u32 colorspace; - __u32 reserved[7]; -}; +#endif /* __KERNEL__ */ #endif -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 05/10] [media] pci: Make use of MEDIA_BUS_FMT definitions
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in pci drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/pci/cx18/cx18-av-core.c | 2 +- drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 2 +- drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index 2d3afe0..4c6ce21 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -952,7 +952,7 @@ static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt int HSC, VSC, Vsrc, Hsrc, filter, Vlines; int is_50Hz = !(state->std & V4L2_STD_525_60); - if (fmt->code != V4L2_MBUS_FMT_FIXED) + if (fmt->code != MEDIA_BUS_FMT_FIXED) return -EINVAL; fmt->field = V4L2_FIELD_INTERLACED; diff --git a/drivers/media/pci/cx18/cx18-controls.c b/drivers/media/pci/cx18/cx18-controls.c index 282a3d2..4aeb7c6 100644 --- a/drivers/media/pci/cx18/cx18-controls.c +++ b/drivers/media/pci/cx18/cx18-controls.c @@ -98,7 +98,7 @@ static int cx18_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 6f2b590..71963db 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -294,7 +294,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, mbus_fmt.width = cx->cxhdl.width = w; mbus_fmt.height = cx->cxhdl.height = h; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &mbus_fmt); return cx18_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 682a4f9..091f5db 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -608,7 +608,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dev->field = f->fmt.pix.field; dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, dev->width, dev->height, dev->field); - v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED); + v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); call_all(dev, video, s_mbus_fmt, &mbus_fmt); v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt); /* s_mbus_fmt overwrites f->fmt.pix.field, restore it */ diff --git a/drivers/media/pci/ivtv/ivtv-controls.c b/drivers/media/pci/ivtv/ivtv-controls.c index 2b0ab26..ccf548c 100644 --- a/drivers/media/pci/ivtv/ivtv-controls.c +++ b/drivers/media/pci/ivtv/ivtv-controls.c @@ -69,7 +69,7 @@ static int ivtv_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(itv->sd_video, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 3e0cb77..4d8ee18 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -595,7 +595,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f fmt->fmt.pix.width /= 2; mbus_fmt.width = fmt->fmt.pix.width; mbus_fmt.height = h; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(itv->sd_video, video, s_mbus_fmt, &mbus_fmt); return ivtv_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index e4ea85f..8b3bb78 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c @@ -140,7 +140,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv, struct saa7134_dev *dev = video_drvdata(file); struct v4l2_mbus_framefmt mbus_fmt
[PATCH v6 02/10] [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed them with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Update the v4l documentation accordingly. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++--- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index b2d5a03..18730b9 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml @@ -86,7 +86,7 @@ green and 5-bit blue values padded on the high bit, transferred as 2 8-bit samples per pixel with the most significant bits (padding, red and half of the green value) transferred first will be named - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE. + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE. The following tables list existing packed RGB formats. @@ -176,8 +176,8 @@ - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 &dash-ent-24; @@ -204,8 +204,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 &dash-ent-24; @@ -232,8 +232,8 @@ r1 r0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003 &dash-ent-24; @@ -260,8 +260,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004 &dash-ent-24; @@ -288,8 +288,8 @@ g4 g3 - - V4L2_MBUS_FMT_BGR565_2X8_BE + + MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005 &dash-ent-24; @@ -316,8 +316,8 @@ r1 r0 - - V4L2_MBUS_FMT_BGR565_2X8_LE + + MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006 &dash-ent-24; @@ -344,8 +344,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB565_2X8_BE + + MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007 &dash-ent-24; @@ -372,8 +372,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB565_2X8_LE + + MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008 &dash-ent-24; @@ -400,8 +400,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB666_1X18 + + MEDIA_BUS_FMT_RGB666_1X18 0x1009 &dash-ent-14; @@ -424,8 +424,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_1X24 + + MEDIA_BUS_FMT_RGB888_1X24 0x100a &dash-ent-8; @@ -454,8 +454,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_BE + + MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b &dash-ent-20; @@ -490,8 +490,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_LE + + MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c &dash-ent-20; @@ -526,8 +526,8 @@ g5 g4 - - V4L2_MBUS_FMT_ARGB888_1X32 + + MEDIA_BUS_FMT_ARGB888_1X32 0x100d a7 @@ -600,7 +600,7 @@ For instance, a format with uncompressed 10-bit Bayer components arranged in a red, green, green, blue pattern transferred as 2 8-bit samples per pixel with the least significant bits transferred first will - be named V4L2_MBUS_FMT_SRGGB10_2X8_PADHI_LE. + be named MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE. @@ -663,8 +663,8 @@ - - V4L2_MBUS_FMT_SBGGR8_1X8 + + MEDIA_BUS_FMT_SBGGR8_1X8 0x3001 - @@ -680,8 +680,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG8_1X8 + +
[PATCH v6 06/10] [media] platform: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all platform drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- Documentation/video4linux/soc-camera.txt | 2 +- arch/arm/mach-davinci/board-dm355-evm.c| 2 +- arch/arm/mach-davinci/board-dm365-evm.c| 4 +- arch/arm/mach-davinci/dm355.c | 7 +- arch/arm/mach-davinci/dm365.c | 7 +- arch/arm/mach-shmobile/board-mackerel.c| 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- drivers/media/platform/blackfin/bfin_capture.c | 14 +-- drivers/media/platform/davinci/vpbe.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 4 +- drivers/media/platform/exynos-gsc/gsc-core.c | 8 +- drivers/media/platform/exynos-gsc/gsc-core.h | 2 +- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/exynos4-is/fimc-core.c | 14 +-- drivers/media/platform/exynos4-is/fimc-core.h | 4 +- drivers/media/platform/exynos4-is/fimc-isp.c | 16 +-- drivers/media/platform/exynos4-is/fimc-lite-reg.c | 26 ++--- drivers/media/platform/exynos4-is/fimc-lite.c | 14 +-- drivers/media/platform/exynos4-is/fimc-reg.c | 14 +-- drivers/media/platform/exynos4-is/mipi-csis.c | 14 +-- drivers/media/platform/marvell-ccic/mcam-core.c| 21 ++-- drivers/media/platform/marvell-ccic/mcam-core.h| 2 +- drivers/media/platform/omap3isp/ispccdc.c | 112 ++--- drivers/media/platform/omap3isp/ispccp2.c | 18 ++-- drivers/media/platform/omap3isp/ispcsi2.c | 42 drivers/media/platform/omap3isp/isppreview.c | 60 ++- drivers/media/platform/omap3isp/ispresizer.c | 19 ++-- drivers/media/platform/omap3isp/ispvideo.c | 95 + drivers/media/platform/omap3isp/ispvideo.h | 10 +- drivers/media/platform/s3c-camif/camif-capture.c | 10 +- drivers/media/platform/s3c-camif/camif-regs.c | 8 +- drivers/media/platform/s5p-tv/hdmi_drv.c | 2 +- drivers/media/platform/s5p-tv/sdo_drv.c| 2 +- drivers/media/platform/sh_vou.c| 8 +- drivers/media/platform/soc_camera/atmel-isi.c | 22 ++-- drivers/media/platform/soc_camera/mx2_camera.c | 26 +++-- drivers/media/platform/soc_camera/mx3_camera.c | 6 +- drivers/media/platform/soc_camera/omap1_camera.c | 36 +++ drivers/media/platform/soc_camera/pxa_camera.c | 16 +-- drivers/media/platform/soc_camera/rcar_vin.c | 14 +-- .../platform/soc_camera/sh_mobile_ceu_camera.c | 20 ++-- drivers/media/platform/soc_camera/sh_mobile_csi2.c | 38 +++ drivers/media/platform/soc_camera/soc_camera.c | 2 +- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/soc_camera/soc_mediabus.c | 78 +++--- drivers/media/platform/via-camera.c| 8 +- drivers/media/platform/vsp1/vsp1_bru.c | 14 +-- drivers/media/platform/vsp1/vsp1_hsit.c| 12 +-- drivers/media/platform/vsp1/vsp1_lif.c | 10 +- drivers/media/platform/vsp1/vsp1_lut.c | 14 +-- drivers/media/platform/vsp1/vsp1_rwpf.c| 10 +- drivers/media/platform/vsp1/vsp1_sru.c | 12 +-- drivers/media/platform/vsp1/vsp1_uds.c | 10 +- drivers/media/platform/vsp1/vsp1_video.c | 42 include/media/davinci/vpbe.h | 2 +- include/media/davinci/vpbe_venc.h | 5 +- include/media/exynos-fimc.h| 2 +- include/media/soc_camera.h | 2 +- include/media/soc_mediabus.h | 6 +- 59 files changed, 483 insertions(+), 495 deletions(-) diff --git a/Documentation/video4linux/soc-camera.txt b/Documentation/video4linux/soc-camera.txt index daa9e2a..84f41cf 100644 --- a/Documentation/video4linux/soc-camera.txt +++ b/Documentation/video4linux/soc-camera.txt @@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to conveniently manage these formats. A table of standard transformations is maintained by soc-camera core, which describes, what FOURCC pixel format will be obtained, if a media-bus pixel format is stored in memory according to -certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per +certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per sample and stored in memory in the little-endian order with no gaps between bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These standard transformations will be used
[PATCH v6 08/10] staging: media: Make use of MEDIA_BUS_FMT_ definitions
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all media drivers residing in staging. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 18 ++-- .../staging/media/davinci_vpfe/dm365_ipipe_hw.c| 26 +++--- drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 100 ++--- drivers/staging/media/davinci_vpfe/dm365_isif.c| 90 +-- drivers/staging/media/davinci_vpfe/dm365_resizer.c | 98 ++-- .../staging/media/davinci_vpfe/vpfe_mc_capture.c | 18 ++-- drivers/staging/media/omap4iss/iss_csi2.c | 62 ++--- drivers/staging/media/omap4iss/iss_ipipe.c | 16 ++-- drivers/staging/media/omap4iss/iss_ipipeif.c | 28 +++--- drivers/staging/media/omap4iss/iss_resizer.c | 26 +++--- drivers/staging/media/omap4iss/iss_video.c | 78 drivers/staging/media/omap4iss/iss_video.h | 10 +-- 12 files changed, 285 insertions(+), 285 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index bdc7f00..704fa20 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -37,15 +37,15 @@ /* ipipe input format's */ static const unsigned int ipipe_input_fmts[] = { - V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_SGRBG12_1X12, - V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, - V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8, + MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_SGRBG12_1X12, + MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, }; /* ipipe output format's */ static const unsigned int ipipe_output_fmts[] = { - V4L2_MBUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_UYVY8_2X8, }; static int ipipe_validate_lutdpc_params(struct vpfe_ipipe_lutdpc *lutdpc) @@ -1457,7 +1457,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe, /* If not found, use SBGGR10 as default */ if (i >= ARRAY_SIZE(ipipe_input_fmts)) - fmt->code = V4L2_MBUS_FMT_SGRBG12_1X12; + fmt->code = MEDIA_BUS_FMT_SGRBG12_1X12; } else if (pad == IPIPE_PAD_SOURCE) { for (i = 0; i < ARRAY_SIZE(ipipe_output_fmts); i++) if (fmt->code == ipipe_output_fmts[i]) @@ -1465,7 +1465,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe, /* If not found, use UYVY as default */ if (i >= ARRAY_SIZE(ipipe_output_fmts)) - fmt->code = V4L2_MBUS_FMT_UYVY8_2X8; + fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; } fmt->width = clamp_t(u32, fmt->width, MIN_OUT_HEIGHT, max_out_width); @@ -1642,7 +1642,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = IPIPE_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG12_1X12; + format.format.code = MEDIA_BUS_FMT_SGRBG12_1X12; format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A; format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A; ipipe_set_format(sd, fh, &format); @@ -1650,7 +1650,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = IPIPE_PAD_SOURCE; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_UYVY8_2X8; + format.format.code = MEDIA_BUS_FMT_UYVY8_2X8; format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A; format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A; ipipe_set_format(sd, fh, &format); diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index b2daf5e..6461de1 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -196,12 +196,12 @@ ipipe_setup_resizer(void *__iomem rsz_base, struct resizer_params *params) rsz_set_rsz_regs(rsz_base, RSZ_B, params); } -static u32 ipipe_get_color_pat(enum v4l2_mbus_pixelcode pix) +static u32 ipipe_get_color_pat(u32 pix) { switch (pix) { - case V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8: - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGRBG12_1X12: + case MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG12_1X12: return ipipe_sgrbg_pattern; default: @@ -211,23 +211,23 @@ static u32 ipipe_get_c
[PATCH v6 00/10] [media] Make mediabus format subsystem neutral
Hello, This patch series prepares the use of media bus formats outside of the V4L2 subsytem (my final goal is to use it in the Atmel HLCDC DRM driver where I have to configure my DPI/RGB bus according to the connected display). The series first defines MEDIA_BUS_FMT_ macros, and then replace all references to the v4l2_mbus_pixelcode enum and its values within the kernel. Best Regards, Boris Changes since v5: - fix V4L2_MBUS_FROM_MEDIA_BUS_FMT macro definition Changes since v4: - put deprecated enum v4l2_mbus_pixelcode at the end of v4l2-mediabus.h header Changes since v3: - add a comment specifying that the v4l2_mbus_pixelcode enum definition is frozen Changes since v2: - drop media_bus_format enum and replace its values with pre-processor macros Changes since v1: - drop patches deprecating v4l2_mbus_pixelcode for user-space users - put V4L2 legacy format definitions into media-bus-format.h Boris Brezillon (10): [media] Move mediabus format definition to a more standard place [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values [media] Make use of the new media_bus_format definitions [media] i2c: Make use of media_bus_format enum [media] pci: Make use of MEDIA_BUS_FMT definitions [media] platform: Make use of media_bus_format enum [media] usb: Make use of media_bus_format enum staging: media: Make use of MEDIA_BUS_FMT_ definitions gpu: ipu-v3: Make use of media_bus_format enum [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++--- Documentation/video4linux/soc-camera.txt | 2 +- arch/arm/mach-davinci/board-dm355-evm.c| 2 +- arch/arm/mach-davinci/board-dm365-evm.c| 4 +- arch/arm/mach-davinci/dm355.c | 7 +- arch/arm/mach-davinci/dm365.c | 7 +- arch/arm/mach-shmobile/board-mackerel.c| 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- drivers/gpu/ipu-v3/ipu-csi.c | 66 ++--- drivers/media/i2c/adv7170.c| 16 +- drivers/media/i2c/adv7175.c| 16 +- drivers/media/i2c/adv7180.c| 6 +- drivers/media/i2c/adv7183.c| 6 +- drivers/media/i2c/adv7604.c| 72 ++--- drivers/media/i2c/adv7842.c| 6 +- drivers/media/i2c/ak881x.c | 8 +- drivers/media/i2c/cx25840/cx25840-core.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c | 6 +- drivers/media/i2c/ml86v7667.c | 6 +- drivers/media/i2c/mt9m032.c| 6 +- drivers/media/i2c/mt9p031.c| 8 +- drivers/media/i2c/mt9t001.c| 8 +- drivers/media/i2c/mt9v011.c| 6 +- drivers/media/i2c/mt9v032.c| 12 +- drivers/media/i2c/noon010pc30.c| 12 +- drivers/media/i2c/ov7670.c | 16 +- drivers/media/i2c/ov9650.c | 10 +- drivers/media/i2c/s5c73m3/s5c73m3.h| 6 +- drivers/media/i2c/s5k4ecgx.c | 4 +- drivers/media/i2c/s5k5baf.c| 14 +- drivers/media/i2c/s5k6a3.c | 2 +- drivers/media/i2c/s5k6aa.c | 8 +- drivers/media/i2c/saa6752hs.c | 6 +- drivers/media/i2c/saa7115.c| 2 +- drivers/media/i2c/saa717x.c| 2 +- drivers/media/i2c/smiapp/smiapp-core.c | 32 +-- drivers/media/i2c/soc_camera/imx074.c | 8 +- drivers/media/i2c/soc_camera/mt9m001.c | 14 +- drivers/media/i2c/soc_camera/mt9m111.c | 70 ++--- drivers/media/i2c/soc_camera/mt9t031.c | 10 +- drivers/media/i2c/soc_camera/mt9t112.c | 22 +- drivers/media/i2c/soc_camera/mt9v022.c | 26 +- drivers/media/i2c/soc_camera/ov2640.c | 54 ++-- drivers/media/i2c/soc_camera/ov5642.c | 8 +- drivers/media/i2c/soc_camera/ov6650.c | 58 ++-- drivers/media/i2c/soc_camera/ov772x.c | 20 +- drivers/media/i2c/soc_camera/ov9640.c | 40 +-- drivers/media/i2c/soc_camera/ov9740.c | 12 +- drivers/media/i2c/soc_camera/rj54n1cb0c.c | 54 ++-- drivers/media/i2c/soc_camera/tw9910.c | 10 +- drivers/media/i2c/sr030pc30.c | 14 +- drivers/media/i2c/tvp514x.c| 12 +- drivers/media/i2c/tvp5150.c| 6 +- drivers/media/i2c/tvp7002.c| 10 +- drivers/media/i2c/vs6624.c | 18 +- drivers/media/pci/cx18/cx18-av-core.c | 2 +- drivers/media/pc
[PATCH v6 01/10] [media] Move mediabus format definition to a more standard place
Define MEDIA_BUS_FMT macros (re-using the values defined in the v4l2_mbus_pixelcode enum) into a separate header file so that they can be used from the DRM/KMS subsystem without any reference to the V4L2 subsystem. Then set V4L2_MBUS_FMT definitions to the MEDIA_BUS_FMT values using the V4L2_MBUS_FROM_MEDIA_BUS_FMT macro. Signed-off-by: Boris Brezillon Acked-by: Guennadi Liakhovetski Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- include/uapi/linux/Kbuild | 1 + include/uapi/linux/media-bus-format.h | 125 +++ include/uapi/linux/v4l2-mediabus.h| 184 +++--- 3 files changed, 206 insertions(+), 104 deletions(-) create mode 100644 include/uapi/linux/media-bus-format.h diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index b70237e..ed39ac8 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -241,6 +241,7 @@ header-y += map_to_7segment.h header-y += matroxfb.h header-y += mdio.h header-y += media.h +header-y += media-bus-format.h header-y += mei.h header-y += memfd.h header-y += mempolicy.h diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h new file mode 100644 index 000..23b4090 --- /dev/null +++ b/include/uapi/linux/media-bus-format.h @@ -0,0 +1,125 @@ +/* + * Media Bus API header + * + * Copyright (C) 2009, Guennadi Liakhovetski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX_MEDIA_BUS_FORMAT_H +#define __LINUX_MEDIA_BUS_FORMAT_H + +/* + * These bus formats uniquely identify data formats on the data bus. Format 0 + * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where + * the data format is fixed. Additionally, "2X8" means that one pixel is + * transferred in two 8-bit samples, "BE" or "LE" specify in which order those + * samples are transferred over the bus: "LE" means that the least significant + * bits are transferred first, "BE" means that the most significant bits are + * transferred first, and "PADHI" and "PADLO" define which bits - low or high, + * in the incomplete high byte, are filled with padding bits. + * + * The bus formats are grouped by type, bus_width, bits per component, samples + * per pixel and order of subsamples. Numerical values are sorted using generic + * numerical sort order (8 thus comes before 10). + * + * As their value can't change when a new bus format is inserted in the + * enumeration, the bus formats are explicitly given a numerical value. The next + * free values for each category are listed below, update them when inserting + * new pixel codes. + */ + +#define MEDIA_BUS_FMT_FIXED0x0001 + +/* RGB - next is 0x100e */ +#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 +#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 +#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003 +#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004 +#define MEDIA_BUS_FMT_BGR565_2X8_BE0x1005 +#define MEDIA_BUS_FMT_BGR565_2X8_LE0x1006 +#define MEDIA_BUS_FMT_RGB565_2X8_BE0x1007 +#define MEDIA_BUS_FMT_RGB565_2X8_LE0x1008 +#define MEDIA_BUS_FMT_RGB666_1X18 0x1009 +#define MEDIA_BUS_FMT_RGB888_1X24 0x100a +#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b +#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c +#define MEDIA_BUS_FMT_ARGB_1X320x100d + +/* YUV (including grey) - next is 0x2024 */ +#define MEDIA_BUS_FMT_Y8_1X8 0x2001 +#define MEDIA_BUS_FMT_UV8_1X8 0x2015 +#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002 +#define MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003 +#define MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004 +#define MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005 +#define MEDIA_BUS_FMT_UYVY8_2X80x2006 +#define MEDIA_BUS_FMT_VYUY8_2X80x2007 +#define MEDIA_BUS_FMT_YUYV8_2X80x2008 +#define MEDIA_BUS_FMT_YVYU8_2X80x2009 +#define MEDIA_BUS_FMT_Y10_1X10 0x200a +#define MEDIA_BUS_FMT_UYVY10_2X10 0x2018 +#define MEDIA_BUS_FMT_VYUY10_2X10 0x2019 +#define MEDIA_BUS_FMT_YUYV10_2X10 0x200b +#define MEDIA_BUS_FMT_YVYU10_2X10 0x200c +#define MEDIA_BUS_FMT_Y12_1X12 0x2013 +#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f +#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010 +#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011 +#define MEDIA_BUS_FMT_YVYU8_1X16 0x2012 +#define MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014 +#define MEDIA_BUS_FMT_UYVY10_1X20 0x201a +#define MEDIA_BUS_FMT_VYUY10_1X20 0x201b +#define MEDIA_BUS_FMT_YUYV10_1X20 0x20
[PATCH v6 03/10] [media] Make use of the new media_bus_format definitions
Replace references to the v4l2_mbus_pixelcode enum with the new media_bus_format enum in all common headers. Signed-off-by: Boris Brezillon Acked-by: Sakari Ailus Acked-by: Hans Verkuil --- include/media/v4l2-mediabus.h| 2 +- include/media/v4l2-subdev.h | 2 +- include/uapi/linux/v4l2-subdev.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 395c4a9..59d7397 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -98,7 +98,7 @@ static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt, const struct v4l2_pix_format *pix_fmt, - enum v4l2_mbus_pixelcode code) + u32 code) { mbus_fmt->width = pix_fmt->width; mbus_fmt->height = pix_fmt->height; diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d746572..5860292 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -341,7 +341,7 @@ struct v4l2_subdev_video_ops { int (*query_dv_timings)(struct v4l2_subdev *sd, struct v4l2_dv_timings *timings); int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, -enum v4l2_mbus_pixelcode *code); +u32 *code); int (*enum_mbus_fsizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); int (*g_mbus_fmt)(struct v4l2_subdev *sd, diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index a619cdd..e0a7e3d 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -68,7 +68,7 @@ struct v4l2_subdev_crop { * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration * @pad: pad number, as reported by the media API * @index: format index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) */ struct v4l2_subdev_mbus_code_enum { __u32 pad; @@ -81,7 +81,7 @@ struct v4l2_subdev_mbus_code_enum { * struct v4l2_subdev_frame_size_enum - Media bus format enumeration * @pad: pad number, as reported by the media API * @index: format index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) */ struct v4l2_subdev_frame_size_enum { __u32 index; @@ -109,7 +109,7 @@ struct v4l2_subdev_frame_interval { * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration * @pad: pad number, as reported by the media API * @index: frame interval index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) * @width: frame width in pixels * @height: frame height in pixels * @interval: frame interval in seconds -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 07/10] [media] usb: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all usb drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 ++-- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c| 2 +- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 459bb0e..95653ba 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1878,7 +1878,7 @@ static int cx231xx_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(dev->sd_cx25840, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 3b3ada6..989d527 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -967,7 +967,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dev->height = f->fmt.pix.height; dev->format = fmt; - v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED); + v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); call_all(dev, video, s_mbus_fmt, &mbus_fmt); v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt); @@ -1012,7 +1012,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) resolution (since a standard change effects things like the number of lines in VACT, etc) */ memset(&mbus_fmt, 0, sizeof(mbus_fmt)); - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; mbus_fmt.width = dev->width; mbus_fmt.height = dev->height; call_all(dev, video, s_mbus_fmt, &mbus_fmt); diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 6d2ea9a..38cf6c8 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -430,7 +430,7 @@ int em28xx_init_camera(struct em28xx *dev) break; } - fmt.code = V4L2_MBUS_FMT_YUYV8_2X8; + fmt.code = MEDIA_BUS_FMT_YUYV8_2X8; fmt.width = 640; fmt.height = 480; v4l2_subdev_call(subdev, video, s_mbus_fmt, &fmt); diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c index ec799b4..d6bf982 100644 --- a/drivers/media/usb/go7007/go7007-v4l2.c +++ b/drivers/media/usb/go7007/go7007-v4l2.c @@ -252,7 +252,7 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) { struct v4l2_mbus_framefmt mbus_fmt; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; mbus_fmt.width = fmt ? fmt->fmt.pix.width : width; mbus_fmt.height = height; go->encoder_h_halve = 0; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 9623b62..2fd9b5e 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2966,7 +2966,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) memset(&fmt, 0, sizeof(fmt)); fmt.width = hdw->res_hor_val; fmt.height = hdw->res_ver_val; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_size(%dx%d)", fmt.width, fmt.height); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_mbus_fmt, &fmt); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 RESEND 07/10] [media] usb: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all usb drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 4 ++-- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/go7007/go7007-v4l2.c| 2 +- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 459bb0e..95653ba 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1878,7 +1878,7 @@ static int cx231xx_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(dev->sd_cx25840, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 3b3ada6..989d527 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -967,7 +967,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dev->height = f->fmt.pix.height; dev->format = fmt; - v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED); + v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); call_all(dev, video, s_mbus_fmt, &mbus_fmt); v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt); @@ -1012,7 +1012,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm) resolution (since a standard change effects things like the number of lines in VACT, etc) */ memset(&mbus_fmt, 0, sizeof(mbus_fmt)); - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; mbus_fmt.width = dev->width; mbus_fmt.height = dev->height; call_all(dev, video, s_mbus_fmt, &mbus_fmt); diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 6d2ea9a..38cf6c8 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -430,7 +430,7 @@ int em28xx_init_camera(struct em28xx *dev) break; } - fmt.code = V4L2_MBUS_FMT_YUYV8_2X8; + fmt.code = MEDIA_BUS_FMT_YUYV8_2X8; fmt.width = 640; fmt.height = 480; v4l2_subdev_call(subdev, video, s_mbus_fmt, &fmt); diff --git a/drivers/media/usb/go7007/go7007-v4l2.c b/drivers/media/usb/go7007/go7007-v4l2.c index ec799b4..d6bf982 100644 --- a/drivers/media/usb/go7007/go7007-v4l2.c +++ b/drivers/media/usb/go7007/go7007-v4l2.c @@ -252,7 +252,7 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) { struct v4l2_mbus_framefmt mbus_fmt; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; mbus_fmt.width = fmt ? fmt->fmt.pix.width : width; mbus_fmt.height = height; go->encoder_h_halve = 0; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index 9623b62..2fd9b5e 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -2966,7 +2966,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) memset(&fmt, 0, sizeof(fmt)); fmt.width = hdw->res_hor_val; fmt.height = hdw->res_ver_val; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_size(%dx%d)", fmt.width, fmt.height); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_mbus_fmt, &fmt); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 RESEND 03/10] [media] Make use of the new media_bus_format definitions
Replace references to the v4l2_mbus_pixelcode enum with the new media_bus_format enum in all common headers. Signed-off-by: Boris Brezillon Acked-by: Sakari Ailus Acked-by: Hans Verkuil --- include/media/v4l2-mediabus.h| 2 +- include/media/v4l2-subdev.h | 2 +- include/uapi/linux/v4l2-subdev.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 395c4a9..59d7397 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -98,7 +98,7 @@ static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt, const struct v4l2_pix_format *pix_fmt, - enum v4l2_mbus_pixelcode code) + u32 code) { mbus_fmt->width = pix_fmt->width; mbus_fmt->height = pix_fmt->height; diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d746572..5860292 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -341,7 +341,7 @@ struct v4l2_subdev_video_ops { int (*query_dv_timings)(struct v4l2_subdev *sd, struct v4l2_dv_timings *timings); int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, -enum v4l2_mbus_pixelcode *code); +u32 *code); int (*enum_mbus_fsizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); int (*g_mbus_fmt)(struct v4l2_subdev *sd, diff --git a/include/uapi/linux/v4l2-subdev.h b/include/uapi/linux/v4l2-subdev.h index a619cdd..e0a7e3d 100644 --- a/include/uapi/linux/v4l2-subdev.h +++ b/include/uapi/linux/v4l2-subdev.h @@ -68,7 +68,7 @@ struct v4l2_subdev_crop { * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration * @pad: pad number, as reported by the media API * @index: format index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) */ struct v4l2_subdev_mbus_code_enum { __u32 pad; @@ -81,7 +81,7 @@ struct v4l2_subdev_mbus_code_enum { * struct v4l2_subdev_frame_size_enum - Media bus format enumeration * @pad: pad number, as reported by the media API * @index: format index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) */ struct v4l2_subdev_frame_size_enum { __u32 index; @@ -109,7 +109,7 @@ struct v4l2_subdev_frame_interval { * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration * @pad: pad number, as reported by the media API * @index: frame interval index during enumeration - * @code: format code (from enum v4l2_mbus_pixelcode) + * @code: format code (MEDIA_BUS_FMT_ definitions) * @width: frame width in pixels * @height: frame height in pixels * @interval: frame interval in seconds -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v6 00/10] [media] Make mediabus format subsystem neutral
On Mon, 10 Nov 2014 18:21:44 +0100 Boris Brezillon wrote: > Hello, > > This patch series prepares the use of media bus formats outside of > the V4L2 subsytem (my final goal is to use it in the Atmel HLCDC DRM > driver where I have to configure my DPI/RGB bus according to the > connected display). > > The series first defines MEDIA_BUS_FMT_ macros, and then replace all > references to the v4l2_mbus_pixelcode enum and its values within the > kernel. > > Best Regards, > > Boris > > Changes since v5: > - fix V4L2_MBUS_FROM_MEDIA_BUS_FMT macro definition Sorry for the noise, I sent the wrong patch set :-(. -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 RESEND 10/10] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel
Place v4l2_mbus_pixelcode in a #ifndef __KERNEL__ section so that kernel users don't have access to these definitions. We have to keep this definition for user-space users even though they're encouraged to move to the new media_bus_format enum. Signed-off-by: Boris Brezillon Acked-by: Sakari Ailus --- include/uapi/linux/v4l2-mediabus.h | 45 -- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index 2618084..b1934a3 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h @@ -15,6 +15,33 @@ #include #include +/** + * struct v4l2_mbus_framefmt - frame format on the media bus + * @width: frame width + * @height:frame height + * @code: data format code (from enum v4l2_mbus_pixelcode) + * @field: used interlacing type (from enum v4l2_field) + * @colorspace:colorspace of the data (from enum v4l2_colorspace) + */ +struct v4l2_mbus_framefmt { + __u32 width; + __u32 height; + __u32 code; + __u32 field; + __u32 colorspace; + __u32 reserved[7]; +}; + +#ifndef __KERNEL__ +/* + * enum v4l2_mbus_pixelcode and its definitions are now deprecated, and + * MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be + * used instead. + * + * New defines should only be added to media-bus-format.h. The + * v4l2_mbus_pixelcode enum is frozen. + */ + #define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \ V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name @@ -102,22 +129,6 @@ enum v4l2_mbus_pixelcode { V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV_1X32), }; - -/** - * struct v4l2_mbus_framefmt - frame format on the media bus - * @width: frame width - * @height:frame height - * @code: data format code (from enum v4l2_mbus_pixelcode) - * @field: used interlacing type (from enum v4l2_field) - * @colorspace:colorspace of the data (from enum v4l2_colorspace) - */ -struct v4l2_mbus_framefmt { - __u32 width; - __u32 height; - __u32 code; - __u32 field; - __u32 colorspace; - __u32 reserved[7]; -}; +#endif /* __KERNEL__ */ #endif -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 RESEND 05/10] [media] pci: Make use of MEDIA_BUS_FMT definitions
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in pci drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/pci/cx18/cx18-av-core.c | 2 +- drivers/media/pci/cx18/cx18-controls.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 2 +- drivers/media/pci/ivtv/ivtv-controls.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/saa7134/saa7134-empress.c | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-av-core.c b/drivers/media/pci/cx18/cx18-av-core.c index 2d3afe0..4c6ce21 100644 --- a/drivers/media/pci/cx18/cx18-av-core.c +++ b/drivers/media/pci/cx18/cx18-av-core.c @@ -952,7 +952,7 @@ static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt int HSC, VSC, Vsrc, Hsrc, filter, Vlines; int is_50Hz = !(state->std & V4L2_STD_525_60); - if (fmt->code != V4L2_MBUS_FMT_FIXED) + if (fmt->code != MEDIA_BUS_FMT_FIXED) return -EINVAL; fmt->field = V4L2_FIELD_INTERLACED; diff --git a/drivers/media/pci/cx18/cx18-controls.c b/drivers/media/pci/cx18/cx18-controls.c index 282a3d2..4aeb7c6 100644 --- a/drivers/media/pci/cx18/cx18-controls.c +++ b/drivers/media/pci/cx18/cx18-controls.c @@ -98,7 +98,7 @@ static int cx18_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 6f2b590..71963db 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -294,7 +294,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, mbus_fmt.width = cx->cxhdl.width = w; mbus_fmt.height = cx->cxhdl.height = h; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &mbus_fmt); return cx18_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 682a4f9..091f5db 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -608,7 +608,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, dev->field = f->fmt.pix.field; dprintk(2, "%s() width=%d height=%d field=%d\n", __func__, dev->width, dev->height, dev->field); - v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED); + v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, MEDIA_BUS_FMT_FIXED); call_all(dev, video, s_mbus_fmt, &mbus_fmt); v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt); /* s_mbus_fmt overwrites f->fmt.pix.field, restore it */ diff --git a/drivers/media/pci/ivtv/ivtv-controls.c b/drivers/media/pci/ivtv/ivtv-controls.c index 2b0ab26..ccf548c 100644 --- a/drivers/media/pci/ivtv/ivtv-controls.c +++ b/drivers/media/pci/ivtv/ivtv-controls.c @@ -69,7 +69,7 @@ static int ivtv_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val) /* fix videodecoder resolution */ fmt.width = cxhdl->width / (is_mpeg1 ? 2 : 1); fmt.height = cxhdl->height; - fmt.code = V4L2_MBUS_FMT_FIXED; + fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(itv->sd_video, video, s_mbus_fmt, &fmt); return 0; } diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 3e0cb77..4d8ee18 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -595,7 +595,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f fmt->fmt.pix.width /= 2; mbus_fmt.width = fmt->fmt.pix.width; mbus_fmt.height = h; - mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + mbus_fmt.code = MEDIA_BUS_FMT_FIXED; v4l2_subdev_call(itv->sd_video, video, s_mbus_fmt, &mbus_fmt); return ivtv_g_fmt_vid_cap(file, fh, fmt); } diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index e4ea85f..8b3bb78 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c @@ -140,7 +140,7 @@ static int empress_s_fmt_vid_cap(struct file *file, void *priv, struct saa7134_dev *dev = video_drvdata(file); struct v4l2_mbus_framefmt mbus_fmt
[PATCH v6 RESEND 02/10] [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed them with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Update the v4l documentation accordingly. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++--- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml b/Documentation/DocBook/media/v4l/subdev-formats.xml index b2d5a03..18730b9 100644 --- a/Documentation/DocBook/media/v4l/subdev-formats.xml +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml @@ -86,7 +86,7 @@ green and 5-bit blue values padded on the high bit, transferred as 2 8-bit samples per pixel with the most significant bits (padding, red and half of the green value) transferred first will be named - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE. + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE. The following tables list existing packed RGB formats. @@ -176,8 +176,8 @@ - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 &dash-ent-24; @@ -204,8 +204,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 &dash-ent-24; @@ -232,8 +232,8 @@ r1 r0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003 &dash-ent-24; @@ -260,8 +260,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE + + MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004 &dash-ent-24; @@ -288,8 +288,8 @@ g4 g3 - - V4L2_MBUS_FMT_BGR565_2X8_BE + + MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005 &dash-ent-24; @@ -316,8 +316,8 @@ r1 r0 - - V4L2_MBUS_FMT_BGR565_2X8_LE + + MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006 &dash-ent-24; @@ -344,8 +344,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB565_2X8_BE + + MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007 &dash-ent-24; @@ -372,8 +372,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB565_2X8_LE + + MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008 &dash-ent-24; @@ -400,8 +400,8 @@ g4 g3 - - V4L2_MBUS_FMT_RGB666_1X18 + + MEDIA_BUS_FMT_RGB666_1X18 0x1009 &dash-ent-14; @@ -424,8 +424,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_1X24 + + MEDIA_BUS_FMT_RGB888_1X24 0x100a &dash-ent-8; @@ -454,8 +454,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_BE + + MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b &dash-ent-20; @@ -490,8 +490,8 @@ b1 b0 - - V4L2_MBUS_FMT_RGB888_2X12_LE + + MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c &dash-ent-20; @@ -526,8 +526,8 @@ g5 g4 - - V4L2_MBUS_FMT_ARGB888_1X32 + + MEDIA_BUS_FMT_ARGB888_1X32 0x100d a7 @@ -600,7 +600,7 @@ For instance, a format with uncompressed 10-bit Bayer components arranged in a red, green, green, blue pattern transferred as 2 8-bit samples per pixel with the least significant bits transferred first will - be named V4L2_MBUS_FMT_SRGGB10_2X8_PADHI_LE. + be named MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE. @@ -663,8 +663,8 @@ - - V4L2_MBUS_FMT_SBGGR8_1X8 + + MEDIA_BUS_FMT_SBGGR8_1X8 0x3001 - @@ -680,8 +680,8 @@ b1 b0 - - V4L2_MBUS_FMT_SGBRG8_1X8 + +
[PATCH v6 RESEND 00/10] [media] Make mediabus format subsystem neutral
Hello, This patch series prepares the use of media bus formats outside of the V4L2 subsytem (my final goal is to use it in the Atmel HLCDC DRM driver where I have to configure my DPI/RGB bus according to the connected display). The series first defines MEDIA_BUS_FMT_ macros, and then replace all references to the v4l2_mbus_pixelcode enum and its values within the kernel. Best Regards, Boris Changes since v5: - fix V4L2_MBUS_FROM_MEDIA_BUS_FMT macro definition Changes since v4: - put deprecated enum v4l2_mbus_pixelcode at the end of v4l2-mediabus.h header Changes since v3: - add a comment specifying that the v4l2_mbus_pixelcode enum definition is frozen Changes since v2: - drop media_bus_format enum and replace its values with pre-processor macros Changes since v1: - drop patches deprecating v4l2_mbus_pixelcode for user-space users - put V4L2 legacy format definitions into media-bus-format.h Boris Brezillon (10): [media] Move mediabus format definition to a more standard place [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values [media] Make use of the new media_bus_format definitions [media] i2c: Make use of media_bus_format enum [media] pci: Make use of MEDIA_BUS_FMT definitions [media] platform: Make use of media_bus_format enum [media] usb: Make use of media_bus_format enum staging: media: Make use of MEDIA_BUS_FMT_ definitions gpu: ipu-v3: Make use of media_bus_format enum [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Documentation/DocBook/media/v4l/subdev-formats.xml | 308 ++--- Documentation/video4linux/soc-camera.txt | 2 +- arch/arm/mach-davinci/board-dm355-evm.c| 2 +- arch/arm/mach-davinci/board-dm365-evm.c| 4 +- arch/arm/mach-davinci/dm355.c | 7 +- arch/arm/mach-davinci/dm365.c | 7 +- arch/arm/mach-shmobile/board-mackerel.c| 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- drivers/gpu/ipu-v3/ipu-csi.c | 66 ++--- drivers/media/i2c/adv7170.c| 16 +- drivers/media/i2c/adv7175.c| 16 +- drivers/media/i2c/adv7180.c| 6 +- drivers/media/i2c/adv7183.c| 6 +- drivers/media/i2c/adv7604.c| 72 ++--- drivers/media/i2c/adv7842.c| 6 +- drivers/media/i2c/ak881x.c | 8 +- drivers/media/i2c/cx25840/cx25840-core.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c | 6 +- drivers/media/i2c/ml86v7667.c | 6 +- drivers/media/i2c/mt9m032.c| 6 +- drivers/media/i2c/mt9p031.c| 8 +- drivers/media/i2c/mt9t001.c| 8 +- drivers/media/i2c/mt9v011.c| 6 +- drivers/media/i2c/mt9v032.c| 12 +- drivers/media/i2c/noon010pc30.c| 12 +- drivers/media/i2c/ov7670.c | 16 +- drivers/media/i2c/ov9650.c | 10 +- drivers/media/i2c/s5c73m3/s5c73m3.h| 6 +- drivers/media/i2c/s5k4ecgx.c | 4 +- drivers/media/i2c/s5k5baf.c| 14 +- drivers/media/i2c/s5k6a3.c | 2 +- drivers/media/i2c/s5k6aa.c | 8 +- drivers/media/i2c/saa6752hs.c | 6 +- drivers/media/i2c/saa7115.c| 2 +- drivers/media/i2c/saa717x.c| 2 +- drivers/media/i2c/smiapp/smiapp-core.c | 32 +-- drivers/media/i2c/soc_camera/imx074.c | 8 +- drivers/media/i2c/soc_camera/mt9m001.c | 14 +- drivers/media/i2c/soc_camera/mt9m111.c | 70 ++--- drivers/media/i2c/soc_camera/mt9t031.c | 10 +- drivers/media/i2c/soc_camera/mt9t112.c | 22 +- drivers/media/i2c/soc_camera/mt9v022.c | 26 +- drivers/media/i2c/soc_camera/ov2640.c | 54 ++-- drivers/media/i2c/soc_camera/ov5642.c | 8 +- drivers/media/i2c/soc_camera/ov6650.c | 58 ++-- drivers/media/i2c/soc_camera/ov772x.c | 20 +- drivers/media/i2c/soc_camera/ov9640.c | 40 +-- drivers/media/i2c/soc_camera/ov9740.c | 12 +- drivers/media/i2c/soc_camera/rj54n1cb0c.c | 54 ++-- drivers/media/i2c/soc_camera/tw9910.c | 10 +- drivers/media/i2c/sr030pc30.c | 14 +- drivers/media/i2c/tvp514x.c| 12 +- drivers/media/i2c/tvp5150.c| 6 +- drivers/media/i2c/tvp7002.c| 10 +- drivers/media/i2c/vs6624.c | 18 +- drivers/media/pci/cx18/cx18-av-core.c | 2 +- drivers/media/p
[PATCH v6 RESEND 04/10] [media] i2c: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definitions to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Replace all references to the old definitions in i2c drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/media/i2c/adv7170.c | 16 +++ drivers/media/i2c/adv7175.c | 16 +++ drivers/media/i2c/adv7180.c | 6 +-- drivers/media/i2c/adv7183.c | 6 +-- drivers/media/i2c/adv7604.c | 72 +++ drivers/media/i2c/adv7842.c | 6 +-- drivers/media/i2c/ak881x.c| 8 ++-- drivers/media/i2c/cx25840/cx25840-core.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c| 6 +-- drivers/media/i2c/ml86v7667.c | 6 +-- drivers/media/i2c/mt9m032.c | 6 +-- drivers/media/i2c/mt9p031.c | 8 ++-- drivers/media/i2c/mt9t001.c | 8 ++-- drivers/media/i2c/mt9v011.c | 6 +-- drivers/media/i2c/mt9v032.c | 12 +++--- drivers/media/i2c/noon010pc30.c | 12 +++--- drivers/media/i2c/ov7670.c| 16 +++ drivers/media/i2c/ov9650.c| 10 ++--- drivers/media/i2c/s5c73m3/s5c73m3.h | 6 +-- drivers/media/i2c/s5k4ecgx.c | 4 +- drivers/media/i2c/s5k5baf.c | 14 +++--- drivers/media/i2c/s5k6a3.c| 2 +- drivers/media/i2c/s5k6aa.c| 8 ++-- drivers/media/i2c/saa6752hs.c | 6 +-- drivers/media/i2c/saa7115.c | 2 +- drivers/media/i2c/saa717x.c | 2 +- drivers/media/i2c/smiapp/smiapp-core.c| 32 +++--- drivers/media/i2c/soc_camera/imx074.c | 8 ++-- drivers/media/i2c/soc_camera/mt9m001.c| 14 +++--- drivers/media/i2c/soc_camera/mt9m111.c| 70 +++--- drivers/media/i2c/soc_camera/mt9t031.c| 10 ++--- drivers/media/i2c/soc_camera/mt9t112.c| 22 +- drivers/media/i2c/soc_camera/mt9v022.c| 26 +-- drivers/media/i2c/soc_camera/ov2640.c | 54 +++ drivers/media/i2c/soc_camera/ov5642.c | 8 ++-- drivers/media/i2c/soc_camera/ov6650.c | 58 - drivers/media/i2c/soc_camera/ov772x.c | 20 - drivers/media/i2c/soc_camera/ov9640.c | 40 - drivers/media/i2c/soc_camera/ov9740.c | 12 +++--- drivers/media/i2c/soc_camera/rj54n1cb0c.c | 54 +++ drivers/media/i2c/soc_camera/tw9910.c | 10 ++--- drivers/media/i2c/sr030pc30.c | 14 +++--- drivers/media/i2c/tvp514x.c | 12 +++--- drivers/media/i2c/tvp5150.c | 6 +-- drivers/media/i2c/tvp7002.c | 10 ++--- drivers/media/i2c/vs6624.c| 18 46 files changed, 382 insertions(+), 382 deletions(-) diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c index 04bb297..40a1a95 100644 --- a/drivers/media/i2c/adv7170.c +++ b/drivers/media/i2c/adv7170.c @@ -63,9 +63,9 @@ static inline struct adv7170 *to_adv7170(struct v4l2_subdev *sd) static char *inputs[] = { "pass_through", "play_back" }; -static enum v4l2_mbus_pixelcode adv7170_codes[] = { - V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_UYVY8_1X16, +static u32 adv7170_codes[] = { + MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_UYVY8_1X16, }; /* --- */ @@ -263,7 +263,7 @@ static int adv7170_s_routing(struct v4l2_subdev *sd, } static int adv7170_enum_fmt(struct v4l2_subdev *sd, unsigned int index, - enum v4l2_mbus_pixelcode *code) + u32 *code) { if (index >= ARRAY_SIZE(adv7170_codes)) return -EINVAL; @@ -278,9 +278,9 @@ static int adv7170_g_fmt(struct v4l2_subdev *sd, u8 val = adv7170_read(sd, 0x7); if ((val & 0x40) == (1 << 6)) - mf->code = V4L2_MBUS_FMT_UYVY8_1X16; + mf->code = MEDIA_BUS_FMT_UYVY8_1X16; else - mf->code = V4L2_MBUS_FMT_UYVY8_2X8; + mf->code = MEDIA_BUS_FMT_UYVY8_2X8; mf->colorspace = V4L2_COLORSPACE_SMPTE170M; mf->width = 0; @@ -297,11 +297,11 @@ static int adv7170_s_fmt(struct v4l2_subdev *sd, int ret; switch (mf->code) { - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: val &= ~0x40; break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: val |= 0x40; break; diff --git a/drivers/media/i2c/adv7175.c b/drivers/media/i2c/adv7175.c index b88f3b3..d220af5 100644 --- a/drivers/media/i2c/adv7175.c +++ b/drivers/media/i2c/adv7175.c @@ -60,9 +60,9 @@ stati
[PATCH v6 RESEND 09/10] gpu: ipu-v3: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed enum values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in the ipu-v3 driver. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Philipp Zabel Acked-by: Sakari Ailus --- drivers/gpu/ipu-v3/ipu-csi.c | 66 ++-- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c index d6f56471..752cdd2 100644 --- a/drivers/gpu/ipu-v3/ipu-csi.c +++ b/drivers/gpu/ipu-v3/ipu-csi.c @@ -227,83 +227,83 @@ static int ipu_csi_set_testgen_mclk(struct ipu_csi *csi, u32 pixel_clk, static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code) { switch (mbus_code) { - case V4L2_MBUS_FMT_BGR565_2X8_BE: - case V4L2_MBUS_FMT_BGR565_2X8_LE: - case V4L2_MBUS_FMT_RGB565_2X8_BE: - case V4L2_MBUS_FMT_RGB565_2X8_LE: + case MEDIA_BUS_FMT_BGR565_2X8_BE: + case MEDIA_BUS_FMT_BGR565_2X8_LE: + case MEDIA_BUS_FMT_RGB565_2X8_BE: + case MEDIA_BUS_FMT_RGB565_2X8_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB565; cfg->mipi_dt = MIPI_DT_RGB565; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE: - case V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE: + case MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB444; cfg->mipi_dt = MIPI_DT_RGB444; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE: - case V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE: + case MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_RGB555; cfg->mipi_dt = MIPI_DT_RGB555; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_2X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_2X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_UYVY8_1X16: + case MEDIA_BUS_FMT_UYVY8_1X16: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_UYVY; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_16; break; - case V4L2_MBUS_FMT_YUYV8_1X16: + case MEDIA_BUS_FMT_YUYV8_1X16: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_YUV422_YUYV; cfg->mipi_dt = MIPI_DT_YUV422; cfg->data_width = IPU_CSI_DATA_WIDTH_16; break; - case V4L2_MBUS_FMT_SBGGR8_1X8: - case V4L2_MBUS_FMT_SGBRG8_1X8: - case V4L2_MBUS_FMT_SGRBG8_1X8: - case V4L2_MBUS_FMT_SRGGB8_1X8: + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGBRG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SRGGB8_1X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW8; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE: - case V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE: + case MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE: + case MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW10; cfg->data_width = IPU_CSI_DATA_WIDTH_8; break; - case V4L2_MBUS_FMT_SBGGR10_1X10: - case V4L2_MBUS_FMT_SGBRG10_1X10: - case V4L2_MBUS_FMT_SGRBG10_1X10: - case V4L2_MBUS_FMT_SRGGB10_1X10: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: + case M
[PATCH v6 RESEND 06/10] [media] platform: Make use of media_bus_format enum
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all platform drivers. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- Documentation/video4linux/soc-camera.txt | 2 +- arch/arm/mach-davinci/board-dm355-evm.c| 2 +- arch/arm/mach-davinci/board-dm365-evm.c| 4 +- arch/arm/mach-davinci/dm355.c | 7 +- arch/arm/mach-davinci/dm365.c | 7 +- arch/arm/mach-shmobile/board-mackerel.c| 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- drivers/media/platform/blackfin/bfin_capture.c | 14 +-- drivers/media/platform/davinci/vpbe.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 4 +- drivers/media/platform/exynos-gsc/gsc-core.c | 8 +- drivers/media/platform/exynos-gsc/gsc-core.h | 2 +- drivers/media/platform/exynos4-is/fimc-capture.c | 2 +- drivers/media/platform/exynos4-is/fimc-core.c | 14 +-- drivers/media/platform/exynos4-is/fimc-core.h | 4 +- drivers/media/platform/exynos4-is/fimc-isp.c | 16 +-- drivers/media/platform/exynos4-is/fimc-lite-reg.c | 26 ++--- drivers/media/platform/exynos4-is/fimc-lite.c | 14 +-- drivers/media/platform/exynos4-is/fimc-reg.c | 14 +-- drivers/media/platform/exynos4-is/mipi-csis.c | 14 +-- drivers/media/platform/marvell-ccic/mcam-core.c| 21 ++-- drivers/media/platform/marvell-ccic/mcam-core.h| 2 +- drivers/media/platform/omap3isp/ispccdc.c | 112 ++--- drivers/media/platform/omap3isp/ispccp2.c | 18 ++-- drivers/media/platform/omap3isp/ispcsi2.c | 42 drivers/media/platform/omap3isp/isppreview.c | 60 ++- drivers/media/platform/omap3isp/ispresizer.c | 19 ++-- drivers/media/platform/omap3isp/ispvideo.c | 95 + drivers/media/platform/omap3isp/ispvideo.h | 10 +- drivers/media/platform/s3c-camif/camif-capture.c | 10 +- drivers/media/platform/s3c-camif/camif-regs.c | 8 +- drivers/media/platform/s5p-tv/hdmi_drv.c | 2 +- drivers/media/platform/s5p-tv/sdo_drv.c| 2 +- drivers/media/platform/sh_vou.c| 8 +- drivers/media/platform/soc_camera/atmel-isi.c | 22 ++-- drivers/media/platform/soc_camera/mx2_camera.c | 26 +++-- drivers/media/platform/soc_camera/mx3_camera.c | 6 +- drivers/media/platform/soc_camera/omap1_camera.c | 36 +++ drivers/media/platform/soc_camera/pxa_camera.c | 16 +-- drivers/media/platform/soc_camera/rcar_vin.c | 14 +-- .../platform/soc_camera/sh_mobile_ceu_camera.c | 20 ++-- drivers/media/platform/soc_camera/sh_mobile_csi2.c | 38 +++ drivers/media/platform/soc_camera/soc_camera.c | 2 +- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/soc_camera/soc_mediabus.c | 78 +++--- drivers/media/platform/via-camera.c| 8 +- drivers/media/platform/vsp1/vsp1_bru.c | 14 +-- drivers/media/platform/vsp1/vsp1_hsit.c| 12 +-- drivers/media/platform/vsp1/vsp1_lif.c | 10 +- drivers/media/platform/vsp1/vsp1_lut.c | 14 +-- drivers/media/platform/vsp1/vsp1_rwpf.c| 10 +- drivers/media/platform/vsp1/vsp1_sru.c | 12 +-- drivers/media/platform/vsp1/vsp1_uds.c | 10 +- drivers/media/platform/vsp1/vsp1_video.c | 42 include/media/davinci/vpbe.h | 2 +- include/media/davinci/vpbe_venc.h | 5 +- include/media/exynos-fimc.h| 2 +- include/media/soc_camera.h | 2 +- include/media/soc_mediabus.h | 6 +- 59 files changed, 483 insertions(+), 495 deletions(-) diff --git a/Documentation/video4linux/soc-camera.txt b/Documentation/video4linux/soc-camera.txt index daa9e2a..84f41cf 100644 --- a/Documentation/video4linux/soc-camera.txt +++ b/Documentation/video4linux/soc-camera.txt @@ -151,7 +151,7 @@ they are transferred over a media bus. Soc-camera provides support to conveniently manage these formats. A table of standard transformations is maintained by soc-camera core, which describes, what FOURCC pixel format will be obtained, if a media-bus pixel format is stored in memory according to -certain rules. E.g. if V4L2_MBUS_FMT_YUYV8_2X8 data is sampled with 8 bits per +certain rules. E.g. if MEDIA_BUS_FMT_YUYV8_2X8 data is sampled with 8 bits per sample and stored in memory in the little-endian order with no gaps between bytes, data in memory will represent the V4L2_PIX_FMT_YUYV FOURCC format. These standard transformations will be used
[PATCH v6 RESEND 08/10] staging: media: Make use of MEDIA_BUS_FMT_ definitions
In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all media drivers residing in staging. Signed-off-by: Boris Brezillon Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 18 ++-- .../staging/media/davinci_vpfe/dm365_ipipe_hw.c| 26 +++--- drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 100 ++--- drivers/staging/media/davinci_vpfe/dm365_isif.c| 90 +-- drivers/staging/media/davinci_vpfe/dm365_resizer.c | 98 ++-- .../staging/media/davinci_vpfe/vpfe_mc_capture.c | 18 ++-- drivers/staging/media/omap4iss/iss_csi2.c | 62 ++--- drivers/staging/media/omap4iss/iss_ipipe.c | 16 ++-- drivers/staging/media/omap4iss/iss_ipipeif.c | 28 +++--- drivers/staging/media/omap4iss/iss_resizer.c | 26 +++--- drivers/staging/media/omap4iss/iss_video.c | 78 drivers/staging/media/omap4iss/iss_video.h | 10 +-- 12 files changed, 285 insertions(+), 285 deletions(-) diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index bdc7f00..704fa20 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -37,15 +37,15 @@ /* ipipe input format's */ static const unsigned int ipipe_input_fmts[] = { - V4L2_MBUS_FMT_UYVY8_2X8, - V4L2_MBUS_FMT_SGRBG12_1X12, - V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, - V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8, + MEDIA_BUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_SGRBG12_1X12, + MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, }; /* ipipe output format's */ static const unsigned int ipipe_output_fmts[] = { - V4L2_MBUS_FMT_UYVY8_2X8, + MEDIA_BUS_FMT_UYVY8_2X8, }; static int ipipe_validate_lutdpc_params(struct vpfe_ipipe_lutdpc *lutdpc) @@ -1457,7 +1457,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe, /* If not found, use SBGGR10 as default */ if (i >= ARRAY_SIZE(ipipe_input_fmts)) - fmt->code = V4L2_MBUS_FMT_SGRBG12_1X12; + fmt->code = MEDIA_BUS_FMT_SGRBG12_1X12; } else if (pad == IPIPE_PAD_SOURCE) { for (i = 0; i < ARRAY_SIZE(ipipe_output_fmts); i++) if (fmt->code == ipipe_output_fmts[i]) @@ -1465,7 +1465,7 @@ ipipe_try_format(struct vpfe_ipipe_device *ipipe, /* If not found, use UYVY as default */ if (i >= ARRAY_SIZE(ipipe_output_fmts)) - fmt->code = V4L2_MBUS_FMT_UYVY8_2X8; + fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; } fmt->width = clamp_t(u32, fmt->width, MIN_OUT_HEIGHT, max_out_width); @@ -1642,7 +1642,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = IPIPE_PAD_SINK; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_SGRBG12_1X12; + format.format.code = MEDIA_BUS_FMT_SGRBG12_1X12; format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A; format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A; ipipe_set_format(sd, fh, &format); @@ -1650,7 +1650,7 @@ ipipe_init_formats(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) memset(&format, 0, sizeof(format)); format.pad = IPIPE_PAD_SOURCE; format.which = fh ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; - format.format.code = V4L2_MBUS_FMT_UYVY8_2X8; + format.format.code = MEDIA_BUS_FMT_UYVY8_2X8; format.format.width = IPIPE_MAX_OUTPUT_WIDTH_A; format.format.height = IPIPE_MAX_OUTPUT_HEIGHT_A; ipipe_set_format(sd, fh, &format); diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c index b2daf5e..6461de1 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe_hw.c @@ -196,12 +196,12 @@ ipipe_setup_resizer(void *__iomem rsz_base, struct resizer_params *params) rsz_set_rsz_regs(rsz_base, RSZ_B, params); } -static u32 ipipe_get_color_pat(enum v4l2_mbus_pixelcode pix) +static u32 ipipe_get_color_pat(u32 pix) { switch (pix) { - case V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8: - case V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8: - case V4L2_MBUS_FMT_SGRBG12_1X12: + case MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8: + case MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8: + case MEDIA_BUS_FMT_SGRBG12_1X12: return ipipe_sgrbg_pattern; default: @@ -211,23 +211,23 @@ static u32 ipipe_get_c
[PATCH 0/7] staging: unisys: more cleanup in visorchipset
Another set of checkpatch.pl fixups for visorchipset files. Benjamin Romer (7): staging: unisys: remove testing.h from visorchipset staging: unisys: refactor visorchipset_file_init() staging: unisys: fix CamelCase global variables in file.c staging: unisys: get rid of HAVE_UNLOCKED_IOCTL code staging: unisys: get rid of goto in visorchipset_open() staging: unisys: fix CamelCase in visorchipset_mmap() staging: unisys: get rid of goto in visorchipset_ioctl() drivers/staging/unisys/visorchipset/file.c | 123 - drivers/staging/unisys/visorchipset/file.h | 2 +- drivers/staging/unisys/visorchipset/testing.h | 43 --- .../unisys/visorchipset/visorchipset_main.c| 1 - 4 files changed, 47 insertions(+), 122 deletions(-) delete mode 100644 drivers/staging/unisys/visorchipset/testing.h -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: unisys: remove testing.h from visorchipset
Nothing in this file is used anymore, so remove it and the one last reference to it from visorchipset_main.c. Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/testing.h | 43 -- .../unisys/visorchipset/visorchipset_main.c| 1 - 2 files changed, 44 deletions(-) delete mode 100644 drivers/staging/unisys/visorchipset/testing.h diff --git a/drivers/staging/unisys/visorchipset/testing.h b/drivers/staging/unisys/visorchipset/testing.h deleted file mode 100644 index 573aa8b..000 --- a/drivers/staging/unisys/visorchipset/testing.h +++ /dev/null @@ -1,43 +0,0 @@ -/* testing.h - * - * Copyright (C) 2010 - 2013 UNISYS CORPORATION - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - */ - -#ifndef __VISORCHIPSET_TESTING_H__ -#define __VISORCHIPSET_TESTING_H__ - -#define VISORCHIPSET_TEST_PROC -#include -#include "globals.h" -#include "controlvmchannel.h" - -void test_produce_test_message(struct controlvm_message *msg, - int isLocalTestAddr); -BOOL test_consume_test_message(struct controlvm_message *msg); -void test_manufacture_vnic_client_add(void *p); -void test_manufacture_vnic_client_add_phys(HOSTADDRESS addr); -void test_manufacture_preamble_messages(void); -void test_manufacture_device_attach(ulong busNo, ulong devNo); -void test_manufacture_device_add(ulong busNo, ulong devNo, uuid_le dataTypeGuid, -void *pChannel); -void test_manufacture_add_bus(ulong busNo, ulong maxDevices, - uuid_le id, u8 *name, BOOL isServer); -void test_manufacture_device_destroy(ulong busNo, ulong devNo); -void test_manufacture_bus_destroy(ulong busNo); -void test_manufacture_detach_externalPort(ulong switchNo, ulong externalPortNo); -void test_manufacture_detach_internalPort(ulong switchNo, ulong internalPortNo); -void test_cleanup(void); - -#endif diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index c8f7bea..0a62177 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -20,7 +20,6 @@ #include "procobjecttree.h" #include "visorchannel.h" #include "periodic_work.h" -#include "testing.h" #include "file.h" #include "parser.h" #include "uniklog.h" -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] staging: unisys: fix CamelCase in visorchipset_mmap()
Fix CamelCase name: physAddr => physaddr Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index d43c403..b82bc4a 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -121,7 +121,7 @@ visorchipset_release(struct inode *inode, struct file *file) static int visorchipset_mmap(struct file *file, struct vm_area_struct *vma) { - ulong physAddr = 0; + ulong physaddr = 0; ulong offset = vma->vm_pgoff << PAGE_SHIFT; GUEST_PHYSICAL_ADDRESS addr = 0; @@ -146,10 +146,10 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) ERRDRV("%s control channel address is 0", __func__); return -ENXIO; } - physAddr = (ulong) (addr); - DEBUGDRV("mapping physical address = 0x%lx", physAddr); + physaddr = (ulong)addr; + DEBUGDRV("mapping physical address = 0x%lx", physaddr); if (remap_pfn_range(vma, vma->vm_start, - physAddr >> PAGE_SHIFT, + physaddr >> PAGE_SHIFT, vma->vm_end - vma->vm_start, /*pgprot_noncached */ (vma->vm_page_prot))) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/7] staging: unisys: get rid of goto in visorchipset_open()
This goto uses CamelCase and was completely unnecessary. Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 4b0c158..d43c403 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -103,17 +103,12 @@ static int visorchipset_open(struct inode *inode, struct file *file) { unsigned minor_number = iminor(inode); - int rc = -ENODEV; DEBUGDRV("%s", __func__); if (minor_number != 0) - goto Away; + return -ENODEV; file->private_data = NULL; - rc = 0; -Away: - if (rc < 0) - ERRDRV("%s minor=%d failed", __func__, minor_number); - return rc; + return 0; } static int -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging: unisys: fix CamelCase global variables in file.c
Fix CamelCase names: Cdev => file_cdev PControlVm_channel => file_controlvm_channel MajorDev => majordev Registered => registered Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index cb5bcb9..f4d01ed 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -28,10 +28,10 @@ #define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c -static struct cdev Cdev; -static VISORCHANNEL **PControlVm_channel; -static dev_t MajorDev = -1; /**< indicates major num for device */ -static BOOL Registered = FALSE; +static struct cdev file_cdev; +static VISORCHANNEL **file_controlvm_channel; +static dev_t majordev = -1; /**< indicates major num for device */ +static BOOL registered = FALSE; static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file); @@ -61,50 +61,50 @@ int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel) { int rc = 0; - PControlVm_channel = controlvm_channel; - MajorDev = major_dev; - cdev_init(&Cdev, &visorchipset_fops); - Cdev.owner = THIS_MODULE; - if (MAJOR(MajorDev) == 0) { + file_controlvm_channel = controlvm_channel; + majordev = major_dev; + cdev_init(&file_cdev, &visorchipset_fops); + file_cdev.owner = THIS_MODULE; + if (MAJOR(majordev) == 0) { /* dynamic major device number registration required */ - if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) { + if (alloc_chrdev_region(&majordev, 0, 1, MYDRVNAME) < 0) { ERRDRV("Unable to allocate+register char device %s", MYDRVNAME); return -1; } - Registered = TRUE; - INFODRV("New major number %d registered\n", MAJOR(MajorDev)); + registered = TRUE; + INFODRV("New major number %d registered\n", MAJOR(majordev)); } else { /* static major device number registration required */ - if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) { + if (register_chrdev_region(majordev, 1, MYDRVNAME) < 0) { ERRDRV("Unable to register char device %s", MYDRVNAME); return -1; } - Registered = TRUE; - INFODRV("Static major number %d registered\n", MAJOR(MajorDev)); + registered = TRUE; + INFODRV("Static major number %d registered\n", MAJOR(majordev)); } - rc = cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1); + rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1); if (rc < 0) { ERRDRV("failed to create char device: (status=%d)\n", rc); return -1; } INFODRV("Registered char device for %s (major=%d)", - MYDRVNAME, MAJOR(MajorDev)); + MYDRVNAME, MAJOR(majordev)); return 0; } void visorchipset_file_cleanup(void) { - if (Cdev.ops != NULL) - cdev_del(&Cdev); - Cdev.ops = NULL; - if (Registered) { - if (MAJOR(MajorDev) >= 0) { - unregister_chrdev_region(MajorDev, 1); - MajorDev = MKDEV(0, 0); + if (file_cdev.ops != NULL) + cdev_del(&file_cdev); + file_cdev.ops = NULL; + if (registered) { + if (MAJOR(majordev) >= 0) { + unregister_chrdev_region(majordev, 1); + majordev = MKDEV(0, 0); } - Registered = FALSE; + registered = FALSE; } } @@ -148,11 +148,11 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) switch (offset) { case VISORCHIPSET_MMAP_CONTROLCHANOFFSET: vma->vm_flags |= VM_IO; - if (*PControlVm_channel == NULL) { + if (*file_controlvm_channel == NULL) { ERRDRV("%s no controlvm channel yet", __func__); return -ENXIO; } - visorchannel_read(*PControlVm_channel, + visorchannel_read(*file_controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, gp_control_channel), &addr, sizeof(addr)); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/7] staging: unisys: get rid of goto in visorchipset_ioctl()
Remove another completely unnecessary goto and just return the values directly. Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index b82bc4a..ced3fbe 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -166,7 +166,6 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - int rc = SUCCESS; s64 adjustment; s64 vrtc_offset; @@ -177,28 +176,21 @@ long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) vrtc_offset = issue_vmcall_query_guest_virtual_time_offset(); if (copy_to_user ((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) { - rc = -EFAULT; - goto Away; + return -EFAULT; } DBGINF("insde visorchipset_ioctl, cmd=%d, vrtc_offset=%lld", cmd, vrtc_offset); - break; + return SUCCESS; case VMCALL_UPDATE_PHYSICAL_TIME: if (copy_from_user (&adjustment, (void __user *)arg, sizeof(adjustment))) { - rc = -EFAULT; - goto Away; + return -EFAULT; } DBGINF("insde visorchipset_ioctl, cmd=%d, adjustment=%lld", cmd, adjustment); - rc = issue_vmcall_update_physical_time(adjustment); - break; + return issue_vmcall_update_physical_time(adjustment); default: LOGERR("visorchipset_ioctl received invalid command"); - rc = -EFAULT; - break; + return -EFAULT; } -Away: - DBGINF("exiting %d!", rc); - return rc; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] staging: unisys: refactor visorchipset_file_init()
Fix the declaration so it is a single line. Fix CamelCase parameter names: MajorDev => major_dev pControlVm_channel => controlvm_channel Remove the unnecessary gotos and just return directly in error cases. Fix the last error condition so it returns the result of cdev_add() instead of always zero. Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 22 ++ drivers/staging/unisys/visorchipset/file.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 373fa36..cb5bcb9 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -57,13 +57,12 @@ static const struct file_operations visorchipset_fops = { .mmap = visorchipset_mmap, }; -int -visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) +int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel) { - int rc = -1; + int rc = 0; - PControlVm_channel = pControlVm_channel; - MajorDev = majorDev; + PControlVm_channel = controlvm_channel; + MajorDev = major_dev; cdev_init(&Cdev, &visorchipset_fops); Cdev.owner = THIS_MODULE; if (MAJOR(MajorDev) == 0) { @@ -71,7 +70,7 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) { ERRDRV("Unable to allocate+register char device %s", MYDRVNAME); - goto Away; + return -1; } Registered = TRUE; INFODRV("New major number %d registered\n", MAJOR(MajorDev)); @@ -79,20 +78,19 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) /* static major device number registration required */ if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) { ERRDRV("Unable to register char device %s", MYDRVNAME); - goto Away; + return -1; } Registered = TRUE; INFODRV("Static major number %d registered\n", MAJOR(MajorDev)); } - if (cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1) < 0) { + rc = cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1); + if (rc < 0) { ERRDRV("failed to create char device: (status=%d)\n", rc); - goto Away; + return -1; } INFODRV("Registered char device for %s (major=%d)", MYDRVNAME, MAJOR(MajorDev)); - rc = 0; -Away: - return rc; + return 0; } void diff --git a/drivers/staging/unisys/visorchipset/file.h b/drivers/staging/unisys/visorchipset/file.h index 21bb906..fb434eb 100644 --- a/drivers/staging/unisys/visorchipset/file.h +++ b/drivers/staging/unisys/visorchipset/file.h @@ -20,7 +20,7 @@ #include "globals.h" -int visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel); +int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel); void visorchipset_file_cleanup(void); #endif -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging: unisys: get rid of HAVE_UNLOCKED_IOCTL code
We definitely have it, so there's no point in keeping the older stuff around. Get rid of the #ifdefs and old code. Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index f4d01ed..4b0c158 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -36,23 +36,14 @@ static BOOL registered = FALSE; static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file); static int visorchipset_mmap(struct file *file, struct vm_area_struct *vma); -#ifdef HAVE_UNLOCKED_IOCTL long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -#else -int visorchipset_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); -#endif static const struct file_operations visorchipset_fops = { .owner = THIS_MODULE, .open = visorchipset_open, .read = NULL, .write = NULL, -#ifdef HAVE_UNLOCKED_IOCTL .unlocked_ioctl = visorchipset_ioctl, -#else - .ioctl = visorchipset_ioctl, -#endif .release = visorchipset_release, .mmap = visorchipset_mmap, }; @@ -178,14 +169,7 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -#ifdef HAVE_UNLOCKED_IOCTL -long -visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -#else -int -visorchipset_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -#endif +long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int rc = SUCCESS; s64 adjustment; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v6 RESEND 01/10] [media] Move mediabus format definition to a more standard place
Define MEDIA_BUS_FMT macros (re-using the values defined in the v4l2_mbus_pixelcode enum) into a separate header file so that they can be used from the DRM/KMS subsystem without any reference to the V4L2 subsystem. Then set V4L2_MBUS_FMT definitions to the MEDIA_BUS_FMT values using the V4L2_MBUS_FROM_MEDIA_BUS_FMT macro. Signed-off-by: Boris Brezillon Acked-by: Guennadi Liakhovetski Acked-by: Hans Verkuil Acked-by: Sakari Ailus --- include/uapi/linux/Kbuild | 1 + include/uapi/linux/media-bus-format.h | 125 +++ include/uapi/linux/v4l2-mediabus.h| 184 +++--- 3 files changed, 206 insertions(+), 104 deletions(-) create mode 100644 include/uapi/linux/media-bus-format.h diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index b70237e..ed39ac8 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild @@ -241,6 +241,7 @@ header-y += map_to_7segment.h header-y += matroxfb.h header-y += mdio.h header-y += media.h +header-y += media-bus-format.h header-y += mei.h header-y += memfd.h header-y += mempolicy.h diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h new file mode 100644 index 000..23b4090 --- /dev/null +++ b/include/uapi/linux/media-bus-format.h @@ -0,0 +1,125 @@ +/* + * Media Bus API header + * + * Copyright (C) 2009, Guennadi Liakhovetski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __LINUX_MEDIA_BUS_FORMAT_H +#define __LINUX_MEDIA_BUS_FORMAT_H + +/* + * These bus formats uniquely identify data formats on the data bus. Format 0 + * is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where + * the data format is fixed. Additionally, "2X8" means that one pixel is + * transferred in two 8-bit samples, "BE" or "LE" specify in which order those + * samples are transferred over the bus: "LE" means that the least significant + * bits are transferred first, "BE" means that the most significant bits are + * transferred first, and "PADHI" and "PADLO" define which bits - low or high, + * in the incomplete high byte, are filled with padding bits. + * + * The bus formats are grouped by type, bus_width, bits per component, samples + * per pixel and order of subsamples. Numerical values are sorted using generic + * numerical sort order (8 thus comes before 10). + * + * As their value can't change when a new bus format is inserted in the + * enumeration, the bus formats are explicitly given a numerical value. The next + * free values for each category are listed below, update them when inserting + * new pixel codes. + */ + +#define MEDIA_BUS_FMT_FIXED0x0001 + +/* RGB - next is 0x100e */ +#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001 +#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002 +#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003 +#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004 +#define MEDIA_BUS_FMT_BGR565_2X8_BE0x1005 +#define MEDIA_BUS_FMT_BGR565_2X8_LE0x1006 +#define MEDIA_BUS_FMT_RGB565_2X8_BE0x1007 +#define MEDIA_BUS_FMT_RGB565_2X8_LE0x1008 +#define MEDIA_BUS_FMT_RGB666_1X18 0x1009 +#define MEDIA_BUS_FMT_RGB888_1X24 0x100a +#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b +#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c +#define MEDIA_BUS_FMT_ARGB_1X320x100d + +/* YUV (including grey) - next is 0x2024 */ +#define MEDIA_BUS_FMT_Y8_1X8 0x2001 +#define MEDIA_BUS_FMT_UV8_1X8 0x2015 +#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002 +#define MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003 +#define MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004 +#define MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005 +#define MEDIA_BUS_FMT_UYVY8_2X80x2006 +#define MEDIA_BUS_FMT_VYUY8_2X80x2007 +#define MEDIA_BUS_FMT_YUYV8_2X80x2008 +#define MEDIA_BUS_FMT_YVYU8_2X80x2009 +#define MEDIA_BUS_FMT_Y10_1X10 0x200a +#define MEDIA_BUS_FMT_UYVY10_2X10 0x2018 +#define MEDIA_BUS_FMT_VYUY10_2X10 0x2019 +#define MEDIA_BUS_FMT_YUYV10_2X10 0x200b +#define MEDIA_BUS_FMT_YVYU10_2X10 0x200c +#define MEDIA_BUS_FMT_Y12_1X12 0x2013 +#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f +#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010 +#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011 +#define MEDIA_BUS_FMT_YVYU8_1X16 0x2012 +#define MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014 +#define MEDIA_BUS_FMT_UYVY10_1X20 0x201a +#define MEDIA_BUS_FMT_VYUY10_1X20 0x201b +#define MEDIA_BUS_FMT_YUYV10_1X20 0x20
[PATCH 0/4] staging: unisys: visorchannel: CamelCase and comment cleanup
From: Bryan Thompson This series of patches addresses two CamelCase issues and a spinlock commenting issue reported by checkpatch on the visorchannel tree. Bryan Thompson (3): staging: unisys: visorchannel: Rename CamelCase variable channelBytes staging: unisys: visorchannel: Rename CamelCase variable nQueues staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct drivers/staging/unisys/visorchannel/visorchannel.h | 12 +++ .../unisys/visorchannel/visorchannel_funcs.c | 37 ++-- 2 files changed, 25 insertions(+), 24 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: unisys: visorchannel: Rename CamelCase variable channelBytes
From: Bryan Thompson Rename channelBytes to channel_bytes in the series of visorchannel_create functions provided by visorchannel. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h | 10 .../unisys/visorchannel/visorchannel_funcs.c | 26 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5061edf..5dbfddb 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -35,17 +35,17 @@ typedef struct VISORCHANNEL_Tag VISORCHANNEL; /* Note that for visorchannel_create() and visorchannel_create_overlapped(), - * and arguments may be 0 if we are a channel CLIENT. + * and arguments may be 0 if we are a channel CLIENT. * In this case, the values can simply be read from the channel header. */ VISORCHANNEL *visorchannel_create(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); VISORCHANNEL *visorchannel_create_with_lock(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); void visorchannel_destroy(VISORCHANNEL *channel); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 36559d5..6601b3e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -49,7 +49,7 @@ struct VISORCHANNEL_Tag { * NOT modify this data area. */ static VISORCHANNEL * -visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid, BOOL needs_lock) { @@ -87,18 +87,18 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, rc = NULL; goto cleanup; } - if (channelBytes == 0) + if (channel_bytes == 0) /* we had better be a CLIENT of this channel */ - channelBytes = (ulong)p->chan_hdr.size; + channel_bytes = (ulong)p->chan_hdr.size; if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) /* we had better be a CLIENT of this channel */ guid = p->chan_hdr.chtype; - if (visor_memregion_resize(p->memregion, channelBytes) < 0) { + if (visor_memregion_resize(p->memregion, channel_bytes) < 0) { ERRDRV("visor_memregion_resize failed: (status=0)\n"); rc = NULL; goto cleanup; } - p->size = channelBytes; + p->size = channel_bytes; p->guid = guid; rc = p; @@ -114,37 +114,37 @@ cleanup: } VISORCHANNEL * -visorchannel_create(HOSTADDRESS physaddr, ulong channelBytes, uuid_le guid) +visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create); VISORCHANNEL * -visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, TRUE); } EXPORT_SYMBOL_GPL(visorchannel_create_with_lock); VISORCHANNEL * -visorchannel_create_overlapped(ulong channelBytes, +visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid) { - return visorchannel_create_guts(0, channelBytes, parent, off, guid, + return visorchannel_create_guts(0, channel_bytes, parent, off, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create_overlapped);
[PATCH 3/3] staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct
From: Bryan Thompson Add comments indicating the requirements and use of the insert_lock and remove_lock in the VISORCHANNEL_Tag structure. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 1568b95..1ce25c2 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -33,9 +33,10 @@ struct VISORCHANNEL_Tag { struct channel_header chan_hdr; uuid_le guid; ulong size; - BOOL needs_lock; - spinlock_t insert_lock; - spinlock_t remove_lock; + BOOL needs_lock;/* channel creator knows if more than one +* thread will be inserting or removing */ + spinlock_t insert_lock; /* protect head writes in chan_hdr */ + spinlock_t remove_lock; /* protect tail writes in chan_hdr */ struct { struct signal_queue_header req_queue; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: unisys: visorchannel: Rename CamelCase variable nQueues
From: Bryan Thompson Rename the visorchannel_debug parameter nQueues to num_queues. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h |2 +- .../unisys/visorchannel/visorchannel_funcs.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5dbfddb..3f2184c 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -68,7 +68,7 @@ u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel); char *visorchannel_uuid_id(uuid_le *guid, char *s); -void visorchannel_debug(VISORCHANNEL *channel, int nQueues, +void visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off); void visorchannel_dump_section(VISORCHANNEL *chan, char *s, int off, int len, struct seq_file *seq); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 6601b3e..1568b95 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -565,7 +565,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) } void -visorchannel_debug(VISORCHANNEL *channel, int nQueues, +visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off) { HOSTADDRESS addr = 0; @@ -625,7 +625,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, if ((phdr->ch_space_offset == 0) || (errcode < 0)) ; else - for (i = 0; i < nQueues; i++) { + for (i = 0; i < num_queues; i++) { struct signal_queue_header q; errcode = visorchannel_read(channel, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: unisys: visorchannel: Rename CamelCase variable nQueues
Rename the visorchannel_debug parameter nQueues to num_queues. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h |2 +- .../unisys/visorchannel/visorchannel_funcs.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5dbfddb..3f2184c 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -68,7 +68,7 @@ u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel); char *visorchannel_uuid_id(uuid_le *guid, char *s); -void visorchannel_debug(VISORCHANNEL *channel, int nQueues, +void visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off); void visorchannel_dump_section(VISORCHANNEL *chan, char *s, int off, int len, struct seq_file *seq); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 6601b3e..1568b95 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -565,7 +565,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) } void -visorchannel_debug(VISORCHANNEL *channel, int nQueues, +visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off) { HOSTADDRESS addr = 0; @@ -625,7 +625,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, if ((phdr->ch_space_offset == 0) || (errcode < 0)) ; else - for (i = 0; i < nQueues; i++) { + for (i = 0; i < num_queues; i++) { struct signal_queue_header q; errcode = visorchannel_read(channel, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct
Add comments indicating the requirements and use of the insert_lock and remove_lock in the VISORCHANNEL_Tag structure. Signed-off-by: Bryan Thompson --- .../unisys/visorchannel/visorchannel_funcs.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 1568b95..1ce25c2 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -33,9 +33,10 @@ struct VISORCHANNEL_Tag { struct channel_header chan_hdr; uuid_le guid; ulong size; - BOOL needs_lock; - spinlock_t insert_lock; - spinlock_t remove_lock; + BOOL needs_lock;/* channel creator knows if more than one +* thread will be inserting or removing */ + spinlock_t insert_lock; /* protect head writes in chan_hdr */ + spinlock_t remove_lock; /* protect tail writes in chan_hdr */ struct { struct signal_queue_header req_queue; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: unisys: visorchannel: CamelCase and comment cleanup
Resending due to return address error. This series of patches addresses two CamelCase issues and a spinlock commenting issue reported by checkpatch on the visorchannel tree. Bryan Thompson (3): staging: unisys: visorchannel: Rename CamelCase variable channelBytes staging: unisys: visorchannel: Rename CamelCase variable nQueues staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct drivers/staging/unisys/visorchannel/visorchannel.h | 12 +++ .../unisys/visorchannel/visorchannel_funcs.c | 37 ++-- 2 files changed, 25 insertions(+), 24 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: unisys: visorchannel: Rename CamelCase variable channelBytes
Rename channelBytes to channel_bytes in the series of visorchannel_create functions provided by visorchannel. Signed-off-by: Bryan Thompson --- drivers/staging/unisys/visorchannel/visorchannel.h | 10 .../unisys/visorchannel/visorchannel_funcs.c | 26 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5061edf..5dbfddb 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -35,17 +35,17 @@ typedef struct VISORCHANNEL_Tag VISORCHANNEL; /* Note that for visorchannel_create() and visorchannel_create_overlapped(), - * and arguments may be 0 if we are a channel CLIENT. + * and arguments may be 0 if we are a channel CLIENT. * In this case, the values can simply be read from the channel header. */ VISORCHANNEL *visorchannel_create(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); VISORCHANNEL *visorchannel_create_with_lock(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); void visorchannel_destroy(VISORCHANNEL *channel); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 36559d5..6601b3e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -49,7 +49,7 @@ struct VISORCHANNEL_Tag { * NOT modify this data area. */ static VISORCHANNEL * -visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid, BOOL needs_lock) { @@ -87,18 +87,18 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, rc = NULL; goto cleanup; } - if (channelBytes == 0) + if (channel_bytes == 0) /* we had better be a CLIENT of this channel */ - channelBytes = (ulong)p->chan_hdr.size; + channel_bytes = (ulong)p->chan_hdr.size; if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) /* we had better be a CLIENT of this channel */ guid = p->chan_hdr.chtype; - if (visor_memregion_resize(p->memregion, channelBytes) < 0) { + if (visor_memregion_resize(p->memregion, channel_bytes) < 0) { ERRDRV("visor_memregion_resize failed: (status=0)\n"); rc = NULL; goto cleanup; } - p->size = channelBytes; + p->size = channel_bytes; p->guid = guid; rc = p; @@ -114,37 +114,37 @@ cleanup: } VISORCHANNEL * -visorchannel_create(HOSTADDRESS physaddr, ulong channelBytes, uuid_le guid) +visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create); VISORCHANNEL * -visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, TRUE); } EXPORT_SYMBOL_GPL(visorchannel_create_with_lock); VISORCHANNEL * -visorchannel_create_overlapped(ulong channelBytes, +visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid) { - return visorchannel_create_guts(0, channelBytes, parent, off, guid, + return visorchannel_create_guts(0, channel_bytes, parent, off, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create_overlapped); VISORCHANNEL * -vis
Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue
Hi Martyn, Thanks for your reply. I have pasted the code below. It is very much similar to your test code from the forum. Thanks! #define _XOPEN_SOURCE 500 #define u32 unsigned int #include #include #include #include #include #include #include #include "vme_user.h" int main(int argc, char *argv[]) { int fd; int i; int retval; int readSize = 2; unsigned char data[readSize]; struct vme_master master; printf("Simple VME User Module Test\n"); fd = open("/dev/bus/vme/m0", O_RDONLY); if (fd == -1) { perror("ERROR: Opening window device file"); return 1; } printf ("opened the file\n"); master.enable = 1; //master.vme_addr = 0x114000; master.vme_addr = 0x114000; master.size = 0x1; master.aspace = 0x2; // VME_A24 master.cycle = 0x2000 | 0x8000;// user/data access master.dwidth = 0x2; // 16 bit word access retval = ioctl(fd, VME_SET_MASTER, &master); if (retval != 0) { printf("retval=%d\n", retval); perror("ERROR: Failed to configure window"); return 1; } printf ("set the master\n"); /* * Reading first 512 bytes */ for (i=0; i wrote: > Hi Maurice, > > Would you be able to point to a complete piece of test code that exhibits > this failure? > > Martyn Welch > Lead Software Engineer > GE Intelligent Platforms > Embedded Systems > > T +44 (0) 1327 322748 > F +44 (0) 1327 322817 > E martyn.we...@ge.com > > Tove Valley Business Park > Towcester, Northants, NN12 6PF, United Kingdom > GE Intelligent Platforms Ltd > > GE imagination at work > > GE Intelligent Platforms Ltd, registered in England and Wales (3828642) at > 100 Barbirolli Square, Manchester, M2 3AB, VAT GB 927 5591 89 > > >> -Original Message- >> From: Maurice Moss [mailto:eightplusc...@gmail.com] >> Sent: 08 November 2014 00:33 >> To: Welch, Martyn (GE Intelligent Platforms) >> Cc: Manohar Vanga; dan.carpen...@oracle.com; driverdev- >> de...@linuxdriverproject.org >> Subject: Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) >> vme_user issue >> >> Hi Manohar/Dan, >> >> Any idea regarding this? >> >> Cheers, >> Maurice >> >> On Mon, Nov 3, 2014 at 5:25 PM, Maurice Moss >> wrote: >> > Hi Martyn, >> > >> > Thanks for your help from previous emails. I managed to talk to my >> > board using a VME-USB board. Now I am back to working with an SBC, and >> > I have a different setup this time around, let me describe it: >> > >> > 1. SBC in slot 0 of a VME64 chassis (with 2 slots), and the bottom one >> > being a slot for an SBC. The SBC is has a Universe-II and when I load >> > the kernel module manually, everything seems fine, and I see this in >> > dmesg: >> > [ 76.192738] vme_ca91cx42 :02:04.0: enabling device (0140 -> 0143) >> > [ 76.192893] vme_ca91cx42 :02:04.0: Board is the VME system >> controller >> > [ 76.192902] vme_ca91cx42 :02:04.0: Slot ID is 0 >> > [ 76.192907] vme_ca91cx42 :02:04.0: CR/CSR Offset: 0 >> > [ 76.192911] vme_ca91cx42 :02:04.0: Slot number is unset, not >> > configuring CR/CSR space >> > [ 76.195956] vme_ca91cx42 :02:04.0: CR/CSR configuration failed. >> > >> > I don't intend to use CR/CSR feature. The linux kernel I am running >> > is 3.13, the board is essentially this: >> > http://www.onestopsystems.com/documents/OSS-PCIe-KIT-6400.pdf >> > >> > 2. Now I would like to talk to a passive Slave board in slot 1 (I am >> > not sure about this numbering, basically the board in the other slot). >> > This slave board essentially talks only A24 and D16 in >> > user/super/data. It's address space internally begins at 0x114000. In >> > my test code, I essentially have the following: >> > >> > master.enable = 1; >> > //master.vme_addr = 0x114000; >> > master.vme_addr = 0x114000; >> > master.size = 0x1; >> > master.aspace = 0x2; // VME_A24 >> > master.cycle = 0x2000 | 0x8000;// user/data access >> > master.dwidth = 0x2; // 16 bit word access >> > retval = ioctl(fd, VME_SET_MASTER, &master); >> > >> > The call doesn't fail, and when I make a pread, all I get are 0xff s >> > on every byte. >> > I feel like I just can't seem to get the vme_addr to point in the >> > right direction. I know it's not the slave board, as I have verified >> > that it works with the VME-to-USB. >> > >> > In my mind, I have to set the SBC as a VME master and make a read at >> > A24 address. However, in vme_user.c I notice that the master resource >> > is allocated as A32. Which is why I just can't seem to get the whole >> > addressing schema right! >> > >> > Here is my lspci -v >> > >> > 02:04.0 Bridge: Tundra Semiconductor Corp. CA91C042 [Universe] (rev 02) >> > Flags: medium devsel, IRQ 16 >> > Memory at f7d
[PATCH] rtl8188eu: Simplify rtw_endofpktfile() in xmit_linux.c
scripts/checkpatch.pl reports a coding style problem in xmit_linux.c WARNING:BRACES: braces {} are not necessary for single statement blocks #61852: FILE: rtl8188eu/os_dep/xmit_linux.c:70: This patch removes unnecessary braces and simplifies the function to a single return statement. Signed-off-by: Krzysztof Konopko --- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index d5e41a5..5acf9a9 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -66,13 +66,7 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen) int rtw_endofpktfile(struct pkt_file *pfile) { - - if (pfile->pkt_len == 0) { - return true; - } - - - return false; + return pfile->pkt_len == 0; } int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz) -- 2.1.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: change typecast to match type returned by htons()
Using a u16 pointer typecast for a result from htons() results in the following warning from sparse: drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: warning: incorrect type in assignment (different base types) drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:expected unsigned short [unsigned] [short] [usertype] drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:got restricted __be16 [usertype] This patch fixes the issue by using an endian-specific typecast that will always match the type returned by htons(). Signed-off-by: Chris Ruffin --- drivers/staging/rtl8723au/core/rtw_xmit.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index a0f7e27..44ef55c 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -1276,7 +1276,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto) snap->oui[0] = oui[0]; snap->oui[1] = oui[1]; snap->oui[2] = oui[2]; - *(u16 *)(data + SNAP_SIZE) = htons(h_proto); + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); return SNAP_SIZE + sizeof(u16); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: change typecast to match type returned by htons()
Chris Ruffin writes: > Using a u16 pointer typecast for a result from htons() results in the > following warning from sparse: > > drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: warning: incorrect type in > assignment (different base types) > drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:expected unsigned short > [unsigned] [short] [usertype] > drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:got restricted __be16 > [usertype] > > This patch fixes the issue by using an endian-specific typecast > that will always match the type returned by htons(). > > Signed-off-by: Chris Ruffin > --- > drivers/staging/rtl8723au/core/rtw_xmit.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks fine to me Signed-off-by: Jes Sorensen > > diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c > b/drivers/staging/rtl8723au/core/rtw_xmit.c > index a0f7e27..44ef55c 100644 > --- a/drivers/staging/rtl8723au/core/rtw_xmit.c > +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c > @@ -1276,7 +1276,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto) > snap->oui[0] = oui[0]; > snap->oui[1] = oui[1]; > snap->oui[2] = oui[2]; > - *(u16 *)(data + SNAP_SIZE) = htons(h_proto); > + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); > return SNAP_SIZE + sizeof(u16); > } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723au: change typecast to match type returned by htons()
Arend van Spriel writes: > On 10-11-14 21:21, Jes Sorensen wrote: >> Chris Ruffin writes: >>> Using a u16 pointer typecast for a result from htons() results in >>> the following warning from sparse: >>> >>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: warning: >>> incorrect type in assignment (different base types) >>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: expected >>> unsigned short [unsigned] [short] [usertype] >>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: got restricted >>> __be16 [usertype] >>> >>> This patch fixes the issue by using an endian-specific typecast >>> that will always match the type returned by htons(). >>> >>> Signed-off-by: Chris Ruffin >>> --- >>> drivers/staging/rtl8723au/core/rtw_xmit.c |2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> Looks fine to me >> >> Signed-off-by: Jes Sorensen >> >>> >>> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c >>> b/drivers/staging/rtl8723au/core/rtw_xmit.c >>> index a0f7e27..44ef55c 100644 >>> --- a/drivers/staging/rtl8723au/core/rtw_xmit.c >>> +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c >>> @@ -1276,7 +1276,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto) >>> snap->oui[0] = oui[0]; >>> snap->oui[1] = oui[1]; >>> snap->oui[2] = oui[2]; >>> - *(u16 *)(data + SNAP_SIZE) = htons(h_proto); >>> + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); > > Could (data + SNAP_SIZE) be on a unaligned address? It shouldn't but probably better to take it into account. I am moving things around in this code right now, so I'll just fix it in a follow-on patch to this one. Cheers, Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/10] staging: rtl8723au: Fixes and remove dead code
From: Jes Sorensen Hi, Here's a set of patches removing a pile of unused code from the rtl8723au drivers. It also includes an alignment issue pointed out by Arend van Spriel. Note this set goes on top of Chris Ruffin's patch: staging: rtl8723au: change typecast to match type returned by htons() Cheers, Jes Jes Sorensen (10): staging: rtl8723au: Remove unused rtw_calculate_wlan_pkt_size_by_attribue23a() staging rtl8723au: rtw_put_smap23a(): Use common SNAP header defines staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set protocol staging: rtl8723au: rtw_put_snap23a(): Make it static staging: rtl8723au: portctrl(): Remove a pile of unnecessary clutter staging: rtl8723au: rtw_dump_xframe(): Use proper ETH_P_* types staging: rtl8723au: pxmitframe->frame_tag is never set to a value > 8 staging: rtl8723au: Remove unused rtl8723a_update_txdesc() and child functions staging: rtl8723au: Remove no-op function Hal_InitChannelPlan23a() staging: rtl8723au: Remove sw led handling drivers/staging/rtl8723au/Makefile|2 - drivers/staging/rtl8723au/core/rtw_cmd.c |6 - drivers/staging/rtl8723au/core/rtw_led.c | 1865 - drivers/staging/rtl8723au/core/rtw_mlme.c |5 - drivers/staging/rtl8723au/core/rtw_recv.c | 43 +- drivers/staging/rtl8723au/core/rtw_xmit.c | 63 +- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 252 --- drivers/staging/rtl8723au/hal/rtl8723au_led.c | 124 -- drivers/staging/rtl8723au/hal/rtl8723au_xmit.c| 19 +- drivers/staging/rtl8723au/hal/usb_halinit.c | 22 - drivers/staging/rtl8723au/include/drv_types.h |2 - drivers/staging/rtl8723au/include/rtl8723a_hal.h |2 - drivers/staging/rtl8723au/include/rtl8723a_led.h | 30 - drivers/staging/rtl8723au/include/rtl8723a_xmit.h |1 - drivers/staging/rtl8723au/include/rtw_cmd.h |1 - drivers/staging/rtl8723au/include/rtw_led.h | 181 -- drivers/staging/rtl8723au/include/rtw_xmit.h |3 - drivers/staging/rtl8723au/os_dep/os_intfs.c | 11 - drivers/staging/rtl8723au/os_dep/usb_intf.c |2 - 19 files changed, 30 insertions(+), 2604 deletions(-) delete mode 100644 drivers/staging/rtl8723au/core/rtw_led.c delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723au_led.c delete mode 100644 drivers/staging/rtl8723au/include/rtl8723a_led.h delete mode 100644 drivers/staging/rtl8723au/include/rtw_led.h -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/10] staging: rtl8723au: Remove no-op function Hal_InitChannelPlan23a()
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 drivers/staging/rtl8723au/hal/usb_halinit.c | 4 drivers/staging/rtl8723au/include/rtl8723a_hal.h | 2 -- 3 files changed, 10 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 8196a33..5c143fc 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -1954,10 +1954,6 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter, pHalData->EEPROMThermalMeter); } -void Hal_InitChannelPlan23a(struct rtw_adapter *padapter) -{ -} - static void rtl8723a_cal_txdesc_chksum(struct tx_desc *ptxdesc) { u16 *usPtr = (u16 *) ptxdesc; diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c b/drivers/staging/rtl8723au/hal/usb_halinit.c index adc2953..1c7ce85 100644 --- a/drivers/staging/rtl8723au/hal/usb_halinit.c +++ b/drivers/staging/rtl8723au/hal/usb_halinit.c @@ -1276,10 +1276,6 @@ static void readAdapterInfo(struct rtw_adapter *padapter) pEEPROM->bautoload_fail_flag); Hal_EfuseParseXtal_8723A(padapter, hwinfo, pEEPROM->bautoload_fail_flag); - /* */ - /* The following part initialize some vars by PG info. */ - /* */ - Hal_InitChannelPlan23a(padapter); /* hal_CustomizedBehavior_8723U(Adapter); */ diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h b/drivers/staging/rtl8723au/include/rtl8723a_hal.h index ee203a5..72af134 100644 --- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h +++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h @@ -518,8 +518,6 @@ void Hal_EfuseParseRateIndicationOption(struct rtw_adapter *padapter, u8 *hwinfo void Hal_EfuseParseXtal_8723A(struct rtw_adapter *pAdapter, u8 *hwinfo, u8 AutoLoadFail); void Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter, u8 *hwinfo, bool AutoLoadFail); -void Hal_InitChannelPlan23a(struct rtw_adapter *padapter); - /* register */ void SetBcnCtrlReg23a(struct rtw_adapter *padapter, u8 SetBits, u8 ClearBits); void rtl8723a_InitBeaconParameters(struct rtw_adapter *padapter); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/10] staging: rtl8723au: Remove unused rtw_calculate_wlan_pkt_size_by_attribue23a()
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_xmit.c| 17 - drivers/staging/rtl8723au/include/rtw_xmit.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index 44ef55c..b9ee983 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -1043,23 +1043,6 @@ s32 rtw_txframes_sta_ac_pending23a(struct rtw_adapter *padapter, } /* - * Calculate wlan 802.11 packet MAX size from pkt_attrib - * This function doesn't consider fragment case - */ -u32 rtw_calculate_wlan_pkt_size_by_attribue23a(struct pkt_attrib *pattrib) -{ - u32 len = 0; - - len = pattrib->hdrlen + pattrib->iv_len; /* WLAN Header and IV */ - len += SNAP_SIZE + sizeof(u16); /* LLC */ - len += pattrib->pktlen; - if (pattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) len += 8; /* MIC */ - len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /* ICV */ - - return len; -} - -/* This sub-routine will perform all the following: diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h b/drivers/staging/rtl8723au/include/rtw_xmit.h index 73e5f9c..3618432 100644 --- a/drivers/staging/rtl8723au/include/rtw_xmit.h +++ b/drivers/staging/rtl8723au/include/rtw_xmit.h @@ -354,8 +354,6 @@ struct xmit_frame *rtw_dequeue_xframe23a(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, int entry); s32 rtw_xmit23a_classifier(struct rtw_adapter *padapter, struct xmit_frame *pxmitframe); -u32 rtw_calculate_wlan_pkt_size_by_attribue23a(struct pkt_attrib *pattrib); -#define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue23a(&f->attrib) s32 rtw_xmitframe_coalesce23a(struct rtw_adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe); s32 _rtw_init_hw_txqueue(struct hw_txqueue *phw_txqueue, u8 ac_tag); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/10] staging: rtl8723au: portctrl(): Remove a pile of unnecessary clutter
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_recv.c | 40 --- 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c index de98da5..9d65393 100644 --- a/drivers/staging/rtl8723au/core/rtw_recv.c +++ b/drivers/staging/rtl8723au/core/rtw_recv.c @@ -568,59 +568,27 @@ static struct recv_frame *portctrl(struct rtw_adapter *adapter, ("portctrl:adapter->securitypriv.dot11AuthAlgrthm =" "%d\n", adapter->securitypriv.dot11AuthAlgrthm)); + prtnframe = precv_frame; + if (auth_alg == dot11AuthAlgrthm_8021X) { /* get ether_type */ ptr = pfhdr->pkt->data + pfhdr->attrib.hdrlen; ether_type = (ptr[6] << 8) | ptr[7]; - if ((psta != NULL) && (psta->ieee8021x_blocked)) { + if (psta && psta->ieee8021x_blocked) { /* blocked */ /* only accept EAPOL frame */ RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("portctrl:psta->ieee8021x_blocked ==" "1\n")); - if (ether_type == eapol_type) { - prtnframe = precv_frame; - } else { + if (ether_type != eapol_type) { /* free this frame */ rtw_free_recvframe23a(precv_frame); prtnframe = NULL; } - } else { - /* allowed */ - /* check decryption status, and decrypt the frame if needed */ - RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, -("portctrl:psta->ieee8021x_blocked ==" - "0\n")); - RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, -("portctrl:precv_frame->hdr.attrib.privacy =" - "%x\n", precv_frame->attrib.privacy)); - - if (pattrib->bdecrypted == 0) { - RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, -("portctrl:prxstat->decrypted =%x\n", - pattrib->bdecrypted)); - } - - prtnframe = precv_frame; - /* check is the EAPOL frame or not (Rekey) */ - if (ether_type == eapol_type) { - RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, -("portctrl:ether_type == " - "0x888e\n")); - /* check Rekey */ - - prtnframe = precv_frame; - } else { - RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, -("portctrl:ether_type = 0x%04x" - "\n", ether_type)); - } } - } else { - prtnframe = precv_frame; } return prtnframe; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/10] staging: rtl8723au: pxmitframe->frame_tag is never set to a value > 8
From: Jes Sorensen No point of masking out high bits since we never set the value to anything exceeding bits 0-3. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_xmit.c | 2 +- drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 11 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index 5cbfab4..1f4ebb3 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -1291,7 +1291,7 @@ void rtw_count_tx_stats23a(struct rtw_adapter *padapter, struct xmit_frame *pxmi struct xmit_priv*pxmitpriv = &padapter->xmitpriv; struct mlme_priv*pmlmepriv = &padapter->mlmepriv; - if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) { + if (pxmitframe->frame_tag == DATA_FRAMETAG) { pxmitpriv->tx_bytes += sz; pmlmepriv->LinkDetectInfo.NumTxOkInPeriod++; diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c index cf31d29..9cdd9e5 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c +++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c @@ -163,7 +163,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag memset(ptxdesc, 0, sizeof(struct tx_desc)); - if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) { + if (pxmitframe->frame_tag == DATA_FRAMETAG) { /* offset 4 */ ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x1f); @@ -215,7 +215,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate23a(pmlmeext->tx_rate)); } - } else if ((pxmitframe->frame_tag&0x0f) == MGNT_FRAMETAG) { + } else if (pxmitframe->frame_tag == MGNT_FRAMETAG) { /* offset 4 */ ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x1f); @@ -240,10 +240,11 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag ptxdesc->txdw5 |= cpu_to_le32(0x0018);/* retry limit = 6 */ ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate23a(pmlmeext->tx_rate)); - } else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG) { + } else if (pxmitframe->frame_tag == TXAGG_FRAMETAG) { DBG_8723A("pxmitframe->frame_tag == TXAGG_FRAMETAG\n"); } else { - DBG_8723A("pxmitframe->frame_tag = %d\n", pxmitframe->frame_tag); + DBG_8723A("pxmitframe->frame_tag = %d\n", + pxmitframe->frame_tag); /* offset 4 */ ptxdesc->txdw1 |= cpu_to_le32((4)&0x1f);/* CAM_ID(MAC_ID) */ @@ -392,7 +393,7 @@ bool rtl8723au_xmitframe_complete(struct rtw_adapter *padapter, pxmitbuf->priv_data = pxmitframe; - if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) { + if (pxmitframe->frame_tag == DATA_FRAMETAG) { if (pxmitframe->attrib.priority <= 15)/* TID0~15 */ res = rtw_xmitframe_coalesce23a(padapter, pxmitframe->pkt, pxmitframe); -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/10] staging: rtl8723au: rtw_put_snap23a(): Make it static
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_xmit.c| 40 ++-- drivers/staging/rtl8723au/include/rtw_xmit.h | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index f8b1243..5cbfab4 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -1039,6 +1039,25 @@ s32 rtw_txframes_sta_ac_pending23a(struct rtw_adapter *padapter, return ptxservq->qcnt; } +/* Logical Link Control(LLC) SubNetwork Attachment Point(SNAP) header + * IEEE LLC/SNAP header contains 8 octets + * First 3 octets comprise the LLC portion + * SNAP portion, 5 octets, is divided into two fields: + * Organizationally Unique Identifier(OUI), 3 octets, + * type, defined by that organization, 2 octets. + */ +static int rtw_put_snap(u8 *data, u16 h_proto) +{ + if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP) + ether_addr_copy(data, bridge_tunnel_header); + else + ether_addr_copy(data, rfc1042_header); + + data += ETH_ALEN; + put_unaligned_be16(h_proto, data); + return ETH_ALEN + sizeof(u16); +} + /* This sub-routine will perform all the following: @@ -1162,7 +1181,7 @@ int rtw_xmitframe_coalesce23a(struct rtw_adapter *padapter, struct sk_buff *skb, mpdu_len -= pattrib->iv_len; } if (frg_inx == 0) { - llc_sz = rtw_put_snap23a(pframe, pattrib->ether_type); + llc_sz = rtw_put_snap(pframe, pattrib->ether_type); pframe += llc_sz; mpdu_len -= llc_sz; } @@ -1232,25 +1251,6 @@ exit: return res; } -/* Logical Link Control(LLC) SubNetwork Attachment Point(SNAP) header - * IEEE LLC/SNAP header contains 8 octets - * First 3 octets comprise the LLC portion - * SNAP portion, 5 octets, is divided into two fields: - * Organizationally Unique Identifier(OUI), 3 octets, - * type, defined by that organization, 2 octets. - */ -s32 rtw_put_snap23a(u8 *data, u16 h_proto) -{ - if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP) - ether_addr_copy(data, bridge_tunnel_header); - else - ether_addr_copy(data, rfc1042_header); - - data += ETH_ALEN; - put_unaligned_be16(h_proto, data); - return ETH_ALEN + sizeof(u16); -} - void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint ie_len) { struct xmit_priv *pxmitpriv = &padapter->xmitpriv; diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h b/drivers/staging/rtl8723au/include/rtw_xmit.h index 3618432..87097c4 100644 --- a/drivers/staging/rtl8723au/include/rtw_xmit.h +++ b/drivers/staging/rtl8723au/include/rtw_xmit.h @@ -340,7 +340,6 @@ s32 rtw_free_xmitbuf23a(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); void rtw_count_tx_stats23a(struct rtw_adapter *padapter, struct xmit_frame *pxmitframe, int sz); void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint ie_len); -s32 rtw_put_snap23a(u8 *data, u16 h_proto); struct xmit_frame *rtw_alloc_xmitframe23a_ext(struct xmit_priv *pxmitpriv); struct xmit_frame *rtw_alloc_xmitframe23a_once(struct xmit_priv *pxmitpriv); s32 rtw_free_xmitframe23a(struct xmit_priv *pxmitpriv, -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/10] staging: rtl8723au: rtw_dump_xframe(): Use proper ETH_P_* types
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c index a67850f..cf31d29 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c +++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c @@ -306,10 +306,10 @@ static int rtw_dump_xframe(struct rtw_adapter *padapter, struct pkt_attrib *pattrib = &pxmitframe->attrib; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - if ((pxmitframe->frame_tag == DATA_FRAMETAG) && - (pxmitframe->attrib.ether_type != 0x0806) && - (pxmitframe->attrib.ether_type != 0x888e) && - (pxmitframe->attrib.dhcp_pkt != 1)) + if (pxmitframe->frame_tag == DATA_FRAMETAG && + pxmitframe->attrib.ether_type != ETH_P_ARP && + pxmitframe->attrib.ether_type != ETH_P_PAE && + pxmitframe->attrib.dhcp_pkt != 1) rtw_issue_addbareq_cmd23a(padapter, pxmitframe); mem_addr = pxmitframe->buf_addr; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/10] staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set protocol
From: Jes Sorensen Reported-by: Arend van Spriel Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index 18a9f34..f8b1243 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -1247,7 +1247,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto) ether_addr_copy(data, rfc1042_header); data += ETH_ALEN; - *(__be16 *)data = htons(h_proto); + put_unaligned_be16(h_proto, data); return ETH_ALEN + sizeof(u16); } -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/10] staging rtl8723au: rtw_put_smap23a(): Use common SNAP header defines
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/core/rtw_xmit.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index b9ee983..18a9f34 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -22,9 +22,6 @@ #include #include -static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; -static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; - static void _init_txservq(struct tx_servq *ptxservq) { @@ -1244,23 +1241,14 @@ exit: */ s32 rtw_put_snap23a(u8 *data, u16 h_proto) { - struct ieee80211_snap_hdr *snap; - u8 *oui; - - snap = (struct ieee80211_snap_hdr *)data; - snap->dsap = 0xaa; - snap->ssap = 0xaa; - snap->ctrl = 0x03; - - if (h_proto == 0x8137 || h_proto == 0x80f3) - oui = P802_1H_OUI; + if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP) + ether_addr_copy(data, bridge_tunnel_header); else - oui = RFC1042_OUI; - snap->oui[0] = oui[0]; - snap->oui[1] = oui[1]; - snap->oui[2] = oui[2]; - *(__be16 *)(data + SNAP_SIZE) = htons(h_proto); - return SNAP_SIZE + sizeof(u16); + ether_addr_copy(data, rfc1042_header); + + data += ETH_ALEN; + *(__be16 *)data = htons(h_proto); + return ETH_ALEN + sizeof(u16); } void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint ie_len) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/10] staging: rtl8723au: Remove unused rtl8723a_update_txdesc() and child functions
From: Jes Sorensen Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 248 -- drivers/staging/rtl8723au/include/rtl8723a_xmit.h | 1 - 2 files changed, 249 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 9a75eb6..8196a33 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -1975,254 +1975,6 @@ static void rtl8723a_cal_txdesc_chksum(struct tx_desc *ptxdesc) ptxdesc->txdw7 |= cpu_to_le32(checksum & 0x); } -static void fill_txdesc_sectype(struct pkt_attrib *pattrib, - struct txdesc_8723a *ptxdesc) -{ - if ((pattrib->encrypt > 0) && !pattrib->bswenc) { - switch (pattrib->encrypt) { - /* SEC_TYPE */ - case WLAN_CIPHER_SUITE_WEP40: - case WLAN_CIPHER_SUITE_WEP104: - case WLAN_CIPHER_SUITE_TKIP: - ptxdesc->sectype = 1; - break; - - case WLAN_CIPHER_SUITE_CCMP: - ptxdesc->sectype = 3; - break; - - case 0: - default: - break; - } - } -} - -static void fill_txdesc_vcs(struct pkt_attrib *pattrib, - struct txdesc_8723a *ptxdesc) -{ - /* DBG_8723A("cvs_mode =%d\n", pattrib->vcs_mode); */ - - switch (pattrib->vcs_mode) { - case RTS_CTS: - ptxdesc->rtsen = 1; - break; - - case CTS_TO_SELF: - ptxdesc->cts2self = 1; - break; - - case NONE_VCS: - default: - break; - } - - if (pattrib->vcs_mode) { - ptxdesc->hw_rts_en = 1; /* ENABLE HW RTS */ - - /* Set RTS BW */ - if (pattrib->ht_en) { - if (pattrib->bwmode & HT_CHANNEL_WIDTH_40) - ptxdesc->rts_bw = 1; - - switch (pattrib->ch_offset) { - case HAL_PRIME_CHNL_OFFSET_DONT_CARE: - ptxdesc->rts_sc = 0; - break; - - case HAL_PRIME_CHNL_OFFSET_LOWER: - ptxdesc->rts_sc = 1; - break; - - case HAL_PRIME_CHNL_OFFSET_UPPER: - ptxdesc->rts_sc = 2; - break; - - default: - ptxdesc->rts_sc = 3;/* Duplicate */ - break; - } - } - } -} - -static void fill_txdesc_phy(struct pkt_attrib *pattrib, - struct txdesc_8723a *ptxdesc) -{ - if (pattrib->ht_en) { - if (pattrib->bwmode & HT_CHANNEL_WIDTH_40) - ptxdesc->data_bw = 1; - - switch (pattrib->ch_offset) { - case HAL_PRIME_CHNL_OFFSET_DONT_CARE: - ptxdesc->data_sc = 0; - break; - - case HAL_PRIME_CHNL_OFFSET_LOWER: - ptxdesc->data_sc = 1; - break; - - case HAL_PRIME_CHNL_OFFSET_UPPER: - ptxdesc->data_sc = 2; - break; - - default: - ptxdesc->data_sc = 3; /* Duplicate */ - break; - } - } -} - -static void rtl8723a_fill_default_txdesc(struct xmit_frame *pxmitframe, -u8 *pbuf) -{ - struct rtw_adapter *padapter; - struct hal_data_8723a *pHalData; - struct dm_priv *pdmpriv; - struct mlme_ext_priv *pmlmeext; - struct mlme_ext_info *pmlmeinfo; - struct pkt_attrib *pattrib; - struct txdesc_8723a *ptxdesc; - s32 bmcst; - - padapter = pxmitframe->padapter; - pHalData = GET_HAL_DATA(padapter); - pdmpriv = &pHalData->dmpriv; - pmlmeext = &padapter->mlmeextpriv; - pmlmeinfo = &pmlmeext->mlmext_info; - - pattrib = &pxmitframe->attrib; - bmcst = is_multicast_ether_addr(pattrib->ra); - - ptxdesc = (struct txdesc_8723a *)pbuf; - - if (pxmitframe->frame_tag == DATA_FRAMETAG) { - ptxdesc->macid = pattrib->mac_id; /* CAM_ID(MAC_ID) */ - - if (pattrib->ampdu_en == true) - ptxdesc->agg_en = 1;/* AGG EN */ - else - ptxdesc->bk = 1;/* AGG BK */ - - ptxdesc->qsel = pattrib->qsel; - ptxdesc->rate_id = pattrib->raid; - - fill_txdesc_sectype(pattrib, ptxdesc); - - ptxdesc->seq = pattrib->seqnum; - -
[PATCH 10/10] staging: rtl8723au: Remove sw led handling
From: Jes Sorensen The rtl8723au relies on hw led support, so no point carrying a large unused sw led infrastructure around. Signed-off-by: Jes Sorensen --- drivers/staging/rtl8723au/Makefile |2 - drivers/staging/rtl8723au/core/rtw_cmd.c |6 - drivers/staging/rtl8723au/core/rtw_led.c | 1865 -- drivers/staging/rtl8723au/core/rtw_mlme.c|5 - drivers/staging/rtl8723au/core/rtw_recv.c|3 - drivers/staging/rtl8723au/core/rtw_xmit.c|2 - drivers/staging/rtl8723au/hal/rtl8723au_led.c| 124 -- drivers/staging/rtl8723au/hal/usb_halinit.c | 18 - drivers/staging/rtl8723au/include/drv_types.h|2 - drivers/staging/rtl8723au/include/rtl8723a_led.h | 30 - drivers/staging/rtl8723au/include/rtw_cmd.h |1 - drivers/staging/rtl8723au/include/rtw_led.h | 181 --- drivers/staging/rtl8723au/os_dep/os_intfs.c | 11 - drivers/staging/rtl8723au/os_dep/usb_intf.c |2 - 14 files changed, 2252 deletions(-) delete mode 100644 drivers/staging/rtl8723au/core/rtw_led.c delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723au_led.c delete mode 100644 drivers/staging/rtl8723au/include/rtl8723a_led.h delete mode 100644 drivers/staging/rtl8723au/include/rtw_led.h diff --git a/drivers/staging/rtl8723au/Makefile b/drivers/staging/rtl8723au/Makefile index a9aae21..b184108 100644 --- a/drivers/staging/rtl8723au/Makefile +++ b/drivers/staging/rtl8723au/Makefile @@ -2,7 +2,6 @@ r8723au-y :=\ core/rtw_cmd.o \ core/rtw_efuse.o\ core/rtw_ieee80211.o\ - core/rtw_led.o \ core/rtw_mlme.o \ core/rtw_mlme_ext.o \ core/rtw_pwrctrl.o \ @@ -34,7 +33,6 @@ r8723au-y := \ hal/rtl8723a_rxdesc.o \ hal/rtl8723a_sreset.o \ hal/rtl8723a_xmit.o \ - hal/rtl8723au_led.o \ hal/rtl8723au_recv.o\ hal/rtl8723au_xmit.o\ hal/usb_halinit.o \ diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index 44eae8e..77d43a5 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -391,8 +391,6 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter, mod_timer(&pmlmepriv->scan_to_timer, jiffies + msecs_to_jiffies(SCANNING_TIMEOUT)); - rtw_led_control(padapter, LED_CTL_SITE_SURVEY); - pmlmepriv->scan_interval = SCAN_INTERVAL;/* 30*2 sec = 60sec */ } else _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); @@ -417,8 +415,6 @@ int rtw_createbss_cmd23a(struct rtw_adapter *padapter) pdev_network = &padapter->registrypriv.dev_network; - rtw_led_control(padapter, LED_CTL_START_TO_LINK); - if (pmlmepriv->assoc_ssid.ssid_len == 0) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", @@ -467,8 +463,6 @@ int rtw_joinbss_cmd23a(struct rtw_adapter *padapter, ifmode = pnetwork->network.ifmode; - rtw_led_control(padapter, LED_CTL_START_TO_LINK); - if (pmlmepriv->assoc_ssid.ssid_len == 0) { RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+Join cmd: Any SSid\n")); diff --git a/drivers/staging/rtl8723au/core/rtw_led.c b/drivers/staging/rtl8723au/core/rtw_led.c deleted file mode 100644 index 92ab1f8..000 --- a/drivers/staging/rtl8723au/core/rtw_led.c +++ /dev/null @@ -1,1865 +0,0 @@ -/** - * - * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - **/ - -#include -#include - -/* */ -/* Description: */ -/* Callback function of LED BlinkTimer, */ -/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl23a */ -/* */ -static void BlinkTimerCallback(unsigned long data) -{ - struct led_8723a *pLed = (struct led_8723a *)data; - struct rtw_adapter *padapter = pLed->padapter; - - /* DBG_8723A("%s\n", __func__); */ - - if ((padapter->bSurpriseRemoved == true) || (padapter->bDriverStopped ==
[PATCH 08/15] staging: comedi: addi_apci_1564: fix counter code in main driver source
The Rev 1.0 APCI-1564 boards do not have counters. Fix the code in the main driver source so that the I/O accesses to the counters do not happen if the devpriv->counters member is not initialized. This does not fix the code in hwdrv_apci1564.c. That code violates the comedi API and is currently broken. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1564.c | 44 ++--- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index b74e6c6..3fb9cc0 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -141,10 +141,12 @@ static int apci1564_reset(struct comedi_device *dev) outl(0x0, devpriv->timer + APCI1564_TIMER_CTRL_REG); outl(0x0, devpriv->timer + APCI1564_TIMER_RELOAD_REG); - /* Reset the counter registers */ - outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(0)); - outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(1)); - outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(2)); + if (devpriv->counters) { + /* Reset the counter registers */ + outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(0)); + outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(1)); + outl(0x0, devpriv->counters + APCI1564_COUNTER_CTRL_REG(2)); + } return 0; } @@ -186,22 +188,24 @@ static irqreturn_t apci1564_interrupt(int irq, void *d) outl(ctrl, devpriv->timer + APCI1564_TIMER_CTRL_REG); } - for (chan = 0; chan < 4; chan++) { - status = inl(devpriv->counters + -APCI1564_COUNTER_IRQ_REG(chan)); - if (status & 0x01) { - /* Disable Counter Interrupt */ - ctrl = inl(devpriv->counters + - APCI1564_COUNTER_CTRL_REG(chan)); - outl(0x0, devpriv->counters + -APCI1564_COUNTER_CTRL_REG(chan)); - - /* Send a signal to from kernel to user space */ - send_sig(SIGIO, devpriv->tsk_current, 0); - - /* Enable Counter Interrupt */ - outl(ctrl, devpriv->counters + -APCI1564_COUNTER_CTRL_REG(chan)); + if (devpriv->counters) { + for (chan = 0; chan < 4; chan++) { + status = inl(devpriv->counters + +APCI1564_COUNTER_IRQ_REG(chan)); + if (status & 0x01) { + /* Disable Counter Interrupt */ + ctrl = inl(devpriv->counters + + APCI1564_COUNTER_CTRL_REG(chan)); + outl(0x0, devpriv->counters + + APCI1564_COUNTER_CTRL_REG(chan)); + + /* Send a signal to from kernel to user space */ + send_sig(SIGIO, devpriv->tsk_current, 0); + + /* Enable Counter Interrupt */ + outl(ctrl, devpriv->counters + + APCI1564_COUNTER_CTRL_REG(chan)); + } } } -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/15] staging: comedi: addi_apci_1564: split timer and counter subdevices
The timer subdevice is currently broken in this driver. The Rev 1.0 and 2.x versions of the board both have a 12-bit timer. But only the Rev 2.x boards have the 3 32-bit counters. Split the current timer subdevice into two separate subdevices: 1) A single channel 12-bit timer subdevice 2) A three channel 32-bit counter subdevice This represents the hardware correctly and the counters can be disabled on the Rev 1.0 boards. Split up the current (*insn_config), (*insn_write), and (*insn_read) so they only deal with the hardware associated with the subdevice. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 312 ++--- drivers/staging/comedi/drivers/addi_apci_1564.c| 36 ++- 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index af37df7..23bc8de 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -17,199 +17,185 @@ #define ADDIDATA_COUNTER 1 #define ADDIDATA_WATCHDOG 2 -/* - * Configures The Timer or Counter - * - * data[0] Configure as: 0 = Timer, 1 = Counter - * data[1] 1 = Enable Interrupt, 0 = Disable Interrupt - * data[2] Time Unit - * data[3] Reload Value - * data[4] Timer Mode - * data[5] Timer Counter Watchdog Number - * data[6] Counter Direction - */ -static int apci1564_timer_config(struct comedi_device *dev, -struct comedi_subdevice *s, -struct comedi_insn *insn, -unsigned int *data) +static int apci1564_timer_insn_config(struct comedi_device *dev, + struct comedi_subdevice *s, + struct comedi_insn *insn, + unsigned int *data) { struct apci1564_private *devpriv = dev->private; - unsigned int chan = CR_CHAN(insn->chanspec); - unsigned int ul_Command1 = 0; + unsigned int ctrl; devpriv->tsk_current = current; - if (data[0] == ADDIDATA_TIMER) { - /* First Stop The Timer */ - ul_Command1 = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); - ul_Command1 = ul_Command1 & 0xF9FEUL; - /* Stop The Timer */ - outl(ul_Command1, devpriv->timer + APCI1564_TIMER_CTRL_REG); - - devpriv->timer_select_mode = ADDIDATA_TIMER; - if (data[1] == 1) { - /* Enable TIMER int & DISABLE ALL THE OTHER int SOURCES */ - outl(0x02, devpriv->timer + APCI1564_TIMER_CTRL_REG); - outl(0x0, dev->iobase + APCI1564_DI_IRQ_REG); - outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); - outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); + + /* First Stop The Timer */ + ctrl = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); + ctrl &= 0xf9fe; + /* Stop The Timer */ + outl(ctrl, devpriv->timer + APCI1564_TIMER_CTRL_REG); + + if (data[1] == 1) { + /* Enable timer int & disable all the other int sources */ + outl(0x02, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(0x0, dev->iobase + APCI1564_DI_IRQ_REG); + outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); + outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); + if (devpriv->counters) { outl(0x0, devpriv->counters + APCI1564_COUNTER_IRQ_REG(0)); outl(0x0, devpriv->counters + APCI1564_COUNTER_IRQ_REG(1)); outl(0x0, devpriv->counters + APCI1564_COUNTER_IRQ_REG(2)); - } else { - /* disable Timer interrupt */ - outl(0x0, devpriv->timer + APCI1564_TIMER_CTRL_REG); } - - /* Loading Timebase */ - outl(data[2], devpriv->timer + APCI1564_TIMER_TIMEBASE_REG); - - /* Loading the Reload value */ - outl(data[3], devpriv->timer + APCI1564_TIMER_RELOAD_REG); - - ul_Command1 = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); - ul_Command1 = (ul_Command1 & 0xFFF719E2UL) | 2UL << 13UL | 0x10UL; - /* mode 2 */ - outl(ul_Command1, devpriv->timer + APCI1564_TIMER_CTRL_REG); - } else if (data[0] == ADDIDATA_COUNTER) { - devpriv->timer_select_mode = ADDIDATA_COUNTER; - - /* First Stop The Counter */ - ul_Command1 = inl(devpriv->counters + - APCI1564_COUNTER_C
[PATCH 11/15] staging: comedi: addi_tcw.h: provide generic defines for the ADDI-DATA TCW
The TCW (timer/counter/watchdog) devices in the various ADDI-DATA drivers use a common register map definition. Provide a common generic define for these registers so they don't have to be replicated in each driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_tcw.h | 56 +++ 1 file changed, 56 insertions(+) create mode 100644 drivers/staging/comedi/drivers/addi_tcw.h diff --git a/drivers/staging/comedi/drivers/addi_tcw.h b/drivers/staging/comedi/drivers/addi_tcw.h new file mode 100644 index 000..8794d4c --- /dev/null +++ b/drivers/staging/comedi/drivers/addi_tcw.h @@ -0,0 +1,56 @@ +#ifndef _ADDI_TCW_H +#define _ADDI_TCW_H + +/* + * Following are the generic definitions for the ADDI-DATA timer/counter/ + * watchdog (TCW) registers and bits. Some of the registers are not used + * depending on the use of the TCW. + */ + +#define ADDI_TCW_VAL_REG 0x00 + +#define ADDI_TCW_SYNC_REG 0x00 +#define ADDI_TCW_SYNC_CTR_TRIG (1 << 8) +#define ADDI_TCW_SYNC_CTR_DIS (1 << 7) +#define ADDI_TCW_SYNC_CTR_ENA (1 << 6) +#define ADDI_TCW_SYNC_TIMER_TRIG (1 << 5) +#define ADDI_TCW_SYNC_TIMER_DIS(1 << 4) +#define ADDI_TCW_SYNC_TIMER_ENA(1 << 3) +#define ADDI_TCW_SYNC_WDOG_TRIG(1 << 2) +#define ADDI_TCW_SYNC_WDOG_DIS (1 << 1) +#define ADDI_TCW_SYNC_WDOG_ENA (1 << 0) + +#define ADDI_TCW_RELOAD_REG0x04 + +#define ADDI_TCW_TIMEBASE_REG 0x08 + +#define ADDI_TCW_CTRL_REG 0x0c +#define ADDI_TCW_CTRL_EXT_CLK_STATUS (1 << 21) +#define ADDI_TCW_CTRL_CASCADE (1 << 20) +#define ADDI_TCW_CTRL_CNTR_ENA (1 << 19) +#define ADDI_TCW_CTRL_CNT_UP (1 << 18) +#define ADDI_TCW_CTRL_EXT_CLK(x) ((x) << 16) +#define ADDI_TCW_CTRL_OUT(x) ((x) << 11) +#define ADDI_TCW_CTRL_GATE (1 << 10) +#define ADDI_TCW_CTRL_TRIG (1 << 9) +#define ADDI_TCW_CTRL_EXT_GATE(x) ((x) << 7) +#define ADDI_TCW_CTRL_EXT_TRIG(x) ((x) << 5) +#define ADDI_TCW_CTRL_TIMER_ENA(1 << 4) +#define ADDI_TCW_CTRL_RESET_ENA(1 << 3) +#define ADDI_TCW_CTRL_WARN_ENA (1 << 2) +#define ADDI_TCW_CTRL_IRQ_ENA (1 << 1) +#define ADDI_TCW_CTRL_ENA (1 << 0) + +#define ADDI_TCW_STATUS_REG0x10 +#define ADDI_TCW_STATUS_SOFT_CLR (1 << 3) +#define ADDI_TCW_STATUS_SOFT_TRIG (1 << 1) +#define ADDI_TCW_STATUS_OVERFLOW (1 << 0) + +#define ADDI_TCW_IRQ_REG 0x14 +#define ADDI_TCW_IRQ (1 << 0) + +#define ADDI_TCW_WARN_TIMEVAL_REG 0x18 + +#define ADDI_TCW_WARN_TIMEBASE_REG 0x1c + +#endif -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/15] staging: comedi: addi_apci_1564: use dev->iobase for main registers
According to ADDI-DATA, the PLD Revision 2.x versions of the APCI-1564 use PCI BAR 0 for the main registers of the board. Remove the 'amcc_iobase' member of the private data and use the dev->iobase to store the base address of PCI BAR 1. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 36 +- drivers/staging/comedi/drivers/addi_apci_1564.c| 79 ++ 2 files changed, 53 insertions(+), 62 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 37733ae..c65dc12 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -18,7 +18,7 @@ #define ADDIDATA_WATCHDOG 2 /* - * devpriv->amcc_iobase Register Map + * dev->iobase Register Map */ #define APCI1564_DI_REG0x04 #define APCI1564_DI_INT_MODE1_REG 0x08 @@ -81,18 +81,18 @@ static int apci1564_timer_config(struct comedi_device *dev, devpriv->tsk_current = current; if (data[0] == ADDIDATA_TIMER) { /* First Stop The Timer */ - ul_Command1 = inl(devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); ul_Command1 = ul_Command1 & 0xF9FEUL; /* Stop The Timer */ - outl(ul_Command1, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); devpriv->timer_select_mode = ADDIDATA_TIMER; if (data[1] == 1) { /* Enable TIMER int & DISABLE ALL THE OTHER int SOURCES */ - outl(0x02, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); - outl(0x0, devpriv->amcc_iobase + APCI1564_DI_IRQ_REG); - outl(0x0, devpriv->amcc_iobase + APCI1564_DO_IRQ_REG); - outl(0x0, devpriv->amcc_iobase + APCI1564_WDOG_IRQ_REG); + outl(0x02, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(0x0, dev->iobase + APCI1564_DI_IRQ_REG); + outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); + outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); outl(0x0, devpriv->counters + APCI1564_COUNTER_IRQ_REG(0)); outl(0x0, @@ -101,19 +101,19 @@ static int apci1564_timer_config(struct comedi_device *dev, devpriv->counters + APCI1564_COUNTER_IRQ_REG(2)); } else { /* disable Timer interrupt */ - outl(0x0, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + outl(0x0, dev->iobase + APCI1564_TIMER_CTRL_REG); } /* Loading Timebase */ - outl(data[2], devpriv->amcc_iobase + APCI1564_TIMER_TIMEBASE_REG); + outl(data[2], dev->iobase + APCI1564_TIMER_TIMEBASE_REG); /* Loading the Reload value */ - outl(data[3], devpriv->amcc_iobase + APCI1564_TIMER_RELOAD_REG); + outl(data[3], dev->iobase + APCI1564_TIMER_RELOAD_REG); - ul_Command1 = inl(devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); ul_Command1 = (ul_Command1 & 0xFFF719E2UL) | 2UL << 13UL | 0x10UL; /* mode 2 */ - outl(ul_Command1, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); } else if (data[0] == ADDIDATA_COUNTER) { devpriv->timer_select_mode = ADDIDATA_COUNTER; @@ -175,17 +175,17 @@ static int apci1564_timer_write(struct comedi_device *dev, if (devpriv->timer_select_mode == ADDIDATA_TIMER) { if (data[1] == 1) { - ul_Command1 = inl(devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); ul_Command1 = (ul_Command1 & 0xF9FFUL) | 0x1UL; /* Enable the Timer */ - outl(ul_Command1, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); } else if (data[1] == 0) { /* Stop The Timer */ - ul_Command1 = inl(devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); ul_Command1 = ul_Command1 & 0xF9FEUL;
[PATCH 06/15] staging: comedi: addi_apci_1564: fix dev->iobase for all PLD revisions
The APCI-1564 has different I/O mapping depending on if the PLD revision is Rev 1.0 or Rev 2.x. Fix the main register defines so they will work for all PLD revisions and initialie the dev->iobase appropriately. Move the register defines to the main driver source file. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 29 - drivers/staging/comedi/drivers/addi_apci_1564.c| 38 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index c65dc12..1c313bc 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -18,35 +18,6 @@ #define ADDIDATA_WATCHDOG 2 /* - * dev->iobase Register Map - */ -#define APCI1564_DI_REG0x04 -#define APCI1564_DI_INT_MODE1_REG 0x08 -#define APCI1564_DI_INT_MODE2_REG 0x0c -#define APCI1564_DI_INT_STATUS_REG 0x10 -#define APCI1564_DI_IRQ_REG0x14 -#define APCI1564_DO_REG0x18 -#define APCI1564_DO_INT_CTRL_REG 0x1c -#define APCI1564_DO_INT_STATUS_REG 0x20 -#define APCI1564_DO_IRQ_REG0x24 -#define APCI1564_WDOG_REG 0x28 -#define APCI1564_WDOG_RELOAD_REG 0x2c -#define APCI1564_WDOG_TIMEBASE_REG 0x30 -#define APCI1564_WDOG_CTRL_REG 0x34 -#define APCI1564_WDOG_STATUS_REG 0x38 -#define APCI1564_WDOG_IRQ_REG 0x3c -#define APCI1564_WDOG_WARN_TIMEVAL_REG 0x40 -#define APCI1564_WDOG_WARN_TIMEBASE_REG0x44 -#define APCI1564_TIMER_REG 0x48 -#define APCI1564_TIMER_RELOAD_REG 0x4c -#define APCI1564_TIMER_TIMEBASE_REG0x50 -#define APCI1564_TIMER_CTRL_REG0x54 -#define APCI1564_TIMER_STATUS_REG 0x58 -#define APCI1564_TIMER_IRQ_REG 0x5c -#define APCI1564_TIMER_WARN_TIMEVAL_REG0x60 -#define APCI1564_TIMER_WARN_TIMEBASE_REG 0x64 - -/* * devpriv->counters Register Map */ #define APCI1564_COUNTER_REG(x)(0x00 + ((x) * 0x20)) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index f75803a..0fa7f72 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -51,6 +51,7 @@ #define APCI1564_EEPROM_DO (1 << 2) #define APCI1564_EEPROM_CS (1 << 1) #define APCI1564_EEPROM_CLK(1 << 0) +#define APCI1564_REV2_MAIN_IOBASE 0x04 /* * PCI BAR 1 @@ -65,6 +66,39 @@ * 0x20 Counter_1 * 0x30 Counter_3 */ +#define APCI1564_REV1_MAIN_IOBASE 0x00 + +/* + * dev->iobase Register Map + * PLD Revision 1.0 - PCI BAR 1 + 0x00 + * PLD Revision 2.x - PCI BAR 0 + 0x04 + */ +#define APCI1564_DI_REG0x00 +#define APCI1564_DI_INT_MODE1_REG 0x04 +#define APCI1564_DI_INT_MODE2_REG 0x08 +#define APCI1564_DI_INT_STATUS_REG 0x0c +#define APCI1564_DI_IRQ_REG0x10 +#define APCI1564_DO_REG0x14 +#define APCI1564_DO_INT_CTRL_REG 0x18 +#define APCI1564_DO_INT_STATUS_REG 0x1c +#define APCI1564_DO_IRQ_REG0x20 +#define APCI1564_WDOG_REG 0x24 +#define APCI1564_WDOG_RELOAD_REG 0x28 +#define APCI1564_WDOG_TIMEBASE_REG 0x2c +#define APCI1564_WDOG_CTRL_REG 0x30 +#define APCI1564_WDOG_STATUS_REG 0x34 +#define APCI1564_WDOG_IRQ_REG 0x38 +#define APCI1564_WDOG_WARN_TIMEVAL_REG 0x3c +#define APCI1564_WDOG_WARN_TIMEBASE_REG0x40 +#define APCI1564_TIMER_REG 0x44 +#define APCI1564_TIMER_RELOAD_REG 0x48 +#define APCI1564_TIMER_TIMEBASE_REG0x4c +#define APCI1564_TIMER_CTRL_REG0x50 +#define APCI1564_TIMER_STATUS_REG 0x54 +#define APCI1564_TIMER_IRQ_REG 0x58 +#define APCI1564_TIMER_WARN_TIMEVAL_REG0x5c /* Rev 2.x only */ +#define APCI1564_TIMER_WARN_TIMEBASE_REG 0x60 /* Rev 2.x only */ + struct apci1564_private { unsigned long eeprom; /* base address of EEPROM register */ @@ -405,12 +439,14 @@ static int apci1564_auto_attac
[PATCH 15/15] staging: comedi: addi_watchdog: use addi_tcw.h defines for watchdog
Use the generic TCW (timer/counter/watchdog) defines for the 8-bit watchdog. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_watchdog.c | 30 -- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_watchdog.c b/drivers/staging/comedi/drivers/addi_watchdog.c index 0af141a..c5b082d 100644 --- a/drivers/staging/comedi/drivers/addi_watchdog.c +++ b/drivers/staging/comedi/drivers/addi_watchdog.c @@ -20,21 +20,9 @@ #include #include "../comedidev.h" +#include "addi_tcw.h" #include "addi_watchdog.h" -/* - * Register offsets/defines for the addi-data watchdog - */ -#define ADDI_WDOG_REG 0x00 -#define ADDI_WDOG_RELOAD_REG 0x04 -#define ADDI_WDOG_TIMEBASE 0x08 -#define ADDI_WDOG_CTRL_REG 0x0c -#define ADDI_WDOG_CTRL_ENABLE (1 << 0) -#define ADDI_WDOG_CTRL_SW_TRIG (1 << 9) -#define ADDI_WDOG_STATUS_REG 0x10 -#define ADDI_WDOG_STATUS_ENABLED (1 << 0) -#define ADDI_WDOG_STATUS_SW_TRIG (1 << 1) - struct addi_watchdog_private { unsigned long iobase; unsigned int wdog_ctrl; @@ -60,9 +48,9 @@ static int addi_watchdog_insn_config(struct comedi_device *dev, switch (data[0]) { case INSN_CONFIG_ARM: - spriv->wdog_ctrl = ADDI_WDOG_CTRL_ENABLE; + spriv->wdog_ctrl = ADDI_TCW_CTRL_ENA; reload = data[1] & s->maxdata; - outl(reload, spriv->iobase + ADDI_WDOG_RELOAD_REG); + outl(reload, spriv->iobase + ADDI_TCW_RELOAD_REG); /* Time base is 20ms, let the user know the timeout */ dev_info(dev->class_dev, "watchdog enabled, timeout:%dms\n", @@ -75,7 +63,7 @@ static int addi_watchdog_insn_config(struct comedi_device *dev, return -EINVAL; } - outl(spriv->wdog_ctrl, spriv->iobase + ADDI_WDOG_CTRL_REG); + outl(spriv->wdog_ctrl, spriv->iobase + ADDI_TCW_CTRL_REG); return insn->n; } @@ -89,7 +77,7 @@ static int addi_watchdog_insn_read(struct comedi_device *dev, int i; for (i = 0; i < insn->n; i++) - data[i] = inl(spriv->iobase + ADDI_WDOG_STATUS_REG); + data[i] = inl(spriv->iobase + ADDI_TCW_STATUS_REG); return insn->n; } @@ -109,8 +97,8 @@ static int addi_watchdog_insn_write(struct comedi_device *dev, /* "ping" the watchdog */ for (i = 0; i < insn->n; i++) { - outl(spriv->wdog_ctrl | ADDI_WDOG_CTRL_SW_TRIG, -spriv->iobase + ADDI_WDOG_CTRL_REG); + outl(spriv->wdog_ctrl | ADDI_TCW_CTRL_TRIG, +spriv->iobase + ADDI_TCW_CTRL_REG); } return insn->n; @@ -118,8 +106,8 @@ static int addi_watchdog_insn_write(struct comedi_device *dev, void addi_watchdog_reset(unsigned long iobase) { - outl(0x0, iobase + ADDI_WDOG_CTRL_REG); - outl(0x0, iobase + ADDI_WDOG_RELOAD_REG); + outl(0x0, iobase + ADDI_TCW_CTRL_REG); + outl(0x0, iobase + ADDI_TCW_RELOAD_REG); } EXPORT_SYMBOL_GPL(addi_watchdog_reset); -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/15] staging: comedi: addi_apci_1564: use addi_tcw.h defines for timer
Use the generic TCW (timer/counter/watchdog) defines for the 12-bit timer. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 24 +++--- drivers/staging/comedi/drivers/addi_apci_1564.c| 23 - 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 23bc8de..2f403e5 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -28,14 +28,14 @@ static int apci1564_timer_insn_config(struct comedi_device *dev, devpriv->tsk_current = current; /* First Stop The Timer */ - ctrl = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); + ctrl = inl(devpriv->timer + ADDI_TCW_CTRL_REG); ctrl &= 0xf9fe; /* Stop The Timer */ - outl(ctrl, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(ctrl, devpriv->timer + ADDI_TCW_CTRL_REG); if (data[1] == 1) { /* Enable timer int & disable all the other int sources */ - outl(0x02, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(0x02, devpriv->timer + ADDI_TCW_CTRL_REG); outl(0x0, dev->iobase + APCI1564_DI_IRQ_REG); outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); @@ -49,20 +49,20 @@ static int apci1564_timer_insn_config(struct comedi_device *dev, } } else { /* disable Timer interrupt */ - outl(0x0, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(0x0, devpriv->timer + ADDI_TCW_CTRL_REG); } /* Loading Timebase */ - outl(data[2], devpriv->timer + APCI1564_TIMER_TIMEBASE_REG); + outl(data[2], devpriv->timer + ADDI_TCW_TIMEBASE_REG); /* Loading the Reload value */ - outl(data[3], devpriv->timer + APCI1564_TIMER_RELOAD_REG); + outl(data[3], devpriv->timer + ADDI_TCW_RELOAD_REG); - ctrl = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); + ctrl = inl(devpriv->timer + ADDI_TCW_CTRL_REG); ctrl &= 0xfff719e2; ctrl |= (2 << 13) | 0x10; /* mode 2 */ - outl(ctrl, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(ctrl, devpriv->timer + ADDI_TCW_CTRL_REG); return insn->n; } @@ -75,7 +75,7 @@ static int apci1564_timer_insn_write(struct comedi_device *dev, struct apci1564_private *devpriv = dev->private; unsigned int ctrl; - ctrl = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); + ctrl = inl(devpriv->timer + ADDI_TCW_CTRL_REG); switch (data[1]) { case 0: /* Stop The Timer */ ctrl &= 0xf9fe; @@ -85,7 +85,7 @@ static int apci1564_timer_insn_write(struct comedi_device *dev, ctrl |= 0x1; break; } - outl(ctrl, devpriv->timer + APCI1564_TIMER_CTRL_REG); + outl(ctrl, devpriv->timer + ADDI_TCW_CTRL_REG); return insn->n; } @@ -98,10 +98,10 @@ static int apci1564_timer_insn_read(struct comedi_device *dev, struct apci1564_private *devpriv = dev->private; /* Stores the status of the Timer */ - data[0] = inl(devpriv->timer + APCI1564_TIMER_STATUS_REG) & 0x1; + data[0] = inl(devpriv->timer + ADDI_TCW_STATUS_REG) & 0x1; /* Stores the Actual value of the Timer */ - data[1] = inl(devpriv->timer + APCI1564_TIMER_REG); + data[1] = inl(devpriv->timer + ADDI_TCW_VAL_REG); return insn->n; } diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 359880d..d47904e 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -28,6 +28,7 @@ #include "../comedidev.h" #include "comedi_fc.h" +#include "addi_tcw.h" #include "addi_watchdog.h" /* @@ -94,18 +95,10 @@ #define APCI1564_WDOG_WARN_TIMEBASE_REG0x40 /* - * devpriv->timer Register Map + * devpriv->timer Register Map (see addi_tcw.h for register/bit defines) * PLD Revision 1.0 - PCI BAR 0 + 0x04 * PLD Revision 2.x - PCI BAR 0 + 0x48 */ -#define APCI1564_TIMER_REG 0x00 -#define APCI1564_TIMER_RELOAD_REG 0x04 -#define APCI1564_TIMER_TIMEBASE_REG0x08 -#define APCI1564_TIMER_CTRL_REG0x0c -#define APCI1564_TIMER_STATUS_REG 0x10 -#define APCI1564_TIMER_IRQ_REG 0x14 -#define APCI1564_TIMER_WARN_TIMEVAL_REG0x18 /* Rev 2.x only */ -#define APCI1564_TIMER_WARN_TIMEBASE_REG 0x1c /* Rev 2.x only */ /* * devpriv->counters Register Map @@ -150,8 +143,8 @@ static int apci1564_reset(struct comedi_device *dev)
[PATCH 02/15] staging: comedi: addi_apci_1564: use correct I/O base for APCI1564_DI_INT_STATUS_REG
The APCI1564_DI_INT_STATUS_REG is located in the PCI BAR 0 I/O space. That base address is stored in devpriv->amcc_iobase. Use that to correctly read the register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1564.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index cf14b0a..467e278 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -85,8 +85,8 @@ static irqreturn_t apci1564_interrupt(int irq, void *d) outl(status & APCI1564_DI_INT_DISABLE, devpriv->amcc_iobase + APCI1564_DI_IRQ_REG); - s->state = inl(dev->iobase + APCI1564_DI_INT_STATUS_REG) - & 0x; + s->state = inl(devpriv->amcc_iobase + + APCI1564_DI_INT_STATUS_REG) & 0x; comedi_buf_write_samples(s, &s->state, 1); comedi_handle_events(dev, s); -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/15] staging: comedi: addi_apci_1564: fix timer iobase for all PLD revisions
The APCI-1564 has different I/O mapping depending on if the PLD revision is Rev 1.0 or Rev 2.x. Add a member, 'timer', to the private data for the base address of the 12-bit timer. Fix the register defines so they will work for all PLD revisions and initialize the devpriv->timer appropriately. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 32 ++ drivers/staging/comedi/drivers/addi_apci_1564.c| 38 ++ 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 1c313bc..b689303 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -52,15 +52,15 @@ static int apci1564_timer_config(struct comedi_device *dev, devpriv->tsk_current = current; if (data[0] == ADDIDATA_TIMER) { /* First Stop The Timer */ - ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); ul_Command1 = ul_Command1 & 0xF9FEUL; /* Stop The Timer */ - outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, devpriv->timer + APCI1564_TIMER_CTRL_REG); devpriv->timer_select_mode = ADDIDATA_TIMER; if (data[1] == 1) { /* Enable TIMER int & DISABLE ALL THE OTHER int SOURCES */ - outl(0x02, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(0x02, devpriv->timer + APCI1564_TIMER_CTRL_REG); outl(0x0, dev->iobase + APCI1564_DI_IRQ_REG); outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); @@ -72,19 +72,19 @@ static int apci1564_timer_config(struct comedi_device *dev, devpriv->counters + APCI1564_COUNTER_IRQ_REG(2)); } else { /* disable Timer interrupt */ - outl(0x0, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(0x0, devpriv->timer + APCI1564_TIMER_CTRL_REG); } /* Loading Timebase */ - outl(data[2], dev->iobase + APCI1564_TIMER_TIMEBASE_REG); + outl(data[2], devpriv->timer + APCI1564_TIMER_TIMEBASE_REG); /* Loading the Reload value */ - outl(data[3], dev->iobase + APCI1564_TIMER_RELOAD_REG); + outl(data[3], devpriv->timer + APCI1564_TIMER_RELOAD_REG); - ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(devpriv->timer + APCI1564_TIMER_CTRL_REG); ul_Command1 = (ul_Command1 & 0xFFF719E2UL) | 2UL << 13UL | 0x10UL; /* mode 2 */ - outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, devpriv->timer + APCI1564_TIMER_CTRL_REG); } else if (data[0] == ADDIDATA_COUNTER) { devpriv->timer_select_mode = ADDIDATA_COUNTER; @@ -146,17 +146,21 @@ static int apci1564_timer_write(struct comedi_device *dev, if (devpriv->timer_select_mode == ADDIDATA_TIMER) { if (data[1] == 1) { - ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(devpriv->timer + + APCI1564_TIMER_CTRL_REG); ul_Command1 = (ul_Command1 & 0xF9FFUL) | 0x1UL; /* Enable the Timer */ - outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, +devpriv->timer + APCI1564_TIMER_CTRL_REG); } else if (data[1] == 0) { /* Stop The Timer */ - ul_Command1 = inl(dev->iobase + APCI1564_TIMER_CTRL_REG); + ul_Command1 = inl(devpriv->timer + + APCI1564_TIMER_CTRL_REG); ul_Command1 = ul_Command1 & 0xF9FEUL; - outl(ul_Command1, dev->iobase + APCI1564_TIMER_CTRL_REG); + outl(ul_Command1, +devpriv->timer + APCI1564_TIMER_CTRL_REG); } } else if (devpriv->timer_select_mode == ADDIDATA_COUNTER) { ul_Command1 = inl(devpriv->counters + @@ -194,10 +198,10 @@ static int apci1564_timer_read(struct comedi_device *dev, if (devpriv->timer_select_mode == ADDIDATA_TIMER) { /* Stores the status of the Timer */ - data[0] = inl(dev->io
[PATCH 01/15] staging: comedi: addi_apci_1564: board does not use an AMCC PCI controller
According to ADDI-DATA, the APCI-1564 board has a FPGA with a PCI core, it does not use an AMCC PCI controller chip. Remove the amcc_s5933.h include as well as the read of the AMCC_OP_REG_INTCSR register. That offset would actually read APCI1564_WDOG_STATUS_REG register in the FPGA which has nothing to do with the interrupt status. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1564.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index aa908a4..cf14b0a 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -28,7 +28,6 @@ #include "../comedidev.h" #include "comedi_fc.h" -#include "amcc_s5933.h" #include "addi_watchdog.h" struct apci1564_private { @@ -80,11 +79,6 @@ static irqreturn_t apci1564_interrupt(int irq, void *d) unsigned int ctrl; unsigned int chan; - /* check interrupt is from this device */ - if ((inl(devpriv->amcc_iobase + AMCC_OP_REG_INTCSR) & -INTCSR_INTR_ASSERTED) == 0) - return IRQ_NONE; - status = inl(devpriv->amcc_iobase + APCI1564_DI_IRQ_REG); if (status & APCI1564_DI_INT_ENABLE) { /* disable the interrupt */ -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/15] staging: comedi: addi_apci_1564: detect PLD revision for I/O mapping
The APCI-1564 has different I/O mapping depending on if the PLD revision is Rev 1.0 or Rev 2.x. The revision can be determined by reading the EEPROM register at offset 0x00 of PCI BAR 0 and checking the value of bits 7 to 4. Add this check to apci1564_auto_attach(). Currently this driver is coded to work with the Rev 2.x I/O mapping. For now, fail the attach if a Rev 1.0 PLD is detected. Document the I/O mapping for both revisions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1564.c | 54 +++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 4252054..f75803a 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -30,7 +30,44 @@ #include "comedi_fc.h" #include "addi_watchdog.h" +/* + * PCI BAR 0 + * + * PLD Revision 1.0 I/O Mapping + * 0x00 93C76 EEPROM + * 0x04 - 0x18 Timer 12-Bit + * + * PLD Revision 2.x I/O Mapping + * 0x00 93C76 EEPROM + * 0x04 - 0x14 Digital Input + * 0x18 - 0x25 Digital Output + * 0x28 - 0x44 Watchdog 8-Bit + * 0x48 - 0x64 Timer 12-Bit + */ +#define APCI1564_EEPROM_REG0x00 +#define APCI1564_EEPROM_VCC_STATUS (1 << 8) +#define APCI1564_EEPROM_TO_REV(x) (((x) >> 4) & 0xf) +#define APCI1564_EEPROM_DI (1 << 3) +#define APCI1564_EEPROM_DO (1 << 2) +#define APCI1564_EEPROM_CS (1 << 1) +#define APCI1564_EEPROM_CLK(1 << 0) + +/* + * PCI BAR 1 + * + * PLD Revision 1.0 I/O Mapping + * 0x00 - 0x10 Digital Input + * 0x14 - 0x20 Digital Output + * 0x24 - 0x3c Watchdog 8-Bit + * + * PLD Revision 2.x I/O Mapping + * 0x00 Counter_0 + * 0x20 Counter_1 + * 0x30 Counter_3 + */ + struct apci1564_private { + unsigned long eeprom; /* base address of EEPROM register */ unsigned long counters; /* base address of 32-bit counters */ unsigned int mode1; /* riding-edge/high level channels */ unsigned int mode2; /* falling-edge/low level channels */ @@ -352,6 +389,7 @@ static int apci1564_auto_attach(struct comedi_device *dev, struct pci_dev *pcidev = comedi_to_pci_dev(dev); struct apci1564_private *devpriv; struct comedi_subdevice *s; + unsigned int val; int ret; devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); @@ -362,9 +400,19 @@ static int apci1564_auto_attach(struct comedi_device *dev, if (ret) return ret; - /* PLD Revision 2.x I/O Mapping */ - dev->iobase = pci_resource_start(pcidev, 0); - devpriv->counters = pci_resource_start(pcidev, 1); + /* read the EEPROM register and check the I/O map revision */ + devpriv->eeprom = pci_resource_start(pcidev, 0); + val = inl(devpriv->eeprom + APCI1564_EEPROM_REG); + if (APCI1564_EEPROM_TO_REV(val) == 0) { + /* PLD Revision 1.0 I/O Mapping */ + dev_err(dev->class_dev, + "PLD Revision 1.0 detected, not yet supported\n"); + return -ENXIO; + } else { + /* PLD Revision 2.x I/O Mapping */ + dev->iobase = devpriv->eeprom; + devpriv->counters = pci_resource_start(pcidev, 1); + } apci1564_reset(dev); -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/15] staging: comedi: addi_apci_1564: fix board I/O mapping
The APCI-1564 boards do not actually have an AMCC PCI controller. According to ADDI-DATA, the boards have always used an FPGA with a PCI core. Unfortunately, there are two major revisions of the FPGA and they use different I/O mappings. Fix the driver so that both I/O map revisions work correctly. The counter/timer code in hwdrv_apci1564.c is still broken due to comedi API violations. H Hartley Sweeten (15): staging: comedi: addi_apci_1564: board does not use an AMCC PCI controller staging: comedi: addi_apci_1564: use correct I/O base for APCI1564_DI_INT_STATUS_REG staging: comedi: addi_apci_1564: store PCI BAR 1 base address in private data staging: comedi: addi_apci_1564: use dev->iobase for main registers staging: comedi: addi_apci_1564: detect PLD revision for I/O mapping staging: comedi: addi_apci_1564: fix dev->iobase for all PLD revisions staging: comedi: addi_apci_1564: fix timer iobase for all PLD revisions staging: comedi: addi_apci_1564: fix counter code in main driver source staging: comedi: addi_apci_1564: move counter register defines to driver staging: comedi: addi_apci_1564: split timer and counter subdevices staging: comedi: addi_tcw.h: provide generic defines for the ADDI-DATA TCW staging: comedi: addi_apci_1564: use addi_tcw.h defines for timer staging: comedi: addi_apci_1564: use addi_tcw.h defines for counters staging: comedi: addi_apci_1564: enable support for PLD Rev 1.0 I/O mapping staging: comedi: addi_watchdog: use addi_tcw.h defines for watchdog .../comedi/drivers/addi-data/hwdrv_apci1564.c | 371 + drivers/staging/comedi/drivers/addi_apci_1564.c| 260 ++- drivers/staging/comedi/drivers/addi_tcw.h | 56 drivers/staging/comedi/drivers/addi_watchdog.c | 30 +- 4 files changed, 404 insertions(+), 313 deletions(-) create mode 100644 drivers/staging/comedi/drivers/addi_tcw.h -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/15] staging: comedi: addi_apci_1564: enable support for PLD Rev 1.0 I/O mapping
Remove the error return in the (*auto_attach) and allow the driver to attach to APC-1564 boards that use the PLD Rev 1.0 I/O mapping. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1564.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 18f38f0..6872b69 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -454,9 +454,6 @@ static int apci1564_auto_attach(struct comedi_device *dev, dev->iobase = pci_resource_start(pcidev, 1) + APCI1564_REV1_MAIN_IOBASE; devpriv->timer = devpriv->eeprom + APCI1564_REV1_TIMER_IOBASE; - dev_err(dev->class_dev, - "PLD Revision 1.0 detected, not yet supported\n"); - return -ENXIO; } else { /* PLD Revision 2.x I/O Mapping */ dev->iobase = devpriv->eeprom + APCI1564_REV2_MAIN_IOBASE; -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/15] staging: comedi: addi_apci_1564: move counter register defines to driver
Move the defines for the counter registers from the included source file to the main driver source file. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c | 12 drivers/staging/comedi/drivers/addi_apci_1564.c | 13 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index b689303..af37df7 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -18,18 +18,6 @@ #define ADDIDATA_WATCHDOG 2 /* - * devpriv->counters Register Map - */ -#define APCI1564_COUNTER_REG(x)(0x00 + ((x) * 0x20)) -#define APCI1564_COUNTER_RELOAD_REG(x) (0x04 + ((x) * 0x20)) -#define APCI1564_COUNTER_TIMEBASE_REG(x) (0x08 + ((x) * 0x20)) -#define APCI1564_COUNTER_CTRL_REG(x) (0x0c + ((x) * 0x20)) -#define APCI1564_COUNTER_STATUS_REG(x) (0x10 + ((x) * 0x20)) -#define APCI1564_COUNTER_IRQ_REG(x)(0x14 + ((x) * 0x20)) -#define APCI1564_COUNTER_WARN_TIMEVAL_REG(x) (0x18 + ((x) * 0x20)) -#define APCI1564_COUNTER_WARN_TIMEBASE_REG(x) (0x1c + ((x) * 0x20)) - -/* * Configures The Timer or Counter * * data[0] Configure as: 0 = Timer, 1 = Counter diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 3fb9cc0..958eb7d 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -107,6 +107,19 @@ #define APCI1564_TIMER_WARN_TIMEVAL_REG0x18 /* Rev 2.x only */ #define APCI1564_TIMER_WARN_TIMEBASE_REG 0x1c /* Rev 2.x only */ +/* + * devpriv->counters Register Map + * PLD Revision 2.x - PCI BAR 1 + 0x00 + */ +#define APCI1564_COUNTER_REG(x)(0x00 + ((x) * 0x20)) +#define APCI1564_COUNTER_RELOAD_REG(x) (0x04 + ((x) * 0x20)) +#define APCI1564_COUNTER_TIMEBASE_REG(x) (0x08 + ((x) * 0x20)) +#define APCI1564_COUNTER_CTRL_REG(x) (0x0c + ((x) * 0x20)) +#define APCI1564_COUNTER_STATUS_REG(x) (0x10 + ((x) * 0x20)) +#define APCI1564_COUNTER_IRQ_REG(x)(0x14 + ((x) * 0x20)) +#define APCI1564_COUNTER_WARN_TIMEVAL_REG(x) (0x18 + ((x) * 0x20)) +#define APCI1564_COUNTER_WARN_TIMEBASE_REG(x) (0x1c + ((x) * 0x20)) + struct apci1564_private { unsigned long eeprom; /* base address of EEPROM register */ unsigned long timer;/* base address of 12-bit timer */ -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/15] staging: comedi: addi_apci_1564: store PCI BAR 1 base address in private data
According to ADDI-DATA, only the PLD Revision 2.x versions of the APCI-1564 have the 3 counters. The base address for these counters is found in PCI BAR 1. For aesthetics, save this base address in the private data. The dev->iobase can then be used for the main registers of the board. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 57 ++ drivers/staging/comedi/drivers/addi_apci_1564.c| 25 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index ad9949c..37733ae 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -47,7 +47,7 @@ #define APCI1564_TIMER_WARN_TIMEBASE_REG 0x64 /* - * dev->iobase Register Map + * devpriv->counters Register Map */ #define APCI1564_COUNTER_REG(x)(0x00 + ((x) * 0x20)) #define APCI1564_COUNTER_RELOAD_REG(x) (0x04 + ((x) * 0x20)) @@ -93,12 +93,12 @@ static int apci1564_timer_config(struct comedi_device *dev, outl(0x0, devpriv->amcc_iobase + APCI1564_DI_IRQ_REG); outl(0x0, devpriv->amcc_iobase + APCI1564_DO_IRQ_REG); outl(0x0, devpriv->amcc_iobase + APCI1564_WDOG_IRQ_REG); - outl(0x0, dev->iobase + - APCI1564_COUNTER_IRQ_REG(0)); - outl(0x0, dev->iobase + - APCI1564_COUNTER_IRQ_REG(1)); - outl(0x0, dev->iobase + - APCI1564_COUNTER_IRQ_REG(2)); + outl(0x0, +devpriv->counters + APCI1564_COUNTER_IRQ_REG(0)); + outl(0x0, +devpriv->counters + APCI1564_COUNTER_IRQ_REG(1)); + outl(0x0, +devpriv->counters + APCI1564_COUNTER_IRQ_REG(2)); } else { /* disable Timer interrupt */ outl(0x0, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); @@ -118,16 +118,16 @@ static int apci1564_timer_config(struct comedi_device *dev, devpriv->timer_select_mode = ADDIDATA_COUNTER; /* First Stop The Counter */ - ul_Command1 = inl(dev->iobase + -APCI1564_COUNTER_CTRL_REG(chan)); + ul_Command1 = inl(devpriv->counters + + APCI1564_COUNTER_CTRL_REG(chan)); ul_Command1 = ul_Command1 & 0xF9FEUL; /* Stop The Timer */ - outl(ul_Command1, dev->iobase + - APCI1564_COUNTER_CTRL_REG(chan)); + outl(ul_Command1, +devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); /* Set the reload value */ - outl(data[3], dev->iobase + - APCI1564_COUNTER_RELOAD_REG(chan)); + outl(data[3], +devpriv->counters + APCI1564_COUNTER_RELOAD_REG(chan)); /* Set the mode : */ /* - Disable the hardware */ @@ -140,18 +140,18 @@ static int apci1564_timer_config(struct comedi_device *dev, ul_Command1 = (ul_Command1 & 0xFFFC19E2UL) | 0x8UL | (unsigned int) ((unsigned int) data[4] << 16UL); - outl(ul_Command1, dev->iobase + - APCI1564_COUNTER_CTRL_REG(chan)); + outl(ul_Command1, +devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); /* Enable or Disable Interrupt */ ul_Command1 = (ul_Command1 & 0xF9FD) | (data[1] << 1); - outl(ul_Command1, dev->iobase + - APCI1564_COUNTER_CTRL_REG(chan)); + outl(ul_Command1, +devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); /* Set the Up/Down selection */ ul_Command1 = (ul_Command1 & 0xFFFBF9FFUL) | (data[6] << 18); - outl(ul_Command1, dev->iobase + - APCI1564_COUNTER_CTRL_REG(chan)); + outl(ul_Command1, +devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); } else { dev_err(dev->class_dev, "Invalid subdevice.\n"); } @@ -188,9 +188,8 @@ static int apci1564_timer_write(struct comedi_device *dev, outl(ul_Command1, devpriv->amcc_iobase + APCI1564_TIMER_CTRL_REG); } } else if (devpriv->timer_select_mode == ADDIDATA_COUNTER) { -
[PATCH 13/15] staging: comedi: addi_apci_1564: use addi_tcw.h defines for counters
Use the generic TCW (timer/counter/watchdog) defines for the 32-bit counters. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 35 -- drivers/staging/comedi/drivers/addi_apci_1564.c| 35 ++ 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 2f403e5..fa99c8c 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -40,12 +40,12 @@ static int apci1564_timer_insn_config(struct comedi_device *dev, outl(0x0, dev->iobase + APCI1564_DO_IRQ_REG); outl(0x0, dev->iobase + APCI1564_WDOG_IRQ_REG); if (devpriv->counters) { - outl(0x0, -devpriv->counters + APCI1564_COUNTER_IRQ_REG(0)); - outl(0x0, -devpriv->counters + APCI1564_COUNTER_IRQ_REG(1)); - outl(0x0, -devpriv->counters + APCI1564_COUNTER_IRQ_REG(2)); + unsigned long iobase; + + iobase = devpriv->counters + ADDI_TCW_IRQ_REG; + outl(0x0, iobase + APCI1564_COUNTER(0)); + outl(0x0, iobase + APCI1564_COUNTER(1)); + outl(0x0, iobase + APCI1564_COUNTER(2)); } } else { /* disable Timer interrupt */ @@ -113,18 +113,19 @@ static int apci1564_counter_insn_config(struct comedi_device *dev, { struct apci1564_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); + unsigned long iobase = devpriv->counters + APCI1564_COUNTER(chan); unsigned int ctrl; devpriv->tsk_current = current; /* First Stop The Counter */ - ctrl = inl(devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + ctrl = inl(iobase + ADDI_TCW_CTRL_REG); ctrl &= 0xf9fe; /* Stop The Timer */ - outl(ctrl, devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + outl(ctrl, iobase + ADDI_TCW_CTRL_REG); /* Set the reload value */ - outl(data[3], devpriv->counters + APCI1564_COUNTER_RELOAD_REG(chan)); + outl(data[3], iobase + ADDI_TCW_RELOAD_REG); /* Set the mode : */ /* - Disable the hardware */ @@ -136,17 +137,17 @@ static int apci1564_counter_insn_config(struct comedi_device *dev, ctrl &= 0xfffc19e2; ctrl |= 0x8 | (data[4] << 16); - outl(ctrl, devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + outl(ctrl, iobase + ADDI_TCW_CTRL_REG); /* Enable or Disable Interrupt */ ctrl &= 0xf9fd; ctrl |= (data[1] << 1); - outl(ctrl, devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + outl(ctrl, iobase + ADDI_TCW_CTRL_REG); /* Set the Up/Down selection */ ctrl &= 0xfffbf9ff; ctrl |= (data[6] << 18); - outl(ctrl, devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + outl(ctrl, iobase + ADDI_TCW_CTRL_REG); return insn->n; } @@ -158,9 +159,10 @@ static int apci1564_counter_insn_write(struct comedi_device *dev, { struct apci1564_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); + unsigned long iobase = devpriv->counters + APCI1564_COUNTER(chan); unsigned int ctrl; - ctrl = inl(devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + ctrl = inl(iobase + ADDI_TCW_CTRL_REG); switch (data[1]) { case 0: /* Stops the Counter subdevice */ ctrl = 0; @@ -174,7 +176,7 @@ static int apci1564_counter_insn_write(struct comedi_device *dev, ctrl |= 0x400; break; } - outl(ctrl, devpriv->counters + APCI1564_COUNTER_CTRL_REG(chan)); + outl(ctrl, iobase + ADDI_TCW_CTRL_REG); return insn->n; } @@ -186,12 +188,13 @@ static int apci1564_counter_insn_read(struct comedi_device *dev, { struct apci1564_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); + unsigned long iobase = devpriv->counters + APCI1564_COUNTER(chan); unsigned int status; /* Read the Counter Actual Value. */ - data[0] = inl(devpriv->counters + APCI1564_COUNTER_REG(chan)); + data[0] = inl(iobase + ADDI_TCW_VAL_REG); - status = inl(devpriv->counters + APCI1564_COUNTER_STATUS_REG(chan)); + status = inl(iobase + ADDI_TCW_STATUS_REG); data[1] = (status >> 1) & 1;/* software trigger status */ data[2] = (status >> 2) & 1;/* hardware trigger status */ data[3] = (status >> 3) & 1;/* software clear status */ diff --git
[PATCH] staging: comedi: adl_pci9111: use comedi_async 'scans_done' to detect EOA
The comedi core now counts the number of samples added to the async buffer and detects the end-of-scan and increments the comedi_async 'scans_done' counter. Remove the private data member 'stop_counter' and use the 'scans_done' member to detect the end-of-acquisition. This fixes a possible interger overflow when calculating the value of the 'stop_counter' and removes the need to accumulate the 'total' number of samples added to the async buffer in pci9111_handle_fifo_half_full(). Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adl_pci9111.c | 28 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 47934c9..539eb94 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -133,8 +133,6 @@ static const struct comedi_lrange pci9111_ai_range = { struct pci9111_private_data { unsigned long lcr_io_base; - int stop_counter; - unsigned int scan_delay; unsigned int chunk_counter; unsigned int chunk_num_samples; @@ -404,12 +402,6 @@ static int pci9111_ai_do_cmd(struct comedi_device *dev, outb(CR_RANGE(cmd->chanlist[0]) & PCI9111_AI_RANGE_MASK, dev->iobase + PCI9111_AI_RANGE_STAT_REG); - /* Set counter */ - if (cmd->stop_src == TRIG_COUNT) - dev_private->stop_counter = cmd->stop_arg * cmd->chanlist_len; - else/* TRIG_NONE */ - dev_private->stop_counter = 0; - /* Set timer pacer */ dev_private->scan_delay = 0; if (cmd->convert_src == TRIG_TIMER) { @@ -435,7 +427,6 @@ static int pci9111_ai_do_cmd(struct comedi_device *dev, } outb(trig, dev->iobase + PCI9111_AI_TRIG_CTRL_REG); - dev_private->stop_counter *= (1 + dev_private->scan_delay); dev_private->chunk_counter = 0; dev_private->chunk_num_samples = cmd->chanlist_len * (1 + dev_private->scan_delay); @@ -464,21 +455,14 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev, { struct pci9111_private_data *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; - unsigned int total = 0; unsigned int samples; - if (cmd->stop_src == TRIG_COUNT && - PCI9111_FIFO_HALF_SIZE > devpriv->stop_counter) - samples = devpriv->stop_counter; - else - samples = PCI9111_FIFO_HALF_SIZE; - + samples = comedi_nsamples_left(s, PCI9111_FIFO_HALF_SIZE); insw(dev->iobase + PCI9111_AI_FIFO_REG, devpriv->ai_bounce_buffer, samples); if (devpriv->scan_delay < 1) { - total = comedi_buf_write_samples(s, devpriv->ai_bounce_buffer, -samples); + comedi_buf_write_samples(s, devpriv->ai_bounce_buffer, samples); } else { unsigned int pos = 0; unsigned int to_read; @@ -491,7 +475,7 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev, if (to_read > samples - pos) to_read = samples - pos; - total += comedi_buf_write_samples(s, + comedi_buf_write_samples(s, devpriv->ai_bounce_buffer + pos, to_read); } else { @@ -500,8 +484,6 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev, if (to_read > samples - pos) to_read = samples - pos; - - total += comedi_samples_to_bytes(s, to_read); } pos += to_read; @@ -512,8 +494,6 @@ static void pci9111_handle_fifo_half_full(struct comedi_device *dev, devpriv->chunk_counter = 0; } } - - devpriv->stop_counter -= comedi_bytes_to_samples(s, total); } static irqreturn_t pci9111_interrupt(int irq, void *p_device) @@ -570,7 +550,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device) pci9111_handle_fifo_half_full(dev, s); } - if (cmd->stop_src == TRIG_COUNT && dev_private->stop_counter == 0) + if (cmd->stop_src == TRIG_COUNT && async->scans_done >= cmd->stop_arg) async->events |= COMEDI_CB_EOA; outb(0, dev->iobase + PCI9111_INT_CLR_REG); -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: comedi: adl_pci9118: tidy up AI acquisition
Use the comedi_async 'scans_done' to detect the EOA and tidy up the DMA code a bit. H Hartley Sweeten (4): staging: comedi: adl_pci9118: use comedi_async 'scans_done' to detect EOA staging: comedi: adl_pci9118: absorb move_block_from_dma() staging: comedi: adl_pci9118: use comedi_bytes_to_samples() staging: comedi: adl_pci9118: switch DMA buffers after writing samples drivers/staging/comedi/drivers/adl_pci9118.c | 69 +++- 1 file changed, 16 insertions(+), 53 deletions(-) -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel