Re: [PATCH v2 1/5] staging: greybus: operation: add asynchronous gb_operation_cancel
On 02/01/17 16:16, Johan Hovold wrote: > On Tue, Dec 27, 2016 at 01:01:35PM +, Bryan O'Donoghue wrote: >> Later patches don't want or need to serialize the cancellation of an >> operation. This patch adds gb_operation_cancel_async() as a simple subset >> of the existing gb_operation_cancel() sans the synchronous wait on the >> cancellation queue. > > This one is not needed and complicates the interface for no good reason > (the async suffix also falsely indicates that this function could be > called from atomic context). > > Just cancel synchronously in the delayed worker function you add later > in the series. > > Johan > hmm ... sounds sensible in principle. Let me test that out gott nytt år ! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 12/15] hyperv: move VMBus connection ids to uapi
On 02/01/2017 20:39, Stephen Hemminger wrote: >>> >>> I would like to minimize what we include in the uapi header; especially >>> when MSFT has made no guarantees >>> with regards how they may be evolved. I will also work on getting some >>> clarity on both stability and >>> under what license we would expose the uapi header. >> Am I correct assuming that QEMU is currently the only user of >> arch/x86/include/uapi/asm/hyperv.h? >> >> Then I think we're fine withdrawing it from uapi as a whole and letting >> QEMU pull it in through its header-harvesting scripts (as does now >> anyway). This would lift all licensing and longterm API stability >> expectations. > > Thanks, that prevents lots of problems. > That is how I handle iproute2 as well. Except it wouldn't work. But no big deal, I guess we'll just synchronize hyperv.h manually. :(( Paolo ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] staging: greybus: loopback_test: Fix race preventing test completion
On 02/01/17 17:27, Axel Haslam wrote: > Hi Bryan, > > On Mon, Jan 2, 2017 at 3:32 PM, Johan Hovold wrote: >> Adding Axel on CC. >> >> On Thu, Dec 22, 2016 at 12:37:29AM +, Bryan O'Donoghue wrote: >>> commit 9250c0ee2626 ("greybus: Loopback_test: use poll instead of >>> inotify") changes the flow of determining when to break out of a loop >>> polling for loopback test completion. >>> >>> The clause is_complete() which determines if all tests are complete - as >>> used is subject to a race condition where one of the tests has completed >>> but at least one other test has not. On real hardware this typically >>> doesn't present itself however in gbsim - which is a lot slower due in-part >>> to a panopoly of printouts - we see that running a loopback test to more >>> than one Interface in gbsim will fail in all instances printing out >>> "Iteration count did not finish". >> > > Im not sure why you might be getting this error. I think the while(1) loop > should have exited when each interface has sent its event, and all the > tests are finished. Alex, Feliz año nuevo (Google translate skillz at work) What's happening is we break the loop when the number_of_events == number of fd indices captured here @ t->poll_count open_poll_files() { /* Set the poll count equal to the number of handles to track */ t->poll_count = fds_idx; } wait_for_complete() { while(1) { for (i = 0; i < t->poll_count; i++) { if(happy) number_of_events++; } if (number_of_events == t->poll_count) break; } if (!is_complete(t)) { fprintf(stderr, "life stinks\n"); return -BROKEN; } } is_complete() - then wants all iteration_counts to be equal to maximum or the test fails. OTOH if the loop doesn't break until all of the tests are complete we never hit that problem. The responsibility should be on kernel-space to ensure all tests complete anyway IMO. --- bod ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/5] staging: greybus: operation: add asynchronous gb_operation_cancel
On Tue, Jan 03, 2017 at 09:23:29AM +, Bryan O'Donoghue wrote: > On 02/01/17 16:16, Johan Hovold wrote: > > On Tue, Dec 27, 2016 at 01:01:35PM +, Bryan O'Donoghue wrote: > >> Later patches don't want or need to serialize the cancellation of an > >> operation. This patch adds gb_operation_cancel_async() as a simple subset > >> of the existing gb_operation_cancel() sans the synchronous wait on the > >> cancellation queue. > > > > This one is not needed and complicates the interface for no good reason > > (the async suffix also falsely indicates that this function could be > > called from atomic context). > > > > Just cancel synchronously in the delayed worker function you add later > > in the series. > > > > Johan > > > > hmm ... sounds sensible in principle. > > Let me test that out I started reviewing the rest of the series, but got interrupted. Will send more comments on the rest later. > gott nytt år ! God fortsättning! Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] staging: greybus: loopback_test: Fix race preventing test completion
On Tue, Jan 3, 2017 at 10:33 AM, Bryan O'Donoghue wrote: > On 02/01/17 17:27, Axel Haslam wrote: >> Hi Bryan, >> >> On Mon, Jan 2, 2017 at 3:32 PM, Johan Hovold wrote: >>> Adding Axel on CC. >>> >>> On Thu, Dec 22, 2016 at 12:37:29AM +, Bryan O'Donoghue wrote: commit 9250c0ee2626 ("greybus: Loopback_test: use poll instead of inotify") changes the flow of determining when to break out of a loop polling for loopback test completion. The clause is_complete() which determines if all tests are complete - as used is subject to a race condition where one of the tests has completed but at least one other test has not. On real hardware this typically doesn't present itself however in gbsim - which is a lot slower due in-part to a panopoly of printouts - we see that running a loopback test to more than one Interface in gbsim will fail in all instances printing out "Iteration count did not finish". >>> >> >> Im not sure why you might be getting this error. I think the while(1) loop >> should have exited when each interface has sent its event, and all the >> tests are finished. > > Alex, > > Feliz año nuevo (Google translate skillz at work) Google got it right!! > > What's happening is we break the loop when the number_of_events == > number of fd indices captured here @ t->poll_count > is this wrong? this means we will break from the loop once all interfaces have sent the event (they are finished) > open_poll_files() { > /* Set the poll count equal to the number of handles to track */ > t->poll_count = fds_idx; > } > > > wait_for_complete() { > > while(1) { > for (i = 0; i < t->poll_count; i++) { > if(happy) > number_of_events++; > } > if (number_of_events == t->poll_count) > break; > } > > if (!is_complete(t)) { > fprintf(stderr, "life stinks\n"); > return -BROKEN; > } > } > > is_complete() - then wants all iteration_counts to be equal to maximum > or the test fails. > the test should fail if the iteration count does not equal the max, right? as i see it, a successful test means: 1- each interfaces should send an event upon completion. 2- the iteration count should equal iteration_max on each of the interfaces what am i missing? > OTOH if the loop doesn't break until all of the tests are complete we > never hit that problem. The responsibility should be on kernel-space to > ensure all tests complete anyway IMO. > the user app can bail out early too, if a timeout for the poll is given or in case of a signal interrupt. > --- > bod ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/5] Staging: comedi: Proc FS related cleanup
On 30/12/16 11:24, Cheah Kok Cheong wrote: This series does trivial cleanup for COMEDI proc fs related stuff. Cheah Kok Cheong (5): Staging: comedi: comedi_fops: Avoid orphaned proc entry Staging: comedi: proc: Change file permission to read only Staging: comedi: proc: Add __init prefix Staging: comedi: proc: Add module owner Staging: comedi: proc: Warn if unable to create proc entry drivers/staging/comedi/comedi_fops.c | 6 +++--- drivers/staging/comedi/proc.c| 6 -- 2 files changed, 7 insertions(+), 5 deletions(-) Looks good, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: comedi_compat32: fixed a syntax error
On 26/12/16 06:26, Jonathan Villatoro wrote: Fixed a syntax error in the function definition's parameter. It's not really a syntax error, just a coding style issue. Signed-off-by: Jonathan Horacio Villatoro Córdoba --- drivers/staging/comedi/comedi_compat32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_compat32.h b/drivers/staging/comedi/comedi_compat32.h index 5ce77f3..91d15c6 100644 --- a/drivers/staging/comedi/comedi_compat32.h +++ b/drivers/staging/comedi/comedi_compat32.h @@ -25,7 +25,7 @@ #ifdef CONFIG_COMPAT struct file; -long comedi_compat_ioctl(struct file *, unsigned int cmd, unsigned long arg); +long comedi_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg); #else /* CONFIG_COMPAT */ Thanks. There is an earlier patch for this that hasn't been applied yet. http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2016-December/097854.html -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/6] staging: fbtft: do not override DMA coherent mask
On Mon, 2017-01-02 at 19:14 +0100, Noralf Trønnes wrote: > Den 02.01.2017 12:35, skrev Andy Shevchenko: > > Usually it's not consumer's business to override resources passed > > from > > provider, in particularly DMA coherent mask. > > --- a/drivers/staging/fbtft/fbtft-core.c > > +++ b/drivers/staging/fbtft/fbtft-core.c > > @@ -841,7 +841,6 @@ struct fb_info *fbtft_framebuffer_alloc(struct > > fbtft_display *display, > > if (txbuflen > 0) { > > #ifdef CONFIG_HAS_DMA > > if (dma) { > > - dev->coherent_dma_mask = ~0; > > Can we make this conditional like in of_dma_configure(): > > if (!dev->coherent_dma_mask) > dev->coherent_dma_mask = DMA_BIT_MASK(32); > > If not, I guess the mask has to be set before adding the spi device in > fbtft_device.c to keep it from breaking. Good point. I will check this. > txbuf = dmam_alloc_coherent(dev, txbuflen, > > &par- > > >txbuf.dma, GFP_DMA); > > } else -- Andy Shevchenko Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: comedidev.h: Drop old style zero-length array
On 21/12/16 19:13, Cheah Kok Cheong wrote: According to Documentation/Changes, the minimum gcc version required to compile the kernel is 3.2 (this is probably outdated too). Signed-off-by: Cheah Kok Cheong --- drivers/staging/comedi/comedidev.h | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 0c7c37a..9713d96 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -612,12 +612,6 @@ extern const struct comedi_lrange range_unknown; #define range_digital range_unipolar5 -#if __GNUC__ >= 3 -#define GCC_ZERO_LENGTH_ARRAY -#else -#define GCC_ZERO_LENGTH_ARRAY 0 -#endif - /** * struct comedi_lrange - Describes a COMEDI range table * @length: Number of entries in the range table. @@ -631,7 +625,7 @@ extern const struct comedi_lrange range_unknown; */ struct comedi_lrange { int length; - struct comedi_krange range[GCC_ZERO_LENGTH_ARRAY]; + struct comedi_krange range[]; }; /** Yes, that seems to be redundant. Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] staging: greybus: loopback_test: Fix race preventing test completion
On 03/01/17 10:17, Axel Haslam wrote: > as i see it, a successful test means: > 1- each interfaces should send an event upon completion. yes > 2- the iteration count should equal iteration_max on each of the interfaces yes > what am i missing? count == max implies the kernel thread is still working and we should continue to sleep. I am interested in why count != max when in user-space number_of_events == t->poll_count - I don't see how that's logically possible, though it makes me wonder why the check is_complete() was put in place - you must have seen this yourself ? As a fundamental though - unless count == max, the test is not done. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] hv_util: improve time adjustment accuracy by disabling interrupts
Stephen Hemminger writes: > On Mon, 2 Jan 2017 20:41:14 +0100 > Vitaly Kuznetsov wrote: > >> If we happen to receive interrupts during hv_set_host_time() execution >> our adjustments may get inaccurate. Make the whole function atomic. >> Unfortunately, we can's call do_settimeofday64() with interrupts >> disabled as some cross-CPU work is being done but this call happens >> very rarely. >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> drivers/hv/hv_util.c | 6 ++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c >> index 4c0fbb0..233d5cb 100644 >> --- a/drivers/hv/hv_util.c >> +++ b/drivers/hv/hv_util.c >> @@ -186,6 +186,9 @@ static void hv_set_host_time(struct work_struct *work) >> u64 newtime; >> struct timespec64 host_ts, our_ts; >> struct timex txc = {0}; >> +unsigned long flags; >> + >> +local_irq_save(flags); >> >> wrk = container_of(work, struct adj_time_work, work); >> >> @@ -214,6 +217,7 @@ static void hv_set_host_time(struct work_struct *work) >> >> /* Try adjusting time by using phase adjustment if possible */ >> if (abs(delta) > MAXPHASE) { >> +local_irq_restore(flags); >> do_settimeofday64(&host_ts); >> return; >> } >> @@ -225,6 +229,8 @@ static void hv_set_host_time(struct work_struct *work) >> txc.status = STA_PLL; >> txc.offset = delta; >> do_adjtimex(&txc); >> + >> +local_irq_restore(flags); > > Yes, it should be atomic, but local irq save/restore is not sufficient > protection > because it does not protect against premptible kernel. Why not a mutex? or a > spinlock? I may be missing something, but: to make preemption happen we need to either get an interrupt or call scheduling manually (directly or via preempt_enable(), local_irq_restore(),...). Interrupts are disabled here and even if something will trigger manual schedulling it won't happen as: #define preemptible() (preempt_count() == 0 && !irqs_disabled()) I don't see a good documentation but Documentation/preempt-locking.txt says: "PREVENTING PREEMPTION USING INTERRUPT DISABLING It is possible to prevent a preemption event using local_irq_disable and local_irq_save. Note, when doing so, you must be very careful to not cause an event that would set need_resched and result in a preemption check. When in doubt, rely on locking or explicit preemption disabling." Spinlock with irqs disabled (spin_lock_irqsave()) would work too but just because we're disabling interrupts. We don't need a lock here because hv_set_host_time() is called from a workqueue and double execution is impossible. Mutex would not help at all as it is sleepable (so we may get a timer interrupt). The point I'm trying to make is: disabling interrupts is enough to prevent other code from being executed on the same CPU in the middle of hv_set_host_time(). The only exception I see is NMIs but we don't usually get them and there is no easy way of protection. -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/2] staging: greybus: loopback_test: Fix race preventing test completion
On Tue, Jan 3, 2017 at 12:51 PM, Bryan O'Donoghue wrote: > On 03/01/17 10:17, Axel Haslam wrote: >> as i see it, a successful test means: >> 1- each interfaces should send an event upon completion. > yes > >> 2- the iteration count should equal iteration_max on each of the interfaces > > yes > >> what am i missing? > > count == max implies the kernel thread is still working and we should > continue to sleep. i think you mean count != max here. > > I am interested in why count != max when in user-space number_of_events > == t->poll_count - I don't see how that's logically possible, though it right, i think this is the issue. > makes me wonder why the check is_complete() was put in place - you must > have seen this yourself ? as a general sanity check. in case the event count were wrong for some reason. which seems to be happening here. i dont remember if i was actually seeing it and under which case, i will give it a try and see if i can reproduce it. looking at your patch it seems the count will eventually complete and equal "max_iterations" maybe the event is somehow sent early. > > As a fundamental though - unless count == max, the test is not done. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/4] hv_util: use do_adjtimex() to update system time
"Alex Ng (LIS)" writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Monday, January 2, 2017 11:41 AM >> To: de...@linuxdriverproject.org >> Cc: linux-ker...@vger.kernel.org; KY Srinivasan ; >> Haiyang Zhang ; John Stultz >> ; Thomas Gleixner ; Alex Ng >> (LIS) >> Subject: [PATCH 3/4] hv_util: use do_adjtimex() to update system time >> >> With TimeSync version 4 protocol support we started updating system time >> continuously through the whole lifetime of Hyper-V guests. Every 5 seconds >> there is a time sample from the host which triggers do_settimeofday[64](). >> While the time from the host is very accurate such adjustments may cause >> issues: >> - Time is jumping forward and backward, some applications may misbehave. >> - In case an NTP client is run in parallel things may go south, e.g. when >> an NTP client tries to adjust tick/frequency with ADJ_TICK/ADJ_FREQUENCY >> the Hyper-V module will not see this changes and time will oscillate and >> never converge. >> - Systemd starts annoying you by printing "Time has been changed" every 5 >> seconds to the system log. > > These are all good points. I am working on a patch to address point 2. > It will allow new TimeSync behavior to be disabled even if the TimeSync IC is > enabled from the host. This can be set to prevent TimeSync IC from interfering > with NTP client. > Good, this can happen in parallel to my series, right? >> >> Instead of calling do_settimeofday64() we can pretend being an NTP client >> and use do_adjtimex(). >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> drivers/hv/hv_util.c | 25 ++--- >> 1 file changed, 22 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index >> 94719eb..4c0fbb0 100644 >> --- a/drivers/hv/hv_util.c >> +++ b/drivers/hv/hv_util.c >> @@ -182,9 +182,10 @@ struct adj_time_work { static void >> hv_set_host_time(struct work_struct *work) { >> struct adj_time_work*wrk; >> -s64 host_tns; >> +s64 host_tns, our_tns, delta; >> u64 newtime; >> -struct timespec64 host_ts; >> +struct timespec64 host_ts, our_ts; >> +struct timex txc = {0}; >> >> wrk = container_of(work, struct adj_time_work, work); >> >> @@ -205,7 +206,25 @@ static void hv_set_host_time(struct work_struct >> *work) >> host_tns = (newtime - WLTIMEDELTA) * 100; >> host_ts = ns_to_timespec64(host_tns); >> >> -do_settimeofday64(&host_ts); >> +getnstimeofday64(&our_ts); >> +our_tns = timespec64_to_ns(&our_ts); >> + >> +/* Difference between our time and host time */ >> +delta = host_tns - our_tns; >> + >> +/* Try adjusting time by using phase adjustment if possible */ >> +if (abs(delta) > MAXPHASE) { >> +do_settimeofday64(&host_ts); >> +return; >> +} > > We should also call do_settimeofday64() if the host sends flag > ICTIMESYNCFLAG_SYNC. This is a signal from host that the guest > shall sync with host time immediately (often when the guest has > just booted). Ok, point taken, will do in v2. We don't get ICTIMESYNCFLAG_SYNC very often, right? > >> + >> +txc.modes = ADJ_TICK | ADJ_FREQUENCY | ADJ_OFFSET | >> ADJ_NANO | >> +ADJ_STATUS; >> +txc.tick = TICK_USEC; >> +txc.freq = 0; > > I'm not familiar with the ADJ_FREQUENCY flag. What does setting this to > 'zero' achieve? > Are there any side-effects from doing this? Zero means no frequency adjustment required (we reset it in case it was previously made by an NTP client). > >> +txc.status = STA_PLL; >> +txc.offset = delta; >> +do_adjtimex(&txc); > > Might be a good idea to handle the return code from do_adjtimex() and log > something > in case of error. I can add a debug message here but as this is a regular action we don't want to get a flood of messages in case this fails permanently. I'd avoid printing info messages here. > >> } >> >> /* >> -- >> 2.9.3 -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/6] staging: fbtft: do not override DMA coherent mask
On Tue, 2017-01-03 at 12:51 +0200, Andy Shevchenko wrote: > On Mon, 2017-01-02 at 19:14 +0100, Noralf Trønnes wrote: > > Den 02.01.2017 12:35, skrev Andy Shevchenko: > > > Usually it's not consumer's business to override resources passed > > > from > > > provider, in particularly DMA coherent mask. > > > --- a/drivers/staging/fbtft/fbtft-core.c > > > +++ b/drivers/staging/fbtft/fbtft-core.c > > > @@ -841,7 +841,6 @@ struct fb_info *fbtft_framebuffer_alloc(struct > > > fbtft_display *display, > > > if (txbuflen > 0) { > > > #ifdef CONFIG_HAS_DMA > > > if (dma) { > > > - dev->coherent_dma_mask = ~0; > > > > Can we make this conditional like in of_dma_configure(): > > > > if (!dev->coherent_dma_mask) > > dev->coherent_dma_mask = DMA_BIT_MASK(32); > > > > If not, I guess the mask has to be set before adding the spi device > > in > > fbtft_device.c to keep it from breaking. > > Good point. I will check this. So, I was too fast. Clearly an SPI slave device does not and *should not* know about DMA capabilities of SPI *host* controller. It's completely out of slave's business. The masks and other DMA properties only makes sense for the device which *actually does DMA*, and apparently SPI slaves do not suit that category (there are might be real SPI slaves with private DMA engines, though it's another story). Thus, the patch from my point of view should be kept in the same form. Regarding to the kbuild bot warning, would you like me to resend it fixed? Whatever the decision, I will wait for more comments and hopefully your tags. P.S. I dunno how it did work before, since DMA mask of slave device basically has no effect. Perhaps first argument to allocator should be NULL. That's only amendment I can see to this particular patch. -- Andy Shevchenko Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: selftest: Make brw_inject_one_error() static
On Fri, Dec 23, 2016 at 09:12:44PM +0530, Karthik Nayak wrote: > Since the function brw_inject_one_error() is used only within > brw_test.c, make it static. This was reported as a warning by sparse. > > Signed-off-by: Karthik Nayak > --- > drivers/staging/lustre/lnet/selftest/brw_test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Someone else sent this same patch before you did, sorry :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: headers: potential UAPI headers
On Mon, Dec 19, 2016 at 12:06:47PM -0500, James Simmons wrote: > Not for landing. This is the purposed UAPI headers > with the removal of unlikely and debugging macros. > This is just for feedback to see if this is acceptable > for the upstream client. > > Signed-off-by: James Simmons > --- > .../lustre/lustre/include/lustre/lustre_fid.h | 353 > + > .../lustre/lustre/include/lustre/lustre_ostid.h| 233 ++ Can you make a lustre "uapi" directory so we can see which files you really want to be UAPI and which you don't as time goes on? > 2 files changed, 586 insertions(+) > create mode 100644 drivers/staging/lustre/lustre/include/lustre/lustre_fid.h > create mode 100644 > drivers/staging/lustre/lustre/include/lustre/lustre_ostid.h > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_fid.h > b/drivers/staging/lustre/lustre/include/lustre/lustre_fid.h > new file mode 100644 > index 000..cb6afa5 > --- /dev/null > +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_fid.h > @@ -0,0 +1,353 @@ > +/* > + * GPL HEADER START > + * > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 only, > + * as published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but > + * WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * General Public License version 2 for more details (a copy is included > + * in the LICENSE file that accompanied this code). > + * > + * You should have received a copy of the GNU General Public License > + * version 2 along with this program; If not, see > + * http://www.gnu.org/licenses/gpl-2.0.html > + * > + * GPL HEADER END > + */ > +/* > + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights > reserved. > + * Use is subject to license terms. > + * > + * Copyright (c) 2011, 2014, Intel Corporation. > + * > + * Copyright 2016 Cray Inc, all rights reserved. > + * Author: Ben Evans. > + * > + * all fid manipulation functions go here > + * > + * FIDS are globally unique within a Lustre filessytem, and are made up > + * of three parts: sequence, Object ID, and version. > + * > + */ > +#ifndef _LUSTRE_LUSTRE_FID_H_ > +#define _LUSTRE_LUSTRE_FID_H_ > + > +#include > + > +/** returns fid object sequence */ > +static inline __u64 fid_seq(const struct lu_fid *fid) > +{ > + return fid->f_seq; > +} > + > +/** returns fid object id */ > +static inline __u32 fid_oid(const struct lu_fid *fid) > +{ > + return fid->f_oid; > +} > + > +/** returns fid object version */ > +static inline __u32 fid_ver(const struct lu_fid *fid) > +{ > + return fid->f_ver; > +} > + > +static inline void fid_zero(struct lu_fid *fid) > +{ > + memset(fid, 0, sizeof(*fid)); > +} > + > +static inline __u64 fid_ver_oid(const struct lu_fid *fid) > +{ > + return (__u64)fid_ver(fid) << 32 | fid_oid(fid); > +} > + > +static inline bool fid_seq_is_mdt0(__u64 seq) > +{ > + return seq == FID_SEQ_OST_MDT0; > +} > + > +static inline bool fid_seq_is_mdt(__u64 seq) > +{ > + return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; > +}; > + > +static inline bool fid_seq_is_echo(__u64 seq) > +{ > + return seq == FID_SEQ_ECHO; > +} > + > +static inline bool fid_is_echo(const struct lu_fid *fid) > +{ > + return fid_seq_is_echo(fid_seq(fid)); > +} > + > +static inline bool fid_seq_is_llog(__u64 seq) > +{ > + return seq == FID_SEQ_LLOG; > +} > + > +static inline bool fid_is_llog(const struct lu_fid *fid) > +{ > + /* file with OID == 0 is not llog but contains last oid */ > + return fid_seq_is_llog(fid_seq(fid)) && fid_oid(fid) > 0; > +} > + > +static inline bool fid_seq_is_rsvd(__u64 seq) > +{ > + return seq > FID_SEQ_OST_MDT0 && seq <= FID_SEQ_RSVD; > +}; > + > +static inline bool fid_seq_is_special(__u64 seq) > +{ > + return seq == FID_SEQ_SPECIAL; > +}; > + > +static inline bool fid_seq_is_local_file(__u64 seq) > +{ > + return seq == FID_SEQ_LOCAL_FILE || > +seq == FID_SEQ_LOCAL_NAME; > +}; > + > +static inline bool fid_seq_is_root(__u64 seq) > +{ > + return seq == FID_SEQ_ROOT; > +} > + > +static inline bool fid_seq_is_dot(__u64 seq) > +{ > + return seq == FID_SEQ_DOT_LUSTRE; > +} > + > +static inline bool fid_seq_is_default(__u64 seq) > +{ > + return seq == FID_SEQ_LOV_DEFAULT; > +} > + > +static inline bool fid_is_mdt0(const struct lu_fid *fid) > +{ > + return fid_seq_is_mdt0(fid_seq(fid)); > +} > + > +static inline void lu_root_fid(struct lu_fid *fid) > +{ > + fid->f_seq = FID_SEQ_ROOT; > + fid->f_oid = FID_OID_ROOT; > + fid->f_ver = 0; > +} > + > +static inline void lu_echo_root_fid(struct lu_fid *fid) > +{ > + fid->f_seq = FID_SEQ_ROOT; > + fid->f_oid
Re: [PATCH] staging : lustre : Remove braces from single-line body.
On Wed, Dec 28, 2016 at 07:40:09PM +0530, Tabrez khan wrote: > Remove unnecessary braces from single-line if statement. > This warning is found using checkpatch.pl. > > Signed-off-by: Tabrez khan > --- > drivers/staging/lustre/lustre/ptlrpc/import.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) You have sent me 5 patches, with 4 of them having duplicated subject lines, yet they do different things. Also, what order am I supposed to apply these patches in? Please resend them as a patch series, properly numbered, and with unique subjects. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 11/12] staging: unisys: visorbus: visorchipset.c: Don't check for more than PAGE_SIZE length
On Thu, Dec 22, 2016 at 11:09:08AM -0500, David Kershner wrote: > From: David Binder > > Since a procfs or sysfs entry is allocated 1 page of memory (4096 bytes) > by default, there is no need to enforce this limit in the driver. This > patch corrects visorbus/visorchipset.c. What does procfs have to do with this patch? confused, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 12/12] staging: unisys: visorbus: Don't check for more than PAGE_SIZE length in visorbus
On Thu, Dec 22, 2016 at 11:09:09AM -0500, David Kershner wrote: > From: David Binder > > Since a procfs or sysfs entry is allocated 1 page of memory (4096 bytes) > by default, there is no need to enforce this limit in the driver. This > patch corrects visorbus/visorbus_main.c. Again, why mention procfs? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: cb_pcidas64: Fixed coding issue about multiple line dereferencing
On Mon, Dec 19, 2016 at 08:44:28PM +0530, devendra sharma wrote: > Fixed coding issue about multiple line dereferencing > > Signed-off-by: Devendra Sharma > --- > drivers/staging/comedi/drivers/cb_pcidas64.c | 13 + > 1 file changed, 5 insertions(+), 8 deletions(-) Always test-build your changes so you don't get grumpy emails from maintainers asking you to always test-build your changes before sending them a patch :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] drivers/staging/dgnc/dgnc_mgmt.c : add some goto statements for error handling
On Thu, Dec 22, 2016 at 05:25:24PM +0100, Francis Laniel wrote: > > I follow Dan Carpenter's advices and I update my patch. > I just add goto statements for error handling. > > > Good bye. That's a very strange changelog text, please look at how other kernel patches are written and redo this and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/14] staging: greybus: arche-platform: Fix typo in the comments.
From: Emmanuil Chatzipetru This warning is caught by checkpatch.pl: - CHECK: 'begining' may be misspelled - perhaps 'beginning'? Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/arche-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 338c2d3ee842..19bfce684335 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -312,7 +312,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid) if (arche_pdata->wake_detect_state == WD_STATE_IDLE) { arche_pdata->wake_detect_start = jiffies; /* -* In the begining, when wake/detect goes low (first time), we assume +* In the beginning, when wake/detect goes low (first time), we assume * it is meant for coldboot and set the flag. If wake/detect line stays low * beyond 30msec, then it is coldboot else fallback to standby boot. */ -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/14] staging: greybus: arche-apb-ctrl: Fix open parenthesis alignment.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/arche-apb-ctrl.c | 43 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c index c41b52addd25..99d3416bfce3 100644 --- a/drivers/staging/greybus/arche-apb-ctrl.c +++ b/drivers/staging/greybus/arche-apb-ctrl.c @@ -69,15 +69,14 @@ static int coldboot_seq(struct platform_device *pdev) struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev); int ret; - if (apb->init_disabled || - apb->state == ARCHE_PLATFORM_STATE_ACTIVE) + if (apb->init_disabled || apb->state == ARCHE_PLATFORM_STATE_ACTIVE) return 0; /* Hold APB in reset state */ assert_reset(apb->resetn_gpio); if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && - gpio_is_valid(apb->spi_en_gpio)) + gpio_is_valid(apb->spi_en_gpio)) devm_gpio_free(dev, apb->spi_en_gpio); /* Enable power to APB */ @@ -120,7 +119,7 @@ static int fw_flashing_seq(struct platform_device *pdev) int ret; if (apb->init_disabled || - apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING) + apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING) return 0; ret = regulator_enable(apb->vcore); @@ -144,7 +143,7 @@ static int fw_flashing_seq(struct platform_device *pdev) flags = GPIOF_OUT_INIT_LOW; ret = devm_gpio_request_one(dev, apb->spi_en_gpio, - flags, "apb_spi_en"); + flags, "apb_spi_en"); if (ret) { dev_err(dev, "Failed requesting SPI bus en gpio %d\n", apb->spi_en_gpio); @@ -169,11 +168,11 @@ static int standby_boot_seq(struct platform_device *pdev) /* Even if it is in OFF state, then we do not want to change the state */ if (apb->state == ARCHE_PLATFORM_STATE_STANDBY || - apb->state == ARCHE_PLATFORM_STATE_OFF) + apb->state == ARCHE_PLATFORM_STATE_OFF) return 0; if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && - gpio_is_valid(apb->spi_en_gpio)) + gpio_is_valid(apb->spi_en_gpio)) devm_gpio_free(dev, apb->spi_en_gpio); /* @@ -198,7 +197,7 @@ static void poweroff_seq(struct platform_device *pdev) return; if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && - gpio_is_valid(apb->spi_en_gpio)) + gpio_is_valid(apb->spi_en_gpio)) devm_gpio_free(dev, apb->spi_en_gpio); /* disable the clock */ @@ -252,8 +251,8 @@ void apb_ctrl_poweroff(struct device *dev) poweroff_seq(to_platform_device(dev)); } -static ssize_t state_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t state_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct platform_device *pdev = to_platform_device(dev); struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev); @@ -298,8 +297,8 @@ static ssize_t state_store(struct device *dev, return ret ? ret : count; } -static ssize_t state_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t state_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct arche_apb_ctrl_drvdata *apb = dev_get_drvdata(dev); @@ -321,7 +320,7 @@ static ssize_t state_show(struct device *dev, static DEVICE_ATTR_RW(state); static int apb_ctrl_get_devtree_data(struct platform_device *pdev, - struct arche_apb_ctrl_drvdata *apb) +struct arche_apb_ctrl_drvdata *apb) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; @@ -333,10 +332,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev, return apb->resetn_gpio; } ret = devm_gpio_request_one(dev, apb->resetn_gpio, - GPIOF_OUT_INIT_LOW, "apb-reset"); + GPIOF_OUT_INIT_LOW, "apb-reset"); if (ret) { dev_err(dev, "Failed requesting reset gpio %d\n", - apb->resetn_gpio); + apb->resetn_gpio); return ret; } @@ -346,10 +345,10 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev, retur
[PATCH 01/14] staging: greybus: arche-apb-ctrl: Remove multiple blank lines.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Please don't use multiple blank lines Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/arche-apb-ctrl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c index 3fda0cd6bb42..c41b52addd25 100644 --- a/drivers/staging/greybus/arche-apb-ctrl.c +++ b/drivers/staging/greybus/arche-apb-ctrl.c @@ -21,7 +21,6 @@ #include #include "arche_platform.h" - struct arche_apb_ctrl_drvdata { /* Control GPIO signals to and from AP <=> AP Bridges */ int resetn_gpio; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/14] staging: greybus: bootrom: Fix line over 80 characters warning.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: WARNING: line over 80 characters Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/bootrom.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index 9baf16014d9a..a060bc4c54ad 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -220,7 +220,8 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op) size_response = op->response->payload; size_response->size = cpu_to_le32(bootrom->fw->size); - dev_dbg(dev, "%s: firmware size %d bytes\n", __func__, size_response->size); + dev_dbg(dev, "%s: firmware size %d bytes\n", + __func__, size_response->size); unlock: mutex_unlock(&bootrom->mutex); @@ -287,8 +288,8 @@ static int gb_bootrom_get_firmware(struct gb_operation *op) firmware_response = op->response->payload; memcpy(firmware_response->data, fw->data + offset, size); - dev_dbg(dev, "responding with firmware (offs = %u, size = %u)\n", offset, - size); + dev_dbg(dev, "responding with firmware (offs = %u, size = %u)\n", + offset, size); unlock: mutex_unlock(&bootrom->mutex); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/14] staging: greybus: camera: Fix NULL comparison to preferred style.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Comparison to NULL could be written "!token" Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/camera.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 0c731153a4dc..d1193a1a876b 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -919,7 +919,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, /* Retrieve number of streams to configure */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) return -EINVAL; ret = kstrtouint(token, 10, &nstreams); @@ -930,7 +930,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, return -EINVAL; token = strsep(&buf, ";"); - if (token == NULL) + if (!token) return -EINVAL; ret = kstrtouint(token, 10, &flags); @@ -947,7 +947,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, /* width */ token = strsep(&buf, ";"); - if (token == NULL) { + if (!token) { ret = -EINVAL; goto done; } @@ -957,7 +957,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, /* height */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) goto done; ret = kstrtouint(token, 10, &stream->height); @@ -966,7 +966,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, /* Image format code */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) goto done; ret = kstrtouint(token, 16, &stream->format); @@ -1010,7 +1010,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, /* Request id */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) return -EINVAL; ret = kstrtouint(token, 10, &request_id); if (ret < 0) @@ -1018,7 +1018,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, /* Stream mask */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) return -EINVAL; ret = kstrtouint(token, 16, &streams_mask); if (ret < 0) @@ -1026,7 +1026,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, /* number of frames */ token = strsep(&buf, ";"); - if (token == NULL) + if (!token) return -EINVAL; ret = kstrtouint(token, 10, &num_frames); if (ret < 0) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/14] staging: greybus: connection: Remove multiple blank lines
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Please don't use multiple blank lines Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/connection.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index e710d431f7b0..560dc8eaa841 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -12,17 +12,13 @@ #include "greybus.h" #include "greybus_trace.h" - #define GB_CONNECTION_CPORT_QUIESCE_TIMEOUT1000 - static void gb_connection_kref_release(struct kref *kref); - static DEFINE_SPINLOCK(gb_connections_lock); static DEFINE_MUTEX(gb_connection_mutex); - /* Caller holds gb_connection_mutex. */ static bool gb_connection_cport_in_use(struct gb_interface *intf, u16 cport_id) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/14] staging: greybus: bootrom: Fix open parenthesis alignment.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/bootrom.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index 5f90721bcc51..9baf16014d9a 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -175,7 +175,7 @@ static int find_firmware(struct gb_bootrom *bootrom, u8 stage) firmware_name); rc = request_firmware(&bootrom->fw, firmware_name, - &connection->bundle->dev); + &connection->bundle->dev); if (rc) { dev_err(&connection->bundle->dev, "failed to find %s firmware (%d)\n", firmware_name, rc); @@ -272,7 +272,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op) if (offset >= fw->size || size > fw->size - offset) { dev_warn(dev, "bad firmware request (offs = %u, size = %u)\n", - offset, size); +offset, size); ret = -EINVAL; goto unlock; } @@ -385,15 +385,15 @@ static int gb_bootrom_get_version(struct gb_bootrom *bootrom) sizeof(response)); if (ret) { dev_err(&bundle->dev, - "failed to get protocol version: %d\n", - ret); + "failed to get protocol version: %d\n", + ret); return ret; } if (response.major > request.major) { dev_err(&bundle->dev, - "unsupported major protocol version (%u > %u)\n", - response.major, request.major); + "unsupported major protocol version (%u > %u)\n", + response.major, request.major); return -ENOTSUPP; } @@ -401,13 +401,13 @@ static int gb_bootrom_get_version(struct gb_bootrom *bootrom) bootrom->protocol_minor = response.minor; dev_dbg(&bundle->dev, "%s - %u.%u\n", __func__, response.major, - response.minor); + response.minor); return 0; } static int gb_bootrom_probe(struct gb_bundle *bundle, - const struct greybus_bundle_id *id) + const struct greybus_bundle_id *id) { struct greybus_descriptor_cport *cport_desc; struct gb_connection *connection; @@ -426,8 +426,8 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, return -ENOMEM; connection = gb_connection_create(bundle, - le16_to_cpu(cport_desc->id), - gb_bootrom_request_handler); + le16_to_cpu(cport_desc->id), + gb_bootrom_request_handler); if (IS_ERR(connection)) { ret = PTR_ERR(connection); goto err_free_bootrom; @@ -464,7 +464,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, NULL, 0); if (ret) { dev_err(&connection->bundle->dev, - "failed to send AP READY: %d\n", ret); + "failed to send AP READY: %d\n", ret); goto err_cancel_timeout; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/14] staging: greybus: control: Remove multiple blank lines
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Please don't use multiple blank lines Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/control.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c index 4716190e740a..2d2ca3397395 100644 --- a/drivers/staging/greybus/control.c +++ b/drivers/staging/greybus/control.c @@ -16,7 +16,6 @@ #define GB_CONTROL_VERSION_MAJOR 0 #define GB_CONTROL_VERSION_MINOR 1 - static int gb_control_get_version(struct gb_control *control) { struct gb_interface *intf = control->connection->intf; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/14] staging: greybus: core: Fix open parenthesis alingment
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 1049e9c0edb0..d4df98c83a73 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -29,7 +29,7 @@ int greybus_disabled(void) EXPORT_SYMBOL_GPL(greybus_disabled); static bool greybus_match_one_id(struct gb_bundle *bundle, -const struct greybus_bundle_id *id) +const struct greybus_bundle_id *id) { if ((id->match_flags & GREYBUS_ID_MATCH_VENDOR) && (id->vendor != bundle->intf->vendor_id)) @@ -269,7 +269,7 @@ static int greybus_remove(struct device *dev) } int greybus_register_driver(struct greybus_driver *driver, struct module *owner, - const char *mod_name) + const char *mod_name) { int retval; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/14] staging: greybus: arche-platform: Fix open parenthesis alignment.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/arche-platform.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 19bfce684335..b0882bb04551 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -348,7 +348,7 @@ static int arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdat ret = clk_prepare_enable(arche_pdata->svc_ref_clk); if (ret) { dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n", - ret); + ret); return ret; } @@ -383,7 +383,7 @@ static int arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_p ret = clk_prepare_enable(arche_pdata->svc_ref_clk); if (ret) { dev_err(arche_pdata->dev, "failed to enable svc_ref_clk: %d\n", - ret); + ret); return ret; } @@ -424,8 +424,8 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF); } -static ssize_t state_store(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) +static ssize_t state_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct platform_device *pdev = to_platform_device(dev); struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev); @@ -498,8 +498,8 @@ static ssize_t state_store(struct device *dev, return ret ? ret : count; } -static ssize_t state_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t state_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct arche_platform_drvdata *arche_pdata = dev_get_drvdata(dev); @@ -579,7 +579,7 @@ static int arche_platform_probe(struct platform_device *pdev) return ret; } ret = gpio_direction_output(arche_pdata->svc_reset_gpio, - arche_pdata->is_reset_act_hi); + arche_pdata->is_reset_act_hi); if (ret) { dev_err(dev, "failed to set svc-reset gpio dir:%d\n", ret); return ret; @@ -643,7 +643,7 @@ static int arche_platform_probe(struct platform_device *pdev) ret = devm_gpio_request(dev, arche_pdata->wake_detect_gpio, "wake detect"); if (ret) { dev_err(dev, "Failed requesting wake_detect gpio %d\n", - arche_pdata->wake_detect_gpio); + arche_pdata->wake_detect_gpio); return ret; } -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/14] staging: greybus: connection: fix open parenthesis alignment
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/connection.c | 71 +- drivers/staging/greybus/power_supply.c | 2 +- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 557075147f2d..e710d431f7b0 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -31,7 +31,7 @@ static bool gb_connection_cport_in_use(struct gb_interface *intf, u16 cport_id) list_for_each_entry(connection, &hd->connections, hd_links) { if (connection->intf == intf && - connection->intf_cport_id == cport_id) + connection->intf_cport_id == cport_id) return true; } @@ -79,7 +79,7 @@ gb_connection_hd_find(struct gb_host_device *hd, u16 cport_id) * received on the bundle. */ void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id, - u8 *data, size_t length) + u8 *data, size_t length) { struct gb_connection *connection; @@ -118,8 +118,8 @@ static void gb_connection_init_name(struct gb_connection *connection) cport_id = connection->intf_cport_id; } - snprintf(connection->name, sizeof(connection->name), - "%u/%u:%u", hd_cport_id, intf_id, cport_id); + snprintf(connection->name, sizeof(connection->name), "%u/%u:%u", +hd_cport_id, intf_id, cport_id); } /* @@ -147,10 +147,10 @@ static void gb_connection_init_name(struct gb_connection *connection) */ static struct gb_connection * _gb_connection_create(struct gb_host_device *hd, int hd_cport_id, - struct gb_interface *intf, - struct gb_bundle *bundle, int cport_id, - gb_request_handler_t handler, - unsigned long flags) + struct gb_interface *intf, + struct gb_bundle *bundle, int cport_id, + gb_request_handler_t handler, + unsigned long flags) { struct gb_connection *connection; int ret; @@ -231,7 +231,7 @@ _gb_connection_create(struct gb_host_device *hd, int hd_cport_id, struct gb_connection * gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id, - gb_request_handler_t handler) + gb_request_handler_t handler) { return _gb_connection_create(hd, hd_cport_id, NULL, NULL, 0, handler, GB_CONNECTION_FLAG_HIGH_PRIO); @@ -247,7 +247,7 @@ gb_connection_create_control(struct gb_interface *intf) struct gb_connection * gb_connection_create(struct gb_bundle *bundle, u16 cport_id, - gb_request_handler_t handler) +gb_request_handler_t handler) { struct gb_interface *intf = bundle->intf; @@ -258,8 +258,8 @@ EXPORT_SYMBOL_GPL(gb_connection_create); struct gb_connection * gb_connection_create_flags(struct gb_bundle *bundle, u16 cport_id, - gb_request_handler_t handler, - unsigned long flags) + gb_request_handler_t handler, + unsigned long flags) { struct gb_interface *intf = bundle->intf; @@ -273,7 +273,7 @@ EXPORT_SYMBOL_GPL(gb_connection_create_flags); struct gb_connection * gb_connection_create_offloaded(struct gb_bundle *bundle, u16 cport_id, - unsigned long flags) + unsigned long flags) { flags |= GB_CONNECTION_FLAG_OFFLOADED; @@ -293,7 +293,7 @@ static int gb_connection_hd_cport_enable(struct gb_connection *connection) connection->flags); if (ret) { dev_err(&hd->dev, "%s: failed to enable host cport: %d\n", - connection->name, ret); + connection->name, ret); return ret; } @@ -311,7 +311,7 @@ static void gb_connection_hd_cport_disable(struct gb_connection *connection) ret = hd->driver->cport_disable(hd, connection->hd_cport_id); if (ret) { dev_err(&hd->dev, "%s: failed to disable host cport: %d\n", - connection->name, ret); + connection->name, ret); } } @@ -326,7 +326,7 @@ static int gb_connection_hd_cport_connected(struct gb_connection *connection) ret = hd->driver->cport_connected(hd, connection->hd_cport_id); if (re
[PATCH 12/14] staging: greybus: control: fix open parenthesis alingment
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/control.c | 46 +++ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c index 2d2ca3397395..5e3bd969ba31 100644 --- a/drivers/staging/greybus/control.c +++ b/drivers/staging/greybus/control.c @@ -32,15 +32,15 @@ static int gb_control_get_version(struct gb_control *control) sizeof(response)); if (ret) { dev_err(&intf->dev, - "failed to get control-protocol version: %d\n", - ret); + "failed to get control-protocol version: %d\n", + ret); return ret; } if (response.major > request.major) { dev_err(&intf->dev, - "unsupported major control-protocol version (%u > %u)\n", - response.major, request.major); + "unsupported major control-protocol version (%u > %u)\n", + response.major, request.major); return -ENOTSUPP; } @@ -48,13 +48,13 @@ static int gb_control_get_version(struct gb_control *control) control->protocol_minor = response.minor; dev_dbg(&intf->dev, "%s - %u.%u\n", __func__, response.major, - response.minor); + response.minor); return 0; } static int gb_control_get_bundle_version(struct gb_control *control, - struct gb_bundle *bundle) +struct gb_bundle *bundle) { struct gb_interface *intf = control->connection->intf; struct gb_control_bundle_version_request request; @@ -69,8 +69,8 @@ static int gb_control_get_bundle_version(struct gb_control *control, &response, sizeof(response)); if (ret) { dev_err(&intf->dev, - "failed to get bundle %u class version: %d\n", - bundle->id, ret); + "failed to get bundle %u class version: %d\n", + bundle->id, ret); return ret; } @@ -78,7 +78,7 @@ static int gb_control_get_bundle_version(struct gb_control *control, bundle->class_minor = response.minor; dev_dbg(&intf->dev, "%s - %u: %u.%u\n", __func__, bundle->id, - response.major, response.minor); + response.major, response.minor); return 0; } @@ -112,7 +112,7 @@ int gb_control_get_manifest_size_operation(struct gb_interface *intf) NULL, 0, &response, sizeof(response)); if (ret) { dev_err(&connection->intf->dev, - "failed to get manifest size: %d\n", ret); + "failed to get manifest size: %d\n", ret); return ret; } @@ -149,16 +149,16 @@ int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id) } int gb_control_disconnecting_operation(struct gb_control *control, - u16 cport_id) + u16 cport_id) { struct gb_control_disconnecting_request *request; struct gb_operation *operation; int ret; operation = gb_operation_create_core(control->connection, - GB_CONTROL_TYPE_DISCONNECTING, - sizeof(*request), 0, 0, - GFP_KERNEL); +GB_CONTROL_TYPE_DISCONNECTING, +sizeof(*request), 0, 0, +GFP_KERNEL); if (!operation) return -ENOMEM; @@ -168,7 +168,7 @@ int gb_control_disconnecting_operation(struct gb_control *control, ret = gb_operation_request_send_sync(operation); if (ret) { dev_err(&control->dev, "failed to send disconnecting: %d\n", - ret); + ret); } gb_operation_put(operation); @@ -450,7 +450,7 @@ int gb_control_interface_hibernate_abort(struct gb_control *control) } static ssize_t vendor_string_show(struct device *dev, - struct device_attribute *attr, char *buf) + struct device_attribute *attr, char *buf) { struct gb_control *control = to_gb_control(dev); @@ -459,7 +459,7 @@ static ssize_t vendor_string_show(struct device *dev, static
[PATCH 07/14] staging: greybus: camera: Fix open parenthesis alingment.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Alignment should match open parenthesis Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/camera.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 0ee291ca2c72..0c731153a4dc 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -842,8 +842,8 @@ static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams, } static int gb_camera_op_capture(void *priv, u32 request_id, - unsigned int streams, unsigned int num_frames, - size_t settings_size, const void *settings) + unsigned int streams, unsigned int num_frames, + size_t settings_size, const void *settings) { struct gb_camera *gcam = priv; @@ -870,7 +870,7 @@ static const struct gb_camera_ops gb_cam_ops = { */ static ssize_t gb_camera_debugfs_capabilities(struct gb_camera *gcam, - char *buf, size_t len) + char *buf, size_t len) { struct gb_camera_debugfs_buffer *buffer = &gcam->debugfs.buffers[GB_CAMERA_DEBUGFS_BUFFER_CAPABILITIES]; @@ -906,7 +906,7 @@ static ssize_t gb_camera_debugfs_capabilities(struct gb_camera *gcam, } static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, - char *buf, size_t len) + char *buf, size_t len) { struct gb_camera_debugfs_buffer *buffer = &gcam->debugfs.buffers[GB_CAMERA_DEBUGFS_BUFFER_STREAMS]; @@ -1000,7 +1000,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, }; static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, - char *buf, size_t len) +char *buf, size_t len) { unsigned int request_id; unsigned int streams_mask; @@ -1041,7 +1041,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, } static ssize_t gb_camera_debugfs_flush(struct gb_camera *gcam, - char *buf, size_t len) + char *buf, size_t len) { struct gb_camera_debugfs_buffer *buffer = &gcam->debugfs.buffers[GB_CAMERA_DEBUGFS_BUFFER_FLUSH]; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/14] staging: greybus: core: Fix NULL comparison to preferred style.
From: Emmanuil Chatzipetru Fix coding style issue caught by checkpatch.pl related to the following warning: - CHECK: Comparison to NULL could be written "!id" Signed-off-by: Emmanuil Chatzipetru --- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index d4df98c83a73..5f9412c51dae 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -49,7 +49,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle, static const struct greybus_bundle_id * greybus_match_id(struct gb_bundle *bundle, const struct greybus_bundle_id *id) { - if (id == NULL) + if (!id) return NULL; for (; id->vendor || id->product || id->class || id->driver_info; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/14] staging: greybus: arche-apb-ctrl: Remove multiple blank lines.
On Tue, Jan 03, 2017 at 03:33:03PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: Please don't use multiple blank lines > > Signed-off-by: Emmanuil Chatzipetru > --- > drivers/staging/greybus/arche-apb-ctrl.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/staging/greybus/arche-apb-ctrl.c > b/drivers/staging/greybus/arche-apb-ctrl.c > index 3fda0cd6bb42..c41b52addd25 100644 > --- a/drivers/staging/greybus/arche-apb-ctrl.c > +++ b/drivers/staging/greybus/arche-apb-ctrl.c > @@ -21,7 +21,6 @@ > #include > #include "arche_platform.h" > > - Using double new lines like this is perfectly fine, so drop this one. > struct arche_apb_ctrl_drvdata { > /* Control GPIO signals to and from AP <=> AP Bridges */ > int resetn_gpio; Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 02/14] staging: greybus: arche-apb-ctrl: Fix open parenthesis alignment.
On Tue, Jan 03, 2017 at 03:33:04PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: Alignment should match open parenthesis This is not even a warning (hint: "CHECK") and not something that is mandated by any coding standard. Please drop this one and all similar patches in this series. Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 03/14] staging: greybus: arche-platform: Fix typo in the comments.
On Tue, Jan 03, 2017 at 03:33:05PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > This warning is caught by checkpatch.pl: > - CHECK: 'begining' may be misspelled - perhaps 'beginning'? > > Signed-off-by: Emmanuil Chatzipetru Acked-by: Johan Hovold ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 06/14] staging: greybus: bootrom: Fix line over 80 characters warning.
On Tue, Jan 03, 2017 at 03:33:08PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: WARNING: line over 80 characters > > Signed-off-by: Emmanuil Chatzipetru Acked-by: Johan Hovold ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/14] staging: greybus: camera: Fix NULL comparison to preferred style.
On Tue, Jan 03, 2017 at 03:33:10PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: Comparison to NULL could be written "!token" Again, not a warning, and something that is up the author of the code to decide. Please drop. Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 10/14] staging: greybus: connection: Remove multiple blank lines
On Tue, Jan 03, 2017 at 03:33:12PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: Please don't use multiple blank lines Again not a warning, and perfectly valid. Please drop. Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 14/14] staging: greybus: core: Fix NULL comparison to preferred style.
On Tue, Jan 03, 2017 at 03:33:16PM +0100, chatzi.eman...@gmail.com wrote: > From: Emmanuil Chatzipetru > > Fix coding style issue caught by checkpatch.pl related to the following > warning: > - CHECK: Comparison to NULL could be written "!id" Current code is fine. Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: most: change dma_buf variable to __le16
dma_buf is being cast to __le16 *, but it was defined as u16 *. sparse reported this error as: drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: cast to restricted __le16 This patch changes dma_buf from u16 to __le16. Signed-off-by: Ramiro Oliveira --- drivers/staging/most/hdm-usb/hdm_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index d6db0bd65be0..8a6da169bb12 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -145,7 +145,7 @@ static void wq_netinfo(struct work_struct *wq_obj); static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf) { int retval; - u16 *dma_buf = kzalloc(sizeof(u16), GFP_KERNEL); + __le16 *dma_buf = kzalloc(sizeof(__le16), GFP_KERNEL); u8 req_type = USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE; if (!dma_buf) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: comedi: cb_pcidas64: use preferred kernel type u8
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Saber Rezvani Reviewed-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 46 ++-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index cb9c269..55e84d0 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -418,12 +418,12 @@ enum range_cal_i2c_contents { BNC_TRIG_THRESHOLD_0V_BIT = 0x80, }; -static inline uint8_t adc_src_4020_bits(unsigned int source) +static inline u8 adc_src_4020_bits(unsigned int source) { return (source << 4) & ADC_SRC_4020_MASK; }; -static inline uint8_t attenuate_bit(unsigned int channel) +static inline u8 attenuate_bit(unsigned int channel) { /* attenuate channel (+-5V input range) */ return 1 << (channel & 0x3); @@ -443,7 +443,7 @@ static const struct comedi_lrange ai_ranges_64xx = { } }; -static const uint8_t ai_range_code_64xx[8] = { +static const u8 ai_range_code_64xx[8] = { 0x0, 0x1, 0x2, 0x3, /* bipolar 10, 5, 2,5, 1.25 */ 0x8, 0x9, 0xa, 0xb /* unipolar 10, 5, 2.5, 1.25 */ }; @@ -461,7 +461,7 @@ static const struct comedi_lrange ai_ranges_64_mx = { } }; -static const uint8_t ai_range_code_64_mx[7] = { +static const u8 ai_range_code_64_mx[7] = { 0x0, 0x1, 0x2, 0x3, /* bipolar 5, 2.5, 1.25, 0.625 */ 0x9, 0xa, 0xb /* unipolar 5, 2.5, 1.25 */ }; @@ -476,7 +476,7 @@ static const struct comedi_lrange ai_ranges_60xx = { } }; -static const uint8_t ai_range_code_60xx[4] = { +static const u8 ai_range_code_60xx[4] = { 0x0, 0x1, 0x4, 0x7 /* bipolar 10, 5, 0.5, 0.05 */ }; @@ -500,7 +500,7 @@ static const struct comedi_lrange ai_ranges_6030 = { } }; -static const uint8_t ai_range_code_6030[14] = { +static const u8 ai_range_code_6030[14] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, /* bip 10, 5, 2, 1, 0.5, 0.2, 0.1 */ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* uni 10, 5, 2, 1, 0.5, 0.2, 0.1 */ }; @@ -526,7 +526,7 @@ static const struct comedi_lrange ai_ranges_6052 = { } }; -static const uint8_t ai_range_code_6052[15] = { +static const u8 ai_range_code_6052[15] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, /* bipolar 10 ... 0.05 */ 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* unipolar 10 ... 0.1 */ }; @@ -634,7 +634,7 @@ struct pcidas64_board { int ai_bits;/* analog input resolution */ int ai_speed; /* fastest conversion period in ns */ const struct comedi_lrange *ai_range_table; - const uint8_t *ai_range_code; + const u8 *ai_range_code; int ao_nchan; /* number of analog out channels */ int ao_bits;/* analog output resolution */ int ao_scan_speed; /* analog output scan speed */ @@ -1175,7 +1175,7 @@ struct pcidas64_private { /* index of calibration source readable through ai ch0 */ int calibration_source; /* bits written to i2c calibration/range register */ - uint8_t i2c_cal_range_bits; + u8 i2c_cal_range_bits; /* configure digital triggers to trigger on falling edge */ unsigned int ext_trig_falling; short ai_cmd_running; @@ -1657,9 +1657,9 @@ static void i2c_set_scl(struct comedi_device *dev, int state) } } -static void i2c_write_byte(struct comedi_device *dev, uint8_t byte) +static void i2c_write_byte(struct comedi_device *dev, u8 byte) { - uint8_t bit; + u8 bit; unsigned int num_bits = 8; for (bit = 1 << (num_bits - 1); bit; bit >>= 1) { @@ -1700,11 +1700,11 @@ static void i2c_stop(struct comedi_device *dev) } static void i2c_write(struct comedi_device *dev, unsigned int address, - const uint8_t *data, unsigned int length) + const u8 *data, unsigned int length) { struct pcidas64_private *devpriv = dev->private; unsigned int i; - uint8_t bitstream; + u8 bitstream; static const int read_bit = 0x1; /* @@ -1831,7 +1831,7 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, /* set start channel, and rest of settings */ writew(bits, devpriv->main_iobase + ADC_QUEUE_LOAD_REG); } else { - uint8_t old_cal_range_bits = devpriv->i2c_cal_range_bits; + u8 old_cal_range_bits = devpriv->i2c_cal_range_bits; devpriv->i2c_cal_range_bits &= ~ADC_SRC_4020_MASK; if (insn->chanspec & CR_ALT_SOURCE) { @@ -1850,7 +1850,7 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, * as it is very slow */ if (old_cal_range_bits != devpriv->i2c_c
[PATCH 3/3] staging: comedi: cb_pcidas64: use preferred kernel type u32
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u32' over 'uint32_t' Signed-off-by: Saber Rezvani Reviewed-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 38 ++-- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index f60096d..efbf277 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -1132,8 +1132,8 @@ struct pcidas64_private { void __iomem *plx9080_iobase; void __iomem *main_iobase; /* local address (used by dma controller) */ - uint32_t local0_iobase; - uint32_t local1_iobase; + u32 local0_iobase; + u32 local1_iobase; /* dma buffers for analog input */ u16 *ai_buffer[MAX_AI_DMA_RING_COUNT]; /* physical addresses of ai dma buffers */ @@ -1169,9 +1169,9 @@ struct pcidas64_private { u16 hw_config_bits; u16 dac_control1_bits; /* last bits written to plx9080 control register */ - uint32_t plx_control_bits; + u32 plx_control_bits; /* last bits written to plx interrupt control and status register */ - uint32_t plx_intcsr_bits; + u32 plx_intcsr_bits; /* index of calibration source readable through ai ch0 */ int calibration_source; /* bits written to i2c calibration/range register */ @@ -1266,7 +1266,7 @@ static void enable_ai_interrupts(struct comedi_device *dev, { const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; - uint32_t bits; + u32 bits; unsigned long flags; bits = EN_ADC_OVERRUN_BIT | EN_ADC_DONE_INTR_BIT | @@ -1292,7 +1292,7 @@ static void init_plx9080(struct comedi_device *dev) { const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; - uint32_t bits; + u32 bits; void __iomem *plx_iobase = devpriv->plx9080_iobase; devpriv->plx_control_bits = @@ -2279,17 +2279,17 @@ static inline unsigned int dma_transfer_size(struct comedi_device *dev) return num_samples; } -static uint32_t ai_convert_counter_6xxx(const struct comedi_device *dev, +static u32 ai_convert_counter_6xxx(const struct comedi_device *dev, const struct comedi_cmd *cmd) { /* supposed to load counter with desired divisor minus 3 */ return cmd->convert_arg / TIMER_BASE - 3; } -static uint32_t ai_scan_counter_6xxx(struct comedi_device *dev, +static u32 ai_scan_counter_6xxx(struct comedi_device *dev, struct comedi_cmd *cmd) { - uint32_t count; + u32 count; /* figure out how long we need to delay at end of scan */ switch (cmd->scan_begin_src) { @@ -2307,7 +2307,7 @@ static uint32_t ai_scan_counter_6xxx(struct comedi_device *dev, return count - 3; } -static uint32_t ai_convert_counter_4020(struct comedi_device *dev, +static u32 ai_convert_counter_4020(struct comedi_device *dev, struct comedi_cmd *cmd) { struct pcidas64_private *devpriv = dev->private; @@ -2382,7 +2382,7 @@ static void set_ai_pacing(struct comedi_device *dev, struct comedi_cmd *cmd) { const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; - uint32_t convert_counter = 0, scan_counter = 0; + u32 convert_counter = 0, scan_counter = 0; check_adc_timing(dev, cmd); @@ -2572,7 +2572,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) struct pcidas64_private *devpriv = dev->private; struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; - uint32_t bits; + u32 bits; unsigned int i; unsigned long flags; int retval; @@ -2754,7 +2754,7 @@ static void pio_drain_ai_fifo_32(struct comedi_device *dev) struct comedi_subdevice *s = dev->read_subdev; unsigned int nsamples; unsigned int i; - uint32_t fifo_data; + u32 fifo_data; int write_code = readw(devpriv->main_iobase + ADC_WRITE_PNTR_REG) & 0x7fff; int read_code = @@ -2794,7 +2794,7 @@ static void drain_dma_buffers(struct comedi_device *dev, unsigned int channel) const struct pcidas64_board *board = dev->board_ptr; struct pcidas64_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - uint32_t next_transfer_addr; + u32 next_transfer_addr; int j; int num_samples = 0; void __iomem *pci_addr_reg; @@ -3056,8 +3056,8 @@ static irqreturn_t handle_interrupt(int irq, void *d) struct comedi_device *dev = d; struct pcidas64_private *devpriv =
[PATCH 2/3] staging: comedi: cb_pcidas64: use preferred kernel type u16
Fix the checkpatch.pl issue: CHECK: Prefer kernel type 'u16' over 'uint16_t' Signed-off-by: Saber Rezvani Reviewed-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 58 ++-- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index 55e84d0..f60096d 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -238,7 +238,7 @@ enum daq_atrig_low_4020_contents { EXT_START_TRIG_BNC_BIT = 0x2000, }; -static inline uint16_t analog_trig_low_threshold_bits(uint16_t threshold) +static inline u16 analog_trig_low_threshold_bits(u16 threshold) { return threshold & 0xfff; } @@ -280,17 +280,17 @@ enum adc_control1_contents { ADC_MODE_MASK = 0xf000, }; -static inline uint16_t adc_lo_chan_4020_bits(unsigned int channel) +static inline u16 adc_lo_chan_4020_bits(unsigned int channel) { return (channel & 0x3) << 8; }; -static inline uint16_t adc_hi_chan_4020_bits(unsigned int channel) +static inline u16 adc_hi_chan_4020_bits(unsigned int channel) { return (channel & 0x3) << 10; }; -static inline uint16_t adc_mode_bits(unsigned int mode) +static inline u16 adc_mode_bits(unsigned int mode) { return (mode & 0xf) << 12; }; @@ -318,12 +318,12 @@ enum calibration_contents { * 7 : dac channel 1 */ -static inline uint16_t adc_src_bits(unsigned int source) +static inline u16 adc_src_bits(unsigned int source) { return (source & 0xf) << 3; }; -static inline uint16_t adc_convert_chan_4020_bits(unsigned int channel) +static inline u16 adc_convert_chan_4020_bits(unsigned int channel) { return (channel & 0x3) << 8; }; @@ -337,7 +337,7 @@ enum adc_queue_load_contents { QUEUE_EOSCAN_BIT = 0x8000, /* queue end of scan */ }; -static inline uint16_t adc_chan_bits(unsigned int channel) +static inline u16 adc_chan_bits(unsigned int channel) { return channel & 0x3f; }; @@ -384,22 +384,22 @@ enum hw_status_contents { ADC_STOP_BIT = 0x200, }; -static inline uint16_t pipe_full_bits(uint16_t hw_status_bits) +static inline u16 pipe_full_bits(u16 hw_status_bits) { return (hw_status_bits >> 10) & 0x3; }; -static inline unsigned int dma_chain_flag_bits(uint16_t prepost_bits) +static inline unsigned int dma_chain_flag_bits(u16 prepost_bits) { return (prepost_bits >> 6) & 0x3; } -static inline unsigned int adc_upper_read_ptr_code(uint16_t prepost_bits) +static inline unsigned int adc_upper_read_ptr_code(u16 prepost_bits) { return (prepost_bits >> 12) & 0x3; } -static inline unsigned int adc_upper_write_ptr_code(uint16_t prepost_bits) +static inline unsigned int adc_upper_write_ptr_code(u16 prepost_bits) { return (prepost_bits >> 14) & 0x3; } @@ -594,7 +594,7 @@ struct hw_fifo_info { unsigned int num_segments; unsigned int max_segment_length; unsigned int sample_packing_ratio; - uint16_t fifo_size_reg_mask; + u16 fifo_size_reg_mask; }; enum pcidas64_boardid { @@ -1135,7 +1135,7 @@ struct pcidas64_private { uint32_t local0_iobase; uint32_t local1_iobase; /* dma buffers for analog input */ - uint16_t *ai_buffer[MAX_AI_DMA_RING_COUNT]; + u16 *ai_buffer[MAX_AI_DMA_RING_COUNT]; /* physical addresses of ai dma buffers */ dma_addr_t ai_buffer_bus_addr[MAX_AI_DMA_RING_COUNT]; /* @@ -1151,7 +1151,7 @@ struct pcidas64_private { */ unsigned int ai_dma_index; /* dma buffers for analog output */ - uint16_t *ao_buffer[AO_DMA_RING_COUNT]; + u16 *ao_buffer[AO_DMA_RING_COUNT]; /* physical addresses of ao dma buffers */ dma_addr_t ao_buffer_bus_addr[AO_DMA_RING_COUNT]; struct plx_dma_desc *ao_dma_desc; @@ -1162,12 +1162,12 @@ struct pcidas64_private { /* last bits sent to INTR_ENABLE_REG register */ unsigned int intr_enable_bits; /* last bits sent to ADC_CONTROL1_REG register */ - uint16_t adc_control1_bits; + u16 adc_control1_bits; /* last bits sent to FIFO_SIZE_REG register */ - uint16_t fifo_size_bits; + u16 fifo_size_bits; /* last bits sent to HW_CONFIG_REG register */ - uint16_t hw_config_bits; - uint16_t dac_control1_bits; + u16 hw_config_bits; + u16 dac_control1_bits; /* last bits written to plx9080 control register */ uint32_t plx_control_bits; /* last bits written to plx interrupt control and status register */ @@ -1193,7 +1193,7 @@ static unsigned int ai_range_bits_6xxx(const struct comedi_device *dev, } static unsigned int hw_revision(const struct comedi_device *dev, - uint16_t hw_status_bits) + u16 hw_status_bits) { const struct pcidas64_board *board =
[PATCH] staging: comedi: ni_670x: using the BIT(x) macro
Fix the checkpatch.pl issue: CHECK: Prefer using the BIT macro replacing bit shifting on 1 with the BIT(x) macro. Signed-off-by: Saber Rezvani Reviewed-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_670x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c index 74911db..1d3ff60 100644 --- a/drivers/staging/comedi/drivers/ni_670x.c +++ b/drivers/staging/comedi/drivers/ni_670x.c @@ -141,7 +141,7 @@ static int ni_670x_dio_insn_config(struct comedi_device *dev, /* ripped from mite.h and mite_setup2() to avoid mite dependency */ #define MITE_IODWBSR 0xc0 /* IO Device Window Base Size Register */ -#define WENAB (1 << 7) /* window enable */ +#define WENAB BIT(7) /* window enable */ static int ni_670x_mite_init(struct pci_dev *pcidev) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: ni_at_ao: using the BIT(x) macro
Fix the checkpatch.pl issue: CHECK: Prefer using the BIT macro replacing bit shifting on 1 with the BIT(x) macro. Signed-off-by: Saber Rezvani Reviewed-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_at_ao.c | 62 +++ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_at_ao.c b/drivers/staging/comedi/drivers/ni_at_ao.c index f27aa0e..158fa29 100644 --- a/drivers/staging/comedi/drivers/ni_at_ao.c +++ b/drivers/staging/comedi/drivers/ni_at_ao.c @@ -49,43 +49,43 @@ #define ATAO_CFG2_REG 0x02 #define ATAO_CFG2_CALLD_NOP(0 << 14) #define ATAO_CFG2_CALLD(x) x) >> 3) + 1) << 14) -#define ATAO_CFG2_FFRTEN (1 << 13) +#define ATAO_CFG2_FFRTEN BIT(13) #define ATAO_CFG2_DACS(x) (1 << (((x) / 2) + 8)) #define ATAO_CFG2_LDAC(x) (1 << (((x) / 2) + 3)) -#define ATAO_CFG2_PROMEN (1 << 2) -#define ATAO_CFG2_SCLK (1 << 1) -#define ATAO_CFG2_SDATA(1 << 0) +#define ATAO_CFG2_PROMEN BIT(2) +#define ATAO_CFG2_SCLK BIT(1) +#define ATAO_CFG2_SDATABIT(0) #define ATAO_CFG3_REG 0x04 -#define ATAO_CFG3_DMAMODE (1 << 6) -#define ATAO_CFG3_CLKOUT (1 << 5) -#define ATAO_CFG3_RCLKEN (1 << 4) -#define ATAO_CFG3_DOUTEN2 (1 << 3) -#define ATAO_CFG3_DOUTEN1 (1 << 2) -#define ATAO_CFG3_EN2_5V (1 << 1) -#define ATAO_CFG3_SCANEN (1 << 0) +#define ATAO_CFG3_DMAMODE BIT(6) +#define ATAO_CFG3_CLKOUT BIT(5) +#define ATAO_CFG3_RCLKEN BIT(4) +#define ATAO_CFG3_DOUTEN2 BIT(3) +#define ATAO_CFG3_DOUTEN1 BIT(2) +#define ATAO_CFG3_EN2_5V BIT(1) +#define ATAO_CFG3_SCANEN BIT(0) #define ATAO_82C53_BASE0x06 #define ATAO_CFG1_REG 0x0a -#define ATAO_CFG1_EXTINT2EN(1 << 15) -#define ATAO_CFG1_EXTINT1EN(1 << 14) -#define ATAO_CFG1_CNTINT2EN(1 << 13) -#define ATAO_CFG1_CNTINT1EN(1 << 12) -#define ATAO_CFG1_TCINTEN (1 << 11) -#define ATAO_CFG1_CNT1SRC (1 << 10) -#define ATAO_CFG1_CNT2SRC (1 << 9) -#define ATAO_CFG1_FIFOEN (1 << 8) -#define ATAO_CFG1_GRP2WR (1 << 7) -#define ATAO_CFG1_EXTUPDEN (1 << 6) -#define ATAO_CFG1_DMARQ(1 << 5) -#define ATAO_CFG1_DMAEN(1 << 4) +#define ATAO_CFG1_EXTINT2ENBIT(15) +#define ATAO_CFG1_EXTINT1ENBIT(14) +#define ATAO_CFG1_CNTINT2ENBIT(13) +#define ATAO_CFG1_CNTINT1ENBIT(12) +#define ATAO_CFG1_TCINTEN BIT(11) +#define ATAO_CFG1_CNT1SRC BIT(10) +#define ATAO_CFG1_CNT2SRC BIT(9) +#define ATAO_CFG1_FIFOEN BIT(8) +#define ATAO_CFG1_GRP2WR BIT(7) +#define ATAO_CFG1_EXTUPDEN BIT(6) +#define ATAO_CFG1_DMARQBIT(5) +#define ATAO_CFG1_DMAENBIT(4) #define ATAO_CFG1_CH(x)(((x) & 0xf) << 0) #define ATAO_STATUS_REG0x0a -#define ATAO_STATUS_FH (1 << 6) -#define ATAO_STATUS_FE (1 << 5) -#define ATAO_STATUS_FF (1 << 4) -#define ATAO_STATUS_INT2 (1 << 3) -#define ATAO_STATUS_INT1 (1 << 2) -#define ATAO_STATUS_TCINT (1 << 1) -#define ATAO_STATUS_PROMOUT(1 << 0) +#define ATAO_STATUS_FH BIT(6) +#define ATAO_STATUS_FE BIT(5) +#define ATAO_STATUS_FF BIT(4) +#define ATAO_STATUS_INT2 BIT(3) +#define ATAO_STATUS_INT1 BIT(2) +#define ATAO_STATUS_TCINT BIT(1) +#define ATAO_STATUS_PROMOUTBIT(0) #define ATAO_FIFO_WRITE_REG0x0c #define ATAO_FIFO_CLEAR_REG0x0c #define ATAO_AO_REG(x) (0x0c + ((x) * 2)) @@ -95,7 +95,7 @@ #define ATAO_2_INT1CLR_REG 0x02 #define ATAO_2_INT2CLR_REG 0x04 #define ATAO_2_RTSISHFT_REG0x06 -#define ATAO_2_RTSISHFT_RSI(1 << 0) +#define ATAO_2_RTSISHFT_RSIBIT(0) #define ATAO_2_RTSISTRB_REG0x07 struct atao_board { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: i4l: Correct coding style errors
On Thu, Dec 22, 2016 at 11:32:16PM +0100, Javier Rodriguez wrote: > Some lines with more than 80 characters has been corrected. > > Also, some printk() functions has been changed with their proper > print functions suggested by checkpatch.pl script as well as some > open braces has been aligned properly. > > Finally, two strings has been merged into unique string. When you have to list the different things you did in a patch, it's a huge sign that you need to break this up into multiple patches. Please do that here and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] isdn: i4l: move active-isdn drivers to staging
On Wed, Mar 02, 2016 at 08:06:46PM +0100, Arnd Bergmann wrote: > The icn, act2000 and pcbit drivers are all for very old hardware, > and it is highly unlikely that anyone is actually still using them > on modern kernels, if at all. > > All three drivers apparently are for hardware that predates PCI > being the common connector, as they are ISA-only and active > PCI ISDN cards were widely available in the 1990s. > > Looking through the git logs, it I cannot find any indication of a > patch to any of these drivers that has been tested on real hardware, > only cleanups or global API changes. > > Signed-off-by: Arnd Bergmann > Acked-by: Karsten Keil This patch got added in the 4.6 kernel release. As I am now taking patches for 4.11-rc1, I figure it is time to just delete the drivers/staging/i4l/ directory now, given that no one has really done anything with it. If people show up that wish to maintain it, I'll be glad to revert it, or if someone really screams in the next week. Otherwise it's time to just move on :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: i4l :fixed coding style
On Fri, Dec 09, 2016 at 11:06:26AM +0530, Tabrez khan wrote: > Remove braces {} for single if statement block. > > Signed-off-by: Tabrez khan > --- > drivers/staging/i4l/act2000/module.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) This patch doesn't apply cleanly, can you refresh your tree and resend it? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: fbtft: fix checkpatch error and udelay
On Mon, Dec 19, 2016 at 07:44:42PM +0200, Ozgur Karatas wrote: > 19.12.2016, 08:35, "Greg KH" : > > On Sun, Dec 18, 2016 at 11:47:30AM -0600, Scott Matheina wrote: > >> These changes where identified by checkpatch.pl as needed changes to > >> align the code with the linux development coding style. The several > >> lines of text where aligned with the precending parenthesis. > >> > >> Signed-off-by: Scott Matheina > >> > >> Changes to be committed: > >> modified: drivers/staging/fbtft/fb_agm1264k-fl.c > > > > Why are these lines in the changelog text? > > I checked with checkpatch script to code and give a some errors. > So, the code have to "udelay(20)". > > udelay(20); > > I read to Documentation/timers/timers-howto.txt and > this line incorrect, usleep_range need must be add defined U_DELAY and fixed. > > udelay(U_DELAY, U_DELAY + 10); > > finally: > > $ checkpatch.pl drivers/staging/fbtft/fb_agm1264k-fl.c | grep total > total: 0 errors > > Signed-off-by: Ozgur Karatas > > --- > drivers/staging/fbtft/fb_agm1264k-fl.c | 31 --- > 1 file changed, 12 insertions(+), 19 deletions(-) You do realize there's nothing I can do with this patch as-is, right? Please fix up the changelog text and resend it properly if you wish to have it included. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/6] fbtft: make it work with DMA enabled SPI
On Mon, Jan 02, 2017 at 01:37:43PM +0200, Andy Shevchenko wrote: > On Mon, 2017-01-02 at 13:35 +0200, Andy Shevchenko wrote: > > This series enables 64x48 OLED display and fixes the driver to work > > with DMA > > enabled SPI properly. > > > > Has been tested on Intel Edison board with Adafruit 2'8" and SSD1306 > > 64x48 > > (Sparkfun for Intel Edison) OLED displays at their maximum speed > > (25MHz and > > 10MHz). > > It should be v1, but here we are. I'll wait for v3 based on the kbuild issue found :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fwserial: fix checkpatch alignment check
On Sun, Jan 01, 2017 at 01:00:59AM +, Abdul Rauf wrote: > Fix the following checks: > Alignment should match open parenthesis. > > Signed-off-by: Abdul Rauf > --- > drivers/staging/fwserial/fwserial.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/fwserial/fwserial.c > b/drivers/staging/fwserial/fwserial.c > index 41a49c8194e5..cb4e361fc545 100644 > --- a/drivers/staging/fwserial/fwserial.c > +++ b/drivers/staging/fwserial/fwserial.c > @@ -1344,8 +1344,9 @@ static int fwtty_break_ctl(struct tty_struct *tty, int > state) > if (state == -1) { > set_bit(STOP_TX, &port->flags); > ret = wait_event_interruptible_timeout(port->wait_tx, > -!test_bit(IN_TX, &port->flags), > -10); > +!test_bit(IN_TX, > + &port->flags), > + 10); Ick, please note that this doesn't look better than before :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: gdm724x: add forced casts in endian converters to fix sparse warnings
On Wed, Dec 28, 2016 at 10:08:43PM -0800, Eric S. Stone wrote: > The modified functions do explicit endian checking and conversion. The > added forced casts fix these sparse warnings: > > CHECK drivers/staging/gdm724x/gdm_endian.c > drivers/staging/gdm724x/gdm_endian.c:28:24: warning: incorrect type in return > expression (different base types) > drivers/staging/gdm724x/gdm_endian.c:28:24:expected unsigned short > drivers/staging/gdm724x/gdm_endian.c:28:24:got restricted __le16 > [usertype] > drivers/staging/gdm724x/gdm_endian.c:30:24: warning: incorrect type in return > expression (different base types) > drivers/staging/gdm724x/gdm_endian.c:30:24:expected unsigned short > drivers/staging/gdm724x/gdm_endian.c:30:24:got restricted __be16 > [usertype] > drivers/staging/gdm724x/gdm_endian.c:36:24: warning: cast to restricted __le16 > drivers/staging/gdm724x/gdm_endian.c:38:24: warning: cast to restricted __be16 > drivers/staging/gdm724x/gdm_endian.c:44:24: warning: incorrect type in return > expression (different base types) > drivers/staging/gdm724x/gdm_endian.c:44:24:expected unsigned int > drivers/staging/gdm724x/gdm_endian.c:44:24:got restricted __le32 > [usertype] > drivers/staging/gdm724x/gdm_endian.c:46:24: warning: incorrect type in return > expression (different base types) > drivers/staging/gdm724x/gdm_endian.c:46:24:expected unsigned int > drivers/staging/gdm724x/gdm_endian.c:46:24:got restricted __be32 > [usertype] > drivers/staging/gdm724x/gdm_endian.c:52:24: warning: cast to restricted __le32 > drivers/staging/gdm724x/gdm_endian.c:54:24: warning: cast to restricted __be32 > > Signed-off-by: Eric S. Stone > --- > drivers/staging/gdm724x/gdm_endian.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/gdm724x/gdm_endian.c > b/drivers/staging/gdm724x/gdm_endian.c > index d7144e7..00ae7a8 100644 > --- a/drivers/staging/gdm724x/gdm_endian.c > +++ b/drivers/staging/gdm724x/gdm_endian.c > @@ -25,31 +25,31 @@ void gdm_set_endian(struct gdm_endian *ed, u8 dev_endian) > u16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x) > { > if (ed->dev_ed == ENDIANNESS_LITTLE) > - return cpu_to_le16(x); > + return (__force u16)cpu_to_le16(x); > else > - return cpu_to_be16(x); > + return (__force u16)cpu_to_be16(x); That's crazy, look at what you are writing here, does it really make any sense? Please fix this up properly... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: ks7010: ks7010_sdio.h: Fixed coding style error
On Fri, Dec 09, 2016 at 07:38:36PM +, Manoj Sawai wrote: > Error - Complex macro not in parentheses and trailing whitespace That's two different things, please make two different patches. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/6] fbtft: make it work with DMA enabled SPI
On Tue, 2017-01-03 at 16:27 +0100, Greg Kroah-Hartman wrote: > On Mon, Jan 02, 2017 at 01:37:43PM +0200, Andy Shevchenko wrote: > > On Mon, 2017-01-02 at 13:35 +0200, Andy Shevchenko wrote: > > > This series enables 64x48 OLED display and fixes the driver to > > > work > > > with DMA > > > enabled SPI properly. > > > > > > Has been tested on Intel Edison board with Adafruit 2'8" and > > > SSD1306 > > > 64x48 > > > (Sparkfun for Intel Edison) OLED displays at their maximum speed > > > (25MHz and > > > 10MHz). > > > > It should be v1, but here we are. > > I'll wait for v3 based on the kbuild issue found :) Yes, please wait. I will re-do DMA approach as well. Need to test it first. -- Andy Shevchenko Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/2] staging: greybus: loopback fixes and updates
On Thu, Dec 22, 2016 at 12:37:27AM +, Bryan O'Donoghue wrote: > Two simple patches here resulting from using greybus on gbsim and > developing support for async. I found a bug in the user-space tool and > while doing that decided to update the kernel thread to be better behaved > when waiting for test completions. > > V2: > Use available bundle pointer for dev_dbg printout - Johan > > Bryan O'Donoghue (2): > staging: greybus: loopback: use gb_loopback_async_wait_all don't spin > staging: greybus: loopback_test: Fix race preventing test completion I've applied just the first patch here. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 3/6] staging: fbtft: fallback to usual allocation when DMA fails
On Mon, 2017-01-02 at 13:35 +0200, Andy Shevchenko wrote: > Fall back to usual allocation method if DMA coherent allocation fails. > > SPI framework will map and use DMA mapped memory when possible. Locally I have re-done DMA approach and thus this patch became optional. Should I leave or remove it? Opinions? > > Signed-off-by: Andy Shevchenko > --- > drivers/staging/fbtft/fbtft-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/fbtft/fbtft-core.c > b/drivers/staging/fbtft/fbtft-core.c > index 226be8c09768..9f024986aff4 100644 > --- a/drivers/staging/fbtft/fbtft-core.c > +++ b/drivers/staging/fbtft/fbtft-core.c > @@ -843,7 +843,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct > fbtft_display *display, > if (dma) { > txbuf = dmam_alloc_coherent(dev, txbuflen, > &par->txbuf.dma, > GFP_DMA); > - } else > + } > + if (!txbuf) > #endif > { > txbuf = devm_kzalloc(par->info->device, -- Andy Shevchenko Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] staging: rtl8188eu: remove unused function _linked_rx_signal_strehgth_display
On Fri, Dec 30, 2016 at 12:01:05AM +0100, Luca Ceresoli wrote: > Not referenced anymore since the removal of field bRxRSSIDisplay in > struct adapter. > > Cc: Greg Kroah-Hartman > Cc: Larry Finger > Cc: Ivan Safonov > Cc: de...@driverdev.osuosl.org > Signed-off-by: Luca Ceresoli > --- > drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 17 - > 1 file changed, 17 deletions(-) This patch doesn't apply to my tree anymore, can you refresh it and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: octeon: Call SET_NETDEV_DEV()
On Tue, Dec 27, 2016 at 02:15:57PM -0800, Florian Fainelli wrote: > On 12/20/2016 07:20 PM, David Miller wrote: > > From: Florian Fainelli > > Date: Tue, 20 Dec 2016 17:02:37 -0800 > > > >> On 12/14/2016 05:13 PM, Florian Fainelli wrote: > >>> The Octeon driver calls into PHYLIB which now checks for > >>> net_device->dev.parent, so make sure we do set it before calling into > >>> any MDIO/PHYLIB related function. > >>> > >>> Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's > >>> a different owner") > >>> Reported-by: Aaro Koskinen > >>> Signed-off-by: Florian Fainelli > >> > >> Greg, David, since this is a fix for a regression introduced in the net > >> tree, it may make sense that David take it via his tree. > > > > Since the change in question is in Linus's tree, it's equally valid > > for Greg to take it as well. > > Sure, Greg, can you take this change? Thank you! Will do so now, thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file
On Tue, Dec 06, 2016 at 06:10:38PM +, Stuart Yoder wrote: > > > > -Original Message- > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > Sent: Tuesday, December 06, 2016 11:56 AM > > To: Stuart Yoder > > Cc: Ruxandra Ioana Radulescu ; > > de...@driverdev.osuosl.org; linux- > > ker...@vger.kernel.org; ag...@suse.de; a...@arndb.de; Alexandru Marginean > > ; > > Bogdan Hamciuc ; Roy Pledge ; > > Laurentiu Tudor > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > On Tue, Dec 06, 2016 at 12:59:59PM +, Stuart Yoder wrote: > > > > > > > > > > -Original Message- > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > Sent: Tuesday, December 06, 2016 4:20 AM > > > > To: Ruxandra Ioana Radulescu > > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > > ag...@suse.de; a...@arndb.de; > > Alexandru > > > > Marginean ; Bogdan Hamciuc > > > > ; Stuart Yoder > > > > ; Roy Pledge ; Laurentiu > > > > Tudor > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > > > On Tue, Dec 06, 2016 at 10:06:25AM +, Ruxandra Ioana Radulescu > > > > wrote: > > > > > > -Original Message- > > > > > > From: Greg KH [mailto:gre...@linuxfoundation.org] > > > > > > Sent: Tuesday, December 06, 2016 11:58 AM > > > > > > To: Ruxandra Ioana Radulescu > > > > > > Cc: de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org; > > > > > > ag...@suse.de; a...@arndb.de; Alexandru Marginean > > > > > > ; Bogdan Hamciuc > > > > > > ; Stuart Yoder ; Roy > > > > > > Pledge ; Laurentiu Tudor > > > > > > > > > > > > Subject: Re: [PATCH 7/8] staging: fsl-dpaa2/eth: Add TODO file > > > > > > > > > > > > On Tue, Dec 06, 2016 at 03:34:41AM -0600, Ioana Radulescu wrote: > > > > > > > Add a list of TODO items for the Ethernet driver > > > > > > > > > > > > > > Signed-off-by: Ioana Radulescu > > > > > > > --- > > > > > > > drivers/staging/fsl-dpaa2/ethernet/TODO |9 + > > > > > > > 1 files changed, 9 insertions(+), 0 deletions(-) > > > > > > > create mode 100644 drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > > > > > > > > diff --git a/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > b/drivers/staging/fsl- > > > > > > dpaa2/ethernet/TODO > > > > > > > new file mode 100644 > > > > > > > index 000..833265b > > > > > > > --- /dev/null > > > > > > > +++ b/drivers/staging/fsl-dpaa2/ethernet/TODO > > > > > > > @@ -0,0 +1,9 @@ > > > > > > > +* Add a DPAA2 MAC kernel driver in order to allow PHY management; > > > > > > currently > > > > > > > + the DPMAC objects and their link to DPNIs are handled by MC > > > > > > > internally > > > > > > > + and all PHYs are seen as fixed-link > > > > > > > +* add more debug support: decide how to expose detailed debug > > > > > > statistics, > > > > > > > + add ingress error queue support > > > > > > > +* MC firmware uprev; the DPAA2 objects used by the Ethernet > > > > > > > driver > > > > > > need to > > > > > > > + be kept in sync with binary interface changes in MC > > > > > > > +* refine README file > > > > > > > +* cleanup > > > > > > > > > > > > These seem like very minor things, why not just spend a week and do > > > > > > this > > > > > > work and get it merged to the "correct" portion of the kernel tree? > > > > > > Why > > > > > > does this have to go into staging? > > > > > > > > > > Actually the first bullet is not minor at all and requires some design > > > > > choices that we aren't yet completely clear with, and which in turn > > > > > may > > > > > affect parts of the Ethernet driver. We figured it would be best to > > > > > try > > > > > adding this in staging first (and also provide this way an example of > > > > > using > > > > > the fsl-mc bus and dpio driver) than wait until all MAC development > > > > > questions are ironed-out. > > > > > > > > Ok, that makes sense. > > > > > > > > > I can remove the other bullets from the TODO list if you think they're > > > > > not worth mentioning. > > > > > > > > No, they should be mentioned, I just didn't think they are all that much > > > > work, and if you didn't have major things needed to get done, you could > > > > just knock it all out in a week of local development. > > > > > > > > I'll look into taking this into the tree later today... > > > > > > Note, as mentioned in the cover letter, in it's current form this patch > > > series is based on the series: > > > [PATCH v3 0/9] staging: fsl-mc: move bus driver out of staging, add dpio > > > > > > ...which means that it won't build or run without that series being > > > applied first, due to header file dependencies. It also functionally > > > depends on the DPIO driver. So we need the dpio driver merged first. > > > > > > Is moving the fsl-mc bus driver out of staging a possibility now? > > > > I'm ok with it, but I really haven't looked at the patches in a while, I > > keep seeing others have problems with it. Want me to review it now?
Re: [PATCH] staging: fwserial: fix checkpatch alignment check
On 01/03/2017 03:28 PM, Greg KH wrote: > On Sun, Jan 01, 2017 at 01:00:59AM +, Abdul Rauf wrote: >> Fix the following checks: >> Alignment should match open parenthesis. >> >> Signed-off-by: Abdul Rauf >> --- >> drivers/staging/fwserial/fwserial.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/fwserial/fwserial.c >> b/drivers/staging/fwserial/fwserial.c >> index 41a49c8194e5..cb4e361fc545 100644 >> --- a/drivers/staging/fwserial/fwserial.c >> +++ b/drivers/staging/fwserial/fwserial.c >> @@ -1344,8 +1344,9 @@ static int fwtty_break_ctl(struct tty_struct *tty, int >> state) >> if (state == -1) { >> set_bit(STOP_TX, &port->flags); >> ret = wait_event_interruptible_timeout(port->wait_tx, >> - !test_bit(IN_TX, &port->flags), >> - 10); >> + !test_bit(IN_TX, >> + &port->flags), >> +10); > Ick, please note that this doesn't look better than before :( > Sir, but it did fix one out of three checks :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/6] staging: fbtft: do not override DMA coherent mask
Den 03.01.2017 14:58, skrev Andy Shevchenko: On Tue, 2017-01-03 at 12:51 +0200, Andy Shevchenko wrote: On Mon, 2017-01-02 at 19:14 +0100, Noralf Trønnes wrote: Den 02.01.2017 12:35, skrev Andy Shevchenko: Usually it's not consumer's business to override resources passed from provider, in particularly DMA coherent mask. --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -841,7 +841,6 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, if (txbuflen > 0) { #ifdef CONFIG_HAS_DMA if (dma) { - dev->coherent_dma_mask = ~0; Can we make this conditional like in of_dma_configure(): if (!dev->coherent_dma_mask) dev->coherent_dma_mask = DMA_BIT_MASK(32); If not, I guess the mask has to be set before adding the spi device in fbtft_device.c to keep it from breaking. Good point. I will check this. So, I was too fast. Clearly an SPI slave device does not and *should not* know about DMA capabilities of SPI *host* controller. It's completely out of slave's business. The masks and other DMA properties only makes sense for the device which *actually does DMA*, and apparently SPI slaves do not suit that category (there are might be real SPI slaves with private DMA engines, though it's another story). Thus, the patch from my point of view should be kept in the same form. Regarding to the kbuild bot warning, would you like me to resend it fixed? Whatever the decision, I will wait for more comments and hopefully your tags. P.S. I dunno how it did work before, since DMA mask of slave device basically has no effect. Perhaps first argument to allocator should be NULL. That's only amendment I can see to this particular patch. I have looked at this more closely and it seems that spi_message.is_dma_mapped is deprecated. And if the spi master driver can do dma, then the spi core will dma map the buffer (spi_map_buf() even does vmalloc'ed buffers), and this is what happens for most dma capable master drivers it seems. Since kmalloc allocates buffers that is always dma mappable, we can always use kmalloc() instead of dmam_alloc_coherent() for the transfer buffer. In addition cleaning up these would prevent any later confusion: drivers/staging/fbtft/fbtft.h: struct fbtft_par { struct { void *buf; -dma_addr_t dma; size_t len; } txbuf; drivers/staging/fbtft/fbtft-core.c: -#include -#ifdef CONFIG_HAS_DMA -static bool dma = true; -module_param(dma, bool, 0); -MODULE_PARM_DESC(dma, "Use DMA buffer"); -#endif if (par->txbuf.buf) - sprintf(text1, ", %zu KiB %sbuffer memory", - par->txbuf.len >> 10, par->txbuf.dma ? "DMA " : ""); + sprintf(text1, ", %zu KiB buffer memory", par->txbuf.len >> 10); drivers/staging/fbtft/fbtft-io.c: int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len) - if (par->txbuf.dma && buf == par->txbuf.buf) { - t.tx_dma = par->txbuf.dma; - m.is_dma_mapped = 1; - } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/6] staging: fbtft: convert fbtft_reset() to be non-atomic
Den 02.01.2017 12:35, skrev Andy Shevchenko: First of all, fbtft in current state doesn't allow to override GPIOs to be optional, like "reset" one. It might be a bug somewhere, but rather out of scope of this fix. Second, not all GPIOs available on the board would be SoC based, some of them might sit on I2C GPIO expanders, for example, on Intel Edison/Arduino, and thus any communication with them might sleep. Besides that using udelay() and mdelay() is kinda resource wasteful. Summarize all of the above, convert fbtft_reset() function to non-atomic variant by using gpio_set_value_cansleep(), usleep_range(), and msleep(). To avoid potential use in atomic context annotate it via might_sleep() macro. Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index bbe89c9c4fb9..e8bf0d1ec11f 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -336,11 +336,14 @@ static void fbtft_reset(struct fbtft_par *par) { if (par->gpio.reset == -1) return; + + might_sleep(); gpio_set_value_cansleep() already does might_sleep(). So with that removed: Reviewed-by: Noralf Trønnes + fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__); - gpio_set_value(par->gpio.reset, 0); - udelay(20); - gpio_set_value(par->gpio.reset, 1); - mdelay(120); + gpio_set_value_cansleep(par->gpio.reset, 0); + usleep_range(20, 40); + gpio_set_value_cansleep(par->gpio.reset, 1); + msleep(120); } static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 3/6] staging: fbtft: fallback to usual allocation when DMA fails
Den 03.01.2017 17:12, skrev Andy Shevchenko: On Mon, 2017-01-02 at 13:35 +0200, Andy Shevchenko wrote: Fall back to usual allocation method if DMA coherent allocation fails. SPI framework will map and use DMA mapped memory when possible. Locally I have re-done DMA approach and thus this patch became optional. Should I leave or remove it? Opinions? If we use kmalloc always, then this goes away. Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 226be8c09768..9f024986aff4 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -843,7 +843,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, if (dma) { txbuf = dmam_alloc_coherent(dev, txbuflen, &par->txbuf.dma, GFP_DMA); - } else + } + if (!txbuf) #endif { txbuf = devm_kzalloc(par->info->device, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fwserial: fix checkpatch alignment check
On Tue, Jan 03, 2017 at 10:16:00PM +, Abdul Rauf Mujahid wrote: > > > On 01/03/2017 03:28 PM, Greg KH wrote: > > On Sun, Jan 01, 2017 at 01:00:59AM +, Abdul Rauf wrote: > >> Fix the following checks: > >> Alignment should match open parenthesis. > >> > >> Signed-off-by: Abdul Rauf > >> --- > >> drivers/staging/fwserial/fwserial.c | 5 +++-- > >> 1 file changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/staging/fwserial/fwserial.c > >> b/drivers/staging/fwserial/fwserial.c > >> index 41a49c8194e5..cb4e361fc545 100644 > >> --- a/drivers/staging/fwserial/fwserial.c > >> +++ b/drivers/staging/fwserial/fwserial.c > >> @@ -1344,8 +1344,9 @@ static int fwtty_break_ctl(struct tty_struct *tty, > >> int state) > >>if (state == -1) { > >>set_bit(STOP_TX, &port->flags); > >>ret = wait_event_interruptible_timeout(port->wait_tx, > >> - !test_bit(IN_TX, &port->flags), > >> - 10); > >> + !test_bit(IN_TX, > >> + &port->flags), > >> + 10); > > Ick, please note that this doesn't look better than before :( > > > Sir, but it did fix one out of three checks :( checkpatch.pl is a guide, use your brain when making changes, that's why we have coding style rules in the first place :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 5/6] staging: fbtft: fb_ssd1306: Support smaller screen sizes
Den 02.01.2017 12:35, skrev Andy Shevchenko: There is 64x48 display exists. In order to support that set multiplexer to 48 pixels and window address to proper position in the graphic display data RAM. Signed-off-by: Andy Shevchenko --- Patches 5 and 6: Acked-by: Noralf Trønnes drivers/staging/fbtft/fb_ssd1306.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c index 80fc57029fee..bede2d5a5571 100644 --- a/drivers/staging/fbtft/fb_ssd1306.c +++ b/drivers/staging/fbtft/fb_ssd1306.c @@ -62,6 +62,8 @@ static int init_display(struct fbtft_par *par) write_reg(par, 0xA8); if (par->info->var.yres == 64) write_reg(par, 0x3F); + else if (par->info->var.yres == 48) + write_reg(par, 0x2F); else write_reg(par, 0x1F); @@ -95,6 +97,9 @@ static int init_display(struct fbtft_par *par) if (par->info->var.yres == 64) /* A[4]=1b, Alternative COM pin configuration */ write_reg(par, 0x12); + else if (par->info->var.yres == 48) + /* A[4]=1b, Alternative COM pin configuration */ + write_reg(par, 0x12); else /* A[4]=0b, Sequential COM pin configuration */ write_reg(par, 0x02); @@ -124,6 +129,19 @@ static int init_display(struct fbtft_par *par) return 0; } +static void set_addr_win_64x48(struct fbtft_par *par) +{ + /* Set Column Address */ + write_reg(par, 0x21); + write_reg(par, 0x20); + write_reg(par, 0x5F); + + /* Set Page Address */ + write_reg(par, 0x22); + write_reg(par, 0x0); + write_reg(par, 0x5); +} + static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) { /* Set Lower Column Start Address for Page Addressing Mode */ @@ -132,6 +150,9 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) write_reg(par, 0x10 | 0x0); /* Set Display Start Line */ write_reg(par, 0x40 | 0x0); + + if (par->info->var.xres == 64 && par->info->var.yres == 48) + set_addr_win_64x48(par); } static int blank(struct fbtft_par *par, bool on) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] staging: vchiq_arm: Fine-tuning for some function implementations
SF Markus Elfring writes: > From: Markus Elfring > Date: Sat, 31 Dec 2016 22:42:34 +0100 > > Some update suggestions were taken into account > from static source code analysis. This series is: Reviewed-by: Eric Anholt signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 2/5] staging: fbtft: remove custom DMA mapped buffer
There is no need to duplicate what SPI core already does, i.e. mapping buffers for DMA capable transfers. Remove all related pices of code. Note, that code, besides its redundancy, was buggy: DMA address potentially can be 0, SPI slave device has nothing to do with DMA capable device properties and DMA mask in particular. Suggested-by: Noralf Trønnes Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fb_ra8875.c | 4 drivers/staging/fbtft/fbtft-core.c | 22 ++ drivers/staging/fbtft/fbtft-io.c | 4 drivers/staging/fbtft/fbtft.h | 1 - 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c index 308a244972aa..a6bc1503a50e 100644 --- a/drivers/staging/fbtft/fb_ra8875.c +++ b/drivers/staging/fbtft/fb_ra8875.c @@ -42,10 +42,6 @@ static int write_spi(struct fbtft_par *par, void *buf, size_t len) } spi_message_init(&m); - if (par->txbuf.dma && buf == par->txbuf.buf) { - t.tx_dma = par->txbuf.dma; - m.is_dma_mapped = 1; - } spi_message_add_tail(&t, &m); return spi_sync(par->spi, &m); } diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 300a1e4505b9..4e13090c7fbd 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -44,12 +43,6 @@ static unsigned long debug; module_param(debug, ulong, 0); MODULE_PARM_DESC(debug, "override device debug level"); -#ifdef CONFIG_HAS_DMA -static bool dma = true; -module_param(dma, bool, 0); -MODULE_PARM_DESC(dma, "Use DMA buffer"); -#endif - void fbtft_dbg_hex(const struct device *dev, int groupsize, void *buf, size_t len, const char *fmt, ...) { @@ -836,17 +829,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, #endif if (txbuflen > 0) { -#ifdef CONFIG_HAS_DMA - if (dma) { - dev->coherent_dma_mask = ~0; - txbuf = dmam_alloc_coherent(dev, txbuflen, - &par->txbuf.dma, GFP_DMA); - } else -#endif - { - txbuf = devm_kzalloc(par->info->device, -txbuflen, GFP_KERNEL); - } + txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL); if (!txbuf) goto alloc_fail; par->txbuf.buf = txbuf; @@ -975,8 +958,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info) fbtft_sysfs_init(par); if (par->txbuf.buf) - sprintf(text1, ", %zu KiB %sbuffer memory", - par->txbuf.len >> 10, par->txbuf.dma ? "DMA " : ""); + sprintf(text1, ", %zu KiB buffer memory", par->txbuf.len >> 10); if (spi) sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num, spi->chip_select, spi->max_speed_hz / 100); diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c index 4dcea2e0b3ae..d86840548b74 100644 --- a/drivers/staging/fbtft/fbtft-io.c +++ b/drivers/staging/fbtft/fbtft-io.c @@ -22,10 +22,6 @@ int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len) } spi_message_init(&m); - if (par->txbuf.dma && buf == par->txbuf.buf) { - t.tx_dma = par->txbuf.dma; - m.is_dma_mapped = 1; - } spi_message_add_tail(&t, &m); return spi_sync(par->spi, &m); } diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index aacdde92cc2e..b09804773ff2 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -209,7 +209,6 @@ struct fbtft_par { u32 pseudo_palette[16]; struct { void *buf; - dma_addr_t dma; size_t len; } txbuf; u8 *buf; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 0/5] fbtft: make it work with DMA enabled SPI
This series enables 64x48 OLED display and fixes the driver to work with DMA enabled SPI properly. Has been tested on Intel Edison board with Adafruit 2'8" and SSD1306 64x48 (Sparkfun for Intel Edison) OLED displays at their maximum speed (25MHz and 10MHz). Since v2: - fix kbuild bot warning - remove duplication of might_sleep() (Noralf) - re-do DMA appoach based on Noralf's suggestion - append Noralf's tags Andy Shevchenko (5): staging: fbtft: convert fbtft_reset() to be non-atomic staging: fbtft: remove custom DMA mapped buffer staging: fbtft: propagate error code from kstrto*() staging: fbtft: fb_ssd1306: Support smaller screen sizes staging: fbtft: fb_ssd1306: Refactor write_vmem() drivers/staging/fbtft/fb_ra8875.c | 4 drivers/staging/fbtft/fb_ssd1306.c | 37 - drivers/staging/fbtft/fbtft-core.c | 30 ++ drivers/staging/fbtft/fbtft-io.c| 4 drivers/staging/fbtft/fbtft-sysfs.c | 7 +-- drivers/staging/fbtft/fbtft.h | 1 - 6 files changed, 35 insertions(+), 48 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 4/5] staging: fbtft: fb_ssd1306: Support smaller screen sizes
There is 64x48 display exists. In order to support that set multiplexer to 48 pixels and window address to proper position in the graphic display data RAM. Acked-by: Noralf Trønnes Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fb_ssd1306.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c index 80fc57029fee..bede2d5a5571 100644 --- a/drivers/staging/fbtft/fb_ssd1306.c +++ b/drivers/staging/fbtft/fb_ssd1306.c @@ -62,6 +62,8 @@ static int init_display(struct fbtft_par *par) write_reg(par, 0xA8); if (par->info->var.yres == 64) write_reg(par, 0x3F); + else if (par->info->var.yres == 48) + write_reg(par, 0x2F); else write_reg(par, 0x1F); @@ -95,6 +97,9 @@ static int init_display(struct fbtft_par *par) if (par->info->var.yres == 64) /* A[4]=1b, Alternative COM pin configuration */ write_reg(par, 0x12); + else if (par->info->var.yres == 48) + /* A[4]=1b, Alternative COM pin configuration */ + write_reg(par, 0x12); else /* A[4]=0b, Sequential COM pin configuration */ write_reg(par, 0x02); @@ -124,6 +129,19 @@ static int init_display(struct fbtft_par *par) return 0; } +static void set_addr_win_64x48(struct fbtft_par *par) +{ + /* Set Column Address */ + write_reg(par, 0x21); + write_reg(par, 0x20); + write_reg(par, 0x5F); + + /* Set Page Address */ + write_reg(par, 0x22); + write_reg(par, 0x0); + write_reg(par, 0x5); +} + static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) { /* Set Lower Column Start Address for Page Addressing Mode */ @@ -132,6 +150,9 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) write_reg(par, 0x10 | 0x0); /* Set Display Start Line */ write_reg(par, 0x40 | 0x0); + + if (par->info->var.xres == 64 && par->info->var.yres == 48) + set_addr_win_64x48(par); } static int blank(struct fbtft_par *par, bool on) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/6] staging: vchiq_arm: Fine-tuning for some function implementations
On Tue, Jan 03, 2017 at 09:46:51AM -0800, Eric Anholt wrote: > SF Markus Elfring writes: > > > From: Markus Elfring > > Date: Sat, 31 Dec 2016 22:42:34 +0100 > > > > Some update suggestions were taken into account > > from static source code analysis. > > This series is: > > Reviewed-by: Eric Anholt Nice, but I have a blacklist from this patch author, and have told them numerous times that I no longer accept patches from them. If you think they are worthy, please resend them with your reviewed-by on them, but I will warn you, I've blacklisted them for a reason... good luck! greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 5/5] staging: fbtft: fb_ssd1306: Refactor write_vmem()
Refactor write_vmem() for sake of readability. While here, fix indentation in one comment. Acked-by: Noralf Trønnes Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fb_ssd1306.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c index bede2d5a5571..76f7da3c7703 100644 --- a/drivers/staging/fbtft/fb_ssd1306.c +++ b/drivers/staging/fbtft/fb_ssd1306.c @@ -84,7 +84,7 @@ static int init_display(struct fbtft_par *par) /* Vertical addressing mode */ write_reg(par, 0x01); - /*Set Segment Re-map */ + /* Set Segment Re-map */ /* column address 127 is mapped to SEG0 */ write_reg(par, 0xA0 | 0x1); @@ -183,26 +183,24 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { u16 *vmem16 = (u16 *)par->info->screen_buffer; + u32 xres = par->info->var.xres; + u32 yres = par->info->var.yres; u8 *buf = par->txbuf.buf; int x, y, i; int ret = 0; - for (x = 0; x < par->info->var.xres; x++) { - for (y = 0; y < par->info->var.yres/8; y++) { + for (x = 0; x < xres; x++) { + for (y = 0; y < yres / 8; y++) { *buf = 0x00; for (i = 0; i < 8; i++) - *buf |= (vmem16[(y * 8 + i) * - par->info->var.xres + x] ? -1 : 0) << i; + *buf |= (vmem16[(y * 8 + i) * xres + x] ? 1 : 0) << i; buf++; } } /* Write data */ gpio_set_value(par->gpio.dc, 1); - ret = par->fbtftops.write(par, par->txbuf.buf, - par->info->var.xres * par->info->var.yres / - 8); + ret = par->fbtftops.write(par, par->txbuf.buf, xres * yres / 8); if (ret < 0) dev_err(par->info->device, "write failed and returned: %d\n", ret); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/5] staging: fbtft: convert fbtft_reset() to be non-atomic
First of all, fbtft in current state doesn't allow to override GPIOs to be optional, like "reset" one. It might be a bug somewhere, but rather out of scope of this fix. Second, not all GPIOs available on the board would be SoC based, some of them might sit on I2C GPIO expanders, for example, on Intel Edison/Arduino, and thus any communication with them might sleep. Besides that using udelay() and mdelay() is kinda resource wasteful. Summarize all of the above, convert fbtft_reset() function to non-atomic variant by using gpio_set_value_cansleep(), usleep_range(), and msleep(). Reviewed-by: Noralf Trønnes Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index bbe89c9c4fb9..300a1e4505b9 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -337,10 +337,10 @@ static void fbtft_reset(struct fbtft_par *par) if (par->gpio.reset == -1) return; fbtft_par_dbg(DEBUG_RESET, par, "%s()\n", __func__); - gpio_set_value(par->gpio.reset, 0); - udelay(20); - gpio_set_value(par->gpio.reset, 1); - mdelay(120); + gpio_set_value_cansleep(par->gpio.reset, 0); + usleep_range(20, 40); + gpio_set_value_cansleep(par->gpio.reset, 1); + msleep(120); } static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line, -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 3/5] staging: fbtft: propagate error code from kstrto*()
kstrto*() functions return proper error code. Do propogate it to the user. Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-sysfs.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c index 8d8bd12b90a1..5922f1b6d8d6 100644 --- a/drivers/staging/fbtft/fbtft-sysfs.c +++ b/drivers/staging/fbtft/fbtft-sysfs.c @@ -4,7 +4,6 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base) { char *p_val; - int ret; if (!str_p || !(*str_p)) return -EINVAL; @@ -14,11 +13,7 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base) if (!p_val) return -EINVAL; - ret = kstrtoul(p_val, base, val); - if (ret) - return -EINVAL; - - return 0; + return kstrtoul(p_val, base, val); } int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves, -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: greybus: add host device function pointer checks
On Mon, Jan 02, 2017 at 02:54:37PM +0100, Johan Hovold wrote: > On Tue, Dec 20, 2016 at 02:49:27PM -0600, Jason Hrycay wrote: > > Add sanity checks for cport_quiesce and cport_clear before invoking the > > callbacks as these function pointers are not required during the host > > device registration. This follows the logic implemented elsewhere for > > various other function pointers. > > Yeah, I allowed for some inconsistency here given that these callbacks > are mandatory on our current platform. > > No harm in checking this way though (well, at least as long as we > remember to set the pointers). > OK, makes sense. We ran into it while integrating the Motorola host-device stack into the latest version of greybus (we were previously forked from a version a year ago - wow time flies). > > Signed-off-by: Jason Hrycay > > Acked-by: Johan Hovold > > Thanks, > Johan -Jason ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 3/4] hv_util: use do_adjtimex() to update system time
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Tuesday, January 3, 2017 4:32 AM > To: Alex Ng (LIS) > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; KY > Srinivasan ; Haiyang Zhang ; > John Stultz ; Thomas Gleixner > Subject: Re: [PATCH 3/4] hv_util: use do_adjtimex() to update system time > > "Alex Ng (LIS)" writes: > > >> -Original Message- > >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > >> Sent: Monday, January 2, 2017 11:41 AM > >> To: de...@linuxdriverproject.org > >> Cc: linux-ker...@vger.kernel.org; KY Srinivasan ; > >> Haiyang Zhang ; John Stultz > >> ; Thomas Gleixner ; Alex > >> Ng > >> (LIS) > >> Subject: [PATCH 3/4] hv_util: use do_adjtimex() to update system time > >> > >> With TimeSync version 4 protocol support we started updating system > >> time continuously through the whole lifetime of Hyper-V guests. Every > >> 5 seconds there is a time sample from the host which triggers > do_settimeofday[64](). > >> While the time from the host is very accurate such adjustments may > >> cause > >> issues: > >> - Time is jumping forward and backward, some applications may > misbehave. > >> - In case an NTP client is run in parallel things may go south, e.g. when > >> an NTP client tries to adjust tick/frequency with > ADJ_TICK/ADJ_FREQUENCY > >> the Hyper-V module will not see this changes and time will oscillate and > >> never converge. > >> - Systemd starts annoying you by printing "Time has been changed" every > 5 > >> seconds to the system log. > > > > These are all good points. I am working on a patch to address point 2. > > It will allow new TimeSync behavior to be disabled even if the > > TimeSync IC is enabled from the host. This can be set to prevent > > TimeSync IC from interfering with NTP client. > > > > Good, this can happen in parallel to my series, right? Yes, that is correct. > > >> > >> Instead of calling do_settimeofday64() we can pretend being an NTP > >> client and use do_adjtimex(). > >> > >> Signed-off-by: Vitaly Kuznetsov > >> --- > >> drivers/hv/hv_util.c | 25 ++--- > >> 1 file changed, 22 insertions(+), 3 deletions(-) > >> > >> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index > >> 94719eb..4c0fbb0 100644 > >> --- a/drivers/hv/hv_util.c > >> +++ b/drivers/hv/hv_util.c > >> @@ -182,9 +182,10 @@ struct adj_time_work { static void > >> hv_set_host_time(struct work_struct *work) { > >>struct adj_time_work*wrk; > >> - s64 host_tns; > >> + s64 host_tns, our_tns, delta; > >>u64 newtime; > >> - struct timespec64 host_ts; > >> + struct timespec64 host_ts, our_ts; > >> + struct timex txc = {0}; > >> > >>wrk = container_of(work, struct adj_time_work, work); > >> > >> @@ -205,7 +206,25 @@ static void hv_set_host_time(struct work_struct > >> *work) > >>host_tns = (newtime - WLTIMEDELTA) * 100; > >>host_ts = ns_to_timespec64(host_tns); > >> > >> - do_settimeofday64(&host_ts); > >> + getnstimeofday64(&our_ts); > >> + our_tns = timespec64_to_ns(&our_ts); > >> + > >> + /* Difference between our time and host time */ > >> + delta = host_tns - our_tns; > >> + > >> + /* Try adjusting time by using phase adjustment if possible */ > >> + if (abs(delta) > MAXPHASE) { > >> + do_settimeofday64(&host_ts); > >> + return; > >> + } > > > > We should also call do_settimeofday64() if the host sends flag > > ICTIMESYNCFLAG_SYNC. This is a signal from host that the guest shall > > sync with host time immediately (often when the guest has just > > booted). > > Ok, point taken, will do in v2. We don't get ICTIMESYNCFLAG_SYNC very > often, right? This is correct. SYNC flags are sent rarely and usually only after a guest has been resumed from a pause. > > > > >> + > >> + txc.modes = ADJ_TICK | ADJ_FREQUENCY | ADJ_OFFSET | > >> ADJ_NANO | > >> + ADJ_STATUS; > >> + txc.tick = TICK_USEC; > >> + txc.freq = 0; > > > > I'm not familiar with the ADJ_FREQUENCY flag. What does setting this to > 'zero' achieve? > > Are there any side-effects from doing this? > > Zero means no frequency adjustment required (we reset it in case it was > previously made by an NTP client). > > > > >> + txc.status = STA_PLL; > >> + txc.offset = delta; > >> + do_adjtimex(&txc); > > > > Might be a good idea to handle the return code from do_adjtimex() and > > log something in case of error. > > I can add a debug message here but as this is a regular action we don't want > to get a flood of messages in case this fails permanently. I'd avoid printing > info messages here. > Agree. A debug level message is reasonable. > > > >> } > >> > >> /* > >> -- > >> 2.9.3 > > -- > Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next v2 08/27] net/hyperv: remove use of VLAN_TAG_PRESENT
Signed-off-by: Michał Mirosław --- drivers/net/hyperv/hyperv_net.h | 2 +- drivers/net/hyperv/netvsc_drv.c | 13 ++--- drivers/net/hyperv/rndis_filter.c | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 3958adade7eb..b53729e85a79 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -186,7 +186,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, void **data, struct ndis_tcp_ip_checksum_info *csum_info, struct vmbus_channel *channel, - u16 vlan_tci); + u16 vlan_tci, bool vlan_present); void netvsc_channel_cb(void *context); int rndis_filter_open(struct netvsc_device *nvdev); int rndis_filter_close(struct netvsc_device *nvdev); diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index c9414c054852..6597d7901929 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -595,7 +595,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net, struct hv_netvsc_packet *packet, struct ndis_tcp_ip_checksum_info *csum_info, - void *data, u16 vlan_tci) + void *data) { struct sk_buff *skb; @@ -625,10 +625,6 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net, skb->ip_summed = CHECKSUM_UNNECESSARY; } - if (vlan_tci & VLAN_TAG_PRESENT) - __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), - vlan_tci); - return skb; } @@ -641,7 +637,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, void **data, struct ndis_tcp_ip_checksum_info *csum_info, struct vmbus_channel *channel, - u16 vlan_tci) + u16 vlan_tci, bool vlan_present) { struct net_device *net = hv_get_drvdata(device_obj); struct net_device_context *net_device_ctx = netdev_priv(net); @@ -664,12 +660,15 @@ int netvsc_recv_callback(struct hv_device *device_obj, net = vf_netdev; /* Allocate a skb - TODO direct I/O to pages? */ - skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data, vlan_tci); + skb = netvsc_alloc_recv_skb(net, packet, csum_info, *data); if (unlikely(!skb)) { ++net->stats.rx_dropped; return NVSP_STAT_FAIL; } + if (vlan_present) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci); + if (net != vf_netdev) skb_record_rx_queue(skb, channel->offermsg.offer.sub_channel_index); diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 8d90904e0e49..7f7b410a41c2 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -381,13 +381,13 @@ static int rndis_filter_receive_data(struct rndis_device *dev, vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); if (vlan) { - vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid | + vlan_tci = vlan->vlanid | (vlan->pri << VLAN_PRIO_SHIFT); } csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO); return netvsc_recv_callback(net_device_ctx->device_ctx, pkt, data, - csum_info, channel, vlan_tci); + csum_info, channel, vlan_tci, vlan); } int rndis_filter_receive(struct hv_device *dev, -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next v2 26/27] net/hyperv: enable passing of VLAN.CFI bit
Signed-off-by: Michał Mirosław --- drivers/net/hyperv/netvsc_drv.c | 1 + drivers/net/hyperv/rndis_filter.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 6597d7901929..4e20f4c247fa 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -441,6 +441,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) vlan = (struct ndis_pkt_8021q_info *)((void *)ppi + ppi->ppi_offset); vlan->vlanid = skb->vlan_tci & VLAN_VID_MASK; + vlan->cfi = !!(skb->vlan_tci & VLAN_CFI_MASK); vlan->pri = (skb->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT; } diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 7f7b410a41c2..9759d7380037 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -382,6 +382,7 @@ static int rndis_filter_receive_data(struct rndis_device *dev, vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); if (vlan) { vlan_tci = vlan->vlanid | + (vlan->cfi ? VLAN_CFI_MASK : 0) | (vlan->pri << VLAN_PRIO_SHIFT); } -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 02/19] ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections
From: Philipp Zabel This patch adds the device tree graph connecting the input multiplexers to the IPU CSIs and the MIPI-CSI2 gasket on i.MX6. The MIPI_IPU multiplexers are added as children of the iomuxc-gpr syscon device node. On i.MX6Q/D two two-input multiplexers in front of IPU1 CSI0 and IPU2 CSI1 allow to select between CSI0/1 parallel input pads and the MIPI CSI-2 virtual channels 0/3. On i.MX6DL/S two five-input multiplexers in front of IPU1 CSI0 and IPU1 CSI1 allow to select between CSI0/1 parallel input pads and any of the four MIPI CSI-2 virtual channels. Signed-off-by: Philipp Zabel - Removed some dangling/unused endpoints (ipu2_csi0_from_csi2ipu) - Renamed the mipi virtual channel endpoint labels, from "mipi_csiX_..." to "mipi_vcX...". - Added input endpoints to the video muxes for the connections from parallel sensors. - Added input endpoints to the mipi_csi for the connections from mipi csi-2 sensors. - The video multiplexer node has compatible string "imx-video-mux" instead of "video-multiplexer". - The video multiplexer node indicates GPR register via reg propert only, (register offset and bitmask), instead of specifying with "bit-mask" and "bit-shift" properties. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6dl.dtsi | 183 + arch/arm/boot/dts/imx6q.dtsi | 119 +++ arch/arm/boot/dts/imx6qdl.dtsi | 10 ++- 3 files changed, 311 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi index 1ade195..0a1718c 100644 --- a/arch/arm/boot/dts/imx6dl.dtsi +++ b/arch/arm/boot/dts/imx6dl.dtsi @@ -181,6 +181,189 @@ "di0", "di1"; }; +&gpr { + ipu1_csi0_mux: ipu1_csi0_mux@34 { + compatible = "imx-video-mux"; + reg = <0x34 0x07>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@0 { + reg = <0>; + + ipu1_csi0_mux_from_mipi_vc0: endpoint { + remote-endpoint = <&mipi_vc0_to_ipu1_csi0_mux>; + }; + }; + + port@1 { + reg = <1>; + + ipu1_csi0_mux_from_mipi_vc1: endpoint { + remote-endpoint = <&mipi_vc1_to_ipu1_csi0_mux>; + }; + }; + + port@2 { + reg = <2>; + + ipu1_csi0_mux_from_mipi_vc2: endpoint { + remote-endpoint = <&mipi_vc2_to_ipu1_csi0_mux>; + }; + }; + + port@3 { + reg = <3>; + + ipu1_csi0_mux_from_mipi_vc3: endpoint { + remote-endpoint = <&mipi_vc3_to_ipu1_csi0_mux>; + }; + }; + + port@4 { + reg = <4>; + + ipu1_csi0_mux_from_parallel_sensor: endpoint { + }; + }; + + port@5 { + reg = <5>; + + ipu1_csi0_mux_to_ipu1_csi0: endpoint { + remote-endpoint = <&ipu1_csi0_from_ipu1_csi0_mux>; + }; + }; + }; + + ipu1_csi1_mux: ipu1_csi1_mux@34 { + compatible = "imx-video-mux"; + reg = <0x34 0x38>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@0 { + reg = <0>; + + ipu1_csi1_mux_from_mipi_vc0: endpoint { + remote-endpoint = <&mipi_vc0_to_ipu1_csi1_mux>; + }; + }; + + port@1 { + reg = <1>; + + ipu1_csi1_mux_from_mipi_vc1: endpoint { + remote-endpoint = <&mipi_vc1_to_ipu1_csi1_mux>; + }; + }; + + port@2 { + reg = <2>; + + ipu1_csi1_mux_from_mipi_vc2: endpoint { + remote-endpoint = <&mipi_vc2_to_ipu1_csi1_mux>; + }; + }; + + port@3 { + reg = <3>; + + ipu1_csi1_mux_from_mipi_vc3: endpoint { + remote-endpoint = <&mipi_vc3_to_ipu1_csi1_mux>; + }; + }; + + port@4 { + reg = <4>; + + ipu1_csi1_mux_from_parallel_sensor: endpoint { + }; + }; + + port@5 { + reg = <5>; + + ipu1_csi1_mux_to_ipu1_csi1: endpoint { +
[PATCH v2 00/19] i.MX Media Driver
In version 2 (no functional changes): - removed patch "gpio: pca953x: Add optional reset gpio control", it has been submitted separately. - fixed some whitespace errors. - added a few missing Signed-off-by's. Philipp Zabel (2): ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections media: imx: Add video switch subdev driver Steve Longerbeam (17): ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node ARM: dts: imx6qdl: add media device ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors ARM: dts: imx6-sabreauto: create i2cmux for i2c3 ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture ARM: dts: imx6-sabreauto: add the ADV7180 video decoder media: Add i.MX media core driver media: imx: Add CSI subdev driver media: imx: Add SMFC subdev driver media: imx: Add IC subdev drivers media: imx: Add Camera Interface subdev driver media: imx: Add MIPI CSI-2 Receiver subdev driver media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver media: imx: Add Parallel OV5642 sensor subdev driver ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers Documentation/devicetree/bindings/media/imx.txt | 205 + Documentation/media/v4l-drivers/imx.rst | 430 ++ arch/arm/boot/dts/imx6dl-sabrelite.dts|5 + arch/arm/boot/dts/imx6dl-sabresd.dts |5 + arch/arm/boot/dts/imx6dl.dtsi | 183 + arch/arm/boot/dts/imx6q-sabrelite.dts |6 + arch/arm/boot/dts/imx6q-sabresd.dts |5 + arch/arm/boot/dts/imx6q.dtsi | 123 + arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 142 +- arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 +- arch/arm/boot/dts/imx6qdl-sabresd.dtsi| 114 +- arch/arm/boot/dts/imx6qdl.dtsi| 25 +- arch/arm/configs/imx_v6_v7_defconfig | 10 +- drivers/staging/media/Kconfig |2 + drivers/staging/media/Makefile|1 + drivers/staging/media/imx/Kconfig | 36 + drivers/staging/media/imx/Makefile| 16 + drivers/staging/media/imx/TODO| 18 + drivers/staging/media/imx/imx-camif.c | 1010 + drivers/staging/media/imx/imx-csi.c | 638 +++ drivers/staging/media/imx/imx-ic-common.c | 113 + drivers/staging/media/imx/imx-ic-pp.c | 636 +++ drivers/staging/media/imx/imx-ic-prpenc.c | 1037 + drivers/staging/media/imx/imx-ic-prpvf.c | 1180 ++ drivers/staging/media/imx/imx-ic.h| 36 + drivers/staging/media/imx/imx-media-common.c | 985 + drivers/staging/media/imx/imx-media-dev.c | 479 +++ drivers/staging/media/imx/imx-media-fim.c | 509 +++ drivers/staging/media/imx/imx-media-internal-sd.c | 457 +++ drivers/staging/media/imx/imx-media-of.c | 291 ++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 299 ++ drivers/staging/media/imx/imx-mipi-csi2.c | 509 +++ drivers/staging/media/imx/imx-smfc.c | 739 drivers/staging/media/imx/imx-video-switch.c | 351 ++ drivers/staging/media/imx/ov5640-mipi.c | 2349 +++ drivers/staging/media/imx/ov5642.c| 4364 + include/media/imx.h | 15 + include/uapi/Kbuild |1 + include/uapi/linux/v4l2-controls.h|4 + include/uapi/media/Kbuild |2 + include/uapi/media/imx.h | 30 + 42 files changed, 17479 insertions(+), 28 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-camif.c create mode 100644 drivers/staging/media/imx/imx-csi.c create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/im
[PATCH v2 03/19] ARM: dts: imx6qdl: add media device
Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6q.dtsi | 4 arch/arm/boot/dts/imx6qdl.dtsi | 8 2 files changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 56a314f..2fbe0b3 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -454,3 +454,7 @@ &vpu { compatible = "fsl,imx6q-vpu", "cnm,coda960"; }; + +&media0 { + ports = <&ipu1_csi0>, <&ipu1_csi1>, <&ipu2_csi0>, <&ipu2_csi1>; +}; diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 89218a4..12ae045 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -1296,5 +1296,13 @@ }; }; }; + + media0: media@0 { + compatible = "fsl,imx-media"; + ports = <&ipu1_csi0>, <&ipu1_csi1>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + }; }; }; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/19] ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node
Add to the MIPI CSI2 receiver node: compatible string, interrupt sources, clocks. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 53e6e63..7b546e3 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -1125,7 +1125,14 @@ }; mipi_csi: mipi@021dc000 { + compatible = "fsl,imx-mipi-csi2"; reg = <0x021dc000 0x4000>; + interrupts = <0 100 0x04>, <0 101 0x04>; + clocks = <&clks IMX6QDL_CLK_HSI_TX>, +<&clks IMX6QDL_CLK_VIDEO_27M>, +<&clks IMX6QDL_CLK_EIM_SEL>; + clock-names = "dphy_clk", "cfg_clk", "pix_clk"; + status = "disabled"; }; mipi_dsi: mipi@021e { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 05/19] ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors
Enables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor. The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux. The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1. Until the OV5652 sensor module compatible with the SabreSD becomes available for testing, the ov5642 node is currently disabled. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6dl-sabresd.dts | 5 ++ arch/arm/boot/dts/imx6q-sabresd.dts| 5 ++ arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 114 - 3 files changed, 123 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6dl-sabresd.dts b/arch/arm/boot/dts/imx6dl-sabresd.dts index 1e45f2f..6cf7a50 100644 --- a/arch/arm/boot/dts/imx6dl-sabresd.dts +++ b/arch/arm/boot/dts/imx6dl-sabresd.dts @@ -15,3 +15,8 @@ model = "Freescale i.MX6 DualLite SABRE Smart Device Board"; compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl"; }; + +&ipu1_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts b/arch/arm/boot/dts/imx6q-sabresd.dts index 9cbdfe7..8c1d7ad 100644 --- a/arch/arm/boot/dts/imx6q-sabresd.dts +++ b/arch/arm/boot/dts/imx6q-sabresd.dts @@ -23,3 +23,8 @@ &sata { status = "okay"; }; + +&ipu1_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 55ef535..39b4228 100644 --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -10,6 +10,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include #include #include @@ -146,6 +147,33 @@ }; }; +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; + data-shift = <12>; /* Lines 19:12 used */ + hsync-active = <1>; + vsync-active = <1>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&ov5642_to_ipu1_csi0_mux>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; +}; + +&mipi_csi { + status = "okay"; +}; + +/* Incoming port from sensor */ +&mipi_csi_from_mipi_sensor { + remote-endpoint = <&ov5640_to_mipi_csi>; + data-lanes = <0 1>; + clock-lanes = <2>; +}; + &audmux { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux>; @@ -214,7 +242,33 @@ 0x8014 /* 4:FN_DMICCDAT */ 0x /* 5:Default */ >; - }; + }; + + camera: ov5642@3c { + compatible = "ovti,ov5642"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5642>; + clocks = <&clks IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + reg = <0x3c>; + xclk = <2400>; + DOVDD-supply = <&vgen4_reg>; /* 1.8v */ + AVDD-supply = <&vgen5_reg>; /* 2.8v, rev C board is VGEN3 + rev B board is VGEN5 */ + DVDD-supply = <&vgen2_reg>; /* 1.5v*/ + pwdn-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; /* SD1_DAT0 */ + reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>; /* SD1_DAT1 */ + status = "disabled"; + + port { + ov5642_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; }; &i2c2 { @@ -322,6 +376,34 @@ }; }; }; + + mipi_camera: ov5640@3c { + compatible = "ovti,ov5640_mipi"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5640>; + reg = <0x3c>; + clocks = <&clks IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + xclk = <2400>; + DOVDD-supply = <&vgen4_reg>; /* 1.8v */ + AVDD-supply = <&vgen5_reg>; /* 2.8v, rev C board is VGEN3 + rev B board is VGEN5 */ + DVDD-supply = <&vgen2_reg>; /* 1.5v*/ + pwdn-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; /* SD1_DAT2 */ + reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; /* SD1_CLK */ + + port { + #address-cells = <1>; + #size-cells = <0>; + + ov5640_to_mipi_csi: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_csi_from_mipi_sensor>; + data-lanes = <0 1>; +
[PATCH v2 08/19] ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
Add pinctrl groups for both GPT input capture channels. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 516bac6..83ac2ff 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -457,6 +457,18 @@ >; }; + pinctrl_gpt_input_capture0: gptinputcapture0grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1 0x8000 + >; + }; + + pinctrl_gpt_input_capture1: gptinputcapture1grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT1__GPT_CAPTURE2 0x8000 + >; + }; + pinctrl_spdif: spdifgrp { fsl,pins = < MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/19] ARM: dts: imx6-sabreauto: add the ADV7180 video decoder
Enables the ADV7180 decoder sensor. The ADV7180 connects to the parallel-bus mux input on ipu1_csi0_mux. On the sabreauto, two analog video inputs are routed to the ADV7180, composite on Ain1, and composite on Ain3. Those inputs are defined via inputs and input-names under the ADV7180 node. The ADV7180 power pin is via max7310_b port expander. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 56 1 file changed, 56 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 83ac2ff..30ee378 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -147,10 +147,42 @@ gpio-controller; #gpio-cells = <2>; }; + + camera: adv7180@21 { + compatible = "adi,adv7180"; + reg = <0x21>; + powerdown-gpios = <&max7310_b 2 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio1>; + interrupts = <27 0x8>; + inputs = <0x00 0x02>; + input-names = "ADV7180 Composite on Ain1", + "ADV7180 Composite on Ain3"; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; }; }; }; +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; +}; + &clks { assigned-clocks = <&clks IMX6QDL_PLL4_BYPASS_SRC>, <&clks IMX6QDL_PLL4_BYPASS>, @@ -451,6 +483,30 @@ >; }; + pinctrl_ipu1_csi0: ipu1grp-csi0 { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04 0x8000 + MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05 0x8000 + MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06 0x8000 + MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07 0x8000 + MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08 0x8000 + MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09 0x8000 + MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10 0x8000 + MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11 0x8000 + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x8000 + MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x8000 + MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x8000 + MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x8000 + MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x8000 + MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x8000 + MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x8000 + MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x8000 + MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x8000 + MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x8000 + MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 04/19] ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors
Enables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor. Both hang off the same i2c2 bus, so they require different (and non- default) i2c slave addresses. The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux. The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1. Note there is a pin conflict with GPIO6. This pin functions as a power input pin to the OV5642, but ENET uses it as the h/w workaround for erratum ERR006687, to wake-up the ARM cores on normal RX and TX packet done events (see 6261c4c8). So workaround 6261c4c8 is reverted here to support the OV5642, and the "fsl,err006687-workaround-present" boolean also must be removed. The result is that the CPUidle driver will no longer allow entering the deep idle states on the sabrelite. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6dl-sabrelite.dts | 5 ++ arch/arm/boot/dts/imx6q-sabrelite.dts| 6 ++ arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 ++- 3 files changed, 129 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/imx6dl-sabrelite.dts b/arch/arm/boot/dts/imx6dl-sabrelite.dts index 0f06ca5..fec2524 100644 --- a/arch/arm/boot/dts/imx6dl-sabrelite.dts +++ b/arch/arm/boot/dts/imx6dl-sabrelite.dts @@ -48,3 +48,8 @@ model = "Freescale i.MX6 DualLite SABRE Lite Board"; compatible = "fsl,imx6dl-sabrelite", "fsl,imx6dl"; }; + +&ipu1_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index 66d10d8..9e2d26d 100644 --- a/arch/arm/boot/dts/imx6q-sabrelite.dts +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts @@ -52,3 +52,9 @@ &sata { status = "okay"; }; + +&ipu1_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +}; + diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index 1f9076e..4a50bb1 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -39,6 +39,8 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ + +#include #include #include @@ -96,6 +98,15 @@ }; }; + mipi_xclk: mipi_xclk { + compatible = "pwm-clock"; + #clock-cells = <0>; + clock-frequency = <2200>; + clock-output-names = "mipi_pwm3"; + pwms = <&pwm3 0 45>; /* 1 / 45 ns = 22 MHz */ + status = "okay"; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -220,6 +231,22 @@ }; }; +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; + data-shift = <12>; /* Lines 19:12 used */ + hsync-active = <1>; + vync-active = <1>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&ov5642_to_ipu1_csi0_mux>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; +}; + &audmux { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_audmux>; @@ -271,9 +298,6 @@ txd1-skew-ps = <0>; txd2-skew-ps = <0>; txd3-skew-ps = <0>; - interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, - <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; - fsl,err006687-workaround-present; status = "okay"; }; @@ -302,6 +326,52 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; status = "okay"; + + camera: ov5642@42 { + compatible = "ovti,ov5642"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5642>; + clocks = <&clks IMX6QDL_CLK_CKO2>; + clock-names = "xclk"; + reg = <0x42>; + xclk = <2400>; + reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + pwdn-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + gp-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; + + port { + ov5642_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; + + mipi_camera: ov5640@40 { + compatible = "ovti,ov5640_mipi"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5640>; + clocks = <&mipi_xclk>; + clock-names = "xclk"; + reg = <0x40>; + xclk = <2200>; + reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; /* NANDF_D5 */ + pwdn-gpi
[PATCH v2 07/19] ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b
The reset pin to the port expander chip (MAX7310) is controlled by a gpio, so define a reset-gpios property to control it. There are three MAX7310's on the SabreAuto CPU card (max7310_[abc]), but all use the same pin for their reset. Since all can't acquire the same pin, assign it to max7310_b, that chip is needed by more functions (usb and adv7180). Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 4a6d038..516bac6 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -136,6 +136,9 @@ reg = <0x32>; gpio-controller; #gpio-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_max7310>; + reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; max7310_c: gpio@34 { @@ -442,6 +445,12 @@ >; }; + pinctrl_max7310: max7310grp { + fsl,pins = < + MX6QDL_PAD_SD2_DAT0__GPIO1_IO15 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 06/19] ARM: dts: imx6-sabreauto: create i2cmux for i2c3
The sabreauto uses a steering pin to select between the SDA signal on i2c3 bus, and a data-in pin for an SPI NOR chip. Use i2cmux to control this steering pin. Idle state of the i2cmux selects SPI NOR. This is not a classic way to use i2cmux, since one side of the mux selects something other than an i2c bus, but it works and is probably the cleanest solution. Note that if one thread is attempting to access SPI NOR while another thread is accessing i2c3, the SPI NOR access will fail since the i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't be avoided in any case, the board is not designed to allow concurrent i2c3 and SPI NOR functions (and the default device-tree does not enable SPI NOR anyway). Devices hanging off i2c3 should now be defined under i2cmux, so that the steering pin can be properly controlled to access those devices. The port expanders (MAX7310) are thus moved into i2cmux. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 65 +--- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 52390ba..4a6d038 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -108,6 +108,44 @@ default-brightness-level = <7>; status = "okay"; }; + + i2cmux { + compatible = "i2c-mux-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3mux>; + mux-gpios = <&gpio5 4 0>; + i2c-parent = <&i2c3>; + idle-state = <0>; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + max7310_a: gpio@30 { + compatible = "maxim,max7310"; + reg = <0x30>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_b: gpio@32 { + compatible = "maxim,max7310"; + reg = <0x32>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_c: gpio@34 { + compatible = "maxim,max7310"; + reg = <0x34>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; }; &clks { @@ -291,27 +329,6 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - - max7310_a: gpio@30 { - compatible = "maxim,max7310"; - reg = <0x30>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_b: gpio@32 { - compatible = "maxim,max7310"; - reg = <0x32>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_c: gpio@34 { - compatible = "maxim,max7310"; - reg = <0x34>; - gpio-controller; - #gpio-cells = <2>; - }; }; &iomuxc { @@ -419,6 +436,12 @@ >; }; + pinctrl_i2c3mux: i2c3muxgrp { + fsl,pins = < + MX6QDL_PAD_EIM_A24__GPIO5_IO04 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 11/19] media: imx: Add CSI subdev driver
This is a media entity subdevice for the i.MX Camera Serial Interface module. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Kconfig | 13 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-csi.c | 638 3 files changed, 653 insertions(+) create mode 100644 drivers/staging/media/imx/imx-csi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index bfde58d..ce2d2c8 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -6,3 +6,16 @@ config VIDEO_IMX_MEDIA Say yes here to enable support for video4linux media controller driver for the i.MX5/6 SOC. +if VIDEO_IMX_MEDIA +menu "i.MX5/6 Media Sub devices" + +config VIDEO_IMX_CAMERA + tristate "i.MX5/6 Camera driver" + depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + select VIDEOBUF2_DMA_CONTIG + default y + ---help--- + A video4linux camera capture driver for i.MX5/6. + +endmenu +endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index ef9f11b..133672a 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -4,3 +4,5 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o + diff --git a/drivers/staging/media/imx/imx-csi.c b/drivers/staging/media/imx/imx-csi.c new file mode 100644 index 000..975eafb --- /dev/null +++ b/drivers/staging/media/imx/imx-csi.c @@ -0,0 +1,638 @@ +/* + * V4L2 Capture CSI Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +#define CSI_NUM_PADS 2 + +struct csi_priv { + struct device *dev; + struct ipu_soc *ipu; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CSI_NUM_PADS]; + struct v4l2_mbus_framefmt format_mbus[CSI_NUM_PADS]; + struct v4l2_mbus_config sensor_mbus_cfg; + struct v4l2_rect crop; + struct ipu_csi *csi; + int csi_id; + int input_pad; + int output_pad; + bool power_on; /* power is on */ + bool stream_on; /* streaming is on */ + + /* the sink for the captured frames */ + struct v4l2_subdev *sink_sd; + enum ipu_csi_dest dest; + struct v4l2_subdev *src_sd; + + struct v4l2_ctrl_handler ctrl_hdlr; + struct imx_media_fim *fim; + + /* the attached sensor at stream on */ + struct imx_media_subdev *sensor; +}; + +static inline struct csi_priv *sd_to_dev(struct v4l2_subdev *sdev) +{ + return container_of(sdev, struct csi_priv, sd); +} + +/* Update the CSI whole sensor and active windows */ +static int csi_setup(struct csi_priv *priv) +{ + struct v4l2_mbus_framefmt infmt; + + ipu_csi_set_window(priv->csi, &priv->crop); + + /* +* the ipu-csi doesn't understand ALTERNATE, but it only +* needs to know whether the stream is interlaced, so set +* to INTERLACED if infmt field is ALTERNATE. +*/ + infmt = priv->format_mbus[priv->input_pad]; + if (infmt.field == V4L2_FIELD_ALTERNATE) + infmt.field = V4L2_FIELD_INTERLACED; + + ipu_csi_init_interface(priv->csi, &priv->sensor_mbus_cfg, &infmt); + + ipu_csi_set_dest(priv->csi, priv->dest); + + ipu_csi_dump(priv->csi); + + return 0; +} + +static int csi_start(struct csi_priv *priv) +{ + int ret; + + if (!priv->sensor) { + v4l2_err(&priv->sd, "no sensor attached\n"); + return -EINVAL; + } + + ret = csi_setup(priv); + if (ret) + return ret; + + /* start the frame interval monitor */ + ret = imx_media_fim_set_stream(priv->fim, priv->sensor, true); + if (ret) + return ret; + + ret = ipu_csi_enable(priv->csi); + if (ret) { + v4l2_err(&priv->sd, "CSI enable error: %d\n", ret); + return ret; + } + + return 0; +} + +static void csi_stop(struct csi_priv *priv) +{ + /* stop the frame interval monitor */ + imx_media_fim_set_stream(priv->fim, priv->sensor, false); + + ipu_csi_disable(priv->csi); +} + +static int csi_s_stream(struct v4l2_subdev *sd, int enable) +{ + struct csi_priv *priv = v4l2_get_subdevdata(sd); + int ret = 0; + + if (!priv->src_sd || !priv->sink_sd) + return -EPIPE; + +
[PATCH v2 12/19] media: imx: Add SMFC subdev driver
This is a media entity subdevice driver for the i.MX Sensor Multi-FIFO Controller module. Video frames are received from the CSI and can be routed to various sinks including the i.MX Image Converter for scaling, color-space conversion, motion compensated deinterlacing, and image rotation. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-smfc.c | 739 +++ 2 files changed, 740 insertions(+) create mode 100644 drivers/staging/media/imx/imx-smfc.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 133672a..3559d7b 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -5,4 +5,5 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o diff --git a/drivers/staging/media/imx/imx-smfc.c b/drivers/staging/media/imx/imx-smfc.c new file mode 100644 index 000..565048c --- /dev/null +++ b/drivers/staging/media/imx/imx-smfc.c @@ -0,0 +1,739 @@ +/* + * V4L2 Capture SMFC Subdev for Freescale i.MX5/6 SOC + * + * This subdevice handles capture of raw/unconverted video frames + * from the CSI, directly to memory via the Sensor Multi-FIFO Controller. + * + * Copyright (c) 2012-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +/* + * Min/Max supported width and heights. + * + * We allow planar output from the SMFC, so we have to align + * output width by 16 pixels to meet IDMAC alignment requirements, + * which also means input width must have the same alignment. + */ +#define MIN_W 176 +#define MIN_H 144 +#define MAX_W 8192 +#define MAX_H 4096 +#define W_ALIGN4 /* multiple of 16 pixels */ +#define H_ALIGN1 /* multiple of 2 lines */ +#define S_ALIGN1 /* multiple of 2 */ + +#define SMFC_NUM_PADS 2 + +struct imx_smfc_priv { + struct device*dev; + struct ipu_soc *ipu; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[SMFC_NUM_PADS]; + int ipu_id; + int smfc_id; + int input_pad; + int output_pad; + + struct ipuv3_channel *smfc_ch; + struct ipu_smfc *smfc; + + struct v4l2_mbus_framefmt format_mbus[SMFC_NUM_PADS]; + const struct imx_media_pixfmt *cc[SMFC_NUM_PADS]; + + struct v4l2_mbus_config sensor_mbus_cfg; + + /* the dma buffer ring to send to sink */ + struct imx_media_dma_buf_ring *out_ring; + struct imx_media_dma_buf *next; + + int ipu_buf_num; /* ipu double buffer index: 0-1 */ + + /* the sink that will receive the dma buffers */ + struct v4l2_subdev *sink_sd; + struct v4l2_subdev *src_sd; + + /* +* the CSI id and mipi virtual channel number at +* link validate +*/ + int csi_id; + int vc_num; + + /* the attached sensor at stream on */ + struct imx_media_subdev *sensor; + + spinlock_t irqlock; + struct timer_list eof_timeout_timer; + int eof_irq; + int nfb4eof_irq; + + bool stream_on; /* streaming is on */ + bool last_eof; /* waiting for last EOF at stream off */ + struct completion last_eof_comp; +}; + +static void imx_smfc_put_ipu_resources(struct imx_smfc_priv *priv) +{ + if (!IS_ERR_OR_NULL(priv->smfc_ch)) + ipu_idmac_put(priv->smfc_ch); + priv->smfc_ch = NULL; + + if (!IS_ERR_OR_NULL(priv->smfc)) + ipu_smfc_put(priv->smfc); + priv->smfc = NULL; +} + +static int imx_smfc_get_ipu_resources(struct imx_smfc_priv *priv) +{ + int ch_num, ret; + + priv->ipu = priv->md->ipu[priv->ipu_id]; + + ch_num = IPUV3_CHANNEL_CSI0 + priv->smfc_id; + + priv->smfc = ipu_smfc_get(priv->ipu, ch_num); + if (IS_ERR(priv->smfc)) { + v4l2_err(&priv->sd, "failed to get SMFC\n"); + ret = PTR_ERR(priv->smfc); + goto out; + } + + priv->smfc_ch = ipu_idmac_get(priv->ipu, ch_num); + if (IS_ERR(priv->smfc_ch)) { + v4l2_err(&priv->sd, "could not get IDMAC channel %u\n", ch_num); + ret = PTR_ERR(priv->smfc_ch); + goto out; + } + + return 0; +out: + imx_smfc_put_ipu_resources(priv); + return ret; +} + +static irqreturn_t imx_smfc_eof_interrupt(int irq, void *dev_id) +{ + struct imx_smfc_priv
[PATCH v2 10/19] media: Add i.MX media core driver
Add the core media driver for i.MX SOC. Signed-off-by: Steve Longerbeam --- Documentation/devicetree/bindings/media/imx.txt | 205 + Documentation/media/v4l-drivers/imx.rst | 430 ++ drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile| 1 + drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile| 6 + drivers/staging/media/imx/TODO| 18 + drivers/staging/media/imx/imx-media-common.c | 985 ++ drivers/staging/media/imx/imx-media-dev.c | 479 +++ drivers/staging/media/imx/imx-media-fim.c | 509 +++ drivers/staging/media/imx/imx-media-internal-sd.c | 457 ++ drivers/staging/media/imx/imx-media-of.c | 291 +++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 299 +++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h| 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 19 files changed, 3767 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/imx-media-of.h create mode 100644 drivers/staging/media/imx/imx-media.h create mode 100644 include/media/imx.h create mode 100644 include/uapi/media/Kbuild create mode 100644 include/uapi/media/imx.h diff --git a/Documentation/devicetree/bindings/media/imx.txt b/Documentation/devicetree/bindings/media/imx.txt new file mode 100644 index 000..3593354 --- /dev/null +++ b/Documentation/devicetree/bindings/media/imx.txt @@ -0,0 +1,205 @@ +Freescale i.MX Media Video Devices + +Video Media Controller node +--- + +This is the parent media controller node for video capture support. + +Required properties: +- compatible : "fsl,imx-media"; +- ports : Should contain a list of phandles pointing to camera + sensor interface ports of IPU devices + + +fim child node +-- + +This is an optional child node of the ipu_csi port nodes. It can be used +to modify the default control values for the video capture Frame +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for +more info on the Frame Interval Monitor. + +Optional properties: +- enable : enable (1) or disable (0) the FIM; +- num-avg : how many frame intervals the FIM will average; +- num-skip: how many frames the FIM will skip after a video + capture restart before beginning to sample frame + intervals; +- tolerance-range : a range of tolerances for the averaged frame + interval error, specified as , in usec. + The FIM will signal a frame interval error if + min < error < max. If the max is <= min, then + tolerance range is disabled (interval error if + error > min). +- input-capture-channel: an input capture channel and channel flags, +specified as . The channel number +must be 0 or 1. The flags can be +IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or +IRQ_TYPE_EDGE_BOTH, and specify which input +capture signal edge will trigger the event. If +an input capture channel is specified, the FIM +will use this method to measure frame intervals +instead of via the EOF interrupt. The input capture +method is much preferred over EOF as it is not +subject to interrupt latency errors. However it +requires routing the VSYNC or FIELD output +signals of the camera sensor to one of the +i.MX input capture pads (SD1_DAT0, SD1_DAT1), +which also gives up support for SD1. + + +mipi_csi2 node +-- + +This is the device node for the MIPI CSI-2 Receiver, required for MIPI +CSI-2 sensors. + +Required properties: +- compatible : "fsl,imx-mipi-csi2"; +- reg : physical base address and l
[PATCH v2 14/19] media: imx: Add Camera Interface subdev driver
This is the camera interface driver that provides the v4l2 user interface. Frames can be received from various sources: - directly from SMFC for capturing unconverted images directly from camera sensors. - from the IC pre-process encode task. - from the IC pre-process viewfinder task. - from the IC post-process task. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile|2 +- drivers/staging/media/imx/imx-camif.c | 1010 + 2 files changed, 1011 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/imx/imx-camif.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index d2a962c..fe9e992 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -8,4 +8,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o - +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o diff --git a/drivers/staging/media/imx/imx-camif.c b/drivers/staging/media/imx/imx-camif.c new file mode 100644 index 000..3cf167e --- /dev/null +++ b/drivers/staging/media/imx/imx-camif.c @@ -0,0 +1,1010 @@ +/* + * Video Camera Capture Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2012-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +#define DEVICE_NAME "imx-media-camif" + +#define CAMIF_NUM_PADS 2 + +#define CAMIF_DQ_TIMEOUT5000 + +struct camif_priv; + +struct camif_priv { + struct device *dev; + struct video_devicevfd; + struct media_pipeline mp; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CAMIF_NUM_PADS]; + struct media_pad vd_pad; + int id; + int input_pad; + int output_pad; + + struct v4l2_mbus_framefmt format_mbus[CAMIF_NUM_PADS]; + const struct imx_media_pixfmt *cc[CAMIF_NUM_PADS]; + + /* dma buffer ring */ + struct imx_media_dma_buf_ring *in_ring; + struct v4l2_subdev *src_sd; + + struct mutex mutex; /* capture device mutex */ + spinlock_t q_lock; /* protect ready_q */ + + /* buffer queue used in videobuf2 */ + struct vb2_queue buffer_queue; + + /* streaming buffer queue */ + struct list_head ready_q; + + /* controls inherited from subdevs */ + struct v4l2_ctrl_handler ctrl_hdlr; + + /* misc status */ + intcurrent_input; /* the current input */ + v4l2_std_idcurrent_std; /* current standard */ + bool stop; /* streaming is stopping */ +}; + +/* In bytes, per queue */ +#define VID_MEM_LIMIT SZ_64M + +static struct vb2_ops camif_qops; + +/* + * Video ioctls follow + */ + +static int vidioc_querycap(struct file *file, void *fh, + struct v4l2_capability *cap) +{ + strncpy(cap->driver, DEVICE_NAME, sizeof(cap->driver) - 1); + strncpy(cap->card, DEVICE_NAME, sizeof(cap->card) - 1); + cap->bus_info[0] = 0; + cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; + + return 0; +} + +static int camif_enum_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_fmtdesc *f) +{ + const struct imx_media_pixfmt *cc; + u32 code; + int ret; + + ret = imx_media_enum_format(&code, f->index, true, true); + if (ret) + return ret; + cc = imx_media_find_format(0, code, true, true); + if (!cc) + return -EINVAL; + + f->pixelformat = cc->fourcc; + + return 0; +} + +static int camif_g_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct camif_priv *priv = video_drvdata(file); + struct v4l2_mbus_framefmt *outfmt; + + /* user format is the same as the format from output pad */ + outfmt = &priv->format_mbus[priv->output_pad]; + return imx_media_mbus_fmt_to_pix_fmt(&f->fmt.pix, outfmt); +} + +static int camif_try_fmt_vid_cap(struct file *file, void *fh, +struct v4l2_format *f) +{ + return camif_g_fmt_vid_cap(file, fh, f); +} + +static int camif_s_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct camif_priv
[PATCH v2 15/19] media: imx: Add MIPI CSI-2 Receiver subdev driver
Adds MIPI CSI-2 Receiver subdev driver. This subdev is required for sensors with a MIPI CSI2 interface. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile| 1 + drivers/staging/media/imx/imx-mipi-csi2.c | 509 ++ 2 files changed, 510 insertions(+) create mode 100644 drivers/staging/media/imx/imx-mipi-csi2.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index fe9e992..0decef7 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o diff --git a/drivers/staging/media/imx/imx-mipi-csi2.c b/drivers/staging/media/imx/imx-mipi-csi2.c new file mode 100644 index 000..84df16e --- /dev/null +++ b/drivers/staging/media/imx/imx-mipi-csi2.c @@ -0,0 +1,509 @@ +/* + * MIPI CSI-2 Receiver Subdev for Freescale i.MX5/6 SOC. + * + * Copyright (c) 2012-2014 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +/* + * there must be 5 pads: 1 input pad from sensor, and + * the 4 virtual channel output pads + */ +#define CSI2_NUM_SINK_PADS 1 +#define CSI2_NUM_SRC_PADS 4 +#define CSI2_NUM_PADS 5 + +struct imxcsi2_dev { + struct device *dev; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CSI2_NUM_PADS]; + struct v4l2_mbus_framefmt format_mbus; + struct v4l2_subdev *src_sd; + struct v4l2_subdev *sink_sd[CSI2_NUM_SRC_PADS]; + intinput_pad; + struct clk *dphy_clk; + struct clk *cfg_clk; + struct clk *pix_clk; /* what is this? */ + void __iomem *base; + int intr1; + int intr2; + struct v4l2_of_bus_mipi_csi2 bus; + boolon; + boolstream_on; +}; + +#define DEVICE_NAME "imx-mipi-csi2" + +/* Register offsets */ +#define CSI2_VERSION0x000 +#define CSI2_N_LANES0x004 +#define CSI2_PHY_SHUTDOWNZ 0x008 +#define CSI2_DPHY_RSTZ 0x00c +#define CSI2_RESETN 0x010 +#define CSI2_PHY_STATE 0x014 +#define CSI2_DATA_IDS_1 0x018 +#define CSI2_DATA_IDS_2 0x01c +#define CSI2_ERR1 0x020 +#define CSI2_ERR2 0x024 +#define CSI2_MSK1 0x028 +#define CSI2_MSK2 0x02c +#define CSI2_PHY_TST_CTRL0 0x030 +#define CSI2_PHY_TST_CTRL1 0x034 +#define CSI2_SFT_RESET 0xf00 + +static inline struct imxcsi2_dev *sd_to_dev(struct v4l2_subdev *sdev) +{ + return container_of(sdev, struct imxcsi2_dev, sd); +} + +static inline u32 imxcsi2_read(struct imxcsi2_dev *csi2, unsigned int regoff) +{ + return readl(csi2->base + regoff); +} + +static inline void imxcsi2_write(struct imxcsi2_dev *csi2, u32 val, +unsigned int regoff) +{ + writel(val, csi2->base + regoff); +} + +static void imxcsi2_set_lanes(struct imxcsi2_dev *csi2) +{ + int lanes = csi2->bus.num_data_lanes; + + imxcsi2_write(csi2, lanes - 1, CSI2_N_LANES); +} + +static void imxcsi2_enable(struct imxcsi2_dev *csi2, bool enable) +{ + if (enable) { + imxcsi2_write(csi2, 0x, CSI2_PHY_SHUTDOWNZ); + imxcsi2_write(csi2, 0x, CSI2_DPHY_RSTZ); + imxcsi2_write(csi2, 0x, CSI2_RESETN); + } else { + imxcsi2_write(csi2, 0x0, CSI2_PHY_SHUTDOWNZ); + imxcsi2_write(csi2, 0x0, CSI2_DPHY_RSTZ); + imxcsi2_write(csi2, 0x0, CSI2_RESETN); + } +} + +static void imxcsi2_reset(struct imxcsi2_dev *csi2) +{ + imxcsi2_enable(csi2, false); + + imxcsi2_write(csi2, 0x0001, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x0002, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x00010044, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x0014, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x0002, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST
[PATCH v2 13/19] media: imx: Add IC subdev drivers
This is a set of three media entity subdevice drivers for the i.MX Image Converter. The i.MX IC module contains three independent "tasks": - Pre-processing Encode task: video frames are routed directly from the CSI and can be scaled, color-space converted, and rotated. Scaled output is limited to 1024x1024 resolution. Output frames are routed to the camera interface entities (camif). - Pre-processing Viewfinder task: this task can perform the same conversions as the pre-process encode task, but in addition can be used for hardware motion compensated deinterlacing. Frames can come either directly from the CSI or from the SMFC entities (memory buffers via IDMAC channels). Scaled output is limited to 1024x1024 resolution. Output frames can be routed to various sinks including the post-processing task entities. - Post-processing task: same conversions as pre-process encode. However this entity sends frames to the i.MX IPU image converter which supports image tiling, which allows scaled output up to 4096x4096 resolution. Output frames can be routed to the camera interfaces. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile|2 + drivers/staging/media/imx/imx-ic-common.c | 113 +++ drivers/staging/media/imx/imx-ic-pp.c | 636 drivers/staging/media/imx/imx-ic-prpenc.c | 1037 + drivers/staging/media/imx/imx-ic-prpvf.c | 1180 + drivers/staging/media/imx/imx-ic.h| 36 + 6 files changed, 3004 insertions(+) create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 3559d7b..d2a962c 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -1,8 +1,10 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ imx-media-of.o +imx-ic-objs := imx-ic-common.o imx-ic-prpenc.o imx-ic-prpvf.o imx-ic-pp.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c new file mode 100644 index 000..1b40558 --- /dev/null +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -0,0 +1,113 @@ +/* + * V4L2 Image Converter Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include "imx-media.h" +#include "imx-ic.h" + +static struct imx_ic_ops *ic_ops[IC_NUM_TASKS] = { + [IC_TASK_ENCODER]= &imx_ic_prpenc_ops, + [IC_TASK_VIEWFINDER] = &imx_ic_prpvf_ops, + [IC_TASK_POST_PROCESSOR] = &imx_ic_pp_ops, +}; + +static int imx_ic_probe(struct platform_device *pdev) +{ + struct imx_media_internal_sd_platformdata *pdata; + struct imx_ic_priv *priv; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + platform_set_drvdata(pdev, &priv->sd); + priv->dev = &pdev->dev; + + /* get our ipu_id, grp_id and IC task id */ + pdata = priv->dev->platform_data; + priv->ipu_id = pdata->ipu_id; + switch (pdata->grp_id) { + case IMX_MEDIA_GRP_ID_IC_PRPENC: + priv->task_id = IC_TASK_ENCODER; + break; + case IMX_MEDIA_GRP_ID_IC_PRPVF: + priv->task_id = IC_TASK_VIEWFINDER; + break; + case IMX_MEDIA_GRP_ID_IC_PP0...IMX_MEDIA_GRP_ID_IC_PP3: + priv->task_id = IC_TASK_POST_PROCESSOR; + break; + default: + return -EINVAL; + } + + v4l2_subdev_init(&priv->sd, ic_ops[priv->task_id]->subdev_ops); + v4l2_set_subdevdata(&priv->sd, priv); + priv->sd.internal_ops = ic_ops[priv->task_id]->internal_ops; + priv->sd.entity.ops = ic_ops[priv->task_id]->entity_ops; + priv->sd.entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; + priv->sd.dev = &pdev->dev; + priv->sd.owner = THIS_MODULE; + priv->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; + priv->sd.grp_id = pdata->grp_id; + strncpy(priv->sd.name, pdata->sd_name, sizeof(priv->sd.name)); + + ret = ic_ops[priv->task_id]->
[PATCH v2 19/19] ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers
Enable imx v4l2 staging drivers. For video capture on the SabreAuto, the ADV7180 video decoder also requires the i2c-mux-gpio and the max7310 port expander. The Sabrelite requires PWM clocks for the OV5640. Signed-off-by: Steve Longerbeam --- arch/arm/configs/imx_v6_v7_defconfig | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index cbe7faf..5da4d8e 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -51,6 +51,7 @@ CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y +CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" CONFIG_KEXEC=y CONFIG_CPU_FREQ=y @@ -181,6 +182,7 @@ CONFIG_SERIAL_FSL_LPUART=y CONFIG_SERIAL_FSL_LPUART_CONSOLE=y # CONFIG_I2C_COMPAT is not set CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MUX=y CONFIG_I2C_MUX_GPIO=y # CONFIG_I2C_HELPER_AUTO is not set CONFIG_I2C_ALGOPCF=m @@ -194,11 +196,11 @@ CONFIG_GPIO_SYSFS=y CONFIG_GPIO_MC9S08DZ60=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_STMPE=y -CONFIG_POWER_SUPPLY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_IMX=y CONFIG_POWER_RESET_SYSCON=y CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_SUPPLY=y CONFIG_SENSORS_GPIO_FAN=y CONFIG_SENSORS_IIO_HWMON=y CONFIG_THERMAL=y @@ -221,6 +223,8 @@ CONFIG_REGULATOR_PFUZE100=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_RC_SUPPORT=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_RC_DEVICES=y CONFIG_IR_GPIO_CIR=y CONFIG_MEDIA_USB_SUPPORT=y @@ -229,6 +233,8 @@ CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_SOC_CAMERA=y CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_CODA=y +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +CONFIG_VIDEO_ADV7180=m CONFIG_SOC_CAMERA_OV2640=y CONFIG_IMX_IPUV3_CORE=y CONFIG_DRM=y @@ -338,6 +344,8 @@ CONFIG_FSL_EDMA=y CONFIG_IMX_SDMA=y CONFIG_MXS_DMA=y CONFIG_STAGING=y +CONFIG_STAGING_MEDIA=y +CONFIG_COMMON_CLK_PWM=y CONFIG_IIO=y CONFIG_VF610_ADC=y CONFIG_MPL3115=y -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 16/19] media: imx: Add video switch subdev driver
From: Philipp Zabel This driver can handle SoC internal and extern video bus multiplexers, controlled either by register bit fields or by GPIO. Signed-off-by: Sascha Hauer Signed-off-by: Philipp Zabel Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-video-switch.c | 351 +++ 2 files changed, 352 insertions(+) create mode 100644 drivers/staging/media/imx/imx-video-switch.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 0decef7..e3d6d8d 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -10,3 +10,4 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o diff --git a/drivers/staging/media/imx/imx-video-switch.c b/drivers/staging/media/imx/imx-video-switch.c new file mode 100644 index 000..79d3837 --- /dev/null +++ b/drivers/staging/media/imx/imx-video-switch.c @@ -0,0 +1,351 @@ +/* + * devicetree probed mediacontrol video multiplexer. + * + * Copyright (C) 2013 Sascha Hauer, Pengutronix + * Copyright (c) 2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +struct vidsw { + struct device *dev; + struct imx_media_dev *md; + struct v4l2_subdev subdev; + struct media_pad *pads; + struct v4l2_mbus_framefmt *format_mbus; + struct v4l2_of_endpoint *endpoint; + struct regmap_field *field; + struct gpio_desc *gpio; + int output_pad; + int numpads; + int active; +}; + +#define to_vidsw(sd) container_of(sd, struct vidsw, subdev) + +static int vidsw_set_mux(struct vidsw *vidsw, int input_index) +{ + if (vidsw->active >= 0) { + if (vidsw->active == input_index) + return 0; + else + return -EBUSY; + } + + vidsw->active = input_index; + + dev_dbg(vidsw->dev, "setting %d active\n", vidsw->active); + + if (vidsw->field) + regmap_field_write(vidsw->field, vidsw->active); + else if (vidsw->gpio) + gpiod_set_value(vidsw->gpio, vidsw->active); + + return 0; +} + +static int vidsw_link_setup(struct media_entity *entity, + const struct media_pad *local, + const struct media_pad *remote, u32 flags) +{ + struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); + struct vidsw *vidsw = to_vidsw(sd); + + dev_dbg(vidsw->dev, "link setup %s -> %s", remote->entity->name, + local->entity->name); + + if (local->flags & MEDIA_PAD_FL_SINK) { + if (!(flags & MEDIA_LNK_FL_ENABLED)) { + if (local->index == vidsw->active) { + dev_dbg(vidsw->dev, "going inactive\n"); + vidsw->active = -1; + } + return 0; + } + + return vidsw_set_mux(vidsw, local->index); + } + + return 0; +} + +static struct media_entity_operations vidsw_ops = { + .link_setup = vidsw_link_setup, + .link_validate = v4l2_subdev_link_validate, +}; + +/* + * retrieve our pads parsed from the OF graph by the media device + */ +static int vidsw_registered(struct v4l2_subdev *sd) +{ + struct vidsw *vidsw = container_of(sd, struct vidsw, subdev); + struct device_node *np = vidsw->dev->of_node; + struct imx_media_subdev *imxsd; + struct device_node *epnode; + struct imx_media_pad *pad; + int i, ret; + + vidsw->md = dev_get_drvdata(sd->v4l2_dev->dev); + + imxsd = imx_media_find_subdev_by_sd(vidsw->md, sd); + if (IS_ERR(imxsd)) + return PTR_ERR(imxsd); + + if (imxsd->num_sink_pads < 2 || imxsd->num_src_pads != 1) + return -EINVAL; + + vidsw->numpads = imxsd->num_sink_pads + imxsd->num_src_pads; + + vidsw->pads = devm_kzalloc(vidsw->dev, + vidsw->numpads * sizeof(*vidsw->pads), + GFP_KERNEL); + if (!vidsw->pads) + return -ENOMEM; + +
[PATCH v2 17/19] media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver
This driver is based on ov5640_mipi.c from Freescale imx_3.10.17_1.0.0_beta branch, modified heavily to bring forward to latest interfaces and code cleanup. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Kconfig |8 + drivers/staging/media/imx/Makefile |2 + drivers/staging/media/imx/ov5640-mipi.c | 2349 +++ 3 files changed, 2359 insertions(+) create mode 100644 drivers/staging/media/imx/ov5640-mipi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index ce2d2c8..09f373d 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -17,5 +17,13 @@ config VIDEO_IMX_CAMERA ---help--- A video4linux camera capture driver for i.MX5/6. +config IMX_OV5640_MIPI + tristate "OmniVision OV5640 MIPI CSI-2 camera support" + depends on GPIOLIB && VIDEO_IMX_CAMERA + select IMX_MIPI_CSI2 + default y + ---help--- + MIPI CSI-2 OV5640 Camera support. + endmenu endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index e3d6d8d..f96e623 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -11,3 +11,5 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o + +obj-$(CONFIG_IMX_OV5640_MIPI) += ov5640-mipi.o diff --git a/drivers/staging/media/imx/ov5640-mipi.c b/drivers/staging/media/imx/ov5640-mipi.c new file mode 100644 index 000..a83b581 --- /dev/null +++ b/drivers/staging/media/imx/ov5640-mipi.c @@ -0,0 +1,2349 @@ +/* + * Copyright (c) 2014 Mentor Graphics Inc. + * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OV5640_VOLTAGE_ANALOG 280 +#define OV5640_VOLTAGE_DIGITAL_CORE 150 +#define OV5640_VOLTAGE_DIGITAL_IO 180 + +#define MIN_FPS 15 +#define MAX_FPS 30 +#define DEFAULT_FPS 30 + +/* min/typical/max system clock (xclk) frequencies */ +#define OV5640_XCLK_MIN 600 +#define OV5640_XCLK_TYP 2400 +#define OV5640_XCLK_MAX 5400 + +/* min/typical/max pixel clock (mclk) frequencies */ +#define OV5640_MCLK_MIN 4800 +#define OV5640_MCLK_TYP 4800 +#define OV5640_MCLK_MAX 9600 + +#define OV5640_CHIP_ID 0x300A +#define OV5640_SLAVE_ID 0x3100 +#define OV5640_DEFAULT_SLAVE_ID 0x3c + +#define OV5640_MAX_CONTROLS 64 + +enum ov5640_mode { + ov5640_mode_MIN = 0, + ov5640_mode_QCIF_176_144 = 0, + ov5640_mode_QVGA_320_240, + ov5640_mode_VGA_640_480, + ov5640_mode_NTSC_720_480, + ov5640_mode_PAL_720_576, + ov5640_mode_XGA_1024_768, + ov5640_mode_720P_1280_720, + ov5640_mode_1080P_1920_1080, + ov5640_mode_QSXGA_2592_1944, + ov5640_num_modes, + ov5640_mode_INIT = 0xff, /*only for sensor init*/ +}; + +enum ov5640_frame_rate { + ov5640_15_fps, + ov5640_30_fps +}; + +static int ov5640_framerates[] = { + [ov5640_15_fps] = 15, + [ov5640_30_fps] = 30, +}; +#define ov5640_num_framerates ARRAY_SIZE(ov5640_framerates) + +/* image size under 1280 * 960 are SUBSAMPLING + * image size upper 1280 * 960 are SCALING + */ +enum ov5640_downsize_mode { + SUBSAMPLING, + SCALING, +}; + +struct reg_value { + u16 reg_addr; + u8 val; + u8 mask; + u32 delay_ms; +}; + +struct ov5640_mode_info { + enum ov5640_mode mode; + enum ov5640_downsize_mode dn_mode; + u32 width; + u32 height; + struct reg_value *init_data_ptr; + u32 init_data_size; +}; + +struct ov5640_dev { + struct i2c_client *i2c_client; + struct device *dev; + struct v4l2_subdev sd; + struct media_pad pad; + struct v4l2_ctrl_handler ctrl_hdl; + struct v4l2_of_endpoint ep; /* the parsed DT endpoint info */ + struct v4l2_mbus_framefmt fmt; + struct v4l2_captureparm streamcap; + struct clk *xclk; /* system clock to OV5640 */ + int xclk_freq;/* requested xclk freq from devicetree */ + + enum ov5640_mode current_mode; + enum ov5640_frame_rate current_fr; + + bool on; + bool awb_on; + bool agc_on; + + /* cached control settings */ + int ctrl_cache[OV5640_MAX_CONTROLS]; + + struct gpio_desc *reset_gpio; + struct gpio_desc *pwdn_gpio; + struct gpio_de
[PATCH v2 1/2] staging: unisys: visorbus: visorchipset.c: Don't check for more than PAGE_SIZE length
From: David Binder Since a sysfs entry is allocated 1 page of memory (4096 bytes) by default, there is no need to enforce this limit in the driver. This patch corrects visorbus/visorchipset.c. Signed-off-by: David Binder Signed-off-by: David Kershner Reported-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorbus/visorchipset.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 7cbf803..501eb9e 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -188,7 +188,7 @@ static ssize_t toolaction_show(struct device *dev, visorchannel_read(controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, tool_action), &tool_action, sizeof(u8)); - return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action); + return sprintf(buf, "%u\n", tool_action); } static ssize_t toolaction_store(struct device *dev, @@ -223,8 +223,7 @@ static ssize_t boottotool_show(struct device *dev, offsetof(struct spar_controlvm_channel_protocol, efi_spar_ind), &efi_spar_indication, sizeof(struct efi_spar_indication)); - return scnprintf(buf, PAGE_SIZE, "%u\n", -efi_spar_indication.boot_to_tool); + return sprintf(buf, "%u\n", efi_spar_indication.boot_to_tool); } static ssize_t boottotool_store(struct device *dev, @@ -259,7 +258,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr, offsetof(struct spar_controlvm_channel_protocol, installation_error), &error, sizeof(u32)); - return scnprintf(buf, PAGE_SIZE, "%i\n", error); + return sprintf(buf, "%i\n", error); } static ssize_t error_store(struct device *dev, struct device_attribute *attr, @@ -292,7 +291,7 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr, offsetof(struct spar_controlvm_channel_protocol, installation_text_id), &text_id, sizeof(u32)); - return scnprintf(buf, PAGE_SIZE, "%i\n", text_id); + return sprintf(buf, "%i\n", text_id); } static ssize_t textid_store(struct device *dev, struct device_attribute *attr, @@ -324,7 +323,7 @@ static ssize_t remaining_steps_show(struct device *dev, offsetof(struct spar_controlvm_channel_protocol, installation_remaining_steps), &remaining_steps, sizeof(u16)); - return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps); + return sprintf(buf, "%hu\n", remaining_steps); } static ssize_t remaining_steps_store(struct device *dev, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel