All of lore.kernel.org
 help / color / mirror / Atom feed
* Kernel updating : export gpio not working ?
@ 2013-02-27 10:51 Mylene Josserand
  2013-02-27 15:19 ` Mylene Josserand
  0 siblings, 1 reply; 4+ messages in thread
From: Mylene Josserand @ 2013-02-27 10:51 UTC (permalink / raw)
  To: kernelnewbies

Hi everyone !


I am currently updating the kernel of my company and I have some 
problems about gpios so I am asking you some help ! :)
I think I am in the good mailist because it is the first time I update a 
kernel and a board configuration ! :D

The previous kernel used was 2.6.31.14 and I am trying to update it to 
last stable version 3.7.9.

In the previous kernel for a "home-made" board (with a IMx27 and a 
ARM9), we used these methods to export gpios in sysfs (for example for 
Gpio OUT) :

mxc_gpio_mode(gpio_number | GPIO_GPIO | GPIO_OUT);
gpio_request(gpio_number, name_of_gpio);
gpio_export(gpio_number, 0);
gpio_direction_output(gpio_number, gpio_value);

In the sysfs, the gpio exported was visible under "name_of_gpio".

Now, if I use the same methods, I can not get anything in sysfs except 
"gpiochip0, gpiochip32" etc.
I tried to use these functions in a module and I could export a gpio but 
under "gpioXX" and not "name_of_gpio". Moreover, I tried to export a 
gpio using the sysfs interface. I succeeded to export it and set 
direction to "out" but when I try to set the value, it did not work and 
the value is always set to 0 (and this gpio was configured as OUT in the 
board).

I make a diff about the gpio documentation and the old kernel used did 
not seem to have many differences with the new kernel ! There is only 
some methods added such as "gpio_resquest_one" and "gpio_export_link". I 
tried them without good results.


What am I doing wrong ?
What am I missing to make it work ?
Is there some other configurations to add in the board configuration ?


Thank you for any help/explanation !


-- 
Myl?ne JOSSERAND

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

* Kernel updating : export gpio not working ?
  2013-02-27 10:51 Kernel updating : export gpio not working ? Mylene Josserand
@ 2013-02-27 15:19 ` Mylene Josserand
  2013-02-27 17:42   ` Mulyadi Santosa
  0 siblings, 1 reply; 4+ messages in thread
From: Mylene Josserand @ 2013-02-27 15:19 UTC (permalink / raw)
  To: kernelnewbies

Just to update you that I have found my problem !

In my config file, I did not notice that my own board and an other imx27 
board was enabled ! So the gpios configured was the one from this board 
and not mine's (thanks debugfs !). That is why it did not act like I wanted.

Otherwise, the gpios are still exported as "gpioXX" and not with 
"name_of_gpio". The label "name_of_gpio" can be found in the debugfs but 
not printed in the sysfs. I don't know if there is a way to change that, 
I will search for it if I have time.

Best regards,


-- 
Myl?ne JOSSERAND



Le 27/02/2013 11:51, Mylene Josserand a ?crit :
> Hi everyone !
>
>
> I am currently updating the kernel of my company and I have some
> problems about gpios so I am asking you some help ! :)
> I think I am in the good mailist because it is the first time I update a
> kernel and a board configuration ! :D
>
> The previous kernel used was 2.6.31.14 and I am trying to update it to
> last stable version 3.7.9.
>
> In the previous kernel for a "home-made" board (with a IMx27 and a
> ARM9), we used these methods to export gpios in sysfs (for example for
> Gpio OUT) :
>
> mxc_gpio_mode(gpio_number | GPIO_GPIO | GPIO_OUT);
> gpio_request(gpio_number, name_of_gpio);
> gpio_export(gpio_number, 0);
> gpio_direction_output(gpio_number, gpio_value);
>
> In the sysfs, the gpio exported was visible under "name_of_gpio".
>
> Now, if I use the same methods, I can not get anything in sysfs except
> "gpiochip0, gpiochip32" etc.
> I tried to use these functions in a module and I could export a gpio but
> under "gpioXX" and not "name_of_gpio". Moreover, I tried to export a
> gpio using the sysfs interface. I succeeded to export it and set
> direction to "out" but when I try to set the value, it did not work and
> the value is always set to 0 (and this gpio was configured as OUT in the
> board).
>
> I make a diff about the gpio documentation and the old kernel used did
> not seem to have many differences with the new kernel ! There is only
> some methods added such as "gpio_resquest_one" and "gpio_export_link". I
> tried them without good results.
>
>
> What am I doing wrong ?
> What am I missing to make it work ?
> Is there some other configurations to add in the board configuration ?
>
>
> Thank you for any help/explanation !
>
>

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

* Kernel updating : export gpio not working ?
  2013-02-27 15:19 ` Mylene Josserand
@ 2013-02-27 17:42   ` Mulyadi Santosa
  2013-02-28  9:38     ` Mylene Josserand
  0 siblings, 1 reply; 4+ messages in thread
From: Mulyadi Santosa @ 2013-02-27 17:42 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Feb 27, 2013 at 10:19 PM, Mylene Josserand
<Mylene.Josserand@navocap.com> wrote:
> Just to update you that I have found my problem !
>
> In my config file, I did not notice that my own board and an other imx27
> board was enabled ! So the gpios configured was the one from this board
> and not mine's (thanks debugfs !). That is why it did not act like I wanted.

This is the kind of post that I like most.... some one has problem but
he/she also still find a way to solve. Then post it back to
kernelnewbies.

Nice info to know.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

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

* Kernel updating : export gpio not working ?
  2013-02-27 17:42   ` Mulyadi Santosa
@ 2013-02-28  9:38     ` Mylene Josserand
  0 siblings, 0 replies; 4+ messages in thread
From: Mylene Josserand @ 2013-02-28  9:38 UTC (permalink / raw)
  To: kernelnewbies

Hi,

Thank you for your answer ! :)

No problem to post back my solution. I think it can always be useful to 
know the solution of a problem even if it is a specific one. And I would 
be happy if it could help other kernel-newbies not to do the same "error" ;)


Best regards,

-- 
Myl?ne JOSSERAND


Le 27/02/2013 18:42, Mulyadi Santosa a ?crit :
> On Wed, Feb 27, 2013 at 10:19 PM, Mylene Josserand
> <Mylene.Josserand@navocap.com>  wrote:
>> Just to update you that I have found my problem !
>>
>> In my config file, I did not notice that my own board and an other imx27
>> board was enabled ! So the gpios configured was the one from this board
>> and not mine's (thanks debugfs !). That is why it did not act like I wanted.
>
> This is the kind of post that I like most.... some one has problem but
> he/she also still find a way to solve. Then post it back to
> kernelnewbies.
>
> Nice info to know.
>

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

end of thread, other threads:[~2013-02-28  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 10:51 Kernel updating : export gpio not working ? Mylene Josserand
2013-02-27 15:19 ` Mylene Josserand
2013-02-27 17:42   ` Mulyadi Santosa
2013-02-28  9:38     ` Mylene Josserand

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.