Re: [PATCH] gpio: gpio-104-dio-48e: Fixed coding style issues

2021-04-08 Thread William Breathitt Gray
gt; - unsigned long flags; > - unsigned control; > + const unsigned int control_addr = dio48egpio->base + 3 + control_port * > 4; > + This empty line is not necessary and can be removed. > + unsigned int long flags; This is "unsigned long"

Re: [PATCH v3 3/3] gpio: xilinx: Utilize generic bitmap_get_value and _set_value

2021-03-27 Thread William Breathitt Gray
p_set_value() we are also specifying the offset (or start) > > position too. so that the remainder of the array remains unaffected. I > > think it would not be feasible to use bitmap_from/to_arr32() here. > > > You have hard coded start and nbits parameters to 32. How is it not t

Re: [Linux-stm32] [PATCH v10 22/33] counter: Internalize sysfs interface code

2021-03-23 Thread William Breathitt Gray
On Mon, Mar 22, 2021 at 05:44:01PM +0100, Fabrice Gasnier wrote: > On 3/19/21 12:00 PM, William Breathitt Gray wrote: > > static const struct atmel_tcb_config tcb_rm9200_config = { > > diff --git a/drivers/counter/stm32-lptimer-cnt.c > > b/drivers/counter/stm32-lp

[PATCH v10 33/33] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8

2021-03-19 Thread William Breathitt Gray
for the devices may be configured via the irq array module parameter. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 167 +-- drivers/counter/Kconfig | 6 +- 2 files changed, 164 insertions(+), 9 deletions

[PATCH v10 32/33] counter: 104-quad-8: Replace mutex with spinlock

2021-03-19 Thread William Breathitt Gray
This patch replaces the mutex I/O lock with a spinlock. This is in preparation for a subsequent patch adding IRQ support for 104-QUAD-8 devices; we can't sleep in an interrupt context, so we'll need to use a spinlock instead. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray

[PATCH v10 29/33] counter: Implement signalZ_action_component_id sysfs attribute

2021-03-19 Thread William Breathitt Gray
to discover what component ID belongs to the respective Synapse. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 7 drivers/counter/counter-sysfs.c | 45 + 2 files

[PATCH v10 31/33] counter: Implement events_queue_size sysfs attribute

2021-03-19 Thread William Breathitt Gray
to a requirement of the kfifo_alloc function called during reallocation of the queue. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 8 drivers/counter/counter-chrdev.c| 4 ++ drivers/counter/counter-sysfs.c | 44

[PATCH v10 30/33] counter: Implement *_component_id sysfs attributes

2021-03-19 Thread William Breathitt Gray
component ID belongs to which respective extension. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 16 ++- drivers/counter/counter-sysfs.c | 30 - 2 files

[PATCH v10 28/33] tools/counter: Create Counter tools

2021-03-19 Thread William Breathitt Gray
This creates an example Counter program under tools/counter/* to exemplify the Counter character device interface. Cc: Pavel Machek Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + tools/Makefile | 13 ++--- tools/counter/Build | 1

[PATCH v10 25/33] counter: Move counter enums to uapi header

2021-03-19 Thread William Breathitt Gray
This is in preparation for a subsequent patch implementing a character device interface for the Counter subsystem. Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + include/linux/counter.h | 42 +-- include

[PATCH v10 24/33] docs: counter: Update to reflect sysfs internalization

2021-03-19 Thread William Breathitt Gray
The Counter subsystem architecture and driver implementations have changed in order to handle Counter sysfs interactions in a more consistent way. This patch updates the Generic Counter interface documentation to reflect the changes. Signed-off-by: William Breathitt Gray --- Documentation/ABI

[PATCH v10 27/33] docs: counter: Document character device interface

2021-03-19 Thread William Breathitt Gray
This patch adds high-level documentation about the Counter subsystem character device interface. Signed-off-by: William Breathitt Gray --- Documentation/driver-api/generic-counter.rst | 185 ++ .../userspace-api/ioctl/ioctl-number.rst | 1 + 2 files changed, 145

[PATCH v10 26/33] counter: Add character device interface

2021-03-19 Thread William Breathitt Gray
on the respective Counter character device node. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/Makefile | 2 +- drivers/counter/counter-chrdev.c | 482 +++ drivers/counter

[PATCH v10 23/33] counter: Update counter.h comments to reflect sysfs internalization

2021-03-19 Thread William Breathitt Gray
The Counter subsystem architecture and driver implementations have changed in order to handle Counter sysfs interactions in a more consistent way. This patch updates the Generic Counter interface header file comments to reflect the changes. Signed-off-by: William Breathitt Gray --- drivers

[PATCH v10 21/33] counter: Rename counter_count_function to counter_function

2021-03-19 Thread William Breathitt Gray
atrick Havelange Cc: Oleksij Rempel Cc: Kamel Bouhara Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 10 +++ drivers/counter/counter.c | 38 --

[PATCH v10 20/33] counter: Rename counter_signal_value to counter_signal_level

2021-03-19 Thread William Breathitt Gray
Signal values will always be levels so let's be explicit it about it to make the intent of the code clear. Cc: Syed Nayyar Waris Cc: Oleksij Rempel Cc: Kamel Bouhara Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 5

[PATCH v10 16/33] counter: stm32-lptimer-cnt: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the stm32_lptim_cnt_synapse_actions to match actions_list. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-lptimer-cnt.c

[PATCH v10 17/33] counter: stm32-timer-cnt: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the stm32_synapse_actions to match actions_list. Cc: Fabrice Gasnier Cc: Benjamin Gaignard Signed-off-by: William Breathitt Gray --- drivers/counter/stm32

[PATCH v10 19/33] counter: Standardize to ERANGE for limit exceeded errors

2021-03-19 Thread William Breathitt Gray
ERANGE is a semantically better error code to return when an argument value falls outside the supported limit range of a device. Cc: Syed Nayyar Waris Cc: Oleksij Rempel Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Reviewed-by: David Lechner Signed-off-by: William Breathitt

[PATCH v10 18/33] counter: Return error code on invalid modes

2021-03-19 Thread William Breathitt Gray
of the code clear. Cc: Syed Nayyar Waris Cc: Kamel Bouhara Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 20 +++ drivers/counter/microchip-tcb-capture.c | 6 drivers

[PATCH v10 15/33] counter: microchip-tcb-capture: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the mchp_tc_synapse_actions to match actions_list. Cc: Kamel Bouhara Signed-off-by: William Breathitt Gray --- drivers/counter/microchip-tcb-capture.c | 2

[PATCH v10 14/33] counter: interrupt-cnt: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the interrupt_cnt_synapse_actionss to match actions_list. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/interrupt-cnt.c | 2

[PATCH v10 12/33] counter: 104-quad-8: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the quad8_index_actions_list and quad8_synapse_actions_list to match actions_list. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers

[PATCH v10 13/33] counter: ftm-quaddec: Add const qualifier for actions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the ftm_quaddec_synapse_actions to match actions_list. Cc: Patrick Havelange Signed-off-by: William Breathitt Gray --- drivers/counter/ftm-quaddec.c | 2

[PATCH v10 10/33] counter: stm32-lptimer-cnt: Add const qualifier for functions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the stm32_lptim_cnt_functions to match functions_list. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-lptimer-cnt.c | 2

[PATCH v10 11/33] counter: stm32-timer-cnt: Add const qualifier for functions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the stm32_count_functions to match functions_list. Cc: Fabrice Gasnier Cc: Benjamin Gaignard Signed-off-by: William Breathitt Gray --- drivers/counter/stm32

[PATCH v10 09/33] counter: microchip-tcb-capture: Add const qualifier for functions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the mchp_tc_count_functions to match functions_list. Cc: Kamel Bouhara Signed-off-by: William Breathitt Gray --- drivers/counter/microchip-tcb-capture.c | 2

[PATCH v10 02/33] docs: counter: Fix spelling

2021-03-19 Thread William Breathitt Gray
"Miscellaneous" is the correct spelling. Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- Documentation/driver-api/generic-counter.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/driver-api/generic-counter.rst b/Documentat

[PATCH v10 04/33] counter: 104-quad-8: Return error when invalid mode during ceiling_write

2021-03-19 Thread William Breathitt Gray
neric interface") Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c index 4bb9abffae48..233a3acc1377 100644 ---

[PATCH v10 07/33] counter: 104-quad-8: Add const qualifier for functions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the quad8_count_functions_list to match functions_list. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 2

[PATCH v10 08/33] counter: interrupt-cnt: Add const qualifier for functions_list array

2021-03-19 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the interrupt__cnt_functions to match functions_list. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/interrupt-cnt.c | 2 +- 1

[PATCH v10 03/33] counter: 104-quad-8: Remove pointless comment

2021-03-19 Thread William Breathitt Gray
It is obvious that devm_counter_register() is used to register a Counter device, so a comment stating such is pointless here. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/counter/104-quad

[PATCH v10 05/33] counter: 104-quad-8: Annotate hardware config module parameter

2021-03-19 Thread William Breathitt Gray
drivers support automatic configuration (e.g. PNP or PCI) in addition to manually coded parameters. This patch annotates the 104-QUAD-8 driver. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v10 06/33] counter: 104-quad-8: Add const qualifiers for quad8_preset_register_set

2021-03-19 Thread William Breathitt Gray
Add some safety by qualifying the quad8_preset_register_set() function parameters as const. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/counter/104-quad-8.c b

[PATCH v10 01/33] docs: counter: Consolidate Counter sysfs attributes documentation

2021-03-19 Thread William Breathitt Gray
Duplicate ABIs are not valid, so let's consolidate these sysfs attributes into the main sysfs-bus-counter documentation file. Cc: Patrick Havelange Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 76

[PATCH v10 00/33] Introduce the Counter character device interface

2021-03-19 Thread William Breathitt Gray
will provide the return status (system error number) of an event operation. William Breathitt Gray (33): docs: counter: Consolidate Counter sysfs attributes documentation docs: counter: Fix spelling counter: 104-quad-8: Remove pointless comment counter: 104-quad-8: Return error when invalid

Re: [Linux-stm32] [PATCH v9 22/33] counter: Internalize sysfs interface code

2021-03-18 Thread William Breathitt Gray
On Thu, Mar 18, 2021 at 11:10:29AM +0100, Fabrice Gasnier wrote: > On 3/18/21 10:21 AM, Fabrice Gasnier wrote: > > On 3/14/21 10:08 AM, William Breathitt Gray wrote: > >> On Sun, Mar 14, 2021 at 04:56:44PM +0900, William Breathitt Gray wrote: > >>> On Fri, Mar 12, 202

Re: [Linux-stm32] [PATCH v9 22/33] counter: Internalize sysfs interface code

2021-03-14 Thread William Breathitt Gray
On Sun, Mar 14, 2021 at 04:56:44PM +0900, William Breathitt Gray wrote: > On Fri, Mar 12, 2021 at 04:02:42PM +0100, Fabrice Gasnier wrote: > > On 3/9/21 2:19 PM, William Breathitt Gray wrote: > > > +static ssize_t enums_available_show(cons

Re: [Linux-stm32] [PATCH v9 22/33] counter: Internalize sysfs interface code

2021-03-13 Thread William Breathitt Gray
On Fri, Mar 12, 2021 at 04:02:42PM +0100, Fabrice Gasnier wrote: > On 3/9/21 2:19 PM, William Breathitt Gray wrote: > > +static ssize_t enums_available_show(const u32 *const enums, > > + const size_t num_enums, > > +

[PATCH v9 33/33] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8

2021-03-09 Thread William Breathitt Gray
for the devices may be configured via the irq array module parameter. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 167 +-- drivers/counter/Kconfig | 6 +- 2 files changed, 164 insertions(+), 9 deletions

[PATCH v9 32/33] counter: 104-quad-8: Replace mutex with spinlock

2021-03-09 Thread William Breathitt Gray
This patch replaces the mutex I/O lock with a spinlock. This is in preparation for a subsequent patch adding IRQ support for 104-QUAD-8 devices; we can't sleep in an interrupt context, so we'll need to use a spinlock instead. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray

[PATCH v9 31/33] counter: Implement events_queue_size sysfs attribute

2021-03-09 Thread William Breathitt Gray
to a requirement of the kfifo_alloc function called during reallocation of the queue. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 8 drivers/counter/counter-chrdev.c| 4 ++ drivers/counter/counter-sysfs.c | 44

[PATCH v9 30/33] counter: Implement *_component_id sysfs attributes

2021-03-09 Thread William Breathitt Gray
component ID belongs to which respective extension. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 16 ++- drivers/counter/counter-sysfs.c | 30 - 2 files

[PATCH v9 28/33] tools/counter: Create Counter tools

2021-03-09 Thread William Breathitt Gray
This creates an example Counter program under tools/counter/* to exemplify the Counter character device interface. Cc: Pavel Machek Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + tools/Makefile | 13 ++--- tools/counter/Build | 1

[PATCH v9 29/33] counter: Implement signalZ_action_component_id sysfs attribute

2021-03-09 Thread William Breathitt Gray
to discover what component ID belongs to the respective Synapse. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 7 drivers/counter/counter-sysfs.c | 45 + 2 files

[PATCH v9 27/33] docs: counter: Document character device interface

2021-03-09 Thread William Breathitt Gray
This patch adds high-level documentation about the Counter subsystem character device interface. Signed-off-by: William Breathitt Gray --- Documentation/driver-api/generic-counter.rst | 185 ++ .../userspace-api/ioctl/ioctl-number.rst | 1 + 2 files changed, 145

[PATCH v9 26/33] counter: Add character device interface

2021-03-09 Thread William Breathitt Gray
on the respective Counter character device node. Cc: David Lechner Cc: Gwendal Grignou Cc: Dan Carpenter Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/Makefile | 2 +- drivers/counter/counter-chrdev.c | 482 +++ drivers/counter

[PATCH v9 25/33] counter: Move counter enums to uapi header

2021-03-09 Thread William Breathitt Gray
This is in preparation for a subsequent patch implementing a character device interface for the Counter subsystem. Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- MAINTAINERS | 1 + include/linux/counter.h | 42 +-- include

[PATCH v9 24/33] docs: counter: Update to reflect sysfs internalization

2021-03-09 Thread William Breathitt Gray
The Counter subsystem architecture and driver implementations have changed in order to handle Counter sysfs interactions in a more consistent way. This patch updates the Generic Counter interface documentation to reflect the changes. Signed-off-by: William Breathitt Gray --- Documentation/ABI

[PATCH v9 23/33] counter: Update counter.h comments to reflect sysfs internalization

2021-03-09 Thread William Breathitt Gray
The Counter subsystem architecture and driver implementations have changed in order to handle Counter sysfs interactions in a more consistent way. This patch updates the Generic Counter interface header file comments to reflect the changes. Signed-off-by: William Breathitt Gray --- drivers

[PATCH v9 21/33] counter: Rename counter_count_function to counter_function

2021-03-09 Thread William Breathitt Gray
atrick Havelange Cc: Oleksij Rempel Cc: Kamel Bouhara Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 10 +++ drivers/counter/counter.c | 38 --

[PATCH v9 20/33] counter: Rename counter_signal_value to counter_signal_level

2021-03-09 Thread William Breathitt Gray
Signal values will always be levels so let's be explicit it about it to make the intent of the code clear. Cc: Syed Nayyar Waris Cc: Oleksij Rempel Cc: Kamel Bouhara Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 5

[PATCH v9 18/33] counter: Return error code on invalid modes

2021-03-09 Thread William Breathitt Gray
of the code clear. Cc: Syed Nayyar Waris Cc: Kamel Bouhara Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c| 20 +++ drivers/counter/microchip-tcb-capture.c | 6 drivers

[PATCH v9 19/33] counter: Standardize to ERANGE for limit exceeded errors

2021-03-09 Thread William Breathitt Gray
ERANGE is a semantically better error code to return when an argument value falls outside the supported limit range of a device. Cc: Syed Nayyar Waris Cc: Oleksij Rempel Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Reviewed-by: David Lechner Signed-off-by: William Breathitt

[PATCH v9 16/33] counter: stm32-lptimer-cnt: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the stm32_lptim_cnt_synapse_actions to match actions_list. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-lptimer-cnt.c

[PATCH v9 17/33] counter: stm32-timer-cnt: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the stm32_synapse_actions to match actions_list. Cc: Fabrice Gasnier Cc: Benjamin Gaignard Signed-off-by: William Breathitt Gray --- drivers/counter/stm32

[PATCH v9 15/33] counter: microchip-tcb-capture: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the mchp_tc_synapse_actions to match actions_list. Cc: Kamel Bouhara Signed-off-by: William Breathitt Gray --- drivers/counter/microchip-tcb-capture.c | 2

[PATCH v9 14/33] counter: interrupt-cnt: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the interrupt_cnt_synapse_actionss to match actions_list. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/interrupt-cnt.c | 2

[PATCH v9 09/33] counter: microchip-tcb-capture: Add const qualifier for functions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the mchp_tc_count_functions to match functions_list. Cc: Kamel Bouhara Signed-off-by: William Breathitt Gray --- drivers/counter/microchip-tcb-capture.c | 2

[PATCH v9 10/33] counter: stm32-lptimer-cnt: Add const qualifier for functions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the stm32_lptim_cnt_functions to match functions_list. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-lptimer-cnt.c | 2

[PATCH v9 13/33] counter: ftm-quaddec: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the ftm_quaddec_synapse_actions to match actions_list. Cc: Patrick Havelange Signed-off-by: William Breathitt Gray --- drivers/counter/ftm-quaddec.c | 2

[PATCH v9 11/33] counter: stm32-timer-cnt: Add const qualifier for functions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the stm32_count_functions to match functions_list. Cc: Fabrice Gasnier Cc: Benjamin Gaignard Signed-off-by: William Breathitt Gray --- drivers/counter/stm32

[PATCH v9 12/33] counter: 104-quad-8: Add const qualifier for actions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_synapse actions_list member expects a const enum counter_synapse_action array. This patch adds the const qualifier to the quad8_index_actions_list and quad8_synapse_actions_list to match actions_list. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers

[PATCH v9 08/33] counter: interrupt-cnt: Add const qualifier for functions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the interrupt__cnt_functions to match functions_list. Cc: Oleksij Rempel Signed-off-by: William Breathitt Gray --- drivers/counter/interrupt-cnt.c | 2 +- 1

[PATCH v9 06/33] counter: 104-quad-8: Add const qualifiers for quad8_preset_register_set

2021-03-09 Thread William Breathitt Gray
Add some safety by qualifying the quad8_preset_register_set() function parameters as const. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/counter/104-quad-8.c b

[PATCH v9 07/33] counter: 104-quad-8: Add const qualifier for functions_list array

2021-03-09 Thread William Breathitt Gray
The struct counter_count functions_list member expects a const enum counter_count_function array. This patch adds the const qualifier to the quad8_count_functions_list to match functions_list. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 2

[PATCH v9 02/33] docs: counter: Fix spelling

2021-03-09 Thread William Breathitt Gray
"Miscellaneous" is the correct spelling. Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- Documentation/driver-api/generic-counter.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/driver-api/generic-counter.rst b/Documentat

[PATCH v9 05/33] counter: 104-quad-8: Annotate hardware config module parameter

2021-03-09 Thread William Breathitt Gray
drivers support automatic configuration (e.g. PNP or PCI) in addition to manually coded parameters. This patch annotates the 104-QUAD-8 driver. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v9 04/33] counter: 104-quad-8: Return error when invalid mode during ceiling_write

2021-03-09 Thread William Breathitt Gray
neric interface") Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c index 4bb9abffae48..233a3acc1377 100644 ---

[PATCH v9 03/33] counter: 104-quad-8: Remove pointless comment

2021-03-09 Thread William Breathitt Gray
It is obvious that devm_counter_register() is used to register a Counter device, so a comment stating such is pointless here. Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/counter/104-quad

[PATCH v9 01/33] docs: counter: Consolidate Counter sysfs attributes documentation

2021-03-09 Thread William Breathitt Gray
Duplicate ABIs are not valid, so let's consolidate these sysfs attributes into the main sysfs-bus-counter documentation file. Cc: Patrick Havelange Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- Documentation/ABI/testing/sysfs-bus-counter | 76

[PATCH v9 00/33] Introduce the Counter character device interface

2021-03-09 Thread William Breathitt Gray
rving as an example of how to support the new Counter events functionality. Something that should still be discussed: should the struct counter_event "status" member be 8 bits or 32 bits wide? This member will provide the return status (system error number) of an event operation. W

Re: [PATCH] mfd: stm32-timers: avoid clearing auto reload register

2021-03-03 Thread William Breathitt Gray
it, and restore it then, instead of clearing its value. > It also fixes the initial condition seen by the counter driver. > > Fixes: d0f949e220fd ("mfd: Add STM32 Timers driver") > > Signed-off-by: Fabrice Gasnier Acked-by: William Breathitt Gray > --- > driver

Re: [PATCH] counter: stm32-timer-cnt: fix ceiling miss-alignment with reload register

2021-03-03 Thread William Breathitt Gray
gt; > Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder") > > Suggested-by: William Breathitt Gray > Signed-off-by: Fabrice Gasnier Acked-by: William Breathitt Gray > --- > Note: this applies on top of: > - "counter: stm32-timer-cnt: fix ceiling w

Re: [PATCH] counter: stm32-timer-cnt: fix ceiling write max value

2021-03-03 Thread William Breathitt Gray
On Tue, Mar 02, 2021 at 06:03:25PM +0100, Fabrice Gasnier wrote: > On 3/2/21 3:56 PM, William Breathitt Gray wrote: > > Side question: if priv->ceiling is tracking the current ceiling > > configuration, would it make sense to change stm32_count_ceiling_read() > > to

Re: [PATCH] counter: stm32-timer-cnt: fix ceiling write max value

2021-03-02 Thread William Breathitt Gray
truncated. > Fix it by checking the max_arr to report a range error [1] to the user. > > Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder") > > [1] https://lkml.org/lkml/2021/2/12/358 > > Signed-off-by: Fabrice Gasnier Acked-by: William Breathit

Re: [PATCH v8 2/2] counter: add IRQ or GPIO based counter

2021-03-01 Thread William Breathitt Gray
ends on the CPU and system load. On > the idle iMX6S I was able to measure up to 20kHz without count drops. > > Signed-off-by: Oleksij Rempel > Reviewed-by: Ahmad Fatoum This version looks acceptable for the Counter subsystem. Thanks, Reviewed-by: William Breathitt

Re: [PATCH v8 1/2] dt-bindings: counter: add interrupt-counter binding

2021-03-01 Thread William Breathitt Gray
On Mon, Mar 01, 2021 at 09:04:00AM +0100, Oleksij Rempel wrote: > Add binding for the interrupt counter node > > Signed-off-by: Oleksij Rempel > Reviewed-by: Linus Walleij Acked-by: William Breathitt Gray > --- > .../bindings/counter/interrupt-counter.yaml | 62 ++

Re: [PATCH v8 20/22] counter: Implement events_queue_size sysfs attribute

2021-02-27 Thread William Breathitt Gray
On Sat, Feb 27, 2021 at 03:18:47PM +, Jonathan Cameron wrote: > On Fri, 26 Feb 2021 09:03:48 +0900 > William Breathitt Gray wrote: > > > On Sun, Feb 21, 2021 at 03:51:40PM +, Jonathan Cameron wrote: > > > On Thu, 18 Feb 2021 19:32:16 +0900 > > &

Re: [PATCH v8 20/22] counter: Implement events_queue_size sysfs attribute

2021-02-26 Thread William Breathitt Gray
On Fri, Feb 26, 2021 at 06:14:12PM -0600, David Lechner wrote: > On 2/25/21 6:03 PM, William Breathitt Gray wrote: > > On Sun, Feb 21, 2021 at 03:51:40PM +, Jonathan Cameron wrote: > >> On Thu, 18 Feb 2021 19:32:16 +0900 > >> William Breathitt Gray wrote: > >&

Re: [PATCH v7 2/2] counter: add IRQ or GPIO based counter

2021-02-26 Thread William Breathitt Gray
On Fri, Feb 26, 2021 at 01:14:55PM +0100, Oleksij Rempel wrote: > On Fri, Feb 26, 2021 at 06:45:20PM +0900, William Breathitt Gray wrote: > > On Fri, Feb 26, 2021 at 10:08:30AM +0100, Oleksij Rempel wrote: > > > +static int interrupt_cnt_signal_read(struct count

Re: [PATCH v7 2/2] counter: add IRQ or GPIO based counter

2021-02-26 Thread William Breathitt Gray
gt;irq == -ENXIO) > + priv->irq = 0; > + else if (priv->irq < 0) > + return dev_err_probe(dev, priv->irq, "failed to get IRQ\n"); > + > + priv->gpio = devm_gpiod_get_optional(dev, NULL, GPIOD_IN); > + if (IS_ERR(priv->

Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter

2021-02-25 Thread William Breathitt Gray
On Fri, Feb 26, 2021 at 07:46:01AM +0100, Oleksij Rempel wrote: > On Wed, Feb 24, 2021 at 05:20:21PM +0900, William Breathitt Gray wrote: > > On Wed, Feb 24, 2021 at 05:11:03PM +0900, William Breathitt Gray wrote: > > > On Wed, Feb 24, 2021 at 08:35:06AM +0100, Oleksij Rempel wro

[PATCH v2] counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED

2021-02-25 Thread William Breathitt Gray
Timer quadrature encoder") Cc: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Signed-off-by: William Breathitt Gray --- Changes in v2: - Support an explicit 0 case for function_get()/function_set() drivers/counter/stm32-timer-cnt.c | 39 --- 1 file c

Re: [PATCH v8 18/22] docs: counter: Document character device interface

2021-02-25 Thread William Breathitt Gray
); > > > > + for (;;) { > > > +read(fd, event_data, sizeof(event_data)); > > If this goes to tools it really should have error handling and > handling of short read. > > Best regards, > Pavel > > -- > http://www.livejournal.com/~pavelmachek Ack. I'll improve the error handling for this. William Breathitt Gray signature.asc Description: PGP signature

Re: [PATCH v8 18/22] docs: counter: Document character device interface

2021-02-25 Thread William Breathitt Gray
On Sun, Feb 14, 2021 at 05:48:19PM +, Jonathan Cameron wrote: > On Fri, 12 Feb 2021 21:13:42 +0900 > William Breathitt Gray wrote: > > > This patch adds high-level documentation about the Counter subsystem > > character device interface. > > > > Sign

Re: [PATCH v8 20/22] counter: Implement events_queue_size sysfs attribute

2021-02-25 Thread William Breathitt Gray
On Sun, Feb 21, 2021 at 03:51:40PM +, Jonathan Cameron wrote: > On Thu, 18 Feb 2021 19:32:16 +0900 > William Breathitt Gray wrote: > > > On Sun, Feb 14, 2021 at 06:11:46PM +, Jonathan Cameron wrote: > > > On Fri, 12 Feb 2021 21:13:44 +0900 > > &

Re: [PATCH v8 19/22] counter: Implement extension*_name sysfs attributes

2021-02-25 Thread William Breathitt Gray
On Sun, Feb 21, 2021 at 02:05:07PM +, Jonathan Cameron wrote: > On Fri, 19 Feb 2021 17:51:37 +0900 > William Breathitt Gray wrote: > > > On Sun, Feb 14, 2021 at 06:09:13PM +, Jonathan Cameron wrote: > > > On Fri, 12 Feb 2021 21:13:43 +0900 > > &

Re: [PATCH] counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED

2021-02-25 Thread William Breathitt Gray
On Thu, Feb 25, 2021 at 12:19:18PM +0100, Fabrice Gasnier wrote: > On 2/19/21 10:59 AM, William Breathitt Gray wrote: > > When in SLAVE_MODE_DISABLED mode, the count still increases if the > > counter is enabled because an internal clock is used. This patch fixes > > the stm

Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter

2021-02-24 Thread William Breathitt Gray
On Wed, Feb 24, 2021 at 05:11:03PM +0900, William Breathitt Gray wrote: > On Wed, Feb 24, 2021 at 08:35:06AM +0100, Oleksij Rempel wrote: > > On Wed, Feb 24, 2021 at 11:34:06AM +0900, William Breathitt Gray wrote: > > > Alternatively, we can take a more generic approac

Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter

2021-02-24 Thread William Breathitt Gray
On Wed, Feb 24, 2021 at 08:35:06AM +0100, Oleksij Rempel wrote: > On Wed, Feb 24, 2021 at 11:34:06AM +0900, William Breathitt Gray wrote: > > On Tue, Feb 23, 2021 at 06:45:16PM +0100, Oleksij Rempel wrote: > > > On Tue, Feb 23, 2021 at 11:06:56AM +0100, Oleksij Rempel wrote: >

Re: [PATCH v8 17/22] counter: Add character device interface

2021-02-23 Thread William Breathitt Gray
On Sun, Feb 14, 2021 at 06:06:12PM +, Jonathan Cameron wrote: > On Fri, 12 Feb 2021 21:13:41 +0900 > William Breathitt Gray wrote: > > > This patch introduces a character device interface for the Counter > > subsystem. Device data is exposed through standard

Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter

2021-02-23 Thread William Breathitt Gray
Mon, Feb 22, 2021 at 10:43:00AM +0900, William Breathitt Gray wrote: > > > On Mon, Feb 15, 2021 at 10:17:37AM +0100, Oleksij Rempel wrote: > > > > > > +static irqreturn_t event_cnt_isr(int irq, void *dev_id) > > > > > > +{ > > > > > > +

Re: [PATCH v6 0/2] add support for GPIO or IRQ based evemt counter

2021-02-23 Thread William Breathitt Gray
On Tue, Feb 23, 2021 at 08:16:30AM +0100, Oleksij Rempel wrote: > Hi William, > > On Mon, Feb 22, 2021 at 10:48:56AM +0900, William Breathitt Gray wrote: > > On Tue, Feb 16, 2021 at 09:13:54AM +0100, Oleksij Rempel wrote: > > > changes v6: > > > - rename it

Re: [PATCH v8 12/22] counter: Rename counter_count_function to counter_function

2021-02-22 Thread William Breathitt Gray
On Sat, Feb 20, 2021 at 10:56:13AM -0600, David Lechner wrote: > On 2/14/21 11:13 AM, Jonathan Cameron wrote: > > On Fri, 12 Feb 2021 21:13:36 +0900 > > William Breathitt Gray wrote: > > > >> The phrase "Counter Count function" is verbose and unintentional

Re: [PATCH v8 09/22] counter: Return error code on invalid modes

2021-02-21 Thread William Breathitt Gray
On Sat, Feb 20, 2021 at 10:43:06AM -0600, David Lechner wrote: > On 2/12/21 6:13 AM, William Breathitt Gray wrote: > > Only a select set of modes (function, action, etc.) are valid for a > > given device configuration. This patch ensures that invalid modes result > >

Re: [PATCH v8 03/22] counter: 104-quad-8: Return error when invalid mode during ceiling_write

2021-02-21 Thread William Breathitt Gray
On Sat, Feb 20, 2021 at 10:30:03AM -0600, David Lechner wrote: > On 2/12/21 6:13 AM, William Breathitt Gray wrote: > > The 104-QUAD-8 only has two count modes where a ceiling value makes > > sense: Range Limit and Modulo-N. Outside of these two modes, setting a > > ceilin

Re: [PATCH v6 0/2] add support for GPIO or IRQ based evemt counter

2021-02-21 Thread William Breathitt Gray
is driver to use that name instead? Sincerely, William Breathitt Gray > - driver fixes > - device tree fixes > > changes v5: > - rename it to event counter, since it support different event sources > - make it work with gpio-only or irq-only configuration > - update

Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter

2021-02-21 Thread William Breathitt Gray
le. How about "Channel 0, GPIO line state"? Ideally, this would match the GPIO name (or I suppose the IRQ number if not a GPIO line). So in your probe() function you can do something like this I believe: cnt_signals[0].name = priv->gpio->name; Of course, you should first check whether this is a GPIO line or IRQ line and set the name accordingly. William Breathitt Gray signature.asc Description: PGP signature

[PATCH] counter: stm32-timer-cnt: Report count function when SLAVE_MODE_DISABLED

2021-02-19 Thread William Breathitt Gray
c: Fabrice Gasnier Cc: Maxime Coquelin Cc: Alexandre Torgue Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-timer-cnt.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-t

  1   2   3   4   5   6   7   8   9   10   >