public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "Azhar Mr." <shaik.azharuddin@yahoo.co.in>
To: linux-omap-open-source@linux.omap.com
Subject: OSK5912 GPIO
Date: Tue, 20 Nov 2007 13:20:34 +0000 (GMT)	[thread overview]
Message-ID: <589867.89402.qm@web7606.mail.in.yahoo.com> (raw)

Dear all,

I AM WORKING ON OMAP5912 OSK

I am trying to write a simple GPIO program to change
the state of  a gpio pin.

For that I am using the gpio-switch.c located at
linux/arch/arm/plat-omap.

In the gpio-switch.c program I included the follwing
function

#define LED_GPIO 23

static int led_glow()
{
	/* requesting for LED_GPIO */
	
      if(omap_request_gpio(LED_GPIO)<0)
		return -1;
	
	/* setting LED_GPIO as output pin */
	omap_set_gpio_direction(LED_GPIO,0);

	/* writing to LED_GPIO the state of KEY_UP */

	omap_set_gpio_dataout(LED_GPIO,1);

	/* printing the value of led_gpio pin */
	
  printk("value of pin # %d =
%d\n",LED_GPIO,omap_get_gpio_datain(LED_GPIO));

	return 0;
	

}
 
I am calling the function "led_glow()" again in the
following function

static int __init gpio_sw_init(void)
{
	int r;

	printk(KERN_INFO "OMAP GPIO switch handler
initializing\n");

	r = driver_register(&gpio_sw_driver);
	if (r)
		return r;

	gpio_sw_platform_dev =
platform_device_register_simple("gpio-switch",
							       -1, NULL, 0);
	if (IS_ERR(gpio_sw_platform_dev)) {
		driver_unregister(&gpio_sw_driver);
		return PTR_ERR(gpio_sw_platform_dev);
	}

	r = add_atag_switches();
	if (r < 0) {
		platform_device_unregister(gpio_sw_platform_dev);
		driver_unregister(&gpio_sw_driver);
		gpio_sw_cleanup();
		return r;
	}

	report_initial_state();

	return 0;
        led_glow();
        
}
  
I complied and ported this to OSK5912

But I am getting neither the print statement nor the
response at the gpio pin 23 in the C.R.O. 

Even I changed the various gpio pins and tried I could
not see any response in the C.R.O

Please help me by an example code.


Regards

Azhar


      Bring your gang together - do your thing. Go to http://in.promos.yahoo.com/groups

             reply	other threads:[~2007-11-20 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20 13:20 Azhar Mr. [this message]
2007-11-20 14:03 ` OSK5912 GPIO Daniel Stone
  -- strict thread matches above, loose matches on Subject: below --
2007-11-16 11:59 Azhar Mr.
2007-11-18  3:12 ` andrzej zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=589867.89402.qm@web7606.mail.in.yahoo.com \
    --to=shaik.azharuddin@yahoo.co.in \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox