[PATCH v2] Bluetooth: btmrvl_main: read wakeup-pin and wakeup-gap-ms as u32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The dt binding document for Marvell bt-sd8897 specify the
'marvell,wakeup-pin' and 'marvell,wakeup-gap-ms' attributes to be a 32-bit
value, but the driver parse it as 16-bit instead. Fix this to meet the
dt-binding document, and to be consistent with the 'marvell,wakeup-pin'
property in the mwifiex driver.

Signed-off-by: Wei-Ning Huang <wnhuang@xxxxxxxxxxxx>
---
 drivers/bluetooth/btmrvl_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 7ad8d61..b6d3404 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -513,21 +513,21 @@ static int btmrvl_check_device_tree(struct btmrvl_private *priv)
 	struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
 	u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE];
 	int ret = 0;
-	u16 gpio, gap;
+	u32 gpio, gap;
 
 	if (card->plt_of_node) {
 		dt_node = card->plt_of_node;
-		ret = of_property_read_u16(dt_node, "marvell,wakeup-pin",
+		ret = of_property_read_u32(dt_node, "marvell,wakeup-pin",
 					   &gpio);
 		if (ret)
 			gpio = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
 
-		ret = of_property_read_u16(dt_node, "marvell,wakeup-gap-ms",
+		ret = of_property_read_u32(dt_node, "marvell,wakeup-gap-ms",
 					   &gap);
 		if (ret)
 			gap = (u8)(priv->btmrvl_dev.gpio_gap & 0x00ff);
 
-		priv->btmrvl_dev.gpio_gap = (gpio << 8) + gap;
+		priv->btmrvl_dev.gpio_gap = ((gpio & 0xff) << 8) + (gap & 0xff);
 
 		ret = of_property_read_u8_array(dt_node, "marvell,cal-data",
 						cal_data + BT_CAL_HDR_LEN,
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux