linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_qca: Simplify determination of serial clock on/off state from votes
@ 2020-06-06 16:53 Matthias Kaehlcke
  2020-06-08  8:09 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Kaehlcke @ 2020-06-06 16:53 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg
  Cc: linux-kernel, Abhishek Pandit-Subedi, linux-bluetooth,
	Rocky Liao, Zijun Hu, Balakrishna Godavarthi, Matthias Kaehlcke

The serial clocks should be on when there is a vote for at least one
of the clocks (RX or TX), and off when there is no 'on' vote. The
current logic to determine the combined state is a bit redundant
in the code paths for different types of votes, use a single
statement in the common path instead.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---

 drivers/bluetooth/hci_qca.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 836949d827ee9..997ddab26a33b 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -289,25 +289,21 @@ static void serial_clock_vote(unsigned long vote, struct hci_uart *hu)
 	case HCI_IBS_TX_VOTE_CLOCK_ON:
 		qca->tx_vote = true;
 		qca->tx_votes_on++;
-		new_vote = true;
 		break;
 
 	case HCI_IBS_RX_VOTE_CLOCK_ON:
 		qca->rx_vote = true;
 		qca->rx_votes_on++;
-		new_vote = true;
 		break;
 
 	case HCI_IBS_TX_VOTE_CLOCK_OFF:
 		qca->tx_vote = false;
 		qca->tx_votes_off++;
-		new_vote = qca->rx_vote | qca->tx_vote;
 		break;
 
 	case HCI_IBS_RX_VOTE_CLOCK_OFF:
 		qca->rx_vote = false;
 		qca->rx_votes_off++;
-		new_vote = qca->rx_vote | qca->tx_vote;
 		break;
 
 	default:
@@ -315,6 +311,8 @@ static void serial_clock_vote(unsigned long vote, struct hci_uart *hu)
 		return;
 	}
 
+	new_vote = qca->rx_vote | qca->tx_vote;
+
 	if (new_vote != old_vote) {
 		if (new_vote)
 			__serial_clock_on(hu->tty);
-- 
2.27.0.278.ge193c7cf3a9-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: hci_qca: Simplify determination of serial clock on/off state from votes
  2020-06-06 16:53 [PATCH] Bluetooth: hci_qca: Simplify determination of serial clock on/off state from votes Matthias Kaehlcke
@ 2020-06-08  8:09 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2020-06-08  8:09 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Johan Hedberg, linux-kernel, Abhishek Pandit-Subedi,
	linux-bluetooth, Rocky Liao, Zijun Hu, Balakrishna Godavarthi

Hi Matthias,

> The serial clocks should be on when there is a vote for at least one
> of the clocks (RX or TX), and off when there is no 'on' vote. The
> current logic to determine the combined state is a bit redundant
> in the code paths for different types of votes, use a single
> statement in the common path instead.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> 
> drivers/bluetooth/hci_qca.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-08  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 16:53 [PATCH] Bluetooth: hci_qca: Simplify determination of serial clock on/off state from votes Matthias Kaehlcke
2020-06-08  8:09 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).