All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: audio: Rename cport with intf_id
@ 2016-10-16  9:59 Pankaj Bharadiya
  2016-10-17  3:29 ` Vaibhav Agarwal
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pankaj Bharadiya @ 2016-10-16  9:59 UTC (permalink / raw)
  To: gregkh
  Cc: vaibhav.sr, mgreer, johan, elder, devel, linux-kernel, pankaj.bharadiya

gb_audio_manager_module_descriptor's cport field is actually used to
manage and pass interface id to user space.

Thus rename gb_audio_manager_module_descriptor's 'cport' field and
few other things to avoid confusion.

Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
---
 drivers/staging/greybus/audio_manager.h        |  2 +-
 drivers/staging/greybus/audio_manager_module.c | 20 ++++++++++----------
 drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
 drivers/staging/greybus/audio_module.c         |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/greybus/audio_manager.h b/drivers/staging/greybus/audio_manager.h
index c4ca097..056088e 100644
--- a/drivers/staging/greybus/audio_manager.h
+++ b/drivers/staging/greybus/audio_manager.h
@@ -21,7 +21,7 @@ struct gb_audio_manager_module_descriptor {
 	int slot;
 	int vid;
 	int pid;
-	int cport;
+	int intf_id;
 	unsigned int ip_devices;
 	unsigned int op_devices;
 };
diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index a10e96a..2bf40a9 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -111,16 +111,16 @@ static ssize_t gb_audio_module_pid_show(
 static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
 	__ATTR(pid, 0664, gb_audio_module_pid_show, NULL);
 
-static ssize_t gb_audio_module_cport_show(
+static ssize_t gb_audio_module_intf_id_show(
 	struct gb_audio_manager_module *module,
 	struct gb_audio_manager_module_attribute *attr, char *buf)
 {
-	return sprintf(buf, "%d", module->desc.cport);
+	return sprintf(buf, "%d", module->desc.intf_id);
 }
 
 static struct gb_audio_manager_module_attribute
-					gb_audio_module_cport_attribute =
-	__ATTR(cport, 0664, gb_audio_module_cport_show, NULL);
+					gb_audio_module_intf_id_attribute =
+	__ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL);
 
 static ssize_t gb_audio_module_ip_devices_show(
 	struct gb_audio_manager_module *module,
@@ -149,7 +149,7 @@ static ssize_t gb_audio_module_op_devices_show(
 	&gb_audio_module_slot_attribute.attr,
 	&gb_audio_module_vid_attribute.attr,
 	&gb_audio_module_pid_attribute.attr,
-	&gb_audio_module_cport_attribute.attr,
+	&gb_audio_module_intf_id_attribute.attr,
 	&gb_audio_module_ip_devices_attribute.attr,
 	&gb_audio_module_op_devices_attribute.attr,
 	NULL,   /* need to NULL terminate the list of attributes */
@@ -167,7 +167,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 	char slot_string[64];
 	char vid_string[64];
 	char pid_string[64];
-	char cport_string[64];
+	char intf_id_string[64];
 	char ip_devices_string[64];
 	char op_devices_string[64];
 
@@ -176,7 +176,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 		slot_string,
 		vid_string,
 		pid_string,
-		cport_string,
+		intf_id_string,
 		ip_devices_string,
 		op_devices_string,
 		NULL
@@ -186,7 +186,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 	snprintf(slot_string, 64, "SLOT=%d", module->desc.slot);
 	snprintf(vid_string, 64, "VID=%d", module->desc.vid);
 	snprintf(pid_string, 64, "PID=%d", module->desc.pid);
-	snprintf(cport_string, 64, "CPORT=%d", module->desc.cport);
+	snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
 	snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
 		 module->desc.ip_devices);
 	snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
@@ -246,13 +246,13 @@ int gb_audio_manager_module_create(
 
 void gb_audio_manager_module_dump(struct gb_audio_manager_module *module)
 {
-	pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X o/p devices=0x%X\n",
+	pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n",
 		module->id,
 		module->desc.name,
 		module->desc.slot,
 		module->desc.vid,
 		module->desc.pid,
-		module->desc.cport,
+		module->desc.intf_id,
 		module->desc.ip_devices,
 		module->desc.op_devices);
 }
diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
index d8bf859..feb195d 100644
--- a/drivers/staging/greybus/audio_manager_sysfs.c
+++ b/drivers/staging/greybus/audio_manager_sysfs.c
@@ -20,10 +20,10 @@ static ssize_t manager_sysfs_add_store(
 
 	int num = sscanf(buf,
 			"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
-			"slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X"
+			"slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X"
 			"o/p devices=0x%X",
 			desc.name, &desc.slot, &desc.vid, &desc.pid,
-			&desc.cport, &desc.ip_devices, &desc.op_devices);
+			&desc.intf_id, &desc.ip_devices, &desc.op_devices);
 
 	if (num != 7)
 		return -EINVAL;
diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c
index ae1c0fa..45b2519 100644
--- a/drivers/staging/greybus/audio_module.c
+++ b/drivers/staging/greybus/audio_module.c
@@ -348,7 +348,7 @@ static int gb_audio_probe(struct gb_bundle *bundle,
 	desc.slot = 1; /* todo */
 	desc.vid = 2; /* todo */
 	desc.pid = 3; /* todo */
-	desc.cport = gbmodule->dev_id;
+	desc.intf_id = gbmodule->dev_id;
 	desc.op_devices = gbmodule->op_devices;
 	desc.ip_devices = gbmodule->ip_devices;
 	gbmodule->manager_id = gb_audio_manager_add(&desc);
-- 
1.9.1

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

* Re: [PATCH] staging: greybus: audio: Rename cport with intf_id
  2016-10-16  9:59 [PATCH] staging: greybus: audio: Rename cport with intf_id Pankaj Bharadiya
@ 2016-10-17  3:29 ` Vaibhav Agarwal
  2016-10-17  5:56 ` Viresh Kumar
  2016-10-17 15:31 ` Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Vaibhav Agarwal @ 2016-10-17  3:29 UTC (permalink / raw)
  To: Pankaj Bharadiya
  Cc: Greg Kroah-Hartman, Mark Greer, Johan Hovold, Alex Elder, devel,
	linux-kernel

On Sun, Oct 16, 2016 at 3:29 PM, Pankaj Bharadiya
<pankaj.bharadiya@gmail.com> wrote:
> gb_audio_manager_module_descriptor's cport field is actually used to
> manage and pass interface id to user space.
>
> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
> few other things to avoid confusion.
>
> Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
> ---
>  drivers/staging/greybus/audio_manager.h        |  2 +-
>  drivers/staging/greybus/audio_manager_module.c | 20 ++++++++++----------
>  drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
>  drivers/staging/greybus/audio_module.c         |  2 +-
>  4 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_manager.h b/drivers/staging/greybus/audio_manager.h
> index c4ca097..056088e 100644
> --- a/drivers/staging/greybus/audio_manager.h
> +++ b/drivers/staging/greybus/audio_manager.h
> @@ -21,7 +21,7 @@ struct gb_audio_manager_module_descriptor {
>         int slot;
>         int vid;
>         int pid;
> -       int cport;
> +       int intf_id;
>         unsigned int ip_devices;
>         unsigned int op_devices;
>  };
> diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
> index a10e96a..2bf40a9 100644
> --- a/drivers/staging/greybus/audio_manager_module.c
> +++ b/drivers/staging/greybus/audio_manager_module.c
> @@ -111,16 +111,16 @@ static ssize_t gb_audio_module_pid_show(
>  static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
>         __ATTR(pid, 0664, gb_audio_module_pid_show, NULL);
>
> -static ssize_t gb_audio_module_cport_show(
> +static ssize_t gb_audio_module_intf_id_show(
>         struct gb_audio_manager_module *module,
>         struct gb_audio_manager_module_attribute *attr, char *buf)
>  {
> -       return sprintf(buf, "%d", module->desc.cport);
> +       return sprintf(buf, "%d", module->desc.intf_id);
>  }
>
>  static struct gb_audio_manager_module_attribute
> -                                       gb_audio_module_cport_attribute =
> -       __ATTR(cport, 0664, gb_audio_module_cport_show, NULL);
> +                                       gb_audio_module_intf_id_attribute =
> +       __ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL);
>
>  static ssize_t gb_audio_module_ip_devices_show(
>         struct gb_audio_manager_module *module,
> @@ -149,7 +149,7 @@ static ssize_t gb_audio_module_op_devices_show(
>         &gb_audio_module_slot_attribute.attr,
>         &gb_audio_module_vid_attribute.attr,
>         &gb_audio_module_pid_attribute.attr,
> -       &gb_audio_module_cport_attribute.attr,
> +       &gb_audio_module_intf_id_attribute.attr,
>         &gb_audio_module_ip_devices_attribute.attr,
>         &gb_audio_module_op_devices_attribute.attr,
>         NULL,   /* need to NULL terminate the list of attributes */
> @@ -167,7 +167,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
>         char slot_string[64];
>         char vid_string[64];
>         char pid_string[64];
> -       char cport_string[64];
> +       char intf_id_string[64];
>         char ip_devices_string[64];
>         char op_devices_string[64];
>
> @@ -176,7 +176,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
>                 slot_string,
>                 vid_string,
>                 pid_string,
> -               cport_string,
> +               intf_id_string,
>                 ip_devices_string,
>                 op_devices_string,
>                 NULL
> @@ -186,7 +186,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
>         snprintf(slot_string, 64, "SLOT=%d", module->desc.slot);
>         snprintf(vid_string, 64, "VID=%d", module->desc.vid);
>         snprintf(pid_string, 64, "PID=%d", module->desc.pid);
> -       snprintf(cport_string, 64, "CPORT=%d", module->desc.cport);
> +       snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
>         snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
>                  module->desc.ip_devices);
>         snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
> @@ -246,13 +246,13 @@ int gb_audio_manager_module_create(
>
>  void gb_audio_manager_module_dump(struct gb_audio_manager_module *module)
>  {
> -       pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X o/p devices=0x%X\n",
> +       pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n",
>                 module->id,
>                 module->desc.name,
>                 module->desc.slot,
>                 module->desc.vid,
>                 module->desc.pid,
> -               module->desc.cport,
> +               module->desc.intf_id,
>                 module->desc.ip_devices,
>                 module->desc.op_devices);
>  }
> diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c
> index d8bf859..feb195d 100644
> --- a/drivers/staging/greybus/audio_manager_sysfs.c
> +++ b/drivers/staging/greybus/audio_manager_sysfs.c
> @@ -20,10 +20,10 @@ static ssize_t manager_sysfs_add_store(
>
>         int num = sscanf(buf,
>                         "name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
> -                       "slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X"
> +                       "slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X"
>                         "o/p devices=0x%X",
>                         desc.name, &desc.slot, &desc.vid, &desc.pid,
> -                       &desc.cport, &desc.ip_devices, &desc.op_devices);
> +                       &desc.intf_id, &desc.ip_devices, &desc.op_devices);
>
>         if (num != 7)
>                 return -EINVAL;
> diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c
> index ae1c0fa..45b2519 100644
> --- a/drivers/staging/greybus/audio_module.c
> +++ b/drivers/staging/greybus/audio_module.c
> @@ -348,7 +348,7 @@ static int gb_audio_probe(struct gb_bundle *bundle,
>         desc.slot = 1; /* todo */
>         desc.vid = 2; /* todo */
>         desc.pid = 3; /* todo */
> -       desc.cport = gbmodule->dev_id;
> +       desc.intf_id = gbmodule->dev_id;
>         desc.op_devices = gbmodule->op_devices;
>         desc.ip_devices = gbmodule->ip_devices;
>         gbmodule->manager_id = gb_audio_manager_add(&desc);
> --
> 1.9.1
>
Reviewed-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>

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

* Re: [PATCH] staging: greybus: audio: Rename cport with intf_id
  2016-10-16  9:59 [PATCH] staging: greybus: audio: Rename cport with intf_id Pankaj Bharadiya
  2016-10-17  3:29 ` Vaibhav Agarwal
@ 2016-10-17  5:56 ` Viresh Kumar
  2016-10-17 15:31 ` Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2016-10-17  5:56 UTC (permalink / raw)
  To: Pankaj Bharadiya
  Cc: Greg Kroah-Hartman, driver-dev, Alex Elder, Vaibhav Agarwal,
	mgreer, linux-kernel, Johan Hovold

On Sun, Oct 16, 2016 at 3:29 PM, Pankaj Bharadiya
<pankaj.bharadiya@gmail.com> wrote:
> gb_audio_manager_module_descriptor's cport field is actually used to
> manage and pass interface id to user space.
>
> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
> few other things to avoid confusion.
>
> Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
> ---
>  drivers/staging/greybus/audio_manager.h        |  2 +-
>  drivers/staging/greybus/audio_manager_module.c | 20 ++++++++++----------
>  drivers/staging/greybus/audio_manager_sysfs.c  |  4 ++--
>  drivers/staging/greybus/audio_module.c         |  2 +-
>  4 files changed, 14 insertions(+), 14 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* Re: [PATCH] staging: greybus: audio: Rename cport with intf_id
  2016-10-16  9:59 [PATCH] staging: greybus: audio: Rename cport with intf_id Pankaj Bharadiya
  2016-10-17  3:29 ` Vaibhav Agarwal
  2016-10-17  5:56 ` Viresh Kumar
@ 2016-10-17 15:31 ` Johan Hovold
  2016-10-19  5:30   ` Vaibhav Agarwal
  2 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2016-10-17 15:31 UTC (permalink / raw)
  To: Pankaj Bharadiya
  Cc: gregkh, vaibhav.sr, mgreer, johan, elder, devel, linux-kernel

On Sun, Oct 16, 2016 at 03:29:14PM +0530, Pankaj Bharadiya wrote:
> gb_audio_manager_module_descriptor's cport field is actually used to
> manage and pass interface id to user space.
> 
> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
> few other things to avoid confusion.

Please be more specific about what these other things are; in this case
sysfs attributes, uevent vars, and an odd-looking sysfs-string
interface (more?).

Wouldn't this change break any current user-space implementation?

Also why aren't any of these attributes documented as they should be?

Thanks,
Johan

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

* Re: [PATCH] staging: greybus: audio: Rename cport with intf_id
  2016-10-17 15:31 ` Johan Hovold
@ 2016-10-19  5:30   ` Vaibhav Agarwal
  0 siblings, 0 replies; 5+ messages in thread
From: Vaibhav Agarwal @ 2016-10-19  5:30 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Pankaj Bharadiya, Greg Kroah-Hartman, Mark Greer, Alex Elder,
	devel, linux-kernel

On Mon, Oct 17, 2016 at 9:01 PM, Johan Hovold <johan@kernel.org> wrote:
> On Sun, Oct 16, 2016 at 03:29:14PM +0530, Pankaj Bharadiya wrote:
>> gb_audio_manager_module_descriptor's cport field is actually used to
>> manage and pass interface id to user space.
>>
>> Thus rename gb_audio_manager_module_descriptor's 'cport' field and
>> few other things to avoid confusion.
>
> Please be more specific about what these other things are; in this case
> sysfs attributes, uevent vars, and an odd-looking sysfs-string
> interface (more?).
>
> Wouldn't this change break any current user-space implementation?

Yes, it would require changes in user space code as well. For now, it
should be GMP-Audio HAL only.

>
> Also why aren't any of these attributes documented as they should be?

Currently, none of GB Audio specific sysfs entries are documented.
I'll share another patch for this.

--
thanks,
./va

>
> Thanks,
> Johan

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

end of thread, other threads:[~2016-10-19  5:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16  9:59 [PATCH] staging: greybus: audio: Rename cport with intf_id Pankaj Bharadiya
2016-10-17  3:29 ` Vaibhav Agarwal
2016-10-17  5:56 ` Viresh Kumar
2016-10-17 15:31 ` Johan Hovold
2016-10-19  5:30   ` Vaibhav Agarwal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.