From rscordeau at gmail.com Wed May 18 22:11:49 2016 From: rscordeau at gmail.com (Rob Cordeau) Date: Wed, 18 May 2016 15:11:49 -0700 Subject: Change interface to GPIO access to allow configuration of exported name Message-ID: Hi, I am working on a board that exports GPIOs in a format that is different than what dio expects. Currently it is hard coded in dio to access a gpio at /sys/class/gpio/gpio# when the gpio is exported, but the board I am on has it configured in the kernel to export, say, GPIO39 as /sys/class/gpio/P3_1 for example. There is no way the DIO code can control this gpio unless I modify the kernel to export the gpio name to what DIO expects. Can DIO change to allow the name of the exported gpio to be passed in? Thanks, Rob From snazarkin at azul.com Thu May 19 10:08:24 2016 From: snazarkin at azul.com (Sergey Nazarkin) Date: Thu, 19 May 2016 10:08:24 +0000 Subject: Change interface to GPIO access to allow configuration of exported name In-Reply-To: References: Message-ID: <4B55F076-3337-4B40-8203-D1E1E673070B@azul.com> Hi Rob, I?m afraid it?s impossible to use alternative names without library recompilation. However it?s quite easy. Just change name pattern at src/share/linux/native/com/oracle/dio/gpio/gpio.c and follow instructions from README file Sergey Nazarkin > On 19 May 2016, at 01:11, Rob Cordeau wrote: > > Hi, > I am working on a board that exports GPIOs in a format that is different > than what dio expects. Currently it is hard coded in dio to access a gpio > at /sys/class/gpio/gpio# when the gpio is exported, but the board I am on > has it configured in the kernel to export, say, GPIO39 as > /sys/class/gpio/P3_1 for example. There is no way the DIO code can control > this gpio unless I modify the kernel to export the gpio name to what DIO > expects. Can DIO change to allow the name of the exported gpio to be > passed in? > > Thanks, > Rob From alexander.mironenko at oracle.com Thu May 19 10:26:14 2016 From: alexander.mironenko at oracle.com (Alexander Mironenko) Date: Thu, 19 May 2016 13:26:14 +0300 Subject: Change interface to GPIO access to allow configuration of exported name In-Reply-To: References: Message-ID: <1AC89314-6735-4ECA-AF53-D4B098F42686@oracle.com> Hi Rob, Not sure, but may be you can create a symbolic link on each GPIO export? For instance you will have a link /sys/class/gpio/GPIO39 -> /sys/class/gpio/P3_1 and Java will work with it? It is just guess. Regards, Alex > On May 19, 2016, at 1:11 AM, Rob Cordeau wrote: > > Hi, > I am working on a board that exports GPIOs in a format that is different > than what dio expects. Currently it is hard coded in dio to access a gpio > at /sys/class/gpio/gpio# when the gpio is exported, but the board I am on > has it configured in the kernel to export, say, GPIO39 as > /sys/class/gpio/P3_1 for example. There is no way the DIO code can control > this gpio unless I modify the kernel to export the gpio name to what DIO > expects. Can DIO change to allow the name of the exported gpio to be > passed in? > > Thanks, > Rob From rscordeau at gmail.com Thu May 19 17:42:40 2016 From: rscordeau at gmail.com (Rob Cordeau) Date: Thu, 19 May 2016 10:42:40 -0700 Subject: Change interface to GPIO access to allow configuration of exported name In-Reply-To: <1AC89314-6735-4ECA-AF53-D4B098F42686@oracle.com> References: <1AC89314-6735-4ECA-AF53-D4B098F42686@oracle.com> Message-ID: Hi Alex, I tried that and it's a no go in the sys directory. So I can either change kernel source or change DIO source. I was hoping to upstream a change in DIO source to increase its flexibility. On Thursday, May 19, 2016, Alexander Mironenko < alexander.mironenko at oracle.com> wrote: > Hi Rob, > > Not sure, but may be you can create a symbolic link on each GPIO export? > For instance you will have a link /sys/class/gpio/GPIO39 -> > /sys/class/gpio/P3_1 and Java will work with it? > > It is just guess. > > Regards, > Alex > > > On May 19, 2016, at 1:11 AM, Rob Cordeau > wrote: > > > > Hi, > > I am working on a board that exports GPIOs in a format that is different > > than what dio expects. Currently it is hard coded in dio to access a > gpio > > at /sys/class/gpio/gpio# when the gpio is exported, but the board I am on > > has it configured in the kernel to export, say, GPIO39 as > > /sys/class/gpio/P3_1 for example. There is no way the DIO code can > control > > this gpio unless I modify the kernel to export the gpio name to what DIO > > expects. Can DIO change to allow the name of the exported gpio to be > > passed in? > > > > Thanks, > > Rob > >