diff mbox series

[net-next,v3] dev: Add NMEA port for MHI WWAN device. (mhi0_NMEA)

Message ID PVOKPS.9BTDD92U5KK72@unrealasia.net (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v3] dev: Add NMEA port for MHI WWAN device. (mhi0_NMEA) | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/apply fail Patch does not apply to net-next-1

Commit Message

Muhammad Nuzaihan Jan. 4, 2025, 4:38 p.m. UTC
Based on the earlier v2 and v1 patches. This patch is a cleanup from v2.

Removed unnecessary code added to "iosm" and "AT IOCTL" which is not 
relevant.

Tested this change on a new kernel and module built and now device NMEA 
(mhi0_NMEA) statements are available through /dev/wwan0nmea0 port on 
bootup.

Signed-off-by: Muhammad Nuzaihan Bin Kamal Luddin 
<zaihan@unrealasia.net>
---
v3:
- Rebased to net-next main branch
- Removed earlier patches that added unnecessary iosm (unrelated) and 
AT IOCTL code.
v2: https://lore.kernel.org/netdev/5LHFPS.G3DNPFBCDKCL2@unrealasia.net/
v1: https://lore.kernel.org/netdev/R8AFPS.THYVK2DKSEE83@unrealasia.net/
---

 drivers/net/wwan/mhi_wwan_ctrl.c | 1 +
 drivers/net/wwan/wwan_core.c | 4 ++++
 include/linux/wwan.h | 2 ++
 3 files changed, 7 insertions(+)

2.34.1

Comments

Andrew Lunn Jan. 4, 2025, 5:35 p.m. UTC | #1
On Sun, Jan 05, 2025 at 12:38:13AM +0800, Muhammad Nuzaihan wrote:
> Based on the earlier v2 and v1 patches. This patch is a cleanup from v2.
> 
> Removed unnecessary code added to "iosm" and "AT IOCTL" which is not
> relevant.
> 
> Tested this change on a new kernel and module built and now device NMEA
> (mhi0_NMEA) statements are available through /dev/wwan0nmea0 port on bootup.
> 
> Signed-off-by: Muhammad Nuzaihan Bin Kamal Luddin <zaihan@unrealasia.net>
> ---
> v3:
> - Rebased to net-next main branch
> - Removed earlier patches that added unnecessary iosm (unrelated) and AT
> IOCTL code.
> v2: https://lore.kernel.org/netdev/5LHFPS.G3DNPFBCDKCL2@unrealasia.net/
> v1: https://lore.kernel.org/netdev/R8AFPS.THYVK2DKSEE83@unrealasia.net/
> ---
> 
> drivers/net/wwan/mhi_wwan_ctrl.c | 1 +
> drivers/net/wwan/wwan_core.c | 4 ++++
> include/linux/wwan.h | 2 ++
> 3 files changed, 7 insertions(+)
> 
> diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c
> b/drivers/net/wwan/mhi_wwan_ctrl.c
> index e9f979d2d851..e13c0b078175 100644
> --- a/drivers/net/wwan/mhi_wwan_ctrl.c
> +++ b/drivers/net/wwan/mhi_wwan_ctrl.c
> @@ -263,6 +263,7 @@ static const struct mhi_device_id
> mhi_wwan_ctrl_match_table[] = {
>        { .chan = "QMI", .driver_data = WWAN_PORT_QMI },
>        { .chan = "DIAG", .driver_data = WWAN_PORT_QCDM },
>        { .chan = "FIREHOSE", .driver_data = WWAN_PORT_FIREHOSE },
> +	{ .chan = "NMEA", .driver_data = WWAN_PORT_NMEA },

The indentation is all messed up in this patch. It looks like a tab to
space conversion has happened somewhere?

Did you use git send-email?

    Andrew

---
pw-bot: cr
Muhammad Nuzaihan Jan. 5, 2025, 3:11 a.m. UTC | #2
Hi Andrew,

Yes, i was using geary client to send out the patch. Will send out 
using git send-email

On Sat, Jan 4 2025 at 06:35:06 PM +0100, Andrew Lunn <andrew@lunn.ch> 
wrote:
> On Sun, Jan 05, 2025 at 12:38:13AM +0800, Muhammad Nuzaihan wrote:
>>  Based on the earlier v2 and v1 patches. This patch is a cleanup 
>> from v2.
>> 
>>  Removed unnecessary code added to "iosm" and "AT IOCTL" which is not
>>  relevant.
>> 
>>  Tested this change on a new kernel and module built and now device 
>> NMEA
>>  (mhi0_NMEA) statements are available through /dev/wwan0nmea0 port 
>> on bootup.
>> 
>>  Signed-off-by: Muhammad Nuzaihan Bin Kamal Luddin 
>> <zaihan@unrealasia.net>
>>  ---
>>  v3:
>>  - Rebased to net-next main branch
>>  - Removed earlier patches that added unnecessary iosm (unrelated) 
>> and AT
>>  IOCTL code.
>>  v2: 
>> https://lore.kernel.org/netdev/5LHFPS.G3DNPFBCDKCL2@unrealasia.net/
>>  v1: 
>> https://lore.kernel.org/netdev/R8AFPS.THYVK2DKSEE83@unrealasia.net/
>>  ---
>> 
>>  drivers/net/wwan/mhi_wwan_ctrl.c | 1 +
>>  drivers/net/wwan/wwan_core.c | 4 ++++
>>  include/linux/wwan.h | 2 ++
>>  3 files changed, 7 insertions(+)
>> 
>>  diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c
>>  b/drivers/net/wwan/mhi_wwan_ctrl.c
>>  index e9f979d2d851..e13c0b078175 100644
>>  --- a/drivers/net/wwan/mhi_wwan_ctrl.c
>>  +++ b/drivers/net/wwan/mhi_wwan_ctrl.c
>>  @@ -263,6 +263,7 @@ static const struct mhi_device_id
>>  mhi_wwan_ctrl_match_table[] = {
>>         { .chan = "QMI", .driver_data = WWAN_PORT_QMI },
>>         { .chan = "DIAG", .driver_data = WWAN_PORT_QCDM },
>>         { .chan = "FIREHOSE", .driver_data = WWAN_PORT_FIREHOSE },
>>  +	{ .chan = "NMEA", .driver_data = WWAN_PORT_NMEA },
> 
> The indentation is all messed up in this patch. It looks like a tab to
> space conversion has happened somewhere?
> 
> Did you use git send-email?
> 
>     Andrew
> 
> ---
> pw-bot: cr
diff mbox series

Patch

diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c 
b/drivers/net/wwan/mhi_wwan_ctrl.c
index e9f979d2d851..e13c0b078175 100644
--- a/drivers/net/wwan/mhi_wwan_ctrl.c
+++ b/drivers/net/wwan/mhi_wwan_ctrl.c
@@ -263,6 +263,7 @@  static const struct mhi_device_id 
mhi_wwan_ctrl_match_table[] = {
        { .chan = "QMI", .driver_data = WWAN_PORT_QMI },
        { .chan = "DIAG", .driver_data = WWAN_PORT_QCDM },
        { .chan = "FIREHOSE", .driver_data = WWAN_PORT_FIREHOSE },
+	{ .chan = "NMEA", .driver_data = WWAN_PORT_NMEA },
        {},
 };
 MODULE_DEVICE_TABLE(mhi, mhi_wwan_ctrl_match_table);
diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index a51e2755991a..ebf574f2b126 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -342,6 +342,10 @@  static const struct {
                .name = "MIPC",
                .devsuf = "mipc",
        },
+	[WWAN_PORT_NMEA] = {
+		.name = "NMEA",
+		.devsuf = "nmea",
+	},
 };

 static ssize_t type_show(struct device *dev, struct device_attribute 
*attr,
diff --git a/include/linux/wwan.h b/include/linux/wwan.h
index a4d6cc0c9f68..ca38a2fe0987 100644
--- a/include/linux/wwan.h
+++ b/include/linux/wwan.h
@@ -19,6 +19,7 @@ 
  * @WWAN_PORT_FASTBOOT: Fastboot protocol control
  * @WWAN_PORT_ADB: ADB protocol control
  * @WWAN_PORT_MIPC: MTK MIPC diagnostic interface
+ * @WWAN_PORT_NMEA: NMEA GPS statements interface
  *
  * @WWAN_PORT_MAX: Highest supported port types
  * @WWAN_PORT_UNKNOWN: Special value to indicate an unknown port type
@@ -34,6 +35,7 @@  enum wwan_port_type {
        WWAN_PORT_FASTBOOT,
        WWAN_PORT_ADB,
        WWAN_PORT_MIPC,
+	WWAN_PORT_NMEA,

        /* Add new port types above this line */
--