Skip to contentSkip to conversation

Export symbol from I2C eeprom driver

PATCH In review Jon Smirl 2 participants 8 messages Jan 8, 2005 – Jan 12, 2005

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

PATCH 1/1 Export symbol from I2C eeprom driver

Trivial patch to export a symbol from the eeprom driver. Currently there are no exported symbols. The symbol lets the radeon DRM driver link to it and modprobe will then force it to load along with the radeon driver.

Signed off by: Jon Smirl <[email protected]>

Signature · 2 lines
Jon Smirl
[email protected]

#signed off by: Jon Smirl <[email protected]> ===== drivers/i2c/chips/eeprom.c 1.14 vs edited =====

drivers/i2c/chips/eeprom.c +2 -1
@@ -85,7 +85,8 @@
 	.detach_client	= eeprom_detach_client,
 };
 
-static int eeprom_id;
+int eeprom_id;
+EXPORT_SYMBOL(eeprom_id);
 
 static void eeprom_update_client(struct i2c_client *client, u8 slice)
 {
#1 lore raw
Quoted 4 lines · Jon Smirl

Trivial patch to export a symbol from the eeprom driver. Currently there are no exported symbols. The symbol lets the radeon DRM driver link to it and modprobe will then force it to load along with the radeon driver.

Why do you need this symbol? Or are you just saying that you need the eeprom driver loaded for some reason?

I say this as this variable is probably going to go away in the very near future, as it isn't really needed at all.

thanks,

greg k-h

author
#2 lore raw
Quoted 11 lines · Greg KH
Quoted 4 lines · Jon Smirl

Trivial patch to export a symbol from the eeprom driver. Currently there are no exported symbols. The symbol lets the radeon DRM driver link to it and modprobe will then force it to load along with the radeon driver.

Why do you need this symbol? Or are you just saying that you need the eeprom driver loaded for some reason?

I say this as this variable is probably going to go away in the very near future, as it isn't really needed at all.

I just need a symbol to force eeprom to load, it can be any symbol. I need something for the radeon driver to link to so that modprobe will know to force eeprom to load when radeon is loaded. radeon is getting hotplug code that needs the eeprom module loaded.

Signature · 2 lines
Jon Smirl
[email protected]
#3 lore raw
Quoted 10 lines · Jon Smirl
Quoted 9 lines · Greg KH
Quoted 4 lines · Jon Smirl

Trivial patch to export a symbol from the eeprom driver. Currently there are no exported symbols. The symbol lets the radeon DRM driver link to it and modprobe will then force it to load along with the radeon driver.

Why do you need this symbol? Or are you just saying that you need the eeprom driver loaded for some reason?

Quoted 7 lines
Quoted 2 lines

I say this as this variable is probably going to go away in the very near future, as it isn't really needed at all.

I just need a symbol to force eeprom to load, it can be any symbol. I need something for the radeon driver to link to so that modprobe will know to force eeprom to load when radeon is loaded. radeon is getting hotplug code that needs the eeprom module loaded.

Then why not try to load the module from your hotplug script?

And why do you need the eeprom driver for the radeon driver to work properly?

thanks,

greg k-h

author
#4 lore raw
Quoted 2 lines · Greg KH

And why do you need the eeprom driver for the radeon driver to work properly?

In the new radeon driver at hotplug time a user space app reads the DDC from the monitor and sets the list of valid modes into the driver. The radeon driver includes an I2C driver. The eeprom driver finds the radeon DDC ROMs and makes them visible to the userspace driver through sysfs. I could add code to the radeon driver to export the DDC ROMs to sysfs but the eeprom driver works fine.

I don't want to load the driver from the script because the radeon driver is creating a sysfs link into the eeprom directory from the radeon one.

Signature · 2 lines
Jon Smirl
[email protected]
#5 lore raw
Quoted 11 lines · Jon Smirl
Quoted 2 lines · Greg KH

And why do you need the eeprom driver for the radeon driver to work properly?

In the new radeon driver at hotplug time a user space app reads the DDC from the monitor and sets the list of valid modes into the driver. The radeon driver includes an I2C driver. The eeprom driver finds the radeon DDC ROMs and makes them visible to the userspace driver through sysfs. I could add code to the radeon driver to export the DDC ROMs to sysfs but the eeprom driver works fine.

Quoted 3 lines

I don't want to load the driver from the script because the radeon driver is creating a sysfs link into the eeprom directory from the radeon one.

How are you getting the kobject to the eeprom directory from the radeon driver?

thanks,

greg k-h

author
#6 lore raw
Quoted 7 lines · Greg KH
Quoted 3 lines

I don't want to load the driver from the script because the radeon driver is creating a sysfs link into the eeprom directory from the radeon one.

How are you getting the kobject to the eeprom directory from the radeon driver?

I own the private I2C bus and eeprom is the only chip that will attach to the bus. I need to do the link in the driver since there are four busses and upto two monitors. The driver knows how to pair the head up with the right bus.

if (dev_priv->primary_head.connector != ddc_none)
list_for_each(item,

&dev_priv->i2c[dev_priv->primary_head.connector].adapter.clients) {
    client = list_entry(item, struct i2c_client, list);
    sysfs_create_link(&dev->primary.dev_class->kobj,
&client->dev.kobj, "monitor");
    break;

}

Signature · 2 lines
Jon Smirl
[email protected]
#7 lore raw
Quoted 14 lines · Jon Smirl
Quoted 7 lines · Greg KH
Quoted 3 lines

I don't want to load the driver from the script because the radeon driver is creating a sysfs link into the eeprom directory from the radeon one.

How are you getting the kobject to the eeprom directory from the radeon driver?

I own the private I2C bus and eeprom is the only chip that will attach to the bus. I need to do the link in the driver since there are four busses and upto two monitors. The driver knows how to pair the head up with the right bus.

Quoted 8 lines

if (dev_priv->primary_head.connector != ddc_none)
list_for_each(item,

&dev_priv->i2c[dev_priv->primary_head.connector].adapter.clients) {
    client = list_entry(item, struct i2c_client, list);
    sysfs_create_link(&dev->primary.dev_class->kobj,
&client->dev.kobj, "monitor");
    break;

}

Ick. Oh well, sure, that's ok. But I really think that a Kconfig rule could be made for this, instead of trying to pull an exported symbol in.

And I have a patch in my queue to delete that id, so you will have to come up with another symbol in the driver to do that with :)

thanks,

greg k-h