counter: microchip-tcb-capture: Handle Signal1 read and Synapse
authorWilliam Breathitt Gray <william.gray@linaro.org>
Tue, 18 Oct 2022 12:10:14 +0000 (08:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:13 +0000 (23:59 +0900)
commitf1204dfc4cd71ebe43de26c0897c54ff68b30e31
tree5f142df06b996f7148b3a135a776fd9fa0c231f8
parent6fb0106c64ee63102b16fe9f0e24a362a446ec65
counter: microchip-tcb-capture: Handle Signal1 read and Synapse

commit d917a62af81b133f35f627e7936e193c842a7947 upstream.

The signal_read(), action_read(), and action_write() callbacks have been
assuming Signal0 is requested without checking. This results in requests
for Signal1 returning data for Signal0. This patch fixes these
oversights by properly checking for the Signal's id in the respective
callbacks and handling accordingly based on the particular Signal
requested. The trig_inverted member of the mchp_tc_data is removed as
superfluous.

Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
Cc: stable@vger.kernel.org
Reviewed-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
Link: https://lore.kernel.org/r/20221018121014.7368-1-william.gray@linaro.org/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/counter/microchip-tcb-capture.c