Re: [PATCH] Bluetooth: btmrvl: add sysfs commands gpiogap and hscfgcmd

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

 



Hi Amitkumar,

>>> This patch adds support for driver's internal host sleep configuration
>>> via sysfs. gpiogap and hscfgcmd sysfs commands are added for this
>>> purpose.
>>> 
>>> Examples.
>>> 1. Get current gpiogap
>>>  cat /sys/class/bluetooth/hci0/gpiogap 2. Set gpio as 13 and gap as
>>> 100msecs
>>>  echo "0x0d64" > /sys/class/bluetooth/hci0/gpiogap 3. Download host
>>> sleep configuration to firmware.
>>>  echo "1" > /sys/class/bluetooth/hci0/hscfgcmd
>> 
>> explain to me how this is a good API. Keep in mind this is an userspace
>> API and needs to be stable.
>> 
>> If you want to expose a GPIO, why not expose it through the standard
>> Linux kernel GPIO API. Then it becomes easily discoverable via standard
>> sysfs tools. Also you can use standard tools to modify it.
>> 
>> I also do not understand why you need something to set host sleep
>> configuration. Just do this all the time and be done with it.
> 
> Thanks for the review. 
> I wasn't aware about standard linux kernel GPIO API. I will go through below link and check how we can make use of it.
> http://lxr.free-electrons.com/source/Documentation/gpio/sysfs.txt
> 
> Basically we have gpiogap and hscfgcmd debugfs commands. As production kernel doesn't enable CONFIG_DEBUGFS, we tried to do same thing via sysfs.

debugfs things are for testing / debugging purposes and should not be required in production. debugfs is also not an API guarantee. So you can change it any time. With sysfs that is no longer the case. And I am really careful letting any driver add any sysfs APIs.

If you are the first driver needing this, then you need a proper explanation why this would be needed at all. There is no driver / hardware from any manufacturer having the need for anything special exposed via sysfs.

Regards

Marcel

--
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