Re: [PATCH v2] gpiolib: add hogs support for machine code

2018-04-26 Thread Bartosz Golaszewski
2018-04-26 14:07 GMT+02:00 Linus Walleij <linus.wall...@linaro.org>: > On Tue, Apr 10, 2018 at 10:30 PM, Bartosz Golaszewski <b...@bgdev.pl> wrote: > >> Board files constitute a significant part of the users of the legacy >> GPIO framework. In many cases they

Re: [PATCH] gpiolib: add hogs support for machine code

2018-04-10 Thread Bartosz Golaszewski
tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/gpiolib-add-hogs-support-for-machine-code/20180410-232047 > base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git > for-next

[PATCH v2] gpiolib: add hogs support for machine code

2018-04-10 Thread Bartosz Golaszewski
the machine.h API with support for registering hog tables in board files. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- v1 -> v2: - kbuild bot complains about enum gpiod_flags having incomplete type although it builds fine for me locally: change the type of dflags to int Documentati

[PATCH] gpiolib: add hogs support for machine code

2018-04-10 Thread Bartosz Golaszewski
the machine.h API with support for registering hog tables in board files. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- Documentation/driver-api/gpio/board.rst | 16 ++ drivers/gpio/gpiolib.c | 67 + include/linux/gpio/machine.h

[PATCH v4 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-14 Thread Bartosz Golaszewski
struct. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Reviewed-by: Jonathan Cameron <jonathan.came...@huawei.com> --- include/linux/irq_sim.h | 44 ++ kernel/irq/Kconfig | 5 ++ kernel/irq/Makefile | 1 + kernel/irq/irq_si

[PATCH v4 0/3] simulated interrupts

2017-08-14 Thread Bartosz Golaszewski
in the gpio-mockup testing driver. NOTE: The next candidate for using this API would be iio-dummy-evgen. v1 -> v2: - added a call to irq_work_sync in irq_sim_fini() v2 -> v3: - added the license header to new files - added Acked-by's and Reviewed-by's v3 -> v4: - moved the .c file to kernel/irq

[PATCH v4 3/3] gpio: mockup: use irq_sim

2017-08-14 Thread Bartosz Golaszewski
Shrink the driver by removing the code dealing with dummy interrupts and replacing it with calls to the irq_sim API. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Acked-by: Jonathan Cameron <jonathan.came...@huawei.com> Reviewed-by: Linus Walleij <linus.wall...@linaro.org>

[PATCH v4 2/3] irq/irq_sim: add a devres variant of irq_sim_init()

2017-08-14 Thread Bartosz Golaszewski
Add a resource managed version of irq_sim_init(). This can be conveniently used in device drivers. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Acked-by: Jonathan Cameron <jonathan.came...@huawei.com> --- Documentation/driver-model/devres.txt | 1 + include/lin

Re: [PATCH v3 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-14 Thread Bartosz Golaszewski
2017-08-14 16:48 GMT+02:00 Thomas Gleixner <t...@linutronix.de>: > On Mon, 14 Aug 2017, Bartosz Golaszewski wrote: >> 2017-08-14 15:06 GMT+02:00 Thomas Gleixner <t...@linutronix.de>: >> > On Mon, 14 Aug 2017, Bartosz Golaszewski wrote: >> > >> &g

Re: [PATCH v3 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-14 Thread Bartosz Golaszewski
2017-08-14 15:06 GMT+02:00 Thomas Gleixner <t...@linutronix.de>: > On Mon, 14 Aug 2017, Bartosz Golaszewski wrote: > >> Implement a simple, irq_work-based framework for simulating >> interrupts. Currently the API exposes routines for initializing and >> deini

[PATCH v3 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-14 Thread Bartosz Golaszewski
struct. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Reviewed-by: Jonathan Cameron <jonathan.came...@huawei.com> --- include/linux/irq_sim.h | 44 ++ init/Kconfig| 4 ++ kernel/Makefile | 1 + kernel/irq_sim.c

[PATCH v3 0/3] simulated interrupts

2017-08-14 Thread Bartosz Golaszewski
in the gpio-mockup testing driver. NOTE: The next candidate for using this API would be iio-dummy-evgen. v1 -> v2: - added a call to irq_work_sync in irq_sim_fini() v2 -> v3: - added the license header to new files - added Acked-by's and Reviewed-by's Bartosz Golaszewski (3): irq/irq_sim: add a

[PATCH v3 3/3] gpio: mockup: use irq_sim

2017-08-14 Thread Bartosz Golaszewski
Shrink the driver by removing the code dealing with dummy interrupts and replacing it with calls to the irq_sim API. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Acked-by: Jonathan Cameron <jonathan.came...@huawei.com> Reviewed-by: Linus Walleij <linus.wall...@linaro.org>

[PATCH v3 2/3] irq/irq_sim: add a devres variant of irq_sim_init()

2017-08-14 Thread Bartosz Golaszewski
Add a resource managed version of irq_sim_init(). This can be conveniently used in device drivers. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> Acked-by: Jonathan Cameron <jonathan.came...@huawei.com> --- Documentation/driver-model/devres.txt | 1 + include/lin

Re: [PATCH v2 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-14 Thread Bartosz Golaszewski
2017-08-12 13:43 GMT+02:00 Jonathan Cameron <ji...@kernel.org>: > On Tue, 1 Aug 2017 16:50:26 +0200 > Bartosz Golaszewski <b...@bgdev.pl> wrote: > >> Implement a simple, irq_work-based framework for simulating >> interrupts. Currently the API

[PATCH v2 2/3] irq/irq_sim: add a devres variant of irq_sim_init()

2017-08-01 Thread Bartosz Golaszewski
Add a resource managed version of irq_sim_init(). This can be conveniently used in device drivers. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- Documentation/driver-model/devres.txt | 1 + include/linux/irq_sim.h | 4 kernel/irq_sim.c

[PATCH v2 3/3] gpio: mockup: use irq_sim

2017-08-01 Thread Bartosz Golaszewski
Shrink the driver by removing the code dealing with dummy interrupts and replacing it with calls to the irq_sim API. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-mockup.c | 77 +- 2

[PATCH v2 0/3] simulated interrupts

2017-08-01 Thread Bartosz Golaszewski
in the gpio-mockup testing driver. NOTE: The next candidate for using this API would be iio-dummy-evgen. v1 -> v2: - added a call to irq_work_sync in irq_sim_fini() Bartosz Golaszewski (3): irq/irq_sim: add a simple interrupt simulator framework irq/irq_sim: add a devres variant of irq_sim_i

[PATCH v2 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-08-01 Thread Bartosz Golaszewski
struct. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- include/linux/irq_sim.h | 37 +++ init/Kconfig| 4 ++ kernel/Makefile | 1 + kernel/irq_sim.c| 119 4 files changed, 161 inse

Re: [PATCH 0/3] simulated interrupts

2017-07-19 Thread Bartosz Golaszewski
2017-07-19 14:25 GMT+02:00 Thomas Gleixner <t...@linutronix.de>: > On Wed, 19 Jul 2017, Bartosz Golaszewski wrote: > >> Some frameworks (e.g. iio, gpiolib) use irq_work to implement simulated >> interrupts that can be 'fired' from process context when needed and >&

[PATCH 1/3] irq/irq_sim: add a simple interrupt simulator framework

2017-07-19 Thread Bartosz Golaszewski
struct. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- include/linux/irq_sim.h | 37 +++ init/Kconfig| 4 ++ kernel/Makefile | 1 + kernel/irq_sim.c| 118 4 files changed, 160 inse

[PATCH 3/3] gpio: mockup: use irq_sim

2017-07-19 Thread Bartosz Golaszewski
Shrink the driver by removing the code dealing with dummy interrupts and replacing it with calls to the irq_sim API. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-mockup.c | 77 +- 2

[PATCH 2/3] irq/irq_sim: add a devres variant of irq_sim_init()

2017-07-19 Thread Bartosz Golaszewski
Add a resource managed version of irq_sim_init(). This can be conveniently used in device drivers. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- Documentation/driver-model/devres.txt | 1 + include/linux/irq_sim.h | 4 kernel/irq_sim.c

[PATCH 0/3] simulated interrupts

2017-07-19 Thread Bartosz Golaszewski
in the gpio-mockup testing driver. NOTE: The next candidate for using this API would be iio-dummy-evgen. Bartosz Golaszewski (3): irq/irq_sim: add a simple interrupt simulator framework irq/irq_sim: add a devres variant of irq_sim_init() gpio: mockup: use irq_sim Documentation/driver-model

Re: [PATCH 0/5] irq: generic-chip: resource management improvements

2017-06-21 Thread Bartosz Golaszewski
2017-06-20 16:14 GMT+02:00 Thomas Gleixner <t...@linutronix.de>: > On Tue, 20 Jun 2017, Bartosz Golaszewski wrote: >> 2017-06-20 12:41 GMT+02:00 Marc Zyngier <marc.zyng...@arm.com>: >> > There was a kbuild report from June 1st with worrying warnings on x86_64 &

Re: [PATCH 0/5] irq: generic-chip: resource management improvements

2017-06-20 Thread Bartosz Golaszewski
2017-05-31 18:06 GMT+02:00 Bartosz Golaszewski <b...@bgdev.pl>: > This series is a follow-up to [1]. > > Some users of irq_alloc_generic_chip() are modules which can be > removed (e.g. gpio-ml-ioh) but have no means of freeing the allocated > generic chip. > > Last time

[PATCH 1/5] irq: generic-chip: provide irq_free_generic_chip()

2017-05-31 Thread Bartosz Golaszewski
-by: Bartosz Golaszewski <b...@bgdev.pl> --- include/linux/irq.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index f887351..cba41a4 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -22,6 +22,7 @@ #include #include #include +#i

[PATCH 0/5] irq: generic-chip: resource management improvements

2017-05-31 Thread Bartosz Golaszewski
of irq_alloc_generic_chip() & irq_setup_generic_chip(). They will be used in drivers where applicable. Device resources are released in reverse order so it's ok to call devm_irq_alloc_generic_chip() and then devm_irq_setup_generic_chip(). [1] https://lkml.org/lkml/2017/3/8/550 Bartosz Golaszewski (5):

[PATCH 3/5] irq: generic-chip: export irq_init_generic_chip() locally

2017-05-31 Thread Bartosz Golaszewski
This function will be used in the devres variant of irq_alloc_generic_chip(). Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- kernel/irq/generic-chip.c | 7 +++ kernel/irq/internals.h| 11 +++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/kern

[PATCH 4/5] irq: generic-chip: provide devm_irq_alloc_generic_chip()

2017-05-31 Thread Bartosz Golaszewski
Provide a resource managed variant of irq_alloc_generic_chip(). Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- Documentation/driver-model/devres.txt | 1 + include/linux/irq.h | 5 + kernel/irq/devres.c | 34 +++

[PATCH 5/5] irq: generic-chip: provide devm_irq_setup_generic_chip()

2017-05-31 Thread Bartosz Golaszewski
Provide a resource managed variant of irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- Documentation/driver-model/devres.txt | 1 + include/linux/irq.h | 3 ++ kernel/irq/devres.c | 52

[PATCH 2/5] irq: generic-chip: provide irq_destroy_generic_chip()

2017-05-31 Thread Bartosz Golaszewski
Most users of irq_alloc_generic_chip() call irq_setup_generic_chip() too. To simplify the cleanup provide a function that both removes a generic chip and frees its memory. Signed-off-by: Bartosz Golaszewski <b...@bgdev.pl> --- include/linux/irq.h | 8 1 file changed, 8 inse

[PATCH v2] irqdesc: add a resource managed version of irq_alloc_descs()

2017-02-10 Thread Bartosz Golaszewski
Add a devres flavor of __devm_irq_alloc_descs() and corresponding helper macros. Signed-off-by: Bartosz Golaszewski <bgolaszew...@baylibre.com> --- v1 -> v2: - added kernel docs for the new function - made the from and cnt fields of struct irq_desc_devres unsigned integers as thi

[PATCH] irqdesc: add memory managed version of irq_alloc_descs()

2017-02-07 Thread Bartosz Golaszewski
Add a devres flavor of __devm_irq_alloc_descs() and corresponding helper macros. Signed-off-by: Bartosz Golaszewski <bgolaszew...@baylibre.com> --- I initially sent this patch as part of the series extending the GPIO testing driver, but as suggested by Linus - I used the non-managed v