apsk25
Posts: 1
Joined: Thu Apr 14, 2016 11:47 am

Probe not getting called EEPROM

Thu Nov 01, 2018 9:16 am

Amrit Pal Singh <apsk81@gmail.com>

12:07 PM (2 hours ago)

to Anil, inside_linux
Hi,

I have connected AT 24C32 to my raspberri Pi(details given).
Changes done in two files :-

Code: Select all

bcm2837.dtsi

&i2c0{
        eeprom: eeprom@50 {
                compatible = "atmel,24c256";
                reg = <0x50>;
        };
};

bcm2https://www.raspberrypi.org/forums/mcp.php?i=main#83x.dtsi
i2c0: i2c@7e205000 {
                        compatible = "atmel,24c256";
                        reg = <0x7e205000 0x1000>;
                        interrupts = <2 21>;
                        clocks = <&clocks BCM2835_CLOCK_VPU>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "enabled";
                }
               
The driver that I wrote my_eeprom.c

static const struct i2c_device_id eeprom24_i2c_id[] = {
        /* Generic Entry */
        { "atmel,24c256", 0 }
        /* Terminating entry */
};


static int eeprom24_probe(struct i2c_client *client,const struct i2c_device_id *id)
{
       // struct si470x_device *radio;
       // int retval = 0;
        printk("\nprobe called\n");
        return 0;
};


static struct i2c_driver eeprom24_i2c_driver = {
        .driver = {
                .name           = "eeprom24",
                .owner          = THIS_MODULE,
        },
        .probe                  =  eeprom24_probe,
        .id_table               = eeprom24_i2c_id,
};

/**************************************************************************
 * Module Interface
 **************************************************************************/

/*
 * si470x_i2c_init - module init
 */
static int  eeprom24_i2c_init(void)
{
        printk("\n Insertion of I2c driver   \n");
        return i2c_add_driver(&eeprom24_i2c_driver);
}
Module gets inserted.
I have downloaded the code through

git clone --depth=1 https://github.com/raspberrypi/linux

And following commands to install.

My probe is not getting called.

Raspberri Pi 3 model

uname -ar
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

I insert my driver using insmod.

Is There any index file which is created from where the driver checks the compatible string?

Thanks & Regards,
Amrit Pal Singh.

Return to “General discussion”