I2C Driver Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have an i2c chip (light management unit) which can be connected to many
leds and other items in many different ways.
While writing this driver I have not been trying to force anything on a
user because of this.  However, I want to make functions such as
enableChargePump(bool) callable from other kernel code that knows how the
hardware is setup for this particular device.  

So I have a kernel module that knows how the chip works(via i2c) and I wish
exposes functions to be called from other kernel code.
I then have another kernel module specific to a product that calls
functions from the previously described kernel module.

How do I create functions callable from outside of the i2c driver? There
can also be many of these i2c devices in a product


Code with question repeated for clarification on question:

lmu_as3676_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct lmu_record *rd = 0;
rd = kzalloc(sizeof(struct lmu_record), GFP_KERNEL);
i2c_set_clientdata(client, rd);
....
}

static int __init lmu_as3676_init(void)
{
return i2c_add_driver(&lmu_driver);
}

static int enableChargePump1(bool enable) // maybe somehow pass in two vars
= (bool enable, i2c_client *client)
{
// How do make this function function do i2c calls for an i2c chip, or
schedule work to be done on the i2c bus
// this function should be allowed to be called from within anywhere in
kernel space
}
EXPORT_SYMBOL(enableChargePump1);


--
Thank you
Michael


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux