[PATCH 3.19.0-rc3 1/1] STAGING: Fix pcl818.c coding style issue

2015-01-09 Thread Simon Guo
Correct coding style problem in pcl818.c. The coding style problems(29 
warnings detected by checkpatch.pl) includes:
- line over 80 characters
- There is space before tabs
The changed file has been verified with checkpatch.pl to be clean for 
warnings/errors.

Signed-off-by: Simon Guo 
---
 drivers/staging/comedi/drivers/pcl818.c | 50 -
 1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 8edea35..111bee1 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -45,11 +45,11 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=A/D input  -5V.. +5V
-  1, 10=A/D input -10V..+10V
+ 1, 10=A/D input -10V..+10V
 [5] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818, PCL-818H:
@@ -57,44 +57,44 @@ A word or two about DMA. Driver support DMA operations at 
two ways:
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
+ 1, 10=D/A output 0-10V (internal reference -10V)
  2=D/A output unknown (external reference)
 
Options for PCL-818HD, PCL-818HG:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA/FIFO  (-1=use FIFO, 0=disable both FIFO and DMA,
-  1=use DMA ch 1, 3=use DMA ch 3)
+ 1=use DMA ch 1, 3=use DMA ch 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0,  5=D/A output 0-5V  (internal reference -5V)
-  1, 10=D/A output 0-10V (internal reference -10V)
- 2=D/A output unknown (external reference)
+ 1, 10=D/A output 0-10V (internal reference -10V)
+ 2=D/A output unknown (external reference)
 
Options for PCL-718:
 [0] - IO Base
 [1] - IRQ  (0=disable, 2, 3, 4, 5, 6, 7)
 [2] - DMA  (0=disable, 1, 3)
 [3] - 0, 10=10MHz clock for 8254
-  1= 1MHz clock for 8254
+ 1= 1MHz clock for 8254
 [4] - 0=A/D Range is +/-10V
  1= +/-5V
  2= +/-2.5V
  3= +/-1V
  4= +/-0.5V
- 5= user defined bipolar
+ 5= user defined bipolar
  6= 0-10V
  7= 0-5V
- 8= 0-2V
+ 8= 0-2V
  9= 0-1V
 10= user defined unipolar
 [5] - 0,  5=D/A outputs 0-5V  (internal reference -5V)
-  1, 10=D/A outputs 0-10V (internal reference -10V)
+ 1, 10=D/A outputs 0-10V (internal reference -10V)
  2=D/A outputs unknown (external reference)
 [6] - 0, 60=max  60kHz A/D sampling
-  1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
+ 1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed)
 
 */
 
@@ -309,11 +309,19 @@ struct pcl818_private {
unsigned long dmabuf[2];/*  pointers to begin of DMA buffers */
unsigned int hwdmaptr[2];   /*  hardware address of DMA buffers */
int next_dma_buf;   /*  which DMA buffer will be used next round */
-   long dma_runs_to_end;   /*  how many we must permorm DMA transfer to 
end of record */
-   unsigned long last_dma_run; /*  how many bytes we must transfer on 
last DMA page */
-   unsigned int ns_min;/*  manimal allowed delay between samples (in 
us) for actual card */
+   long dma_runs_to_end;   /*  how many we must permorm DMA transfer
+*  to end of record
+*/
+   unsigned long last_dma_run; /*  how many bytes we must transfer
+*  on last DMA page
+*/
+   unsigned int ns_min;/*  manimal allowed delay between
+*  samples (in us) for actual card
+*/
int i8253_osc_base; /*  1/frequency of on board oscilator in ns */
-   unsigned int act_chanlist[16];  /*  MUX setting for actual AI 
operations */
+   unsigned int act_chanlist[16];  /*  MUX setting

Re: [PATCH v8 1/4] doc: add bindings document for altera fpga manager

2015-01-09 Thread Rob Herring
On Tue, Jan 6, 2015 at 4:34 PM, atull  wrote:
> On Tue, 6 Jan 2015, Rob Herring wrote:
>
>> On Tue, Jan 6, 2015 at 2:13 PM,   wrote:
>> > From: Alan Tull 
>> >
>> > New bindings document for Altera fpga manager.
>> >
>> > Signed-off-by: Alan Tull 
>>
>> Acked-by: Rob Herring 
>>
>> Like I said, this binding doesn't look like it will change other than
>> perhaps additional optional properties, so it can go into
>> Documentation. Perhaps .../bindings/fpga/. I'm happy to merge this
>> thru DT tree if you want.
>>
>> Rob
>
> Thanks, that would be great.  Yes ../bindings/fpga sounds good.
>
> Do you want me to send you a patch with the updated path?

Yes, please.

Rob
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v5] Staging: comedi: fix line over 80 characters warning

2015-01-09 Thread jitendra kumar khasdev
This is patch to file pcl812.c that fix line over 80
characters warning which is found by checkpatch.pl tool.

Signed-off-by: Jitendra kumar khasdev 
---
 drivers/staging/comedi/drivers/pcl812.c | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index ac243ca..3eac017 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -507,20 +507,26 @@ static const struct pcl812_board boardtypes[] = {
 };
 
 struct pcl812_private {
-   unsigned char dma;  /*  >0 use dma ( usedDMA channel) */
+   unsigned char dma;  /*  >0 use dma ( usedDMA channel) */
unsigned char range_correction; /*  =1 we must add 1 to range number */
unsigned int last_ai_chanspec;
-   unsigned char mode_reg_int; /*  there is stored INT number for some 
card */
+   unsigned char mode_reg_int; /*  there is stored INT number for
+*  some card
+*/
unsigned int ai_poll_ptr;   /*  how many sampes transfer poll */
unsigned int dmapages;
unsigned int hwdmasize;
unsigned long dmabuf[2];/*  PTR to DMA buf */
unsigned int hwdmaptr[2];   /*  HW PTR to DMA buf */
unsigned int dmabytestomove[2]; /*  how many bytes DMA transfer */
-   int next_dma_buf;   /*  which buffer is next to use */
-   unsigned int dma_runs_to_end;   /*  how many times we must switch DMA 
buffers */
-   unsigned int last_dma_run;  /*  how many bytes to transfer on last 
DMA buffer */
-   unsigned int max_812_ai_mode0_rangewait;/*  setling time for 
gain */
+   int next_dma_buf;   /*  which buffer is next to use */
+   unsigned int dma_runs_to_end;   /*  how many times we must switch
+*  DMA buffers
+*/
+   unsigned int last_dma_run;  /*  how many bytes to transfer on
+*  last DMA buffer
+*/
+   unsigned int max_812_ai_mode0_rangewait;/* setling time for gain */
unsigned int divisor1;
unsigned int divisor2;
unsigned int use_diff:1;
@@ -1235,7 +1241,7 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
for (i = 0; i < 2; i++) {
unsigned long dmabuf;
 
-   dmabuf =  __get_dma_pages(GFP_KERNEL, 
devpriv->dmapages);
+   dmabuf = __get_dma_pages(GFP_KERNEL, devpriv->dmapages);
if (!dmabuf)
return -ENOMEM;
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 1/4] doc: add bindings document for altera fpga manager

2015-01-09 Thread atull
On Fri, 9 Jan 2015, Rob Herring wrote:

> On Tue, Jan 6, 2015 at 4:34 PM, atull  wrote:
> > On Tue, 6 Jan 2015, Rob Herring wrote:
> >
> >> On Tue, Jan 6, 2015 at 2:13 PM,   wrote:
> >> > From: Alan Tull 
> >> >
> >> > New bindings document for Altera fpga manager.
> >> >
> >> > Signed-off-by: Alan Tull 
> >>
> >> Acked-by: Rob Herring 
> >>
> >> Like I said, this binding doesn't look like it will change other than
> >> perhaps additional optional properties, so it can go into
> >> Documentation. Perhaps .../bindings/fpga/. I'm happy to merge this
> >> thru DT tree if you want.
> >>
> >> Rob
> >
> > Thanks, that would be great.  Yes ../bindings/fpga sounds good.
> >
> > Do you want me to send you a patch with the updated path?
> 
> Yes, please.
> 
> Rob
> 

OK I'll split that patch out and just send it separately to you and the DT 
list.

Alan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 2/4] fpga manager: add sysfs interface document

2015-01-09 Thread atull
On Wed, 7 Jan 2015, Pavel Machek wrote:

> On Tue 2015-01-06 14:13:37, at...@opensource.altera.com wrote:
> > +
> > +What:  /sys/class/fpga_manager//firmware
> > +Date:  October 2014
> > +KernelVersion: 3.18
> > +Contact:   Alan Tull 
> > +Description:   Name of the FPGA image file to load using firmware
> > class.
> 
> This one is ugly: it unneccessarily passes firmware name through the
> kernel. Just make interface and code simpler by always passing
> "socfpga-fpga-image" or something like that.
> 
> Thanks,
>   Pavel

Hi Pavel,

It might be ugly.  It's not unnecessary.  Some uses of FPGAs involve
switching out the FPGA images dynamically under control of the userspace.

Alan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: Fix the warning messages about casting without __user macro

2015-01-09 Thread Andrey Utkin
2014-12-10 16:49 GMT+02:00 Greg KH :
> On Wed, Dec 10, 2014 at 07:09:59AM +, Al Viro wrote:
>> On Tue, Dec 09, 2014 at 10:56:12PM -0800, Shalin Mehta wrote:
>> > From: Shalin Mehta 
>> >
>> > This issue is showed up while compiling with sparse. The iov_base in 
>> > struct iovec struct explicitly declares that the assigned value should be 
>> > user space pointer with __user macro. Where as here, the __user macro 
>> > isn't used while casting.
>>
>> ... and pointers are not user space ones at all.  Which is to say, quit
>> messing with casts; it's not struct iovec.  Proper fix is to replace
>> it here (and in almost all places throughout drivers/staging/lustre) with
>> struct kvec.  And yes, such a patch had been sent.  Still not applied,
>> AFAICS...
>
> Yeah, it's in the merge window and I'll pick new staging patches back up
> when 3.19-rc1 is released.

Hi Greg,
Still no commits for
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c since Sun Nov
23 (staging: lustre: Coalesce string fragments) in linux-next. Maybe
the aforementioned commit got missed for merging?

-- 
Andrey Utkin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor cleanup

2015-01-09 Thread gre...@linuxfoundation.org
On Thu, Jan 08, 2015 at 05:04:20PM +, KY Srinivasan wrote:
> 
> 
> > -Original Message-
> > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> > Sent: Thursday, January 8, 2015 8:02 AM
> > To: KY Srinivasan
> > Cc: gre...@linuxfoundation.org; de...@linuxdriverproject.org; Haiyang
> > Zhang; linux-ker...@vger.kernel.org
> > Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor
> > cleanup
> > 
> > KY Srinivasan  writes:
> > 
> > >> -Original Message-
> > >> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org]
> > >> On Behalf Of gre...@linuxfoundation.org
> > >> Sent: Wednesday, December 10, 2014 6:48 AM
> > >> To: Vitaly Kuznetsov
> > >> Cc: de...@linuxdriverproject.org; Haiyang Zhang; linux-
> > >> ker...@vger.kernel.org
> > >> Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do
> > >> minor cleanup
> > >>
> > >> On Wed, Dec 10, 2014 at 10:22:40AM +0100, Vitaly Kuznetsov wrote:
> > >> > Dexuan Cui  writes:
> > >> >
> > >> > >> -Original Message-
> > >> > >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> > >> > >> Sent: Tuesday, December 9, 2014 23:48 PM
> > >> > >> To: KY Srinivasan
> > >> > >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux-
> > >> > >> ker...@vger.kernel.org; Dexuan Cui
> > >> > >> Subject: [PATCH 0/5] Tools: hv: fix compiler warnings and do
> > >> > >> minor cleanup
> > >> > >>
> > >> > >> When someone does 'make' in tools/hv/ issues appear:
> > >> > >> - hv_fcopy_daemon is not being built;
> > >> > >> - lots of compiler warnings.
> > >> > >>
> > >> > >> This is just a cleanup. Compile-tested by myself on top of
> > >> > >> linux-
> > >> next/master.
> > >> > >>
> > >> > >> Piggyback this series and send "[PATCH 5/5] Tools: hv: do not
> > >> > >> add redundant '/'
> > >> > >>  in hv_start_fcopy()"
> > >> > >>
> > >> > >> Vitaly Kuznetsov (5):
> > >> > >>   Tools: hv: add mising fcopyd to the Makefile
> > >> > >>   Tools: hv: remove unused bytes_written from kvp_update_file()
> > >> > >>   Tools: hv: address compiler warnings for hv_kvp_daemon.c
> > >> > >>   Tools: hv: address compiler warnings for hv_fcopy_daemon.c
> > >> > >>   Tools: hv: do not add redundant '/' in hv_start_fcopy()
> > >> > >>
> > >> > >>  tools/hv/Makefile  |  4 ++--
> > >> > >>  tools/hv/hv_fcopy_daemon.c | 10 ++
> > >> > >>  tools/hv/hv_kvp_daemon.c   | 29 +
> > >> > >>  3 files changed, 17 insertions(+), 26 deletions(-)
> > >> > >>
> > >> > >> --
> > >> > >> 1.9.3
> > >> > >
> > >> > > Hi Vitaly,
> > >> > > Thanks for the patchset!
> > >> > >
> > >> > > Acked-by: Dexuan Cui 
> > >> > >
> > >> > > PS, I added Greg into the TO list.
> > >> > > The hv code in drivers/hv/ and tools/hv/ usually has to go into
> > >> > > Greg's tree first.
> > >> >
> > >> > Well, I don't mind spamming Greg but he's not on the
> > >> > scripts/get_maintainer.pl output. In case he's not monitoring the
> > >> > list for patches by some other tool (patchwork?) a patch adding him
> > >> > to MAINTAINERS would do the job.
> > >> >
> > >> > Greg, do you want to become an official Hyper-V maintainer in
> > >> > MAINTAINERS? I can send a patch then :-)
> > >>
> > >> No.  It's up to the "real" maintainers to take the patches and then
> > >> forward them on to me for inclusion in the kernel tree.  KY knows this...
> > >
> > > I will take care of this.
> > >
> > 
> > Hi KY,
> > 
> > I just found out these patches never made it to any repo, at least I can't 
> > see
> > them in char-misc-next. Do I need to resend?
> 
> Greg,
> 
> I have signed off on these patches. Do you want us to resend them. On a 
> different note, I too have a
> Few patches that I sent some weeks ago. Should I be resending them as well.

Please resend everything, there has been a mess of different patches and
discussions and I can't figure out what should be applied and what
should not.  I'll guess at a few easy ones, but getting the "correct"
ones from you is the best thing.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v8 2/4] fpga manager: add sysfs interface document

2015-01-09 Thread Pavel Machek
On Fri 2015-01-09 13:14:24, atull wrote:
> On Wed, 7 Jan 2015, Pavel Machek wrote:
> 
> > On Tue 2015-01-06 14:13:37, at...@opensource.altera.com wrote:
> > > +
> > > +What:/sys/class/fpga_manager//firmware
> > > +Date:October 2014
> > > +KernelVersion:   3.18
> > > +Contact: Alan Tull 
> > > +Description: Name of the FPGA image file to load using firmware
> > > class.
> > 
> > This one is ugly: it unneccessarily passes firmware name through the
> > kernel. Just make interface and code simpler by always passing
> > "socfpga-fpga-image" or something like that.
> > 
> > Thanks,
> > Pavel
> 
> Hi Pavel,
> 
> It might be ugly.  It's not unnecessary.  Some uses of FPGAs involve
> switching out the FPGA images dynamically under control of the userspace.

Then configure udev to load right firmware for you, or ln -s
image-i-want-now socfpga-fpga-image to select the one to read...?

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors

2015-01-09 Thread Greg Kroah-Hartman
On Mon, Dec 01, 2014 at 11:52:41AM +0100, Vitaly Kuznetsov wrote:
> When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary
> cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/online)
> the system freeze is observed. This happens due to the fact that on newer
> hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed
> across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c)
> and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining
> when vmbus is loaded until the issue is fixed host-side.
> 
> This patch also disables hibernation but it is OK as it is also broken (MCE
> error is hit on resume). Suspend still works.
> 
> Tested with WS2008R2 and WS2012R2.
> 
> Signed-off-by: Vitaly Kuznetsov 
> Acked-by: Dexuan Cui 
> 
> ---
> Changes since v1:
> - introduce hv_cpu_hotplug_quirk() function to not spread #ifdefs [Greg KH]
> - add pr_notice() message "hv_vmbus: CPU offlining is not supported by 
> hypervisor"
> ---
>  drivers/hv/vmbus_drv.c | 33 +
>  1 file changed, 33 insertions(+)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 4d6b269..2e6b38e 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -32,6 +32,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -671,6 +672,36 @@ static void vmbus_isr(void)
>   tasklet_schedule(&msg_dpc);
>  }
>  
> +#ifdef CONFIG_HOTPLUG_CPU
> +static int hyperv_cpu_disable(void)
> +{
> + return -1;
> +}
> +
> +static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
> +{
> + /*
> +  * Offlining a CPU when running on newer hypervisors (WS2012R2, Win8,
> +  * ...) is not supported at this moment as channel interrupts are
> +  * distributed across all of them.
> +  */
> +
> + if ((vmbus_proto_version == VERSION_WS2008) ||
> + (vmbus_proto_version == VERSION_WIN7))
> + return;
> +
> + if (vmbus_loaded) {
> + smp_ops.cpu_disable = hyperv_cpu_disable;
> + pr_notice("CPU offlining is not supported by hypervisor");
> + } else
> + smp_ops.cpu_disable = native_cpu_disable;
> +}
> +#else
> +static void hv_cpu_hotplug_quirk(bool vmbus_loaded)
> +{
> +}
> +#endif
> +
>  /*
>   * vmbus_bus_init -Main vmbus driver initialization routine.
>   *
> @@ -711,6 +742,7 @@ static int vmbus_bus_init(int irq)
>   if (ret)
>   goto err_alloc;
>  
> + hv_cpu_hotplug_quirk(true);
>   vmbus_request_offers();
>  
>   return 0;
> @@ -964,6 +996,7 @@ static void __exit vmbus_exit(void)
>   bus_unregister(&hv_bus);
>   hv_cleanup();
>   acpi_bus_unregister_driver(&vmbus_acpi_driver);
> + hv_cpu_hotplug_quirk(false);
>  }
>  
>  
> -- 
> 1.9.3

This breaks the build:
ERROR: "native_cpu_disable" [drivers/hv/hv_vmbus.ko] undefined!

Please test better.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor cleanup

2015-01-09 Thread KY Srinivasan


> -Original Message-
> From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org]
> Sent: Friday, January 9, 2015 12:48 PM
> To: KY Srinivasan
> Cc: Vitaly Kuznetsov; de...@linuxdriverproject.org; Haiyang Zhang; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor
> cleanup
> 
> On Thu, Jan 08, 2015 at 05:04:20PM +, KY Srinivasan wrote:
> >
> >
> > > -Original Message-
> > > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> > > Sent: Thursday, January 8, 2015 8:02 AM
> > > To: KY Srinivasan
> > > Cc: gre...@linuxfoundation.org; de...@linuxdriverproject.org;
> > > Haiyang Zhang; linux-ker...@vger.kernel.org
> > > Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do
> > > minor cleanup
> > >
> > > KY Srinivasan  writes:
> > >
> > > >> -Original Message-
> > > >> From: devel
> > > >> [mailto:driverdev-devel-boun...@linuxdriverproject.org]
> > > >> On Behalf Of gre...@linuxfoundation.org
> > > >> Sent: Wednesday, December 10, 2014 6:48 AM
> > > >> To: Vitaly Kuznetsov
> > > >> Cc: de...@linuxdriverproject.org; Haiyang Zhang; linux-
> > > >> ker...@vger.kernel.org
> > > >> Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do
> > > >> minor cleanup
> > > >>
> > > >> On Wed, Dec 10, 2014 at 10:22:40AM +0100, Vitaly Kuznetsov wrote:
> > > >> > Dexuan Cui  writes:
> > > >> >
> > > >> > >> -Original Message-
> > > >> > >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> > > >> > >> Sent: Tuesday, December 9, 2014 23:48 PM
> > > >> > >> To: KY Srinivasan
> > > >> > >> Cc: Haiyang Zhang; de...@linuxdriverproject.org; linux-
> > > >> > >> ker...@vger.kernel.org; Dexuan Cui
> > > >> > >> Subject: [PATCH 0/5] Tools: hv: fix compiler warnings and do
> > > >> > >> minor cleanup
> > > >> > >>
> > > >> > >> When someone does 'make' in tools/hv/ issues appear:
> > > >> > >> - hv_fcopy_daemon is not being built;
> > > >> > >> - lots of compiler warnings.
> > > >> > >>
> > > >> > >> This is just a cleanup. Compile-tested by myself on top of
> > > >> > >> linux-
> > > >> next/master.
> > > >> > >>
> > > >> > >> Piggyback this series and send "[PATCH 5/5] Tools: hv: do
> > > >> > >> not add redundant '/'
> > > >> > >>  in hv_start_fcopy()"
> > > >> > >>
> > > >> > >> Vitaly Kuznetsov (5):
> > > >> > >>   Tools: hv: add mising fcopyd to the Makefile
> > > >> > >>   Tools: hv: remove unused bytes_written from
> kvp_update_file()
> > > >> > >>   Tools: hv: address compiler warnings for hv_kvp_daemon.c
> > > >> > >>   Tools: hv: address compiler warnings for hv_fcopy_daemon.c
> > > >> > >>   Tools: hv: do not add redundant '/' in hv_start_fcopy()
> > > >> > >>
> > > >> > >>  tools/hv/Makefile  |  4 ++--
> > > >> > >>  tools/hv/hv_fcopy_daemon.c | 10 ++
> > > >> > >>  tools/hv/hv_kvp_daemon.c   | 29 +
> > > >> > >>  3 files changed, 17 insertions(+), 26 deletions(-)
> > > >> > >>
> > > >> > >> --
> > > >> > >> 1.9.3
> > > >> > >
> > > >> > > Hi Vitaly,
> > > >> > > Thanks for the patchset!
> > > >> > >
> > > >> > > Acked-by: Dexuan Cui 
> > > >> > >
> > > >> > > PS, I added Greg into the TO list.
> > > >> > > The hv code in drivers/hv/ and tools/hv/ usually has to go
> > > >> > > into Greg's tree first.
> > > >> >
> > > >> > Well, I don't mind spamming Greg but he's not on the
> > > >> > scripts/get_maintainer.pl output. In case he's not monitoring
> > > >> > the list for patches by some other tool (patchwork?) a patch
> > > >> > adding him to MAINTAINERS would do the job.
> > > >> >
> > > >> > Greg, do you want to become an official Hyper-V maintainer in
> > > >> > MAINTAINERS? I can send a patch then :-)
> > > >>
> > > >> No.  It's up to the "real" maintainers to take the patches and
> > > >> then forward them on to me for inclusion in the kernel tree.  KY knows
> this...
> > > >
> > > > I will take care of this.
> > > >
> > >
> > > Hi KY,
> > >
> > > I just found out these patches never made it to any repo, at least I
> > > can't see them in char-misc-next. Do I need to resend?
> >
> > Greg,
> >
> > I have signed off on these patches. Do you want us to resend them. On
> > a different note, I too have a Few patches that I sent some weeks ago.
> Should I be resending them as well.
> 
> Please resend everything, there has been a mess of different patches and
> discussions and I can't figure out what should be applied and what should
> not.  I'll guess at a few easy ones, but getting the "correct"
> ones from you is the best thing.
Will do. Vitaly, could you please resend the patches. 

Regards,

K. Y
> 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor cleanup

2015-01-09 Thread gre...@linuxfoundation.org
On Fri, Jan 09, 2015 at 08:58:08PM +, KY Srinivasan wrote:
> > Please resend everything, there has been a mess of different patches and
> > discussions and I can't figure out what should be applied and what should
> > not.  I'll guess at a few easy ones, but getting the "correct"
> > ones from you is the best thing.
> Will do. Vitaly, could you please resend the patches. 

You are the subsystem maintainer, right?  It's your job to bundle them
up and resend if needed.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor cleanup

2015-01-09 Thread KY Srinivasan


> -Original Message-
> From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org]
> Sent: Friday, January 9, 2015 1:02 PM
> To: KY Srinivasan
> Cc: de...@linuxdriverproject.org; Haiyang Zhang; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH 0/5] Tools: hv: fix compiler warnings and do minor
> cleanup
> 
> On Fri, Jan 09, 2015 at 08:58:08PM +, KY Srinivasan wrote:
> > > Please resend everything, there has been a mess of different patches
> > > and discussions and I can't figure out what should be applied and
> > > what should not.  I'll guess at a few easy ones, but getting the "correct"
> > > ones from you is the best thing.
> > Will do. Vitaly, could you please resend the patches.
> 
> You are the subsystem maintainer, right?  It's your job to bundle them up
> and resend if needed.

Will do.

K. Y
> 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: dmm32at: Fixed a code indent issue

2015-01-09 Thread Greg KH
On Sun, Jan 04, 2015 at 04:22:35PM +0100, Piotr Kubus wrote:
> This is a patch to the dmm32at.c file that fixes up a code indent error found 
> by the checkpatch.pl tool.
> 
> Signed-off-by: Piotr Kubus 
> ---
>  drivers/staging/comedi/drivers/dmm32at.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
> b/drivers/staging/comedi/drivers/dmm32at.c
> index 6df298a..31919b8 100644
> --- a/drivers/staging/comedi/drivers/dmm32at.c
> +++ b/drivers/staging/comedi/drivers/dmm32at.c
> @@ -365,7 +365,7 @@ static void dmm32at_setaitimer(struct comedi_device *dev, 
> unsigned int nansec)
>   /* enable the ai conversion interrupt and the clock to start scans */
>   outb(DMM32AT_INTCLK_ADINT |
>DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL,
> - dev->iobase + DMM32AT_INTCLK_REG);
> +  dev->iobase + DMM32AT_INTCLK_REG);
>  }
>  
>  static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice 
> *s)
> -- 
> 1.9.1

Someone already submitted this same change before you :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: comedi: drivers: fix space coding style issue in s626.c

2015-01-09 Thread Greg KH
On Mon, Dec 29, 2014 at 02:42:56PM +0530, jitendra kumar khasdev wrote:
> This is a patch to the s626.c file that fixes up a space error
> found by the checkpatch.pl tool
> 
> Signed-off-by: Jitendra Kumar Khasdev 
> Reviewed-by: Ian Abbott 
> ---
>  drivers/staging/comedi/drivers/s626.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/s626.c 
> b/drivers/staging/comedi/drivers/s626.c
> index 14932c5..fc497dd 100644
> --- a/drivers/staging/comedi/drivers/s626.c
> +++ b/drivers/staging/comedi/drivers/s626.c
> @@ -118,7 +118,7 @@ static void s626_mc_enable(struct comedi_device *dev,
>  static void s626_mc_disable(struct comedi_device *dev,
>   unsigned int cmd, unsigned int reg)
>  {
> - writel(cmd << 16 , dev->mmio + reg);
> + writel(cmd << 16, dev->mmio + reg);
>   mmiowb();
>  }
>  
> -- 
> 1.9.1

Someone already sent this patch in before you :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Staging: comedi: dmm32at: Fix a code indent issue

2015-01-09 Thread Greg KH
On Tue, Jan 06, 2015 at 11:16:16AM +0100, Piotr Kubus wrote:
> Fixed a code indent error found by checkpatch.pl in dmm32at.c.
> 
> Signed-off-by: Piotr Kubus 
> ---
> v2: make the commit message clearer and shorter
> 
>  drivers/staging/comedi/drivers/dmm32at.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
> b/drivers/staging/comedi/drivers/dmm32at.c
> index 6df298a..31919b8 100644
> --- a/drivers/staging/comedi/drivers/dmm32at.c
> +++ b/drivers/staging/comedi/drivers/dmm32at.c
> @@ -365,7 +365,7 @@ static void dmm32at_setaitimer(struct comedi_device *dev, 
> unsigned int nansec)
>   /* enable the ai conversion interrupt and the clock to start scans */
>   outb(DMM32AT_INTCLK_ADINT |
>DMM32AT_INTCLK_CLKEN | DMM32AT_INTCLK_CLKSEL,
> - dev->iobase + DMM32AT_INTCLK_REG);
> +  dev->iobase + DMM32AT_INTCLK_REG);
>  }
>  
>  static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice 
> *s)
> -- 
> 1.9.1
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Already sent by someone else before you :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5] Staging: comedi: fix line over 80 characters warning

2015-01-09 Thread Greg KH
On Fri, Jan 09, 2015 at 10:05:56PM +0530, jitendra kumar khasdev wrote:
> This is patch to file pcl812.c that fix line over 80
> characters warning which is found by checkpatch.pl tool.

You also do something else in here, that you did not document, so I
can't accept this patch :(

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 51/69] staging: unisys: remove ERRDRV and related macros

2015-01-09 Thread Greg KH
On Fri, Dec 05, 2014 at 05:09:26PM -0500, Benjamin Romer wrote:
> Remove the ERRDRV() macro family and use pr_err directly everywhere it was 
> used.
> Completely remove any error messages that used the macro but are redundant, 
> for
> example, several of the messages were from memory allocation failures.

That's a lot of different things to be doing all in one patch.

I'm happy to see you get rid of some of your macros, but you can't just
replace them with pr_err, lots of these should be dev_err() instead.

Try doing just one thing at a time here please.

I've taken the patches up to this one.

Also:

> - LOGERR("CONTROLVM_BUS_CREATE Failed: max buses:%d already 
> created\n",
> + pr_err("CONTROLVM_BUS_CREATE Failed: max buses:%d already 
> created\n",

What is with all of the "CONTROLVM_BUS_CREATE" type strings in messages?
That's not really needed, right?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 52/69] staging: unisys: remove DBGINF() macros

2015-01-09 Thread Greg KH
On Fri, Dec 05, 2014 at 05:09:27PM -0500, Benjamin Romer wrote:
> Remove the DBGINF() group of logging macros and use pr_debug() instead. Fix
> places that used the DBGINF() macro so they actually print the expected value,
> because they were not being compiled at all before the switchover.
> 
> Signed-off-by: Ken Depro 
> Signed-off-by: Benjamin Romer 
> ---
>  drivers/staging/unisys/include/timskmod.h  |  2 --
>  drivers/staging/unisys/include/uniklog.h   | 39 
>  drivers/staging/unisys/uislib/uislib.c |  8 ++---
>  drivers/staging/unisys/uislib/uisutils.c   |  2 +-
>  drivers/staging/unisys/virthba/virthba.c   | 57 
> +++---
>  drivers/staging/unisys/virtpci/virtpci.c   | 41 ++---
>  drivers/staging/unisys/visorchipset/file.c | 18 +-
>  7 files changed, 64 insertions(+), 103 deletions(-)
> 
> diff --git a/drivers/staging/unisys/include/timskmod.h 
> b/drivers/staging/unisys/include/timskmod.h
> index 7831dbc..3d563c4 100644
> --- a/drivers/staging/unisys/include/timskmod.h
> +++ b/drivers/staging/unisys/include/timskmod.h
> @@ -91,14 +91,12 @@
>  #define WARNDRV(fmt, args...)   LOGWRN(fmt, ## args)
>  #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args)
>  #define INFODRV(fmt, args...)   LOGINF(fmt, ## args)
> -#define DEBUGDRV(fmt, args...)  DBGINF(fmt, ## args)
>  
>  #define PRINTKDEV(devname, fmt, args...)  LOGINFDEV(devname, fmt, ## args)
>  #define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args)
>  #define SECUREDEV(devname, fmt, args...)  LOGWRNDEV(devname, fmt, ## args)
>  #define INFODEV(devname, fmt, args...)LOGINFDEV(devname, fmt, ## args)
>  #define INFODEVX(devno, fmt, args...) LOGINFDEVX(devno, fmt, ## args)
> -#define DEBUGDEV(devname, fmt, args...)   DBGINFDEV(devname, fmt, ## args)
>  
>  /** Verifies the consistency of your PRIVATEDEVICEDATA structure using
>   *  conventional "signature" fields:
> diff --git a/drivers/staging/unisys/include/uniklog.h 
> b/drivers/staging/unisys/include/uniklog.h
> index e94120b..edc12f0 100644
> --- a/drivers/staging/unisys/include/uniklog.h
> +++ b/drivers/staging/unisys/include/uniklog.h
> @@ -26,45 +26,6 @@
>  #include 
>  
>  /*
> - * # DBGINF
> - *
> - * \brief Log debug informational message - log a LOG_INFO message only
> - *if DEBUG compiletime option enabled
> - *
> - * \param devname the device name of the device reporting this message, or
> - *NULL if this message is NOT device-related.
> - * \param fmt printf()-style format string containing the message to log.
> - * \param args Optional arguments to be formatted and inserted into the
> - * format string.
> - * \return nothing
> - *
> - * Log a message at the LOG_INFO level, but only if DEBUG is enabled.  If
> - * DEBUG is disabled, this expands to a no-op.
> - */
> -
> -/*
> - * # DBGVER
> - *
> - * \brief Log debug verbose message - log a LOG_DEBUG message only if
> - *DEBUG compiletime option enabled
> - *
> - * \param devname the device name of the device reporting this message, or
> - *NULL if this message is NOT device-related.
> - * \param fmt printf()-style format string containing the message to log.
> - * \param args Optional arguments to be formatted and inserted into the
> - * format string.
> - * \return nothing
> - *
> - * Log a message at the LOG_DEBUG level, but only if DEBUG is enabled.  If
> - * DEBUG is disabled, this expands to a no-op.  Note also that LOG_DEBUG
> - * messages can be enabled/disabled at runtime as well.
> - */
> -#define DBGINFDEV(devname, fmt, args...)do { } while (0)
> -#define DBGVERDEV(devname, fmt, args...)do { } while (0)
> -#define DBGINF(fmt, args...)do { } while (0)
> -#define DBGVER(fmt, args...)do { } while (0)
> -
> -/*
>   * # LOGINF
>   *
>   * \brief Log informational message - logs a message at the LOG_INFO level
> diff --git a/drivers/staging/unisys/uislib/uislib.c 
> b/drivers/staging/unisys/uislib/uislib.c
> index eb58449..d986fde 100644
> --- a/drivers/staging/unisys/uislib/uislib.c
> +++ b/drivers/staging/unisys/uislib/uislib.c
> @@ -1161,7 +1161,7 @@ static ssize_t info_debugfs_read(struct file *file, 
> char __user *buf,
>  
>  /* *start = buf; */
>   if (debug_buf == NULL) {
> - DBGINF("debug_buf == NULL; allocating buffer.\n.");
> + pr_debug("debug_buf == NULL; allocating buffer.\n.");
>   debug_buf = vmalloc(PROC_READ_BUFFER_SIZE);
>  
>   if (debug_buf == NULL) {
> @@ -1173,7 +1173,7 @@ static ssize_t info_debugfs_read(struct file *file, 
> char __user *buf,
>   temp = debug_buf;
>  
>   if ((*offset == 0) || (!debug_buf_valid)) {
> - DBGINF("calling info_debugfs_read_helper.\n");
> + pr_debug("calling info_debugfs_read_helper.\n");
>   /* if the read fails, then -1 will be returned */
>   total_by

Re: [PATCH 53/69] staging: unisys: get rid of LOGINFO() macros

2015-01-09 Thread Greg KH
On Fri, Dec 05, 2014 at 05:09:28PM -0500, Benjamin Romer wrote:
> Remove the entire set of LOGINFO() macros and replace them with calls to
> pr_info() instead.
> 
> Signed-off-by: Ken Depro 
> Signed-off-by: Benjamin Romer 
> ---
>  drivers/staging/unisys/include/timskmod.h  |  5 --
>  drivers/staging/unisys/include/uniklog.h   | 29 
>  drivers/staging/unisys/uislib/uislib.c | 40 +-
>  drivers/staging/unisys/uislib/uisthread.c  |  6 +-
>  drivers/staging/unisys/uislib/uisutils.c   |  6 +-
>  drivers/staging/unisys/virthba/virthba.c   | 54 +++---
>  drivers/staging/unisys/virtpci/virtpci.c   | 72 +-
>  .../unisys/visorchannel/visorchannel_main.c|  4 +-
>  drivers/staging/unisys/visorchipset/file.c |  6 +-
>  .../unisys/visorchipset/visorchipset_main.c| 86 
> +++---
>  10 files changed, 137 insertions(+), 171 deletions(-)
> 
> diff --git a/drivers/staging/unisys/include/timskmod.h 
> b/drivers/staging/unisys/include/timskmod.h
> index 3d563c4..5f33d5c 100644
> --- a/drivers/staging/unisys/include/timskmod.h
> +++ b/drivers/staging/unisys/include/timskmod.h
> @@ -87,16 +87,11 @@
>   (void *)(p2) = SWAPPOINTERS_TEMP;   \
>   } while (0)
>  
> -#define PRINTKDRV(fmt, args...) LOGINF(fmt, ## args)
>  #define WARNDRV(fmt, args...)   LOGWRN(fmt, ## args)
>  #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args)
> -#define INFODRV(fmt, args...)   LOGINF(fmt, ## args)
>  
> -#define PRINTKDEV(devname, fmt, args...)  LOGINFDEV(devname, fmt, ## args)
>  #define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args)
>  #define SECUREDEV(devname, fmt, args...)  LOGWRNDEV(devname, fmt, ## args)
> -#define INFODEV(devname, fmt, args...)LOGINFDEV(devname, fmt, ## args)
> -#define INFODEVX(devno, fmt, args...) LOGINFDEVX(devno, fmt, ## args)
>  
>  /** Verifies the consistency of your PRIVATEDEVICEDATA structure using
>   *  conventional "signature" fields:
> diff --git a/drivers/staging/unisys/include/uniklog.h 
> b/drivers/staging/unisys/include/uniklog.h
> index edc12f0..74a723e 100644
> --- a/drivers/staging/unisys/include/uniklog.h
> +++ b/drivers/staging/unisys/include/uniklog.h
> @@ -26,35 +26,6 @@
>  #include 
>  
>  /*
> - * # LOGINF
> - *
> - * \brief Log informational message - logs a message at the LOG_INFO level
> - *
> - * \param devname the device name of the device reporting this message, or
> - *NULL if this message is NOT device-related.
> - * \param fmt printf()-style format string containing the message to log.
> - * \param args Optional arguments to be formatted and inserted into the
> - * format string.
> - * \return nothing
> - *
> - * Logs the specified message at the LOG_INFO level.
> - */
> -
> -#define LOGINF(fmt, args...) pr_info(fmt, ## args)
> -#define LOGINFDEV(devname, fmt, args...) \
> - pr_info("%s " fmt, devname, ## args)
> -#define LOGINFDEVX(devno, fmt, args...) \
> - pr_info("dev%d " fmt, devno, ## args)
> -#define LOGINFNAME(vnic, fmt, args...)   \
> - do {\
> - if (vnic != NULL) { \
> - pr_info("%s " fmt, vnic->name, ## args);\
> - } else {\
> - pr_info(fmt, ## args);  \
> - }   \
> - } while (0)
> -
> -/*
>   * # LOGVER
>   *
>   * \brief Log verbose message - logs a message at the LOG_DEBUG level,
> diff --git a/drivers/staging/unisys/uislib/uislib.c 
> b/drivers/staging/unisys/uislib/uislib.c
> index d986fde..b6a7fb0 100644
> --- a/drivers/staging/unisys/uislib/uislib.c
> +++ b/drivers/staging/unisys/uislib/uislib.c
> @@ -671,7 +671,7 @@ static int destroy_device(struct controlvm_message *msg, 
> char *buf)
>   dev_no = msg->cmd.destroy_device.bus_no;
>  
>   read_lock(&bus_list_lock);
> - LOGINF("destroy_device called for bus_no=%u, dev_no=%u", bus_no,
> + pr_info("destroy_device called for bus_no=%u, dev_no=%u", bus_no,
>  dev_no);
>   for (bus = bus_list; bus; bus = bus->next) {
>   if (bus->bus_no == bus_no) {
> @@ -733,12 +733,12 @@ static int destroy_device(struct controlvm_message 
> *msg, char *buf)
>   * kernel paging request"
>   */
>   if (dev->polling) {
> - LOGINF("calling uislib_disable_channel_interrupts");
> + pr_info("calling uislib_disable_channel_interrupts");
>   uislib_disable_channel_interrupts(bus_no, dev_no);
>   }
>   /* unmap the channel memory for the device. */
>   if (!msg->hdr.flags.test_message) {
> - LOGINF("destroy_device, doing iounmap"

Re: [PATCH 55/69] staging: unisys: get rid of LOGWRN() macro and uisklog.h

2015-01-09 Thread Greg KH
On Fri, Dec 05, 2014 at 05:09:30PM -0500, Benjamin Romer wrote:
> Get rid of LOGWRN() and all related macros, and call pr_warn() directly 
> instead.

Side note, are you setting pr_fmt() properly so that everything is
"unified" with these messages?  No driver subsystem should ever use a
pr_* call unless it is at startup / shutdown where there is no hardware
involved.  I think that's not the case here so use the correct dev_*
versions instead.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3.19.0-rc3 1/1] STAGING: Fix pcl818.c coding style issue

2015-01-09 Thread Greg Kroah-Hartman
On Fri, Jan 09, 2015 at 12:20:04PM +0800, Simon Guo wrote:
> Correct coding style problem in pcl818.c. The coding style problems(29 
> warnings detected by checkpatch.pl) includes:
> - line over 80 characters
> - There is space before tabs
> The changed file has been verified with checkpatch.pl to be clean for 
> warnings/errors.

Those are different things, so there should be different patches, make
this a series please.

Also fix up your trailing whitespace in the changelog itself.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v6] Staging: comedi: patch to fix 80 characters line over warnings

2015-01-09 Thread jitendra kumar khasdev
This is the patch to pcl812.c that fix 80 character line over warnings.
These warnings are identified by checkpatch.pl tool.
For this patch I have did following changes,
1. convert single line comment into multiline comment
2. provide tab sapce for indentation purpose
3. reduce extra space between ( = ) sign.

Signed-off-by: Jitendra kumar khasdev 
---
 drivers/staging/comedi/drivers/pcl812.c | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index ac243ca..3eac017 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -507,20 +507,26 @@ static const struct pcl812_board boardtypes[] = {
 };
 
 struct pcl812_private {
-   unsigned char dma;  /*  >0 use dma ( usedDMA channel) */
+   unsigned char dma;  /*  >0 use dma ( usedDMA channel) */
unsigned char range_correction; /*  =1 we must add 1 to range number */
unsigned int last_ai_chanspec;
-   unsigned char mode_reg_int; /*  there is stored INT number for some 
card */
+   unsigned char mode_reg_int; /*  there is stored INT number for
+*  some card
+*/
unsigned int ai_poll_ptr;   /*  how many sampes transfer poll */
unsigned int dmapages;
unsigned int hwdmasize;
unsigned long dmabuf[2];/*  PTR to DMA buf */
unsigned int hwdmaptr[2];   /*  HW PTR to DMA buf */
unsigned int dmabytestomove[2]; /*  how many bytes DMA transfer */
-   int next_dma_buf;   /*  which buffer is next to use */
-   unsigned int dma_runs_to_end;   /*  how many times we must switch DMA 
buffers */
-   unsigned int last_dma_run;  /*  how many bytes to transfer on last 
DMA buffer */
-   unsigned int max_812_ai_mode0_rangewait;/*  setling time for 
gain */
+   int next_dma_buf;   /*  which buffer is next to use */
+   unsigned int dma_runs_to_end;   /*  how many times we must switch
+*  DMA buffers
+*/
+   unsigned int last_dma_run;  /*  how many bytes to transfer on
+*  last DMA buffer
+*/
+   unsigned int max_812_ai_mode0_rangewait;/* setling time for gain */
unsigned int divisor1;
unsigned int divisor2;
unsigned int use_diff:1;
@@ -1235,7 +1241,7 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
for (i = 0; i < 2; i++) {
unsigned long dmabuf;
 
-   dmabuf =  __get_dma_pages(GFP_KERNEL, 
devpriv->dmapages);
+   dmabuf = __get_dma_pages(GFP_KERNEL, devpriv->dmapages);
if (!dmabuf)
return -ENOMEM;
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v6] Staging: comedi: patch to fix 80 characters line over warnings

2015-01-09 Thread Greg KH
On Sat, Jan 10, 2015 at 09:54:39AM +0530, jitendra kumar khasdev wrote:
> This is the patch to pcl812.c that fix 80 character line over warnings.
> These warnings are identified by checkpatch.pl tool.
> For this patch I have did following changes,
> 1. convert single line comment into multiline comment
> 2. provide tab sapce for indentation purpose
> 3. reduce extra space between ( = ) sign.

You did 3 things here, so make it 3 different patches please.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7] Staging: comedi: patch to fix line over 80 characters warning

2015-01-09 Thread jitendra kumar khasdev
This is patch to pcl812.c that fix line over 80 characters warning
which is found by checkpatch.pl tool. Reduce the extra space around
equal sign that fix warning.

Signed-off-by: Jitendra kumar khasdev 
---
 drivers/staging/comedi/drivers/pcl812.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index ac243ca..9b576bc 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -1235,7 +1235,7 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
for (i = 0; i < 2; i++) {
unsigned long dmabuf;
 
-   dmabuf =  __get_dma_pages(GFP_KERNEL, 
devpriv->dmapages);
+   dmabuf = __get_dma_pages(GFP_KERNEL, devpriv->dmapages);
if (!dmabuf)
return -ENOMEM;
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 0/5] Tools: hv: fix compiler warnings and do minor cleanup

2015-01-09 Thread K. Y. Srinivasan
When someone does 'make' in tools/hv/ issues appear:
- hv_fcopy_daemon is not being built;
- lots of compiler warnings.

This is just a cleanup. Compile-tested by myself on top of linux-next/master.

Piggyback this series and send "[PATCH 5/5] Tools: hv: do not add redundant '/'
in hv_start_fcopy()"

Vitaly Kuznetsov (5):
  Tools: hv: add mising fcopyd to the Makefile
  Tools: hv: remove unused bytes_written from kvp_update_file()
  Tools: hv: address compiler warnings for hv_kvp_daemon.c
  Tools: hv: address compiler warnings for hv_fcopy_daemon.c
  Tools: hv: do not add redundant '/' in hv_start_fcopy()

 tools/hv/Makefile  |4 ++--
 tools/hv/hv_fcopy_daemon.c |   10 ++
 tools/hv/hv_kvp_daemon.c   |   29 +
 3 files changed, 17 insertions(+), 26 deletions(-)

-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 3/5] Tools: hv: address compiler warnings for hv_kvp_daemon.c

2015-01-09 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 

This patch addresses two types of compiler warnings:
... warning: comparison between signed and unsigned integer expressions 
[-Wsign-compare]
and
... warning: pointer targets in passing argument N of .kvp_ differ in 
signedness [-Wpointer-sign]

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 tools/hv/hv_kvp_daemon.c |   25 -
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 5a274ca..48a95f9 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -308,7 +308,7 @@ static int kvp_file_init(void)
return 0;
 }
 
-static int kvp_key_delete(int pool, const char *key, int key_size)
+static int kvp_key_delete(int pool, const __u8 *key, int key_size)
 {
int i;
int j, k;
@@ -351,8 +351,8 @@ static int kvp_key_delete(int pool, const char *key, int 
key_size)
return 1;
 }
 
-static int kvp_key_add_or_modify(int pool, const char *key, int key_size, 
const char *value,
-   int value_size)
+static int kvp_key_add_or_modify(int pool, const __u8 *key, int key_size,
+const __u8 *value, int value_size)
 {
int i;
int num_records;
@@ -405,7 +405,7 @@ static int kvp_key_add_or_modify(int pool, const char *key, 
int key_size, const
return 0;
 }
 
-static int kvp_get_value(int pool, const char *key, int key_size, char *value,
+static int kvp_get_value(int pool, const __u8 *key, int key_size, __u8 *value,
int value_size)
 {
int i;
@@ -437,8 +437,8 @@ static int kvp_get_value(int pool, const char *key, int 
key_size, char *value,
return 1;
 }
 
-static int kvp_pool_enumerate(int pool, int index, char *key, int key_size,
-   char *value, int value_size)
+static int kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size,
+   __u8 *value, int value_size)
 {
struct kvp_record *record;
 
@@ -659,7 +659,7 @@ static char *kvp_if_name_to_mac(char *if_name)
char*p, *x;
charbuf[256];
char addr_file[256];
-   int i;
+   unsigned int i;
char *mac_addr = NULL;
 
snprintf(addr_file, sizeof(addr_file), "%s%s%s", "/sys/class/net/",
@@ -698,7 +698,7 @@ static char *kvp_mac_to_if_name(char *mac)
charbuf[256];
char *kvp_net_dir = "/sys/class/net/";
char dev_id[256];
-   int i;
+   unsigned int i;
 
dir = opendir(kvp_net_dir);
if (dir == NULL)
@@ -748,7 +748,7 @@ static char *kvp_mac_to_if_name(char *mac)
 
 
 static void kvp_process_ipconfig_file(char *cmd,
-   char *config_buf, int len,
+   char *config_buf, unsigned int len,
int element_size, int offset)
 {
char buf[256];
@@ -766,7 +766,7 @@ static void kvp_process_ipconfig_file(char *cmd,
if (offset == 0)
memset(config_buf, 0, len);
while ((p = fgets(buf, sizeof(buf), file)) != NULL) {
-   if ((len - strlen(config_buf)) < (element_size + 1))
+   if (len < strlen(config_buf) + element_size + 1)
break;
 
x = strchr(p, '\n');
@@ -914,7 +914,7 @@ static int kvp_process_ip_address(void *addrp,
 
 static int
 kvp_get_ip_info(int family, char *if_name, int op,
-void  *out_buffer, int length)
+void  *out_buffer, unsigned int length)
 {
struct ifaddrs *ifap;
struct ifaddrs *curp;
@@ -1017,8 +1017,7 @@ kvp_get_ip_info(int family, char *if_name, int op,
weight += hweight32(&w[i]);
 
sprintf(cidr_mask, "/%d", weight);
-   if ((length - sn_offset) <
-   (strlen(cidr_mask) + 1))
+   if (length < sn_offset + strlen(cidr_mask) + 1)
goto gather_ipaddr;
 
if (sn_offset == 0)
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 1/5] Tools: hv: add mising fcopyd to the Makefile

2015-01-09 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 

fcopyd in missing in the Makefile, add it there.

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 tools/hv/Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index bd22f78..99ffe61 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -5,9 +5,9 @@ PTHREAD_LIBS = -lpthread
 WARNINGS = -Wall -Wextra
 CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS)
 
-all: hv_kvp_daemon hv_vss_daemon
+all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
 %: %.c
$(CC) $(CFLAGS) -o $@ $^
 
 clean:
-   $(RM) hv_kvp_daemon hv_vss_daemon
+   $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 4/5] Tools: hv: address compiler warnings for hv_fcopy_daemon.c

2015-01-09 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 

This patch addresses two types of compiler warnings:
... warning: unused variable .fd. [-Wunused-variable]
and
... warning: format .%s. expects argument of type .char *., but argument 5 has 
type .__u16 *. [-Wformat=]

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 tools/hv/hv_fcopy_daemon.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index f437d73..1a23872 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -51,7 +51,7 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
 
p = (char *)smsg->path_name;
snprintf(target_fname, sizeof(target_fname), "%s/%s",
-   (char *)smsg->path_name, smsg->file_name);
+(char *)smsg->path_name, (char *)smsg->file_name);
 
syslog(LOG_INFO, "Target file name: %s", target_fname);
/*
@@ -137,7 +137,7 @@ void print_usage(char *argv[])
 
 int main(int argc, char *argv[])
 {
-   int fd, fcopy_fd, len;
+   int fcopy_fd, len;
int error;
int daemonize = 1, long_index = 0, opt;
int version = FCOPY_CURRENT_VERSION;
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 5/5] Tools: hv: do not add redundant '/' in hv_start_fcopy()

2015-01-09 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 

We don't need to add additional '/' to smsg->path_name as snprintf("%s/%s")
does the right thing. Without the patch we get doubled '//' in the log message.

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 tools/hv/hv_fcopy_daemon.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index 1a23872..9445d8f 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -43,12 +43,6 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
int error = HV_E_FAIL;
char *q, *p;
 
-   /*
-* If possile append a path seperator to the path.
-*/
-   if (strlen((char *)smsg->path_name) < (W_MAX_PATH - 2))
-   strcat((char *)smsg->path_name, "/");
-
p = (char *)smsg->path_name;
snprintf(target_fname, sizeof(target_fname), "%s/%s",
 (char *)smsg->path_name, (char *)smsg->file_name);
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 2/5] Tools: hv: remove unused bytes_written from kvp_update_file()

2015-01-09 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 

fwrite() does not actually return the number of bytes written and
this value is being ignored anyway and ferror() is being called to
check for an error. As we assign to this variable and never use it
we get the following compile-time warning:
hv_kvp_daemon.c:149:9: warning: variable .bytes_written. set but not used 
[-Wunused-but-set-variable]
Remove bytes_written completely.

Signed-off-by: Vitaly Kuznetsov 
Signed-off-by: K. Y. Srinivasan 
---
 tools/hv/hv_kvp_daemon.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 6a6432a..5a274ca 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -147,7 +147,6 @@ static void kvp_release_lock(int pool)
 static void kvp_update_file(int pool)
 {
FILE *filep;
-   size_t bytes_written;
 
/*
 * We are going to write our in-memory registry out to
@@ -163,8 +162,7 @@ static void kvp_update_file(int pool)
exit(EXIT_FAILURE);
}
 
-   bytes_written = fwrite(kvp_file_info[pool].records,
-   sizeof(struct kvp_record),
+   fwrite(kvp_file_info[pool].records, sizeof(struct kvp_record),
kvp_file_info[pool].num_records, filep);
 
if (ferror(filep) || fclose(filep)) {
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/25] staging: line6: Remove line6_pod_transmit_paramter()

2015-01-09 Thread Chris Rorvick
This function was no longer used as of commit 2807904441d4 (staging:
line6: drop MIDI parameter sysfs attrs).

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/pod.c | 9 -
 drivers/staging/line6/pod.h | 2 --
 2 files changed, 11 deletions(-)

diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 44f4b2f..7b4ec92f 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -159,15 +159,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)
 }
 
 /*
-   Transmit PODxt Pro control parameter.
-*/
-void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
- u8 value)
-{
-   line6_transmit_parameter(&pod->line6, param, value);
-}
-
-/*
Send system parameter (from integer).
 */
 static int pod_set_system_param_int(struct usb_line6_pod *pod, int value,
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 3e3f167..397d94c 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -96,7 +96,5 @@ extern void line6_pod_disconnect(struct usb_interface 
*interface);
 extern int line6_pod_init(struct usb_interface *interface,
  struct usb_line6_pod *pod);
 extern void line6_pod_process_message(struct usb_line6_pod *pod);
-extern void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
-u8 value);
 
 #endif
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/25] staging: line6: Remove `device_bit' from properties

2015-01-09 Thread Chris Rorvick
The `device_bit' member was no longer used as of commit 2807904441d4
(staging: line6: drop MIDI parameter sysfs attrs).

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c  | 44 +++---
 drivers/staging/line6/driver.h  |  5 
 drivers/staging/line6/pcm.h |  2 ++
 drivers/staging/line6/usbdefs.h | 59 -
 4 files changed, 24 insertions(+), 86 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 503b2d7..15f3bc4 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -57,32 +57,32 @@ static const struct usb_device_id line6_id_table[] = {
 
 MODULE_DEVICE_TABLE(usb, line6_id_table);
 
-#define L6PROP(dev_bit, dev_id, dev_name, dev_cap)\
-   {.device_bit = LINE6_BIT_##dev_bit, .id = dev_id,\
+#define L6PROP(dev_id, dev_name, dev_cap)\
+   {.id = dev_id,\
 .name = dev_name, .capabilities = LINE6_BIT_##dev_cap}
 
 /* *INDENT-OFF* */
 static const struct line6_properties line6_properties_table[] = {
-   L6PROP(BASSPODXT, "BassPODxt", "BassPODxt",CTRL_PCM_HW),
-   L6PROP(BASSPODXTLIVE, "BassPODxtLive", "BassPODxt Live",   CTRL_PCM_HW),
-   L6PROP(BASSPODXTPRO,  "BassPODxtPro",  "BassPODxt Pro",CTRL_PCM_HW),
-   L6PROP(GUITARPORT,"GuitarPort","GuitarPort",   PCM),
-   L6PROP(POCKETPOD, "PocketPOD", "Pocket POD",   CONTROL),
-   L6PROP(PODHD300,  "PODHD300",  "POD HD300",CTRL_PCM_HW),
-   L6PROP(PODHD400,  "PODHD400",  "POD HD400",CTRL_PCM_HW),
-   L6PROP(PODHD500,  "PODHD500",  "POD HD500",CTRL_PCM_HW),
-   L6PROP(PODSTUDIO_GX,  "PODStudioGX",   "POD Studio GX",PCM),
-   L6PROP(PODSTUDIO_UX1, "PODStudioUX1",  "POD Studio UX1",   PCM),
-   L6PROP(PODSTUDIO_UX2, "PODStudioUX2",  "POD Studio UX2",   PCM),
-   L6PROP(PODX3, "PODX3", "POD X3",   PCM),
-   L6PROP(PODX3LIVE, "PODX3Live", "POD X3 Live",  PCM),
-   L6PROP(PODXT, "PODxt", "PODxt",CTRL_PCM_HW),
-   L6PROP(PODXTLIVE, "PODxtLive", "PODxt Live",   CTRL_PCM_HW),
-   L6PROP(PODXTPRO,  "PODxtPro",  "PODxt Pro",CTRL_PCM_HW),
-   L6PROP(TONEPORT_GX,   "TonePortGX","TonePort GX",  PCM),
-   L6PROP(TONEPORT_UX1,  "TonePortUX1",   "TonePort UX1", PCM),
-   L6PROP(TONEPORT_UX2,  "TonePortUX2",   "TonePort UX2", PCM),
-   L6PROP(VARIAX,"Variax","Variax Workbench", CONTROL),
+   L6PROP("BassPODxt", "BassPODxt",CTRL_PCM_HW),
+   L6PROP("BassPODxtLive", "BassPODxt Live",   CTRL_PCM_HW),
+   L6PROP("BassPODxtPro",  "BassPODxt Pro",CTRL_PCM_HW),
+   L6PROP("GuitarPort","GuitarPort",   PCM),
+   L6PROP("PocketPOD", "Pocket POD",   CONTROL),
+   L6PROP("PODHD300",  "POD HD300",CTRL_PCM_HW),
+   L6PROP("PODHD400",  "POD HD400",CTRL_PCM_HW),
+   L6PROP("PODHD500",  "POD HD500",CTRL_PCM_HW),
+   L6PROP("PODStudioGX",   "POD Studio GX",PCM),
+   L6PROP("PODStudioUX1",  "POD Studio UX1",   PCM),
+   L6PROP("PODStudioUX2",  "POD Studio UX2",   PCM),
+   L6PROP("PODX3", "POD X3",   PCM),
+   L6PROP("PODX3Live", "POD X3 Live",  PCM),
+   L6PROP("PODxt", "PODxt",CTRL_PCM_HW),
+   L6PROP("PODxtLive", "PODxt Live",   CTRL_PCM_HW),
+   L6PROP("PODxtPro",  "PODxt Pro",CTRL_PCM_HW),
+   L6PROP("TonePortGX","TonePort GX",  PCM),
+   L6PROP("TonePortUX1",   "TonePort UX1", PCM),
+   L6PROP("TonePortUX2",   "TonePort UX2", PCM),
+   L6PROP("Variax","Variax Workbench", CONTROL),
 };
 /* *INDENT-ON* */
 
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 16e3fc2..1cc7532 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -76,11 +76,6 @@ static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 
4;
 */
 struct line6_properties {
/**
-Bit identifying this device in the line6usb driver.
-   */
-   int device_bit;
-
-   /**
 Card id string (maximum 16 characters).
 This can be used to address the device in ALSA programs as
 "default:CARD="
diff --git a/drivers/staging/line6/pcm.h b/drivers/staging/line6/pcm.h
index 6aa0d46..5716f16 100644
--- a/drivers/staging/line6/pcm.h
+++ b/drivers/staging/line6/pcm.h
@@ -98,6 +98,8 @@ enum {
LINE6_INDEX_PAUSE_PLAYBACK,
LINE6_INDEX_PREPARED,
 
+#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x
+
/* individual bit masks: */
LINE6_BIT(PCM_ALSA_PLAYBACK_BUFFER),
LINE6_BIT(PCM_ALSA_PLAYBACK_STREAM),
diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbd

[PATCH 03/25] staging: line6: Remove unsupported X3 devices

2015-01-09 Thread Chris Rorvick
Support for these devices appears to have never been completed.  Remove
them from the device table along with a minimal amount of supporting
code.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c  | 26 --
 drivers/staging/line6/pcm.c |  2 --
 drivers/staging/line6/usbdefs.h |  2 --
 3 files changed, 30 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 15f3bc4..e40400b 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -43,8 +43,6 @@ static const struct usb_device_id line6_id_table[] = {
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_GX)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX1)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX2)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODX3)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODX3LIVE)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXT)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXTLIVE)},
{USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXTPRO)},
@@ -74,8 +72,6 @@ static const struct line6_properties line6_properties_table[] 
= {
L6PROP("PODStudioGX",   "POD Studio GX",PCM),
L6PROP("PODStudioUX1",  "POD Studio UX1",   PCM),
L6PROP("PODStudioUX2",  "POD Studio UX2",   PCM),
-   L6PROP("PODX3", "POD X3",   PCM),
-   L6PROP("PODX3Live", "POD X3 Live",  PCM),
L6PROP("PODxt", "PODxt",CTRL_PCM_HW),
L6PROP("PODxtLive", "PODxt Live",   CTRL_PCM_HW),
L6PROP("PODxtPro",  "PODxt Pro",CTRL_PCM_HW),
@@ -673,8 +669,6 @@ static int line6_probe(struct usb_interface *interface,
break;
 
case LINE6_DEVID_PODHD500:
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
switch (interface_number) {
case 0:
alternate = 1;
@@ -765,14 +759,6 @@ static int line6_probe(struct usb_interface *interface,
ep_write = 0x02;
break;
 
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
-   /* currently unused! */
-   size = sizeof(struct usb_line6_pod);
-   ep_read = 0x81;
-   ep_write = 0x01;
-   break;
-
case LINE6_DEVID_PODSTUDIO_GX:
case LINE6_DEVID_PODSTUDIO_UX1:
case LINE6_DEVID_PODSTUDIO_UX2:
@@ -898,8 +884,6 @@ static int line6_probe(struct usb_interface *interface,
case LINE6_DEVID_BASSPODXTLIVE:
case LINE6_DEVID_BASSPODXTPRO:
case LINE6_DEVID_POCKETPOD:
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
case LINE6_DEVID_PODXT:
case LINE6_DEVID_PODXTPRO:
ret = line6_pod_init(interface, (struct usb_line6_pod *)line6);
@@ -971,14 +955,6 @@ static int line6_probe(struct usb_interface *interface,
dev_info(&interface->dev, "Line6 %s now attached\n",
 line6->properties->name);
 
-   switch (product) {
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
-   dev_info(&interface->dev,
-"NOTE: the Line6 %s is detected, but not yet 
supported\n",
-line6->properties->name);
-   }
-
/* increment reference counters: */
usb_get_intf(interface);
usb_get_dev(usbdev);
@@ -1026,8 +1002,6 @@ static void line6_disconnect(struct usb_interface 
*interface)
case LINE6_DEVID_BASSPODXTLIVE:
case LINE6_DEVID_BASSPODXTPRO:
case LINE6_DEVID_POCKETPOD:
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
case LINE6_DEVID_PODXT:
case LINE6_DEVID_PODXTPRO:
line6_pod_disconnect(interface);
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index a3136b1..076c87b 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -442,8 +442,6 @@ int line6_init_pcm(struct usb_line6 *line6,
break;
 
case LINE6_DEVID_PODHD500:
-   case LINE6_DEVID_PODX3:
-   case LINE6_DEVID_PODX3LIVE:
ep_read = 0x86;
ep_write = 0x02;
break;
diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbdefs.h
index 2bc2fe7..06bf909 100644
--- a/drivers/staging/line6/usbdefs.h
+++ b/drivers/staging/line6/usbdefs.h
@@ -30,8 +30,6 @@
 #define LINE6_DEVID_PODSTUDIO_GX  0x4153
 #define LINE6_DEVID_PODSTUDIO_UX1 0x4150
 #define LINE6_DEVID_PODSTUDIO_UX2 0x4151
-#define LINE6_DEVID_PODX3 0x414a
-#define LINE6_DEVID_PODX3LIVE 0x414b
 #define LINE6_DEVID_PODXT 0x5044
 #define LINE6_DEVID_PODXTLIVE 0x4650
 #define LINE6_DEVID_PODXTPRO  0x5050
-- 
2.1.0

___
devel mailing list

[PATCH 09/25] staging: line6: Remove useless comments

2015-01-09 Thread Chris Rorvick
Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 6dc8a0d..acde205 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -61,7 +61,6 @@ MODULE_DEVICE_TABLE(usb, line6_id_table);
{.id = dev_id,\
 .name = dev_name, .capabilities = LINE6_BIT_##dev_cap}
 
-/* *INDENT-OFF* */
 static const struct line6_properties line6_properties_table[] = {
L6PROP("BassPODxt", "BassPODxt",CTRL_PCM_HW),
L6PROP("BassPODxtLive", "BassPODxt Live",   CTRL_PCM_HW),
@@ -82,7 +81,6 @@ static const struct line6_properties line6_properties_table[] 
= {
L6PROP("TonePortUX2",   "TonePort UX2", PCM),
L6PROP("Variax","Variax Workbench", CONTROL),
 };
-/* *INDENT-ON* */
 
 /*
This is Line6's MIDI manufacturer ID.
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/25] line6usb cleanup

2015-01-09 Thread Chris Rorvick
The line6usb driver references the device's idProduct and, in some
cases, the interface number in a number of places to determine device-
specific configuration values and to call device-specific functionality.
Rework code to leverage the device table matching more effectively.
Consolidate configuration settings into the properties entries and use
function pointers setup at initialization to remove much of the
conditional logic.

I have a TonePort UX2 that I've used for testing, meaning that some of
this is really only compile-tested.

Regards,

Chris

Chris Rorvick (25):
  staging: line6: Remove `device_bit' from properties
  staging: line6: Remove line6_pod_transmit_paramter()
  staging: line6: Remove unsupported X3 devices
  staging: line6: Cleanup device table
  staging: line6: Define a device type enum
  staging: line6: Index properties array with device type
  staging: line6: Key off of device type
  staging: line6: Remove idVendor and idProduct macros
  staging: line6: Remove useless comments
  staging: line6: Rename capability macros
  staging: line6: Use explicit indexes when defining properties
  staging: line6: List out capabilities individually
  staging: line6: Split out PODxt Live interfaces
  staging: line6: Split out POD HD500 interfaces
  staging: line6: Filter on Pocket POD interface
  staging: line6: Filter on UX2 interfaces
  staging: line6: Move altsetting to properties
  staging: line6: Move control endpoints to properties
  staging: line6: Remove stale Pocket POD PCM endpoints
  staging: line6: Move audio endpoints to properties
  staging: line6: Pass *_init() `usb_line6' pointers
  staging: line6: Pass *_process_message() `usb_line6' pointers
  staging: line6: Call *_process_message() via pointer
  staging: line6: Call *_disconnect() via pointer
  staging: line6: Make *_disconnect() functions static

 drivers/staging/line6/capture.c  |   9 +-
 drivers/staging/line6/driver.c   | 698 ++-
 drivers/staging/line6/driver.h   |  57 ++--
 drivers/staging/line6/midi.c |   4 +-
 drivers/staging/line6/pcm.c  |  55 +--
 drivers/staging/line6/pcm.h  |  12 +-
 drivers/staging/line6/playback.c |  11 +-
 drivers/staging/line6/pod.c  |  83 +++--
 drivers/staging/line6/pod.h  |  12 +-
 drivers/staging/line6/podhd.c|  48 +--
 drivers/staging/line6/podhd.h|   3 +-
 drivers/staging/line6/toneport.c | 113 ---
 drivers/staging/line6/toneport.h |   3 +-
 drivers/staging/line6/usbdefs.h  |  95 +-
 drivers/staging/line6/variax.c   |  36 +-
 drivers/staging/line6/variax.h   |   4 +-
 16 files changed, 528 insertions(+), 715 deletions(-)

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/25] staging: line6: Key off of device type

2015-01-09 Thread Chris Rorvick
The driver currently uses the device's idProduct as input to several
switch statements.  In some cases this is not sufficiently granular and
the interface number must be taken into account.

Store the device type in `usb_line6' and key off of it instead.  New
types can then be added that map to specific interfaces on the device so
that this conditional logic can be flattened out.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c   | 203 ---
 drivers/staging/line6/driver.h   |   4 +-
 drivers/staging/line6/pcm.c  |  38 
 drivers/staging/line6/toneport.c |  42 
 4 files changed, 144 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index c090b2b..81d5a27 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -363,23 +363,23 @@ static void line6_data_received(struct urb *urb)
line6->message_length = done;
line6_midi_receive(line6, line6->buffer_message, done);
 
-   switch (le16_to_cpu(line6->usbdev->descriptor.idProduct)) {
-   case LINE6_DEVID_BASSPODXT:
-   case LINE6_DEVID_BASSPODXTLIVE:
-   case LINE6_DEVID_BASSPODXTPRO:
-   case LINE6_DEVID_PODXT:
-   case LINE6_DEVID_PODXTPRO:
-   case LINE6_DEVID_POCKETPOD:
+   switch (line6->type) {
+   case LINE6_BASSPODXT:
+   case LINE6_BASSPODXTLIVE:
+   case LINE6_BASSPODXTPRO:
+   case LINE6_PODXT:
+   case LINE6_PODXTPRO:
+   case LINE6_POCKETPOD:
line6_pod_process_message((struct usb_line6_pod *)
  line6);
break;
 
-   case LINE6_DEVID_PODHD300:
-   case LINE6_DEVID_PODHD400:
-   case LINE6_DEVID_PODHD500:
+   case LINE6_PODHD300:
+   case LINE6_PODHD400:
+   case LINE6_PODHD500:
break; /* let userspace handle MIDI */
 
-   case LINE6_DEVID_PODXTLIVE:
+   case LINE6_PODXTLIVE:
switch (line6->interface_number) {
case PODXTLIVE_INTERFACE_POD:
line6_pod_process_message((struct usb_line6_pod
@@ -399,7 +399,7 @@ static void line6_data_received(struct urb *urb)
}
break;
 
-   case LINE6_DEVID_VARIAX:
+   case LINE6_VARIAX:
line6_variax_process_message((struct usb_line6_variax *)
 line6);
break;
@@ -629,7 +629,6 @@ static int line6_probe(struct usb_interface *interface,
struct usb_line6 *line6;
const struct line6_properties *properties;
int interface_number, alternate = 0;
-   int product;
int size = 0;
int ep_read = 0, ep_write = 0;
int ret;
@@ -651,19 +650,18 @@ static int line6_probe(struct usb_interface *interface,
/* initialize device info: */
properties = &line6_properties_table[devtype];
dev_info(&interface->dev, "Line6 %s found\n", properties->name);
-   product = le16_to_cpu(usbdev->descriptor.idProduct);
 
/* query interface number */
interface_number = interface->cur_altsetting->desc.bInterfaceNumber;
 
-   switch (product) {
-   case LINE6_DEVID_BASSPODXTLIVE:
-   case LINE6_DEVID_PODXTLIVE:
-   case LINE6_DEVID_VARIAX:
+   switch (devtype) {
+   case LINE6_BASSPODXTLIVE:
+   case LINE6_PODXTLIVE:
+   case LINE6_VARIAX:
alternate = 1;
break;
 
-   case LINE6_DEVID_POCKETPOD:
+   case LINE6_POCKETPOD:
switch (interface_number) {
case 0:
return -ENODEV; /* this interface has no endpoints */
@@ -675,7 +673,7 @@ static int line6_probe(struct usb_interface *interface,
}
break;
 
-   case LINE6_DEVID_PODHD500:
+   case LINE6_PODHD500:
switch (interface_number) {
case 0:
alternate = 1;
@@ -688,25 +686,25 @@ static int line6_probe(struct usb_interface *interface,
}
break;
 
-   case LINE6_DEVID_BASSPODXT:
-   case LINE6_DEVID_BASSPODXTPRO:
-   case LINE6_DEVID_PODXT:
-   case LINE6_DEVID_PODXTPRO:
-   case LINE6_DEVID_PODHD300:
-   case LINE6_DEVID_PODHD400:
+   case LINE6_BASSPODXT:
+   case LINE6_BASSPODXTPRO:
+   case LINE6_PODXT:
+   case LINE6_PODXTPRO:
+   case LINE6_PODHD300:
+   case LINE6_PODHD400:
alternate = 5;
break;
 
-   case LINE6_DEVID_GUITARPORT:
-   case LINE6_DEVID_PODSTUDIO_GX:
-   case LINE6_

[PATCH 04/25] staging: line6: Cleanup device table

2015-01-09 Thread Chris Rorvick
Wrap USB_DEVICE to avoid repeating the Line 6 vendor ID.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 40 +---
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index e40400b..a263bce 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -30,27 +30,29 @@
 #define DRIVER_DESC"Line6 USB Driver"
 #define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
 
+#define LINE6_DEVICE(prod) USB_DEVICE(LINE6_VENDOR_ID, prod)
+
 /* table of devices that work with this driver */
 static const struct usb_device_id line6_id_table[] = {
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_BASSPODXT)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_BASSPODXTLIVE)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_BASSPODXTPRO)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_GUITARPORT)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_POCKETPOD)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD300)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD400)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODHD500)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_GX)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX1)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODSTUDIO_UX2)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXT)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXTLIVE)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_PODXTPRO)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_GX)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX1)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_TONEPORT_UX2)},
-   {USB_DEVICE(LINE6_VENDOR_ID, LINE6_DEVID_VARIAX)},
-   {},
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXT) },
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTLIVE) },
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTPRO) },
+   { LINE6_DEVICE(LINE6_DEVID_GUITARPORT) },
+   { LINE6_DEVICE(LINE6_DEVID_POCKETPOD) },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD300) },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD400) },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD500) },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_GX) },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX1) },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX2) },
+   { LINE6_DEVICE(LINE6_DEVID_PODXT) },
+   { LINE6_DEVICE(LINE6_DEVID_PODXTLIVE) },
+   { LINE6_DEVICE(LINE6_DEVID_PODXTPRO) },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_GX) },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX1) },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX2) },
+   { LINE6_DEVICE(LINE6_DEVID_VARIAX) },
+   {}
 };
 
 MODULE_DEVICE_TABLE(usb, line6_id_table);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/25] staging: line6: List out capabilities individually

2015-01-09 Thread Chris Rorvick
The `LINE6_CAP_CTRL_PCM_HW' macro combines three capabilities to save
horizontal space when defining the properties entries.  Now that these
are no longer limited to single lines this is not such a concern.
Specify capabilities individually when defining each property for
better clarity.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c  | 54 +++--
 drivers/staging/line6/usbdefs.h |  4 ---
 2 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index c988b78..6fecc1b 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -61,92 +61,110 @@ static const struct line6_properties 
line6_properties_table[] = {
[LINE6_BASSPODXT] = {
.id = "BassPODxt",
.name = "BassPODxt",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_BASSPODXTLIVE] = {
.id = "BassPODxtLive",
.name = "BassPODxt Live",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_BASSPODXTPRO] = {
.id = "BassPODxtPro",
.name = "BassPODxt Pro",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_GUITARPORT] = {
.id = "GuitarPort",
.name = "GuitarPort",
-   .capabilities = LINE6_CAP_PCM,
+   .capabilities   = LINE6_CAP_PCM,
},
[LINE6_POCKETPOD] = {
.id = "PocketPOD",
.name = "Pocket POD",
-   .capabilities = LINE6_CAP_CONTROL,
+   .capabilities   = LINE6_CAP_CONTROL,
},
[LINE6_PODHD300] = {
.id = "PODHD300",
.name = "POD HD300",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_PODHD400] = {
.id = "PODHD400",
.name = "POD HD400",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_PODHD500] = {
.id = "PODHD500",
.name = "POD HD500",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_PODSTUDIO_GX] = {
.id = "PODStudioGX",
.name = "POD Studio GX",
-   .capabilities = LINE6_CAP_PCM,
+   .capabilities   = LINE6_CAP_PCM,
},
[LINE6_PODSTUDIO_UX1] = {
.id = "PODStudioUX1",
.name = "POD Studio UX1",
-   .capabilities = LINE6_CAP_PCM,
+   .capabilities   = LINE6_CAP_PCM,
},
[LINE6_PODSTUDIO_UX2] = {
.id = "PODStudioUX2",
.name = "POD Studio UX2",
-   .capabilities = LINE6_CAP_PCM,
+   .capabilities   = LINE6_CAP_PCM,
},
[LINE6_PODXT] = {
.id = "PODxt",
.name = "PODxt",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_PODXTLIVE] = {
.id = "PODxtLive",
.name = "PODxt Live",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_PODXTPRO] = {
.id = "PODxtPro",
.name = "PODxt Pro",
-   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
},
[LINE6_TONEPORT_GX] = {
.id = "TonePortGX",
.name = "TonePort GX",
-   .capabilities = LINE6_CAP_PCM,
+   .capabilities   = LINE6_CAP_PCM,
},
[LINE6_TONEPORT_UX1] = {
.id

[PATCH 10/25] staging: line6: Rename capability macros

2015-01-09 Thread Chris Rorvick
Including "BIT" in the macro name is pointless.  Replace with "CAP" to
provide some context for what its value represents.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c   |  8 
 drivers/staging/line6/midi.c |  2 +-
 drivers/staging/line6/pcm.c  |  2 +-
 drivers/staging/line6/playback.c |  2 +-
 drivers/staging/line6/pod.c  |  2 +-
 drivers/staging/line6/usbdefs.h  | 12 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index acde205..4ec87a3 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -59,7 +59,7 @@ MODULE_DEVICE_TABLE(usb, line6_id_table);
 
 #define L6PROP(dev_id, dev_name, dev_cap)\
{.id = dev_id,\
-.name = dev_name, .capabilities = LINE6_BIT_##dev_cap}
+.name = dev_name, .capabilities = LINE6_CAP_##dev_cap}
 
 static const struct line6_properties line6_properties_table[] = {
L6PROP("BassPODxt", "BassPODxt",CTRL_PCM_HW),
@@ -830,7 +830,7 @@ static int line6_probe(struct usb_interface *interface,
 
usb_set_intfdata(interface, line6);
 
-   if (properties->capabilities & LINE6_BIT_CONTROL) {
+   if (properties->capabilities & LINE6_CAP_CONTROL) {
/* initialize USB buffers: */
line6->buffer_listen =
kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL);
@@ -1052,7 +1052,7 @@ static int line6_suspend(struct usb_interface *interface, 
pm_message_t message)
 
snd_power_change_state(line6->card, SNDRV_CTL_POWER_D3hot);
 
-   if (line6->properties->capabilities & LINE6_BIT_CONTROL)
+   if (line6->properties->capabilities & LINE6_CAP_CONTROL)
line6_stop_listen(line6);
 
if (line6pcm != NULL) {
@@ -1071,7 +1071,7 @@ static int line6_resume(struct usb_interface *interface)
 {
struct usb_line6 *line6 = usb_get_intfdata(interface);
 
-   if (line6->properties->capabilities & LINE6_BIT_CONTROL)
+   if (line6->properties->capabilities & LINE6_CAP_CONTROL)
line6_start_listen(line6);
 
snd_power_change_state(line6->card, SNDRV_CTL_POWER_D0);
diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c
index 1ac343b..c453485 100644
--- a/drivers/staging/line6/midi.c
+++ b/drivers/staging/line6/midi.c
@@ -279,7 +279,7 @@ int line6_init_midi(struct usb_line6 *line6)
int err;
struct snd_line6_midi *line6midi;
 
-   if (!(line6->properties->capabilities & LINE6_BIT_CONTROL)) {
+   if (!(line6->properties->capabilities & LINE6_CAP_CONTROL)) {
/* skip MIDI initialization and report success */
return 0;
}
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index 86c7bcb..e09772f 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -424,7 +424,7 @@ int line6_init_pcm(struct usb_line6 *line6,
int ep_read = 0, ep_write = 0;
struct snd_line6_pcm *line6pcm;
 
-   if (!(line6->properties->capabilities & LINE6_BIT_PCM))
+   if (!(line6->properties->capabilities & LINE6_CAP_PCM))
return 0;   /* skip PCM initialization and report success */
 
/* initialize PCM subsystem based on device: */
diff --git a/drivers/staging/line6/playback.c b/drivers/staging/line6/playback.c
index 2ca8900..54b7f60 100644
--- a/drivers/staging/line6/playback.c
+++ b/drivers/staging/line6/playback.c
@@ -261,7 +261,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm 
*line6pcm)
 #endif
if (!
(line6pcm->line6->
-properties->capabilities & LINE6_BIT_HWMON)
+properties->capabilities & LINE6_CAP_HWMON)
&& (line6pcm->flags & LINE6_BITS_PLAYBACK_STREAM)
&& (line6pcm->flags & LINE6_BITS_CAPTURE_STREAM))
add_monitor_signal(urb_out, line6pcm->prev_fbuf,
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 7b4ec92f..0fb1788 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -396,7 +396,7 @@ static int pod_try_init(struct usb_interface *interface,
   handler.
 */
 
-   if (pod->line6.properties->capabilities & LINE6_BIT_CONTROL) {
+   if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL) {
pod->monitor_level = POD_SYSTEM_INVALID;
 
/* initiate startup procedure: */
diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbdefs.h
index c897dba..d6e46ee 100644
--- a/drivers/staging/line6/usbdefs.h
+++ b/drivers/staging/line6/usbdefs.h
@@ -15,15 +15,15 @@
 #define USB_INTERVALS_PER_SECOND 1000
 
 /* device supports settings parameter via USB */
-#define LINE6_BIT_CONTROL (1 << 0)
+#define LINE6_CAP_CONTROL (1 << 0)
 /* device supports PC

[PATCH 06/25] staging: line6: Index properties array with device type

2015-01-09 Thread Chris Rorvick
The current logic uses the index of the matched entry from the device
table as an offset to the corresponding properties entry.  The values
of the new `line6_device_type' enum are ordered such that they can be
used as an index into either of these arrays.  Drop the device entry
lookup logic and use the device type (via the .driver_info member)
instead.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 17 ++---
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 2797e41..c090b2b 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -624,7 +624,7 @@ static void line6_destruct(struct usb_interface *interface)
 static int line6_probe(struct usb_interface *interface,
   const struct usb_device_id *id)
 {
-   int devtype;
+   enum line6_device_type devtype;
struct usb_device *usbdev;
struct usb_line6 *line6;
const struct line6_properties *properties;
@@ -646,20 +646,7 @@ static int line6_probe(struct usb_interface *interface,
goto err_put;
}
 
-   /* check vendor and product id */
-   for (devtype = ARRAY_SIZE(line6_id_table) - 1; devtype--;) {
-   u16 idVendor = le16_to_cpu(usbdev->descriptor.idVendor);
-   u16 idProduct = le16_to_cpu(usbdev->descriptor.idProduct);
-
-   if (idVendor == line6_id_table[devtype].idVendor &&
-   idProduct == line6_id_table[devtype].idProduct)
-   break;
-   }
-
-   if (devtype < 0) {
-   ret = -ENODEV;
-   goto err_put;
-   }
+   devtype = id->driver_info;
 
/* initialize device info: */
properties = &line6_properties_table[devtype];
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/25] staging: line6: Remove idVendor and idProduct macros

2015-01-09 Thread Chris Rorvick
These are now only used to build the device table.  Each entry in this
table is already clearly documented as to what device it maps to so the
macros become unnecessary indirection.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c  | 56 ++---
 drivers/staging/line6/usbdefs.h | 24 --
 2 files changed, 19 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 81d5a27..6dc8a0d 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -30,46 +30,28 @@
 #define DRIVER_DESC"Line6 USB Driver"
 #define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
 
-#define LINE6_DEVICE(prod) USB_DEVICE(LINE6_VENDOR_ID, prod)
+#define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
 
 /* table of devices that work with this driver */
 static const struct usb_device_id line6_id_table[] = {
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXT),
-   .driver_info = LINE6_BASSPODXT },
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTLIVE),
-   .driver_info = LINE6_BASSPODXTLIVE },
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTPRO),
-   .driver_info = LINE6_BASSPODXTPRO },
-   { LINE6_DEVICE(LINE6_DEVID_GUITARPORT),
-   .driver_info = LINE6_GUITARPORT },
-   { LINE6_DEVICE(LINE6_DEVID_POCKETPOD),
-   .driver_info = LINE6_POCKETPOD },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD300),
-   .driver_info = LINE6_PODHD300 },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD400),
-   .driver_info = LINE6_PODHD400 },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD500),
-   .driver_info = LINE6_PODHD500 },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_GX),
-   .driver_info = LINE6_PODSTUDIO_GX },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX1),
-   .driver_info = LINE6_PODSTUDIO_UX1 },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX2),
-   .driver_info = LINE6_PODSTUDIO_UX2 },
-   { LINE6_DEVICE(LINE6_DEVID_PODXT),
-   .driver_info = LINE6_PODXT },
-   { LINE6_DEVICE(LINE6_DEVID_PODXTLIVE),
-   .driver_info = LINE6_PODXTLIVE },
-   { LINE6_DEVICE(LINE6_DEVID_PODXTPRO),
-   .driver_info = LINE6_PODXTPRO },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_GX),
-   .driver_info = LINE6_TONEPORT_GX },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX1),
-   .driver_info = LINE6_TONEPORT_UX1 },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX2),
-   .driver_info = LINE6_TONEPORT_UX2 },
-   { LINE6_DEVICE(LINE6_DEVID_VARIAX),
-   .driver_info = LINE6_VARIAX },
+   { LINE6_DEVICE(0x4250),.driver_info = LINE6_BASSPODXT },
+   { LINE6_DEVICE(0x4642),.driver_info = LINE6_BASSPODXTLIVE },
+   { LINE6_DEVICE(0x4252),.driver_info = LINE6_BASSPODXTPRO },
+   { LINE6_DEVICE(0x4750),.driver_info = LINE6_GUITARPORT },
+   { LINE6_DEVICE(0x5051),.driver_info = LINE6_POCKETPOD },
+   { LINE6_DEVICE(0x5057),.driver_info = LINE6_PODHD300 },
+   { LINE6_DEVICE(0x5058),.driver_info = LINE6_PODHD400 },
+   { LINE6_DEVICE(0x414D),.driver_info = LINE6_PODHD500 },
+   { LINE6_DEVICE(0x4153),.driver_info = LINE6_PODSTUDIO_GX },
+   { LINE6_DEVICE(0x4150),.driver_info = LINE6_PODSTUDIO_UX1 },
+   { LINE6_DEVICE(0x4151),.driver_info = LINE6_PODSTUDIO_UX2 },
+   { LINE6_DEVICE(0x5044),.driver_info = LINE6_PODXT },
+   { LINE6_DEVICE(0x4650),.driver_info = LINE6_PODXTLIVE },
+   { LINE6_DEVICE(0x5050),.driver_info = LINE6_PODXTPRO },
+   { LINE6_DEVICE(0x4147),.driver_info = LINE6_TONEPORT_GX },
+   { LINE6_DEVICE(0x4141),.driver_info = LINE6_TONEPORT_UX1 },
+   { LINE6_DEVICE(0x4142),.driver_info = LINE6_TONEPORT_UX2 },
+   { LINE6_DEVICE(0x534d),.driver_info = LINE6_VARIAX },
{}
 };
 
diff --git a/drivers/staging/line6/usbdefs.h b/drivers/staging/line6/usbdefs.h
index 06bf909..c897dba 100644
--- a/drivers/staging/line6/usbdefs.h
+++ b/drivers/staging/line6/usbdefs.h
@@ -12,32 +12,8 @@
 #ifndef USBDEFS_H
 #define USBDEFS_H
 
-#define LINE6_VENDOR_ID  0x0e41
-
 #define USB_INTERVALS_PER_SECOND 1000
 
-/*
-   Device ids.
-*/
-#define LINE6_DEVID_BASSPODXT 0x4250
-#define LINE6_DEVID_BASSPODXTLIVE 0x4642
-#define LINE6_DEVID_BASSPODXTPRO  0x4252
-#define LINE6_DEVID_GUITARPORT0x4750
-#define LINE6_DEVID_POCKETPOD 0x5051
-#define LINE6_DEVID_PODHD300  0x5057
-#define LINE6_DEVID_PODHD400  0x5058
-#define LINE6_DEVID_PODHD500  0x414D
-#define LINE6_DEVID_PODSTUDIO_GX  0x4153
-#define LINE6_DEVID_PODSTUDIO_UX1 0x4150
-#define LINE6_DEVID_PODSTUDIO_UX2 0x4151
-#define LINE6_DEVID_PODXT 0x5044
-#define LINE6_DEVID_PODXTLIVE 0x4650
-#define LINE6_DEVID_PODXTPRO  0x5050
-#define LINE6_DEVID_TONEPORT_GX   0x4147
-#define LINE6_DEVID_TONEPORT_UX1  0x41

[PATCH 05/25] staging: line6: Define a device type enum

2015-01-09 Thread Chris Rorvick
Define an enum containing the supported devices and associate each entry
in the device table to the respective value.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 54 --
 drivers/staging/line6/driver.h | 21 
 2 files changed, 57 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index a263bce..2797e41 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -34,24 +34,42 @@
 
 /* table of devices that work with this driver */
 static const struct usb_device_id line6_id_table[] = {
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXT) },
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTLIVE) },
-   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTPRO) },
-   { LINE6_DEVICE(LINE6_DEVID_GUITARPORT) },
-   { LINE6_DEVICE(LINE6_DEVID_POCKETPOD) },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD300) },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD400) },
-   { LINE6_DEVICE(LINE6_DEVID_PODHD500) },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_GX) },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX1) },
-   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX2) },
-   { LINE6_DEVICE(LINE6_DEVID_PODXT) },
-   { LINE6_DEVICE(LINE6_DEVID_PODXTLIVE) },
-   { LINE6_DEVICE(LINE6_DEVID_PODXTPRO) },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_GX) },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX1) },
-   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX2) },
-   { LINE6_DEVICE(LINE6_DEVID_VARIAX) },
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXT),
+   .driver_info = LINE6_BASSPODXT },
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTLIVE),
+   .driver_info = LINE6_BASSPODXTLIVE },
+   { LINE6_DEVICE(LINE6_DEVID_BASSPODXTPRO),
+   .driver_info = LINE6_BASSPODXTPRO },
+   { LINE6_DEVICE(LINE6_DEVID_GUITARPORT),
+   .driver_info = LINE6_GUITARPORT },
+   { LINE6_DEVICE(LINE6_DEVID_POCKETPOD),
+   .driver_info = LINE6_POCKETPOD },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD300),
+   .driver_info = LINE6_PODHD300 },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD400),
+   .driver_info = LINE6_PODHD400 },
+   { LINE6_DEVICE(LINE6_DEVID_PODHD500),
+   .driver_info = LINE6_PODHD500 },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_GX),
+   .driver_info = LINE6_PODSTUDIO_GX },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX1),
+   .driver_info = LINE6_PODSTUDIO_UX1 },
+   { LINE6_DEVICE(LINE6_DEVID_PODSTUDIO_UX2),
+   .driver_info = LINE6_PODSTUDIO_UX2 },
+   { LINE6_DEVICE(LINE6_DEVID_PODXT),
+   .driver_info = LINE6_PODXT },
+   { LINE6_DEVICE(LINE6_DEVID_PODXTLIVE),
+   .driver_info = LINE6_PODXTLIVE },
+   { LINE6_DEVICE(LINE6_DEVID_PODXTPRO),
+   .driver_info = LINE6_PODXTPRO },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_GX),
+   .driver_info = LINE6_TONEPORT_GX },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX1),
+   .driver_info = LINE6_TONEPORT_UX1 },
+   { LINE6_DEVICE(LINE6_DEVID_TONEPORT_UX2),
+   .driver_info = LINE6_TONEPORT_UX2 },
+   { LINE6_DEVICE(LINE6_DEVID_VARIAX),
+   .driver_info = LINE6_VARIAX },
{}
 };
 
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 1cc7532..8fb4a9c 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -20,6 +20,27 @@
 
 #define DRIVER_NAME "line6usb"
 
+enum line6_device_type {
+   LINE6_BASSPODXT,
+   LINE6_BASSPODXTLIVE,
+   LINE6_BASSPODXTPRO,
+   LINE6_GUITARPORT,
+   LINE6_POCKETPOD,
+   LINE6_PODHD300,
+   LINE6_PODHD400,
+   LINE6_PODHD500,
+   LINE6_PODSTUDIO_GX,
+   LINE6_PODSTUDIO_UX1,
+   LINE6_PODSTUDIO_UX2,
+   LINE6_PODXT,
+   LINE6_PODXTLIVE,
+   LINE6_PODXTPRO,
+   LINE6_TONEPORT_GX,
+   LINE6_TONEPORT_UX1,
+   LINE6_TONEPORT_UX2,
+   LINE6_VARIAX
+};
+
 #define LINE6_TIMEOUT 1
 #define LINE6_BUFSIZE_LISTEN 32
 #define LINE6_MESSAGE_MAXLEN 256
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/25] staging: line6: Split out PODxt Live interfaces

2015-01-09 Thread Chris Rorvick
The PODxt Live device has both a POD and a Variax interface.  Add device
type entries for each of these.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 112 -
 drivers/staging/line6/driver.h |   8 +--
 drivers/staging/line6/pcm.c|   3 +-
 drivers/staging/line6/pod.h|   6 ---
 4 files changed, 48 insertions(+), 81 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 6fecc1b..cb96029 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -31,6 +31,7 @@
 #define DRIVER_VERSION "0.9.1beta" DRIVER_REVISION
 
 #define LINE6_DEVICE(prod) USB_DEVICE(0x0e41, prod)
+#define LINE6_IF_NUM(prod, n) USB_DEVICE_INTERFACE_NUMBER(0x0e41, prod, n)
 
 /* table of devices that work with this driver */
 static const struct usb_device_id line6_id_table[] = {
@@ -46,7 +47,8 @@ static const struct usb_device_id line6_id_table[] = {
{ LINE6_DEVICE(0x4150),.driver_info = LINE6_PODSTUDIO_UX1 },
{ LINE6_DEVICE(0x4151),.driver_info = LINE6_PODSTUDIO_UX2 },
{ LINE6_DEVICE(0x5044),.driver_info = LINE6_PODXT },
-   { LINE6_DEVICE(0x4650),.driver_info = LINE6_PODXTLIVE },
+   { LINE6_IF_NUM(0x4650, 0), .driver_info = LINE6_PODXTLIVE_POD },
+   { LINE6_IF_NUM(0x4650, 1), .driver_info = LINE6_PODXTLIVE_VARIAX },
{ LINE6_DEVICE(0x5050),.driver_info = LINE6_PODXTPRO },
{ LINE6_DEVICE(0x4147),.driver_info = LINE6_TONEPORT_GX },
{ LINE6_DEVICE(0x4141),.driver_info = LINE6_TONEPORT_UX1 },
@@ -132,7 +134,14 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
},
-   [LINE6_PODXTLIVE] = {
+   [LINE6_PODXTLIVE_POD] = {
+   .id = "PODxtLive",
+   .name = "PODxt Live",
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
+   },
+   [LINE6_PODXTLIVE_VARIAX] = {
.id = "PODxtLive",
.name = "PODxt Live",
.capabilities   = LINE6_CAP_CONTROL
@@ -445,24 +454,15 @@ static void line6_data_received(struct urb *urb)
case LINE6_PODHD500:
break; /* let userspace handle MIDI */
 
-   case LINE6_PODXTLIVE:
-   switch (line6->interface_number) {
-   case PODXTLIVE_INTERFACE_POD:
-   line6_pod_process_message((struct usb_line6_pod
+   case LINE6_PODXTLIVE_POD:
+   line6_pod_process_message((struct usb_line6_pod
   *)line6);
-   break;
-
-   case PODXTLIVE_INTERFACE_VARIAX:
-   line6_variax_process_message((struct
- usb_line6_variax
- *)line6);
-   break;
-
-   default:
-   dev_err(line6->ifcdev,
-   "PODxt Live interface %d not 
supported\n",
-   line6->interface_number);
-   }
+   break;
+
+   case LINE6_PODXTLIVE_VARIAX:
+   line6_variax_process_message((struct
+ usb_line6_variax
+ *)line6);
break;
 
case LINE6_VARIAX:
@@ -722,7 +722,8 @@ static int line6_probe(struct usb_interface *interface,
 
switch (devtype) {
case LINE6_BASSPODXTLIVE:
-   case LINE6_PODXTLIVE:
+   case LINE6_PODXTLIVE_POD:
+   case LINE6_PODXTLIVE_VARIAX:
case LINE6_VARIAX:
alternate = 1;
break;
@@ -841,24 +842,16 @@ static int line6_probe(struct usb_interface *interface,
/* these don't have a control channel */
break;
 
-   case LINE6_PODXTLIVE:
-   switch (interface_number) {
-   case PODXTLIVE_INTERFACE_POD:
-   size = sizeof(struct usb_line6_pod);
-   ep_read = 0x84;
-   ep_write = 0x03;
-   break;
-
-   case PODXTLIVE_INTERFACE_VARIAX:
-   size = sizeof(struct usb_line6_variax);
-   ep_read = 0x86;
-   ep_write = 0x05;
-   break;
+   case LINE6_PODXTLIVE_POD:
+   size = sizeof(struct usb_line6_pod);
+   ep_read = 0x84;
+   ep_write = 0x03;
+   break;
 
-   

[PATCH 11/25] staging: line6: Use explicit indexes when defining properties

2015-01-09 Thread Chris Rorvick
Specify the index of the properties entry explicitly to define this
structure more robustly.  Also, drop the `L6PROP' macro in favor of
initializing each member explicitly on its own line since horizontal
space is limited and more attributes will be added later.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 112 +
 1 file changed, 90 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 4ec87a3..c988b78 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -57,29 +57,97 @@ static const struct usb_device_id line6_id_table[] = {
 
 MODULE_DEVICE_TABLE(usb, line6_id_table);
 
-#define L6PROP(dev_id, dev_name, dev_cap)\
-   {.id = dev_id,\
-.name = dev_name, .capabilities = LINE6_CAP_##dev_cap}
-
 static const struct line6_properties line6_properties_table[] = {
-   L6PROP("BassPODxt", "BassPODxt",CTRL_PCM_HW),
-   L6PROP("BassPODxtLive", "BassPODxt Live",   CTRL_PCM_HW),
-   L6PROP("BassPODxtPro",  "BassPODxt Pro",CTRL_PCM_HW),
-   L6PROP("GuitarPort","GuitarPort",   PCM),
-   L6PROP("PocketPOD", "Pocket POD",   CONTROL),
-   L6PROP("PODHD300",  "POD HD300",CTRL_PCM_HW),
-   L6PROP("PODHD400",  "POD HD400",CTRL_PCM_HW),
-   L6PROP("PODHD500",  "POD HD500",CTRL_PCM_HW),
-   L6PROP("PODStudioGX",   "POD Studio GX",PCM),
-   L6PROP("PODStudioUX1",  "POD Studio UX1",   PCM),
-   L6PROP("PODStudioUX2",  "POD Studio UX2",   PCM),
-   L6PROP("PODxt", "PODxt",CTRL_PCM_HW),
-   L6PROP("PODxtLive", "PODxt Live",   CTRL_PCM_HW),
-   L6PROP("PODxtPro",  "PODxt Pro",CTRL_PCM_HW),
-   L6PROP("TonePortGX","TonePort GX",  PCM),
-   L6PROP("TonePortUX1",   "TonePort UX1", PCM),
-   L6PROP("TonePortUX2",   "TonePort UX2", PCM),
-   L6PROP("Variax","Variax Workbench", CONTROL),
+   [LINE6_BASSPODXT] = {
+   .id = "BassPODxt",
+   .name = "BassPODxt",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_BASSPODXTLIVE] = {
+   .id = "BassPODxtLive",
+   .name = "BassPODxt Live",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_BASSPODXTPRO] = {
+   .id = "BassPODxtPro",
+   .name = "BassPODxt Pro",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_GUITARPORT] = {
+   .id = "GuitarPort",
+   .name = "GuitarPort",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_POCKETPOD] = {
+   .id = "PocketPOD",
+   .name = "Pocket POD",
+   .capabilities = LINE6_CAP_CONTROL,
+   },
+   [LINE6_PODHD300] = {
+   .id = "PODHD300",
+   .name = "POD HD300",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_PODHD400] = {
+   .id = "PODHD400",
+   .name = "POD HD400",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_PODHD500] = {
+   .id = "PODHD500",
+   .name = "POD HD500",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_PODSTUDIO_GX] = {
+   .id = "PODStudioGX",
+   .name = "POD Studio GX",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_PODSTUDIO_UX1] = {
+   .id = "PODStudioUX1",
+   .name = "POD Studio UX1",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_PODSTUDIO_UX2] = {
+   .id = "PODStudioUX2",
+   .name = "POD Studio UX2",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_PODXT] = {
+   .id = "PODxt",
+   .name = "PODxt",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_PODXTLIVE] = {
+   .id = "PODxtLive",
+   .name = "PODxt Live",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_PODXTPRO] = {
+   .id = "PODxtPro",
+   .name = "PODxt Pro",
+   .capabilities = LINE6_CAP_CTRL_PCM_HW,
+   },
+   [LINE6_TONEPORT_GX] = {
+   .id = "TonePortGX",
+   .name = "TonePort GX",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_TONEPORT_UX1] = {
+   .id = "TonePortUX1",
+   .name = "TonePort UX1",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_TONEPORT_UX2] = {
+   .id = "TonePortUX2",
+   .name = "TonePort UX2",
+   .capabilities = LINE6_CAP_PCM,
+   },
+   [LINE6_VARIAX] = {
+   .id = "Variax",
+   .name = 

[PATCH 15/25] staging: line6: Filter on Pocket POD interface

2015-01-09 Thread Chris Rorvick
The driver only supports interface 1 of the Pocket POD.  Use the device
table to filter on this.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index e97e2cb..8b03bc0 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -39,7 +39,7 @@ static const struct usb_device_id line6_id_table[] = {
{ LINE6_DEVICE(0x4642),.driver_info = LINE6_BASSPODXTLIVE },
{ LINE6_DEVICE(0x4252),.driver_info = LINE6_BASSPODXTPRO },
{ LINE6_DEVICE(0x4750),.driver_info = LINE6_GUITARPORT },
-   { LINE6_DEVICE(0x5051),.driver_info = LINE6_POCKETPOD },
+   { LINE6_IF_NUM(0x5051, 1), .driver_info = LINE6_POCKETPOD },
{ LINE6_DEVICE(0x5057),.driver_info = LINE6_PODHD300 },
{ LINE6_DEVICE(0x5058),.driver_info = LINE6_PODHD400 },
{ LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500_0 },
@@ -738,15 +738,7 @@ static int line6_probe(struct usb_interface *interface,
break;
 
case LINE6_POCKETPOD:
-   switch (interface_number) {
-   case 0:
-   return -ENODEV; /* this interface has no endpoints */
-   case 1:
-   alternate = 0;
-   break;
-   default:
-   MISSING_CASE;
-   }
+   alternate = 0;
break;
 
case LINE6_PODHD500_0:
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/25] staging: line6: Pass *_process_message() `usb_line6' pointers

2015-01-09 Thread Chris Rorvick
Casting the `struct usb_line6' pointer at the call point makes the code
difficult to read.  This is substantially cleaned up by moving the cast
into the callees.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 13 -
 drivers/staging/line6/pod.c|  3 ++-
 drivers/staging/line6/pod.h|  2 +-
 drivers/staging/line6/variax.c |  3 ++-
 drivers/staging/line6/variax.h |  2 +-
 5 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 08f8051..369e60e 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -544,8 +544,7 @@ static void line6_data_received(struct urb *urb)
case LINE6_PODXT:
case LINE6_PODXTPRO:
case LINE6_POCKETPOD:
-   line6_pod_process_message((struct usb_line6_pod *)
- line6);
+   line6_pod_process_message(line6);
break;
 
case LINE6_PODHD300:
@@ -555,19 +554,15 @@ static void line6_data_received(struct urb *urb)
break; /* let userspace handle MIDI */
 
case LINE6_PODXTLIVE_POD:
-   line6_pod_process_message((struct usb_line6_pod
-  *)line6);
+   line6_pod_process_message(line6);
break;
 
case LINE6_PODXTLIVE_VARIAX:
-   line6_variax_process_message((struct
- usb_line6_variax
- *)line6);
+   line6_variax_process_message(line6);
break;
 
case LINE6_VARIAX:
-   line6_variax_process_message((struct usb_line6_variax *)
-line6);
+   line6_variax_process_message(line6);
break;
 
default:
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 9292b72..aa8977d 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -131,8 +131,9 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod 
*pod, int code,
 /*
Process a completely received message.
 */
-void line6_pod_process_message(struct usb_line6_pod *pod)
+void line6_pod_process_message(struct usb_line6 *line6)
 {
+   struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
const unsigned char *buf = pod->line6.buffer_message;
 
if (memcmp(buf, pod_version_header, sizeof(pod_version_header)) == 0) {
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index cf6c75cd..984a00b 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -89,6 +89,6 @@ struct usb_line6_pod {
 extern void line6_pod_disconnect(struct usb_interface *interface);
 extern int line6_pod_init(struct usb_interface *interface,
  struct usb_line6 *line6);
-extern void line6_pod_process_message(struct usb_line6_pod *pod);
+extern void line6_pod_process_message(struct usb_line6 *line6);
 
 #endif
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c
index f5b618b..4d41994 100644
--- a/drivers/staging/line6/variax.c
+++ b/drivers/staging/line6/variax.c
@@ -130,8 +130,9 @@ static void variax_startup6(struct work_struct *work)
 /*
Process a completely received message.
 */
-void line6_variax_process_message(struct usb_line6_variax *variax)
+void line6_variax_process_message(struct usb_line6 *line6)
 {
+   struct usb_line6_variax *variax = (struct usb_line6_variax *) line6;
const unsigned char *buf = variax->line6.buffer_message;
 
switch (buf[0]) {
diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h
index 9bf1464..7d445ff 100644
--- a/drivers/staging/line6/variax.h
+++ b/drivers/staging/line6/variax.h
@@ -67,6 +67,6 @@ struct usb_line6_variax {
 extern void line6_variax_disconnect(struct usb_interface *interface);
 extern int line6_variax_init(struct usb_interface *interface,
 struct usb_line6 *line6);
-extern void line6_variax_process_message(struct usb_line6_variax *variax);
+extern void line6_variax_process_message(struct usb_line6 *line6);
 
 #endif
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/25] staging: line6: Split out POD HD500 interfaces

2015-01-09 Thread Chris Rorvick
The driver uses a different altsetting depending on the interface.  Add
device type entries for each of these.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 41 -
 drivers/staging/line6/driver.h |  3 ++-
 drivers/staging/line6/pcm.c|  3 ++-
 3 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index cb96029..e97e2cb 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -42,7 +42,8 @@ static const struct usb_device_id line6_id_table[] = {
{ LINE6_DEVICE(0x5051),.driver_info = LINE6_POCKETPOD },
{ LINE6_DEVICE(0x5057),.driver_info = LINE6_PODHD300 },
{ LINE6_DEVICE(0x5058),.driver_info = LINE6_PODHD400 },
-   { LINE6_DEVICE(0x414D),.driver_info = LINE6_PODHD500 },
+   { LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500_0 },
+   { LINE6_IF_NUM(0x414D, 1), .driver_info = LINE6_PODHD500_1 },
{ LINE6_DEVICE(0x4153),.driver_info = LINE6_PODSTUDIO_GX },
{ LINE6_DEVICE(0x4150),.driver_info = LINE6_PODSTUDIO_UX1 },
{ LINE6_DEVICE(0x4151),.driver_info = LINE6_PODSTUDIO_UX2 },
@@ -105,7 +106,14 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
},
-   [LINE6_PODHD500] = {
+   [LINE6_PODHD500_0] = {
+   .id = "PODHD500",
+   .name = "POD HD500",
+   .capabilities   = LINE6_CAP_CONTROL
+   | LINE6_CAP_PCM
+   | LINE6_CAP_HWMON,
+   },
+   [LINE6_PODHD500_1] = {
.id = "PODHD500",
.name = "POD HD500",
.capabilities   = LINE6_CAP_CONTROL
@@ -451,7 +459,8 @@ static void line6_data_received(struct urb *urb)
 
case LINE6_PODHD300:
case LINE6_PODHD400:
-   case LINE6_PODHD500:
+   case LINE6_PODHD500_0:
+   case LINE6_PODHD500_1:
break; /* let userspace handle MIDI */
 
case LINE6_PODXTLIVE_POD:
@@ -740,17 +749,12 @@ static int line6_probe(struct usb_interface *interface,
}
break;
 
-   case LINE6_PODHD500:
-   switch (interface_number) {
-   case 0:
-   alternate = 1;
-   break;
-   case 1:
-   alternate = 0;
-   break;
-   default:
-   MISSING_CASE;
-   }
+   case LINE6_PODHD500_0:
+   alternate = 1;
+   break;
+
+   case LINE6_PODHD500_1:
+   alternate = 0;
break;
 
case LINE6_BASSPODXT:
@@ -819,7 +823,8 @@ static int line6_probe(struct usb_interface *interface,
ep_write = 0x03;
break;
 
-   case LINE6_PODHD500:
+   case LINE6_PODHD500_0:
+   case LINE6_PODHD500_1:
size = sizeof(struct usb_line6_podhd);
ep_read = 0x81;
ep_write = 0x01;
@@ -954,7 +959,8 @@ static int line6_probe(struct usb_interface *interface,
 
case LINE6_PODHD300:
case LINE6_PODHD400:
-   case LINE6_PODHD500:
+   case LINE6_PODHD500_0:
+   case LINE6_PODHD500_1:
ret = line6_podhd_init(interface,
   (struct usb_line6_podhd *)line6);
break;
@@ -1061,7 +1067,8 @@ static void line6_disconnect(struct usb_interface 
*interface)
 
case LINE6_PODHD300:
case LINE6_PODHD400:
-   case LINE6_PODHD500:
+   case LINE6_PODHD500_0:
+   case LINE6_PODHD500_1:
line6_podhd_disconnect(interface);
break;
 
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 085aa44..9d6b351 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -28,7 +28,8 @@ enum line6_device_type {
LINE6_POCKETPOD,
LINE6_PODHD300,
LINE6_PODHD400,
-   LINE6_PODHD500,
+   LINE6_PODHD500_0,
+   LINE6_PODHD500_1,
LINE6_PODSTUDIO_GX,
LINE6_PODSTUDIO_UX1,
LINE6_PODSTUDIO_UX2,
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index d09d1ea..d8450af 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -442,7 +442,8 @@ int line6_init_pcm(struct usb_line6 *line6,
ep_write = 0x01;
break;
 
-   case LINE6_PODHD500:
+   case LINE6_PODHD500_0:
+   case LINE6_PODHD500_1:
ep_read = 0x86;
ep_write = 0x02;
break;
-- 
2.1.0

___
d

[PATCH 21/25] staging: line6: Pass *_init() `usb_line6' pointers

2015-01-09 Thread Chris Rorvick
Casting the `struct usb_line6' pointer at the call point makes the code
difficult to read.  This is substantially cleaned up by moving the cast
into the callees.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c   | 21 ++---
 drivers/staging/line6/pod.c  |  8 
 drivers/staging/line6/pod.h  |  2 +-
 drivers/staging/line6/podhd.c|  4 ++--
 drivers/staging/line6/podhd.h|  2 +-
 drivers/staging/line6/toneport.c |  8 
 drivers/staging/line6/toneport.h |  2 +-
 drivers/staging/line6/variax.c   |  8 
 drivers/staging/line6/variax.h   |  2 +-
 9 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 4bfef21..08f8051 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -959,33 +959,26 @@ static int line6_probe(struct usb_interface *interface,
case LINE6_POCKETPOD:
case LINE6_PODXT:
case LINE6_PODXTPRO:
-   ret = line6_pod_init(interface, (struct usb_line6_pod *)line6);
+   ret = line6_pod_init(interface, line6);
break;
 
case LINE6_PODHD300:
case LINE6_PODHD400:
case LINE6_PODHD500_0:
case LINE6_PODHD500_1:
-   ret = line6_podhd_init(interface,
-  (struct usb_line6_podhd *)line6);
+   ret = line6_podhd_init(interface, line6);
break;
 
case LINE6_PODXTLIVE_POD:
-   ret =
-   line6_pod_init(interface,
-  (struct usb_line6_pod *)line6);
+   ret = line6_pod_init(interface, line6);
break;
 
case LINE6_PODXTLIVE_VARIAX:
-   ret =
-   line6_variax_init(interface,
- (struct usb_line6_variax *)line6);
+   ret = line6_variax_init(interface, line6);
break;
 
case LINE6_VARIAX:
-   ret =
-   line6_variax_init(interface,
- (struct usb_line6_variax *)line6);
+   ret = line6_variax_init(interface, line6);
break;
 
case LINE6_PODSTUDIO_GX:
@@ -995,9 +988,7 @@ static int line6_probe(struct usb_interface *interface,
case LINE6_TONEPORT_UX1:
case LINE6_TONEPORT_UX2:
case LINE6_GUITARPORT:
-   ret =
-   line6_toneport_init(interface,
-   (struct usb_line6_toneport *)line6);
+   ret = line6_toneport_init(interface, line6);
break;
 
default:
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 0fb1788..9292b72 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -353,10 +353,10 @@ static int pod_create_files2(struct device *dev)
 Try to init POD device.
 */
 static int pod_try_init(struct usb_interface *interface,
-   struct usb_line6_pod *pod)
+   struct usb_line6 *line6)
 {
int err;
-   struct usb_line6 *line6 = &pod->line6;
+   struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
 
init_timer(&pod->startup_timer);
INIT_WORK(&pod->startup_work, pod_startup4);
@@ -409,9 +409,9 @@ static int pod_try_init(struct usb_interface *interface,
 /*
 Init POD device (and clean up in case of failure).
 */
-int line6_pod_init(struct usb_interface *interface, struct usb_line6_pod *pod)
+int line6_pod_init(struct usb_interface *interface, struct usb_line6 *line6)
 {
-   int err = pod_try_init(interface, pod);
+   int err = pod_try_init(interface, line6);
 
if (err < 0)
pod_destruct(interface);
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 91fd4c5..cf6c75cd 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -88,7 +88,7 @@ struct usb_line6_pod {
 
 extern void line6_pod_disconnect(struct usb_interface *interface);
 extern int line6_pod_init(struct usb_interface *interface,
- struct usb_line6_pod *pod);
+ struct usb_line6 *line6);
 extern void line6_pod_process_message(struct usb_line6_pod *pod);
 
 #endif
diff --git a/drivers/staging/line6/podhd.c b/drivers/staging/line6/podhd.c
index 7ef4543..3bb942e 100644
--- a/drivers/staging/line6/podhd.c
+++ b/drivers/staging/line6/podhd.c
@@ -121,9 +121,9 @@ static int podhd_try_init(struct usb_interface *interface,
 /*
Init POD HD device (and clean up in case of failure).
 */
-int line6_podhd_init(struct usb_interface *interface,
-struct usb_line6_podhd *podhd)
+int line6_podhd_init(struct usb_interface *interface, struct usb_line6 *line6)
 {
+   struct usb_line6_podhd *podhd = (struct usb_line6_podhd *) line6;
int err = podhd_

[PATCH 19/25] staging: line6: Remove stale Pocket POD PCM endpoints

2015-01-09 Thread Chris Rorvick
Commit 1027f476f507 (staging: line6: sync with upstream) removed PCM
from the Pocket POD capabilities but left the endpoint configuration.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/pcm.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index d8450af..19aa927 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -448,11 +448,6 @@ int line6_init_pcm(struct usb_line6 *line6,
ep_write = 0x02;
break;
 
-   case LINE6_POCKETPOD:
-   ep_read = 0x82;
-   ep_write = 0x02;
-   break;
-
case LINE6_GUITARPORT:
case LINE6_PODSTUDIO_GX:
case LINE6_PODSTUDIO_UX1:
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/25] staging: line6: Filter on UX2 interfaces

2015-01-09 Thread Chris Rorvick
The driver only supports interface 0 of the TonePort UX2 and POD Studio
UX2 devices.  Use the device table to filter on this.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 20 
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 8b03bc0..f04ff80 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -46,14 +46,14 @@ static const struct usb_device_id line6_id_table[] = {
{ LINE6_IF_NUM(0x414D, 1), .driver_info = LINE6_PODHD500_1 },
{ LINE6_DEVICE(0x4153),.driver_info = LINE6_PODSTUDIO_GX },
{ LINE6_DEVICE(0x4150),.driver_info = LINE6_PODSTUDIO_UX1 },
-   { LINE6_DEVICE(0x4151),.driver_info = LINE6_PODSTUDIO_UX2 },
+   { LINE6_IF_NUM(0x4151, 0), .driver_info = LINE6_PODSTUDIO_UX2 },
{ LINE6_DEVICE(0x5044),.driver_info = LINE6_PODXT },
{ LINE6_IF_NUM(0x4650, 0), .driver_info = LINE6_PODXTLIVE_POD },
{ LINE6_IF_NUM(0x4650, 1), .driver_info = LINE6_PODXTLIVE_VARIAX },
{ LINE6_DEVICE(0x5050),.driver_info = LINE6_PODXTPRO },
{ LINE6_DEVICE(0x4147),.driver_info = LINE6_TONEPORT_GX },
{ LINE6_DEVICE(0x4141),.driver_info = LINE6_TONEPORT_UX1 },
-   { LINE6_DEVICE(0x4142),.driver_info = LINE6_TONEPORT_UX2 },
+   { LINE6_IF_NUM(0x4142, 0), .driver_info = LINE6_TONEPORT_UX2 },
{ LINE6_DEVICE(0x534d),.driver_info = LINE6_VARIAX },
{}
 };
@@ -768,20 +768,8 @@ static int line6_probe(struct usb_interface *interface,
 
case LINE6_TONEPORT_UX2:
case LINE6_PODSTUDIO_UX2:
-   switch (interface_number) {
-   case 0:
-   /* defaults to 44.1kHz, 16-bit */
-   alternate = 2;
-   break;
-   case 1:
-   /* don't know yet what this is ...
-  alternate = 1;
-  break;
-*/
-   return -ENODEV;
-   default:
-   MISSING_CASE;
-   }
+   /* defaults to 44.1kHz, 16-bit */
+   alternate = 2;
break;
 
default:
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/25] staging: line6: Move altsetting to properties

2015-01-09 Thread Chris Rorvick
The device type can now be used to determine the altsetting for the
interface.  Drop the conditional logic and make this value a property.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 74 +-
 drivers/staging/line6/driver.h |  2 ++
 2 files changed, 25 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index f04ff80..0150470 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -67,6 +67,7 @@ static const struct line6_properties line6_properties_table[] 
= {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 5,
},
[LINE6_BASSPODXTLIVE] = {
.id = "BassPODxtLive",
@@ -74,6 +75,7 @@ static const struct line6_properties line6_properties_table[] 
= {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 1,
},
[LINE6_BASSPODXTPRO] = {
.id = "BassPODxtPro",
@@ -81,16 +83,19 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 5,
},
[LINE6_GUITARPORT] = {
.id = "GuitarPort",
.name = "GuitarPort",
.capabilities   = LINE6_CAP_PCM,
+   .altsetting = 2,  /* 1..4 seem to be ok */
},
[LINE6_POCKETPOD] = {
.id = "PocketPOD",
.name = "Pocket POD",
.capabilities   = LINE6_CAP_CONTROL,
+   .altsetting = 0,
},
[LINE6_PODHD300] = {
.id = "PODHD300",
@@ -98,6 +103,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 5,
},
[LINE6_PODHD400] = {
.id = "PODHD400",
@@ -105,6 +111,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 5,
},
[LINE6_PODHD500_0] = {
.id = "PODHD500",
@@ -112,6 +119,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 1,
},
[LINE6_PODHD500_1] = {
.id = "PODHD500",
@@ -119,21 +127,25 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 1,
},
[LINE6_PODSTUDIO_GX] = {
.id = "PODStudioGX",
.name = "POD Studio GX",
.capabilities   = LINE6_CAP_PCM,
+   .altsetting = 2,  /* 1..4 seem to be ok */
},
[LINE6_PODSTUDIO_UX1] = {
.id = "PODStudioUX1",
.name = "POD Studio UX1",
.capabilities   = LINE6_CAP_PCM,
+   .altsetting = 2,  /* 1..4 seem to be ok */
},
[LINE6_PODSTUDIO_UX2] = {
.id = "PODStudioUX2",
.name = "POD Studio UX2",
.capabilities   = LINE6_CAP_PCM,
+   .altsetting = 2,  /* defaults to 44.1kHz, 16-bit */
},
[LINE6_PODXT] = {
.id = "PODxt",
@@ -141,6 +153,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 5,
},
[LINE6_PODXTLIVE_POD] = {
.id = "PODxtLive",
@@ -148,6 +161,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
+   .altsetting = 1,
},
[LINE6_PODXTLIVE_VARIAX] = {
.id = "PODxtLive",
@@ -155,6 +169,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_CONTROL
| LINE6_CAP_PCM
  

[PATCH 24/25] staging: line6: Call *_disconnect() via pointer

2015-01-09 Thread Chris Rorvick
Which *_disconnect() to call on disconnect is known at initialization.
Add a function pointer to the `usb_line6' struct and use to call into
the appropriate logic instead of evaluating the conditional logic.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c   | 43 +---
 drivers/staging/line6/driver.h   |  1 +
 drivers/staging/line6/pod.c  |  1 +
 drivers/staging/line6/podhd.c|  2 ++
 drivers/staging/line6/toneport.c |  2 ++
 drivers/staging/line6/variax.c   |  1 +
 6 files changed, 8 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index f7629cb..fc852f6 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -1017,48 +1017,7 @@ static void line6_disconnect(struct usb_interface 
*interface)
dev_err(line6->ifcdev,
"driver bug: inconsistent usb device\n");
 
-   switch (line6->type) {
-   case LINE6_BASSPODXT:
-   case LINE6_BASSPODXTLIVE:
-   case LINE6_BASSPODXTPRO:
-   case LINE6_POCKETPOD:
-   case LINE6_PODXT:
-   case LINE6_PODXTPRO:
-   line6_pod_disconnect(interface);
-   break;
-
-   case LINE6_PODHD300:
-   case LINE6_PODHD400:
-   case LINE6_PODHD500_0:
-   case LINE6_PODHD500_1:
-   line6_podhd_disconnect(interface);
-   break;
-
-   case LINE6_PODXTLIVE_POD:
-   line6_pod_disconnect(interface);
-   break;
-
-   case LINE6_PODXTLIVE_VARIAX:
-   line6_variax_disconnect(interface);
-   break;
-
-   case LINE6_VARIAX:
-   line6_variax_disconnect(interface);
-   break;
-
-   case LINE6_PODSTUDIO_GX:
-   case LINE6_PODSTUDIO_UX1:
-   case LINE6_PODSTUDIO_UX2:
-   case LINE6_TONEPORT_GX:
-   case LINE6_TONEPORT_UX1:
-   case LINE6_TONEPORT_UX2:
-   case LINE6_GUITARPORT:
-   line6_toneport_disconnect(interface);
-   break;
-
-   default:
-   MISSING_CASE;
-   }
+   line6->disconnect(interface);
 
dev_info(&interface->dev, "Line6 %s now disconnected\n",
 line6->properties->name);
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index 220813f..ad203f1 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -196,6 +196,7 @@ struct usb_line6 {
int message_length;
 
void (*process_message)(struct usb_line6 *);
+   void (*disconnect)(struct usb_interface *);
 };
 
 extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1,
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 79dcff4..b9af5cf 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -360,6 +360,7 @@ static int pod_try_init(struct usb_interface *interface,
struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
 
line6->process_message = line6_pod_process_message;
+   line6->disconnect = line6_pod_disconnect;
 
init_timer(&pod->startup_timer);
INIT_WORK(&pod->startup_work, pod_startup4);
diff --git a/drivers/staging/line6/podhd.c b/drivers/staging/line6/podhd.c
index 3bb942e..a57fbce 100644
--- a/drivers/staging/line6/podhd.c
+++ b/drivers/staging/line6/podhd.c
@@ -98,6 +98,8 @@ static int podhd_try_init(struct usb_interface *interface,
if ((interface == NULL) || (podhd == NULL))
return -ENODEV;
 
+   line6->disconnect = line6_podhd_disconnect;
+
/* initialize audio system: */
err = line6_init_audio(line6);
if (err < 0)
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
index 70fba02..42c34eb 100644
--- a/drivers/staging/line6/toneport.c
+++ b/drivers/staging/line6/toneport.c
@@ -347,6 +347,8 @@ static int toneport_try_init(struct usb_interface 
*interface,
if ((interface == NULL) || (toneport == NULL))
return -ENODEV;
 
+   line6->disconnect = line6_toneport_disconnect;
+
/* initialize audio system: */
err = line6_init_audio(line6);
if (err < 0)
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c
index ccb1f68..ca25b41 100644
--- a/drivers/staging/line6/variax.c
+++ b/drivers/staging/line6/variax.c
@@ -181,6 +181,7 @@ static int variax_try_init(struct usb_interface *interface,
int err;
 
line6->process_message = line6_variax_process_message;
+   line6->disconnect = line6_variax_disconnect;
 
init_timer(&variax

[PATCH 25/25] staging: line6: Make *_disconnect() functions static

2015-01-09 Thread Chris Rorvick
Remove declarations from the header and move the definitions up in the
source so they need not be forward declared.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/pod.c  | 58 ++--
 drivers/staging/line6/pod.h  |  1 -
 drivers/staging/line6/podhd.c| 42 +--
 drivers/staging/line6/podhd.h|  1 -
 drivers/staging/line6/toneport.c | 63 +---
 drivers/staging/line6/toneport.h |  1 -
 drivers/staging/line6/variax.c   | 22 +++---
 drivers/staging/line6/variax.h   |  1 -
 8 files changed, 94 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index b9af5cf..85a4363 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -338,6 +338,35 @@ static void pod_destruct(struct usb_interface *interface)
 }
 
 /*
+   POD device disconnected.
+*/
+static void line6_pod_disconnect(struct usb_interface *interface)
+{
+   struct usb_line6_pod *pod;
+
+   if (interface == NULL)
+   return;
+   pod = usb_get_intfdata(interface);
+
+   if (pod != NULL) {
+   struct snd_line6_pcm *line6pcm = pod->line6.line6pcm;
+   struct device *dev = &interface->dev;
+
+   if (line6pcm != NULL)
+   line6_pcm_disconnect(line6pcm);
+
+   if (dev != NULL) {
+   /* remove sysfs entries: */
+   device_remove_file(dev, &dev_attr_device_id);
+   device_remove_file(dev, &dev_attr_firmware_version);
+   device_remove_file(dev, &dev_attr_serial_number);
+   }
+   }
+
+   pod_destruct(interface);
+}
+
+/*
Create sysfs entries.
 */
 static int pod_create_files2(struct device *dev)
@@ -422,32 +451,3 @@ int line6_pod_init(struct usb_interface *interface, struct 
usb_line6 *line6)
 
return err;
 }
-
-/*
-   POD device disconnected.
-*/
-void line6_pod_disconnect(struct usb_interface *interface)
-{
-   struct usb_line6_pod *pod;
-
-   if (interface == NULL)
-   return;
-   pod = usb_get_intfdata(interface);
-
-   if (pod != NULL) {
-   struct snd_line6_pcm *line6pcm = pod->line6.line6pcm;
-   struct device *dev = &interface->dev;
-
-   if (line6pcm != NULL)
-   line6_pcm_disconnect(line6pcm);
-
-   if (dev != NULL) {
-   /* remove sysfs entries: */
-   device_remove_file(dev, &dev_attr_device_id);
-   device_remove_file(dev, &dev_attr_firmware_version);
-   device_remove_file(dev, &dev_attr_serial_number);
-   }
-   }
-
-   pod_destruct(interface);
-}
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 0d78ca7..87a8f0f 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -86,7 +86,6 @@ struct usb_line6_pod {
int device_id;
 };
 
-extern void line6_pod_disconnect(struct usb_interface *interface);
 extern int line6_pod_init(struct usb_interface *interface,
  struct usb_line6 *line6);
 
diff --git a/drivers/staging/line6/podhd.c b/drivers/staging/line6/podhd.c
index a57fbce..27c5402 100644
--- a/drivers/staging/line6/podhd.c
+++ b/drivers/staging/line6/podhd.c
@@ -87,6 +87,27 @@ static void podhd_destruct(struct usb_interface *interface)
 }
 
 /*
+   POD HD device disconnected.
+*/
+static void line6_podhd_disconnect(struct usb_interface *interface)
+{
+   struct usb_line6_podhd *podhd;
+
+   if (interface == NULL)
+   return;
+   podhd = usb_get_intfdata(interface);
+
+   if (podhd != NULL) {
+   struct snd_line6_pcm *line6pcm = podhd->line6.line6pcm;
+
+   if (line6pcm != NULL)
+   line6_pcm_disconnect(line6pcm);
+   }
+
+   podhd_destruct(interface);
+}
+
+/*
Try to init POD HD device.
 */
 static int podhd_try_init(struct usb_interface *interface,
@@ -133,24 +154,3 @@ int line6_podhd_init(struct usb_interface *interface, 
struct usb_line6 *line6)
 
return err;
 }
-
-/*
-   POD HD device disconnected.
-*/
-void line6_podhd_disconnect(struct usb_interface *interface)
-{
-   struct usb_line6_podhd *podhd;
-
-   if (interface == NULL)
-   return;
-   podhd = usb_get_intfdata(interface);
-
-   if (podhd != NULL) {
-   struct snd_line6_pcm *line6pcm = podhd->line6.line6pcm;
-
-   if (line6pcm != NULL)
-   line6_pcm_disconnect(line6pcm);
-   }
-
-   podhd_destruct(interface);
-}
diff --git a/drivers/staging/line6/podhd.h b/drivers/staging/line6/podhd.h
index b7d9568..a14f711 100644
--- a/drivers/staging/line6/podhd.h
+++ b/drivers/staging/line6/podhd.h
@@ -23,7 +23,6 @@ struct usb_line6_podhd {
st

[PATCH 23/25] staging: line6: Call *_process_message() via pointer

2015-01-09 Thread Chris Rorvick
Which *_process_message() function (if any) to call when data is
received is known at initialization.  Add a function pointer to the
`usb_line6' struct and use to call into the appropriate logic instead
of evaluating the conditional logic for each message.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 33 ++---
 drivers/staging/line6/driver.h |  2 ++
 drivers/staging/line6/pod.c|  4 +++-
 drivers/staging/line6/pod.h|  1 -
 drivers/staging/line6/variax.c |  4 +++-
 drivers/staging/line6/variax.h |  1 -
 6 files changed, 10 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 369e60e..f7629cb 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -537,37 +537,8 @@ static void line6_data_received(struct urb *urb)
line6->message_length = done;
line6_midi_receive(line6, line6->buffer_message, done);
 
-   switch (line6->type) {
-   case LINE6_BASSPODXT:
-   case LINE6_BASSPODXTLIVE:
-   case LINE6_BASSPODXTPRO:
-   case LINE6_PODXT:
-   case LINE6_PODXTPRO:
-   case LINE6_POCKETPOD:
-   line6_pod_process_message(line6);
-   break;
-
-   case LINE6_PODHD300:
-   case LINE6_PODHD400:
-   case LINE6_PODHD500_0:
-   case LINE6_PODHD500_1:
-   break; /* let userspace handle MIDI */
-
-   case LINE6_PODXTLIVE_POD:
-   line6_pod_process_message(line6);
-   break;
-
-   case LINE6_PODXTLIVE_VARIAX:
-   line6_variax_process_message(line6);
-   break;
-
-   case LINE6_VARIAX:
-   line6_variax_process_message(line6);
-   break;
-
-   default:
-   MISSING_CASE;
-   }
+   if (line6->process_message)
+   line6->process_message(line6);
}
 
line6_start_listen(line6);
diff --git a/drivers/staging/line6/driver.h b/drivers/staging/line6/driver.h
index a4bde71..220813f 100644
--- a/drivers/staging/line6/driver.h
+++ b/drivers/staging/line6/driver.h
@@ -194,6 +194,8 @@ struct usb_line6 {
 Length of message to be processed.
*/
int message_length;
+
+   void (*process_message)(struct usb_line6 *);
 };
 
 extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1,
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index aa8977d..79dcff4 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -131,7 +131,7 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod 
*pod, int code,
 /*
Process a completely received message.
 */
-void line6_pod_process_message(struct usb_line6 *line6)
+static void line6_pod_process_message(struct usb_line6 *line6)
 {
struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
const unsigned char *buf = pod->line6.buffer_message;
@@ -359,6 +359,8 @@ static int pod_try_init(struct usb_interface *interface,
int err;
struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
 
+   line6->process_message = line6_pod_process_message;
+
init_timer(&pod->startup_timer);
INIT_WORK(&pod->startup_work, pod_startup4);
 
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 984a00b..0d78ca7 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -89,6 +89,5 @@ struct usb_line6_pod {
 extern void line6_pod_disconnect(struct usb_interface *interface);
 extern int line6_pod_init(struct usb_interface *interface,
  struct usb_line6 *line6);
-extern void line6_pod_process_message(struct usb_line6 *line6);
 
 #endif
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c
index 4d41994..ccb1f68 100644
--- a/drivers/staging/line6/variax.c
+++ b/drivers/staging/line6/variax.c
@@ -130,7 +130,7 @@ static void variax_startup6(struct work_struct *work)
 /*
Process a completely received message.
 */
-void line6_variax_process_message(struct usb_line6 *line6)
+static void line6_variax_process_message(struct usb_line6 *line6)
 {
struct usb_line6_variax *variax = (struct usb_line6_variax *) line6;
const unsigned char *buf = variax->line6.buffer_message;
@@ -180,6 +180,8 @@ static int variax_try_init(struct usb_interface *interface,
struct usb_line6_variax *variax = (struct usb_line6_variax *) line6;
int err;
 
+   line6->process_message = line6_variax_process_message;
+
init_timer(&variax->startup_timer1);
init_timer(&variax->startup_timer2);
INIT_WORK(&variax->startup_work, variax_startup6);
diff --git a/drivers/stagin

[PATCH 20/25] staging: line6: Move audio endpoints to properties

2015-01-09 Thread Chris Rorvick
The device type can now be used to determine the addresses of the
audio endpoints for the interface.  Drop the conditional logic and make
these values properties.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/capture.c  |  9 
 drivers/staging/line6/driver.c   | 38 +++
 drivers/staging/line6/driver.h   |  2 ++
 drivers/staging/line6/pcm.c  | 48 ++--
 drivers/staging/line6/pcm.h  | 10 -
 drivers/staging/line6/playback.c |  9 
 6 files changed, 52 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/line6/capture.c b/drivers/staging/line6/capture.c
index e6ca631..f24c7c5 100644
--- a/drivers/staging/line6/capture.c
+++ b/drivers/staging/line6/capture.c
@@ -400,6 +400,7 @@ struct snd_pcm_ops snd_line6_capture_ops = {
 
 int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm)
 {
+   struct usb_line6 *line6 = line6pcm->line6;
int i;
 
/* create audio URBs and fill in constant values: */
@@ -411,14 +412,14 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm 
*line6pcm)
usb_alloc_urb(LINE6_ISO_PACKETS, GFP_KERNEL);
 
if (urb == NULL) {
-   dev_err(line6pcm->line6->ifcdev, "Out of memory\n");
+   dev_err(line6->ifcdev, "Out of memory\n");
return -ENOMEM;
}
 
-   urb->dev = line6pcm->line6->usbdev;
+   urb->dev = line6->usbdev;
urb->pipe =
-   usb_rcvisocpipe(line6pcm->line6->usbdev,
-   line6pcm->ep_audio_read &
+   usb_rcvisocpipe(line6->usbdev,
+   line6->properties->ep_audio_r &
USB_ENDPOINT_NUMBER_MASK);
urb->transfer_flags = URB_ISO_ASAP;
urb->start_frame = -1;
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 40ec57c..4bfef21 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -70,6 +70,8 @@ static const struct line6_properties line6_properties_table[] 
= {
.altsetting = 5,
.ep_ctrl_r = 0x84,
.ep_ctrl_w = 0x03,
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_BASSPODXTLIVE] = {
.id = "BassPODxtLive",
@@ -80,6 +82,8 @@ static const struct line6_properties line6_properties_table[] 
= {
.altsetting = 1,
.ep_ctrl_r = 0x84,
.ep_ctrl_w = 0x03,
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_BASSPODXTPRO] = {
.id = "BassPODxtPro",
@@ -90,6 +94,8 @@ static const struct line6_properties line6_properties_table[] 
= {
.altsetting = 5,
.ep_ctrl_r = 0x84,
.ep_ctrl_w = 0x03,
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_GUITARPORT] = {
.id = "GuitarPort",
@@ -97,6 +103,8 @@ static const struct line6_properties 
line6_properties_table[] = {
.capabilities   = LINE6_CAP_PCM,
.altsetting = 2,  /* 1..4 seem to be ok */
/* no control channel */
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_POCKETPOD] = {
.id = "PocketPOD",
@@ -105,6 +113,7 @@ static const struct line6_properties 
line6_properties_table[] = {
.altsetting = 0,
.ep_ctrl_r = 0x82,
.ep_ctrl_w = 0x02,
+   /* no audio channel */
},
[LINE6_PODHD300] = {
.id = "PODHD300",
@@ -115,6 +124,8 @@ static const struct line6_properties 
line6_properties_table[] = {
.altsetting = 5,
.ep_ctrl_r = 0x84,
.ep_ctrl_w = 0x03,
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_PODHD400] = {
.id = "PODHD400",
@@ -125,6 +136,8 @@ static const struct line6_properties 
line6_properties_table[] = {
.altsetting = 5,
.ep_ctrl_r = 0x84,
.ep_ctrl_w = 0x03,
+   .ep_audio_r = 0x82,
+   .ep_audio_w = 0x01,
},
[LINE6_PODHD500_0] = {
.id = "PODHD500",
@@ -135,6 +148,8 @@ static const struct line6_properties 
line6_properties_table[] = {
.altsetting = 1,
.ep_ctrl_r = 0x81,
.ep_ctrl_w = 0x01,
+   .ep_audio_r = 0x86,
+   .ep_audio_w = 0x02,
},
[LINE6_PODHD500_1] = {
.id = "PODHD500",
@@ -145,6 +160,8 @@ static const struct line6_properties 
line6_properties_table[] = {
.altsetting = 1,
.ep_ctrl_r =

[PATCH 18/25] staging: line6: Move control endpoints to properties

2015-01-09 Thread Chris Rorvick
The device type can now be used to determine the addresses of the
control endpoints for the interface.  Drop the conditional logic and
make these values properties.

Signed-off-by: Chris Rorvick 
---
 drivers/staging/line6/driver.c | 73 +-
 drivers/staging/line6/driver.h | 13 ++--
 drivers/staging/line6/midi.c   |  2 +-
 3 files changed, 48 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index 0150470..40ec57c 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -68,6 +68,8 @@ static const struct line6_properties line6_properties_table[] 
= {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 5,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_BASSPODXTLIVE] = {
.id = "BassPODxtLive",
@@ -76,6 +78,8 @@ static const struct line6_properties line6_properties_table[] 
= {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 1,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_BASSPODXTPRO] = {
.id = "BassPODxtPro",
@@ -84,18 +88,23 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 5,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_GUITARPORT] = {
.id = "GuitarPort",
.name = "GuitarPort",
.capabilities   = LINE6_CAP_PCM,
.altsetting = 2,  /* 1..4 seem to be ok */
+   /* no control channel */
},
[LINE6_POCKETPOD] = {
.id = "PocketPOD",
.name = "Pocket POD",
.capabilities   = LINE6_CAP_CONTROL,
.altsetting = 0,
+   .ep_ctrl_r = 0x82,
+   .ep_ctrl_w = 0x02,
},
[LINE6_PODHD300] = {
.id = "PODHD300",
@@ -104,6 +113,8 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 5,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_PODHD400] = {
.id = "PODHD400",
@@ -112,6 +123,8 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 5,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_PODHD500_0] = {
.id = "PODHD500",
@@ -120,6 +133,8 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 1,
+   .ep_ctrl_r = 0x81,
+   .ep_ctrl_w = 0x01,
},
[LINE6_PODHD500_1] = {
.id = "PODHD500",
@@ -128,24 +143,29 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 1,
+   .ep_ctrl_r = 0x81,
+   .ep_ctrl_w = 0x01,
},
[LINE6_PODSTUDIO_GX] = {
.id = "PODStudioGX",
.name = "POD Studio GX",
.capabilities   = LINE6_CAP_PCM,
.altsetting = 2,  /* 1..4 seem to be ok */
+   /* no control channel */
},
[LINE6_PODSTUDIO_UX1] = {
.id = "PODStudioUX1",
.name = "POD Studio UX1",
.capabilities   = LINE6_CAP_PCM,
.altsetting = 2,  /* 1..4 seem to be ok */
+   /* no control channel */
},
[LINE6_PODSTUDIO_UX2] = {
.id = "PODStudioUX2",
.name = "POD Studio UX2",
.capabilities   = LINE6_CAP_PCM,
.altsetting = 2,  /* defaults to 44.1kHz, 16-bit */
+   /* no control channel */
},
[LINE6_PODXT] = {
.id = "PODxt",
@@ -154,6 +174,8 @@ static const struct line6_properties 
line6_properties_table[] = {
| LINE6_CAP_PCM
| LINE6_CAP_HWMON,
.altsetting = 5,
+   .ep_ctrl_r = 0x84,
+   .ep_ctrl_w = 0x03,
},
[LINE6_PODXTLIVE_POD] = {
.id = "PODxtLive",
@@ -162,6 +184,8 @@ static const struct line6_properties 
line6_properties_table[] = {
 

[PATCH RESEND 0/6] Drivers: hv: Miscellaneous fixes and enhancements

2015-01-09 Thread K. Y. Srinivasan
In addition to some miscellaneous bug fixes and enhancements
implement a clockevent device based on the functionality supported by Hyper-V.

K. Y. Srinivasan (6):
  Drivers: hv: hv_balloon: Make adjustments in computing the floor
  Drivers: hv: hv_balloon: Fix a locking bug in the balloon driver
  Drivers: hv: hv_balloon: Don't post pressure status from interrupt
context
  Drivers: hv: vmbus: Implement a clockevent device
  Drivers: hv: vmbus: Fix a bug in vmbus_establish_gpadl()
  Drivers: hv: vmbus: Support a vmbus API for efficiently sending page
arrays

 arch/x86/include/uapi/asm/hyperv.h |   11 +
 drivers/hv/channel.c   |   48 +++-
 drivers/hv/hv.c|   78 +++
 drivers/hv/hv_balloon.c|   88 +---
 drivers/hv/hyperv_vmbus.h  |   21 +
 drivers/hv/vmbus_drv.c |   40 +++-
 include/linux/hyperv.h |   31 +
 7 files changed, 297 insertions(+), 20 deletions(-)

-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 3/6] Drivers: hv: hv_balloon: Don't post pressure status from interrupt context

2015-01-09 Thread K. Y. Srinivasan
We currently release memory (balloon down) in the interrupt context and we also
post memory status while releasing memory. Rather than posting the status
in the interrupt context, wakeup the status posting thread to post the status.
This will address the inconsistent lock state that Sitsofe Wheeler 

reported:

http://lkml.iu.edu/hypermail/linux/kernel/1411.1/00075.html

Signed-off-by: K. Y. Srinivasan 
Reported-by: Sitsofe Wheeler 
---
 drivers/hv/hv_balloon.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 8e30415..ff16938 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1226,7 +1226,7 @@ static void balloon_down(struct hv_dynmem_device *dm,
 
for (i = 0; i < range_count; i++) {
free_balloon_pages(dm, &range_array[i]);
-   post_status(&dm_device);
+   complete(&dm_device.config_event);
}
 
if (req->more_pages == 1)
@@ -1250,19 +1250,16 @@ static void balloon_onchannelcallback(void *context);
 static int dm_thread_func(void *dm_dev)
 {
struct hv_dynmem_device *dm = dm_dev;
-   int t;
 
while (!kthread_should_stop()) {
-   t = wait_for_completion_interruptible_timeout(
+   wait_for_completion_interruptible_timeout(
&dm_device.config_event, 1*HZ);
/*
 * The host expects us to post information on the memory
 * pressure every second.
 */
-
-   if (t == 0)
-   post_status(dm);
-
+   reinit_completion(&dm_device.config_event);
+   post_status(dm);
}
 
return 0;
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 6/6] Drivers: hv: vmbus: Support a vmbus API for efficiently sending page arrays

2015-01-09 Thread K. Y. Srinivasan
Currently, the API for sending a multi-page buffer over VMBUS is limited to
a maximum pfn array of MAX_MULTIPAGE_BUFFER_COUNT. This limitation is
not imposed by the host and unnecessarily limits the maximum payload
that can be sent. Implement an API that does not have this restriction.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel.c   |   44 
 include/linux/hyperv.h |   31 +++
 2 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index c76ffbe..18c4f23 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -686,6 +686,50 @@ EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer);
 /*
  * vmbus_sendpacket_multipagebuffer - Send a multi-page buffer packet
  * using a GPADL Direct packet type.
+ * The buffer includes the vmbus descriptor.
+ */
+int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
+ struct vmbus_packet_mpb_array *desc,
+ u32 desc_size,
+ void *buffer, u32 bufferlen, u64 requestid)
+{
+   int ret;
+   u32 packetlen;
+   u32 packetlen_aligned;
+   struct kvec bufferlist[3];
+   u64 aligned_data = 0;
+   bool signal = false;
+
+   packetlen = desc_size + bufferlen;
+   packetlen_aligned = ALIGN(packetlen, sizeof(u64));
+
+   /* Setup the descriptor */
+   desc->type = VM_PKT_DATA_USING_GPA_DIRECT;
+   desc->flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
+   desc->dataoffset8 = desc_size >> 3; /* in 8-bytes grandularity */
+   desc->length8 = (u16)(packetlen_aligned >> 3);
+   desc->transactionid = requestid;
+   desc->rangecount = 1;
+
+   bufferlist[0].iov_base = desc;
+   bufferlist[0].iov_len = desc_size;
+   bufferlist[1].iov_base = buffer;
+   bufferlist[1].iov_len = bufferlen;
+   bufferlist[2].iov_base = &aligned_data;
+   bufferlist[2].iov_len = (packetlen_aligned - packetlen);
+
+   ret = hv_ringbuffer_write(&channel->outbound, bufferlist, 3, &signal);
+
+   if (ret == 0 && signal)
+   vmbus_setevent(channel);
+
+   return ret;
+}
+EXPORT_SYMBOL_GPL(vmbus_sendpacket_mpb_desc);
+
+/*
+ * vmbus_sendpacket_multipagebuffer - Send a multi-page buffer packet
+ * using a GPADL Direct packet type.
  */
 int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
struct hv_multipage_buffer *multi_pagebuffer,
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 476c685..259023a 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -57,6 +57,18 @@ struct hv_multipage_buffer {
u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT];
 };
 
+/*
+ * Multiple-page buffer array; the pfn array is variable size:
+ * The number of entries in the PFN array is determined by
+ * "len" and "offset".
+ */
+struct hv_mpb_array {
+   /* Length and Offset determines the # of pfns in the array */
+   u32 len;
+   u32 offset;
+   u64 pfn_array[];
+};
+
 /* 0x18 includes the proprietary packet header */
 #define MAX_PAGE_BUFFER_PACKET (0x18 + \
(sizeof(struct hv_page_buffer) * \
@@ -814,6 +826,18 @@ struct vmbus_channel_packet_multipage_buffer {
struct hv_multipage_buffer range;
 } __packed;
 
+/* The format must be the same as struct vmdata_gpa_direct */
+struct vmbus_packet_mpb_array {
+   u16 type;
+   u16 dataoffset8;
+   u16 length8;
+   u16 flags;
+   u64 transactionid;
+   u32 reserved;
+   u32 rangecount; /* Always 1 in this case */
+   struct hv_mpb_array range;
+} __packed;
+
 
 extern int vmbus_open(struct vmbus_channel *channel,
u32 send_ringbuffersize,
@@ -845,6 +869,13 @@ extern int vmbus_sendpacket_multipagebuffer(struct 
vmbus_channel *channel,
u32 bufferlen,
u64 requestid);
 
+extern int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
+struct vmbus_packet_mpb_array *mpb,
+u32 desc_size,
+void *buffer,
+u32 bufferlen,
+u64 requestid);
+
 extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
  void *kbuffer,
  u32 size,
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 1/6] Drivers: hv: hv_balloon: Make adjustments in computing the floor

2015-01-09 Thread K. Y. Srinivasan
Make adjustments in computing the balloon floor. The current computation
of the balloon floor was not appropriate for virtual machines with more than
10 GB of assigned memory - we would get into situations where the host would
agressively balloon down the guest and leave the guest in an unusable state.
This patch fixes the issue by raising the floor.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hv_balloon.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index b958ded..9cbbb83 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -928,9 +928,8 @@ static unsigned long compute_balloon_floor(void)
 * 12872(1/2)
 * 512   168(1/4)
 *2048   360(1/8)
-*8192   552(1/32)
-*   32768  1320
-*  131072  4392
+*8192   768(1/16)
+*   32768  1536(1/32)
 */
if (totalram_pages < MB2PAGES(128))
min_pages = MB2PAGES(8) + (totalram_pages >> 1);
@@ -938,8 +937,10 @@ static unsigned long compute_balloon_floor(void)
min_pages = MB2PAGES(40) + (totalram_pages >> 2);
else if (totalram_pages < MB2PAGES(2048))
min_pages = MB2PAGES(104) + (totalram_pages >> 3);
+   else if (totalram_pages < MB2PAGES(8192))
+   min_pages = MB2PAGES(256) + (totalram_pages >> 4);
else
-   min_pages = MB2PAGES(296) + (totalram_pages >> 5);
+   min_pages = MB2PAGES(512) + (totalram_pages >> 5);
 #undef MB2PAGES
return min_pages;
 }
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 2/6] Drivers: hv: hv_balloon: Fix a locking bug in the balloon driver

2015-01-09 Thread K. Y. Srinivasan
We support memory hot-add in the Hyper-V balloon driver by hot adding an 
appropriately
sized and aligned region and controlling the on-lining of pages within that 
region
based on the pages that the host wants us to online. We do this because the
granularity and alignment requirements in Linux are different from what Windows
expects. The state to manage the onlining of pages needs to be correctly
protected. Fix this bug.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hv_balloon.c |   68 +++---
 1 files changed, 63 insertions(+), 5 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 9cbbb83..8e30415 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -533,6 +533,9 @@ struct hv_dynmem_device {
 */
struct task_struct *thread;
 
+   struct mutex ha_region_mutex;
+   struct completion waiter_event;
+
/*
 * A list of hot-add regions.
 */
@@ -549,7 +552,59 @@ struct hv_dynmem_device {
 static struct hv_dynmem_device dm_device;
 
 static void post_status(struct hv_dynmem_device *dm);
+
 #ifdef CONFIG_MEMORY_HOTPLUG
+static void acquire_region_mutex(bool trylock)
+{
+   if (trylock) {
+   reinit_completion(&dm_device.waiter_event);
+   while (!mutex_trylock(&dm_device.ha_region_mutex))
+   wait_for_completion(&dm_device.waiter_event);
+   } else {
+   mutex_lock(&dm_device.ha_region_mutex);
+   }
+}
+
+static void release_region_mutex(bool trylock)
+{
+   if (trylock) {
+   mutex_unlock(&dm_device.ha_region_mutex);
+   } else {
+   mutex_unlock(&dm_device.ha_region_mutex);
+   complete(&dm_device.waiter_event);
+   }
+}
+
+static int hv_memory_notifier(struct notifier_block *nb, unsigned long val,
+ void *v)
+{
+   switch (val) {
+   case MEM_GOING_ONLINE:
+   acquire_region_mutex(true);
+   break;
+
+   case MEM_ONLINE:
+   case MEM_CANCEL_ONLINE:
+   release_region_mutex(true);
+   if (dm_device.ha_waiting) {
+   dm_device.ha_waiting = false;
+   complete(&dm_device.ol_waitevent);
+   }
+   break;
+
+   case MEM_GOING_OFFLINE:
+   case MEM_OFFLINE:
+   case MEM_CANCEL_OFFLINE:
+   break;
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block hv_memory_nb = {
+   .notifier_call = hv_memory_notifier,
+   .priority = 0
+};
+
 
 static void hv_bring_pgs_online(unsigned long start_pfn, unsigned long size)
 {
@@ -591,6 +646,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned 
long size,
init_completion(&dm_device.ol_waitevent);
dm_device.ha_waiting = true;
 
+   release_region_mutex(false);
nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn));
ret = add_memory(nid, PFN_PHYS((start_pfn)),
(HA_CHUNK << PAGE_SHIFT));
@@ -619,6 +675,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned 
long size,
 * have not been "onlined" within the allowed time.
 */
wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ);
+   acquire_region_mutex(false);
post_status(&dm_device);
}
 
@@ -632,11 +689,6 @@ static void hv_online_page(struct page *pg)
unsigned long cur_start_pgp;
unsigned long cur_end_pgp;
 
-   if (dm_device.ha_waiting) {
-   dm_device.ha_waiting = false;
-   complete(&dm_device.ol_waitevent);
-   }
-
list_for_each(cur, &dm_device.ha_region_list) {
has = list_entry(cur, struct hv_hotadd_state, list);
cur_start_pgp = (unsigned long)
@@ -834,6 +886,7 @@ static void hot_add_req(struct work_struct *dummy)
resp.hdr.size = sizeof(struct dm_hot_add_response);
 
 #ifdef CONFIG_MEMORY_HOTPLUG
+   acquire_region_mutex(false);
pg_start = dm->ha_wrk.ha_page_range.finfo.start_page;
pfn_cnt = dm->ha_wrk.ha_page_range.finfo.page_cnt;
 
@@ -865,6 +918,7 @@ static void hot_add_req(struct work_struct *dummy)
if (do_hot_add)
resp.page_count = process_hot_add(pg_start, pfn_cnt,
rg_start, rg_sz);
+   release_region_mutex(false);
 #endif
/*
 * The result field of the response structure has the
@@ -1388,7 +1442,9 @@ static int balloon_probe(struct hv_device *dev,
dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN7;
init_completion(&dm_device.host_event);
init_completion(&dm_device.config_event);
+   init_completion(&dm_device.waiter_event);
INIT_LIST_HEAD(&dm_device.ha_region_list);
+   mutex_init(&dm_device.ha_region_mutex);
INIT_

[PATCH RESEND 5/6] Drivers: hv: vmbus: Fix a bug in vmbus_establish_gpadl()

2015-01-09 Thread K. Y. Srinivasan
Correctly compute the local (gpadl) handle.
I would like to thank Michael Brown  for seeing this bug.

Signed-off-by: K. Y. Srinivasan 
Reported-by: Michael Brown 
---
 drivers/hv/channel.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 433f72a..c76ffbe 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -366,8 +366,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, 
void *kbuffer,
unsigned long flags;
int ret = 0;
 
-   next_gpadl_handle = atomic_read(&vmbus_connection.next_gpadl_handle);
-   atomic_inc(&vmbus_connection.next_gpadl_handle);
+   next_gpadl_handle =
+   (atomic_inc_return(&vmbus_connection.next_gpadl_handle) - 1);
 
ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
if (ret)
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND 4/6] Drivers: hv: vmbus: Implement a clockevent device

2015-01-09 Thread K. Y. Srinivasan
Implement a clockevent device based on the timer support available on
Hyper-V.
In this version of the patch I have addressed Jason's review comments.

Signed-off-by: K. Y. Srinivasan 
Reviewed-by: Jason Wang 
---
 arch/x86/include/uapi/asm/hyperv.h |   11 +
 drivers/hv/hv.c|   78 
 drivers/hv/hyperv_vmbus.h  |   21 ++
 drivers/hv/vmbus_drv.c |   37 -
 4 files changed, 145 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/uapi/asm/hyperv.h 
b/arch/x86/include/uapi/asm/hyperv.h
index 462efe7..90c458e 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -187,6 +187,17 @@
 #define HV_X64_MSR_SINT14  0x409E
 #define HV_X64_MSR_SINT15  0x409F
 
+/*
+ * Synthetic Timer MSRs. Four timers per vcpu.
+ */
+#define HV_X64_MSR_STIMER0_CONFIG  0x40B0
+#define HV_X64_MSR_STIMER0_COUNT   0x40B1
+#define HV_X64_MSR_STIMER1_CONFIG  0x40B2
+#define HV_X64_MSR_STIMER1_COUNT   0x40B3
+#define HV_X64_MSR_STIMER2_CONFIG  0x40B4
+#define HV_X64_MSR_STIMER2_COUNT   0x40B5
+#define HV_X64_MSR_STIMER3_CONFIG  0x40B6
+#define HV_X64_MSR_STIMER3_COUNT   0x40B7
 
 #define HV_X64_MSR_HYPERCALL_ENABLE0x0001
 #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT12
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 3e4235c..50e51a5 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -28,7 +28,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include "hyperv_vmbus.h"
 
 /* The one and only */
@@ -37,6 +39,10 @@ struct hv_context hv_context = {
.hypercall_page = NULL,
 };
 
+#define HV_TIMER_FREQUENCY (10 * 1000 * 1000) /* 100ns period */
+#define HV_MAX_MAX_DELTA_TICKS 0x
+#define HV_MIN_DELTA_TICKS 1
+
 /*
  * query_hypervisor_info - Get version info of the windows hypervisor
  */
@@ -144,6 +150,8 @@ int hv_init(void)
   sizeof(int) * NR_CPUS);
memset(hv_context.event_dpc, 0,
   sizeof(void *) * NR_CPUS);
+   memset(hv_context.clk_evt, 0,
+  sizeof(void *) * NR_CPUS);
 
max_leaf = query_hypervisor_info();
 
@@ -258,10 +266,63 @@ u16 hv_signal_event(void *con_id)
return status;
 }
 
+static int hv_ce_set_next_event(unsigned long delta,
+   struct clock_event_device *evt)
+{
+   cycle_t current_tick;
+
+   WARN_ON(evt->mode != CLOCK_EVT_MODE_ONESHOT);
+
+   rdmsrl(HV_X64_MSR_TIME_REF_COUNT, current_tick);
+   current_tick += delta;
+   wrmsrl(HV_X64_MSR_STIMER0_COUNT, current_tick);
+   return 0;
+}
+
+static void hv_ce_setmode(enum clock_event_mode mode,
+ struct clock_event_device *evt)
+{
+   union hv_timer_config timer_cfg;
+
+   switch (mode) {
+   case CLOCK_EVT_MODE_PERIODIC:
+   /* unsupported */
+   break;
+
+   case CLOCK_EVT_MODE_ONESHOT:
+   timer_cfg.enable = 1;
+   timer_cfg.auto_enable = 1;
+   timer_cfg.sintx = VMBUS_MESSAGE_SINT;
+   wrmsrl(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64);
+   break;
+
+   case CLOCK_EVT_MODE_UNUSED:
+   case CLOCK_EVT_MODE_SHUTDOWN:
+   wrmsrl(HV_X64_MSR_STIMER0_COUNT, 0);
+   wrmsrl(HV_X64_MSR_STIMER0_CONFIG, 0);
+   break;
+   case CLOCK_EVT_MODE_RESUME:
+   break;
+   }
+}
+
+static void hv_init_clockevent_device(struct clock_event_device *dev, int cpu)
+{
+   dev->name = "Hyper-V clockevent";
+   dev->features = CLOCK_EVT_FEAT_ONESHOT;
+   dev->cpumask = cpumask_of(cpu);
+   dev->rating = 1000;
+   dev->owner = THIS_MODULE;
+
+   dev->set_mode = hv_ce_setmode;
+   dev->set_next_event = hv_ce_set_next_event;
+}
+
 
 int hv_synic_alloc(void)
 {
size_t size = sizeof(struct tasklet_struct);
+   size_t ced_size = sizeof(struct clock_event_device);
int cpu;
 
for_each_online_cpu(cpu) {
@@ -272,6 +333,13 @@ int hv_synic_alloc(void)
}
tasklet_init(hv_context.event_dpc[cpu], vmbus_on_event, cpu);
 
+   hv_context.clk_evt[cpu] = kzalloc(ced_size, GFP_ATOMIC);
+   if (hv_context.clk_evt[cpu] == NULL) {
+   pr_err("Unable to allocate clock event device\n");
+   goto err;
+   }
+   hv_init_clockevent_device(hv_context.clk_evt[cpu], cpu);
+
hv_context.synic_message_page[cpu] =
(void *)get_zeroed_page(GFP_ATOMIC);
 
@@ -305,6 +373,7 @@ err:
 static void hv_synic_free_cpu(int cpu)
 {
kfree(hv_context.event_dpc[cpu]);
+   kfree(hv_context.clk_evt[cpu]);
if (hv_context.synic_event_pag