Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ee48a5e authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

greybus: firmware: prefix char-device with 'gb-'



This will make it consistent with any other character devices we have
for greybus and let us identify greybus character devices easily.

Compiled tested only.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 93dbb97a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -49,14 +49,14 @@ Sysfs Interfaces - Firmware Management

The Firmware Management Protocol interacts with Userspace using the character
device interface. The character device will be present in /dev/ directory
and will be named fw-mgmt-<N>. The number <N> is assigned at runtime.
and will be named gb-fw-mgmt-<N>. The number <N> is assigned at runtime.

Identifying the Character Device
================================

There can be multiple devices present in /dev/ directory with name fw-mgmt-N and
user first needs to identify the character device used for firmware-management
for a particular interface.
There can be multiple devices present in /dev/ directory with name gb-fw-mgmt-N
and user first needs to identify the character device used for
firmware-management for a particular interface.

The Firmware Management core creates a device of class 'gb_fw_mgmt', which shall
be used by the user to identify the right character device for it. The class
@@ -64,17 +64,17 @@ device is created within the Bundle directory for a particular Interface.

For example this is how the class-device can be present:

/sys/bus/greybus/devices/1-1/1-1.1/1-1.1.1/gb_fw_mgmt/fw-mgmt-0
/sys/bus/greybus/devices/1-1/1-1.1/1-1.1.1/gb_fw_mgmt/gb-fw-mgmt-0

The last name in this path: fw-mgmt-0 is precisely the name of the char device
and so the device in this case will be:
The last name in this path: gb-fw-mgmt-0 is precisely the name of the char
device and so the device in this case will be:

/dev/fw-mgmt-0.
/dev/gb-fw-mgmt-0.

Operations on the Char device
=============================

The Character device (fw-mgmt-0 in example) can be opened by the userspace
The Character device (gb-fw-mgmt-0 in example) can be opened by the userspace
application and it can perform various 'ioctl' operations on the device. The
device doesn't support any read/write operations.

+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])

	/* Make sure arguments are correct */
	if (argc != 2) {
		printf("\nUsage: ./firmware <Path of the fw-mgmt-X dev>\n");
		printf("\nUsage: ./firmware <Path of the gb-fw-mgmt-X dev>\n");
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -599,7 +599,7 @@ int gb_fw_mgmt_connection_init(struct gb_connection *connection)
	/* Add a soft link to the previously added char-dev within the bundle */
	fw_mgmt->class_device = device_create(fw_mgmt_class, fw_mgmt->parent,
					      fw_mgmt->dev_num, NULL,
					      "fw-mgmt-%d", minor);
					      "gb-fw-mgmt-%d", minor);
	if (IS_ERR(fw_mgmt->class_device)) {
		ret = PTR_ERR(fw_mgmt->class_device);
		goto err_del_cdev;