public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* rtc-ds3232 driver
@ 2012-03-01 17:09 Anthony Drake
       [not found] ` <61_2012_11913_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Drake @ 2012-03-01 17:09 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

Group,

I've built and insmod'd rtc-ds3232.ko, but I do not know how to access 
the functionality of the driver.  I think there should be a device
special file such as /dev/rtc1 or something like it, but I don't know
what it is. I suspect that since this is a type of i2c driver there
must be a way to access the driver at a higher level but I do not know
how.  Is there any information to help?

I can access the ds3232 from user space application, using i2c-dev
model.  I would also like to be able to read the status register from a
lkm.  Thank you in advance.

Thanks, Drake.

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

* Re: rtc-ds3232 driver
       [not found] ` <61_2012_11913_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
@ 2012-03-01 19:12   ` Wolfram Sang
  2012-03-01 19:54     ` Anthony Drake
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2012-03-01 19:12 UTC (permalink / raw)
  To: Anthony Drake; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]


> I've built and insmod'd rtc-ds3232.ko, but I do not know how to access 
> the functionality of the driver.  I think there should be a device
> special file such as /dev/rtc1 or something like it, but I don't know
> what it is. I suspect that since this is a type of i2c driver there
> must be a way to access the driver at a higher level but I do not know
> how.  Is there any information to help?

Documentation/rtc.txt

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: rtc-ds3232 driver
  2012-03-01 19:12   ` Wolfram Sang
@ 2012-03-01 19:54     ` Anthony Drake
       [not found]       ` <61_2012_13540_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Anthony Drake @ 2012-03-01 19:54 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Thu, 1 Mar 2012 20:12:00 +0100,
Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote 

> 
> Documentation/rtc.txt
> 
> --=20
Thank you.  I am familiar with the /dev/rtc0 character device special 
file interface, and can access it well.  My problem is that there is no
device special file created for rtc-ds3232 module.  I know how to mknod
a character device, but I do not know the major/minor number for
rtc-ds3232.ko, it does not appear in /proc/devices.  I do have
/dev/i2c-1, 2, & 3 in my system.  

I think I just do not know how to access i2c driver services, one that
is added in the following way, from rtc-ds3232.c: 

static int __init ds3232_init(void)
{
	printk("adding ds3232 driver: %s\n", ds3232_driver.driver.name);
	return i2c_add_driver(&ds3232_driver);
}

ds3232_driver defined:
static struct i2c_driver ds3232_driver = {
	.driver = {
		.name = "rtc-ds3232",
		.owner = THIS_MODULE,
	},
	.probe = ds3232_probe,
	.remove = __devexit_p(ds3232_remove),
	.id_table = ds3232_id,
};

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

* Re: rtc-ds3232 driver
       [not found]       ` <61_2012_13540_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
@ 2012-03-01 20:34         ` Jean Delvare
  2012-03-02 17:27           ` Anthony Drake
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2012-03-01 20:34 UTC (permalink / raw)
  To: Anthony Drake; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Thu, 1 Mar 2012 19:54:00 +0000 (UTC), Anthony Drake wrote:
> On Thu, 1 Mar 2012 20:12:00 +0100,
> Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote 
> 
> > 
> > Documentation/rtc.txt
> > 
> > --=20
> Thank you.  I am familiar with the /dev/rtc0 character device special 
> file interface, and can access it well.  My problem is that there is no
> device special file created for rtc-ds3232 module.

Odds are that the underlying I2C slave device was not instantiated.
Please read:
Documentation/i2c/instantiating-devices

Note that the rtc-ds3232 driver doesn't support method 3 (presumably
the device lacks identification and thus can't be autodetected.

-- 
Jean Delvare

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

* Re: rtc-ds3232 driver
  2012-03-01 20:34         ` Jean Delvare
@ 2012-03-02 17:27           ` Anthony Drake
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony Drake @ 2012-03-02 17:27 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Thu, 1 Mar 2012 21:34:14 +0100,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote in 
message
> 
> Odds are that the underlying I2C slave device was not instantiated.
> Please read:
> Documentation/i2c/instantiating-devices
> 
Thank you very much! It works! after using method 4 with the name
("ds3232") from the i2c_device_id array, the kernel autoloads the
module, creates /dev/rtc1. I've modified my userspace app to use the
driver instead of raw i2c read/write, all working well. 

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

end of thread, other threads:[~2012-03-02 17:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 17:09 rtc-ds3232 driver Anthony Drake
     [not found] ` <61_2012_11913_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
2012-03-01 19:12   ` Wolfram Sang
2012-03-01 19:54     ` Anthony Drake
     [not found]       ` <61_2012_13540_GON-2AO0Uh8ossnZ+VzJOa5vwg@public.gmane.org>
2012-03-01 20:34         ` Jean Delvare
2012-03-02 17:27           ` Anthony Drake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox