#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <linux/sysctl.h>
static int daca_detect_client(struct i2c_adapter *adapter, int address);
static int daca_detach_client(struct i2c_client *client);
-/* Unique ID allocation */
-static int daca_id;
-
struct i2c_driver daca_driver = {
- .owner = THIS_MODULE,
- .name = "DAC3550A driver V " DACA_VERSION,
+ .driver = {
+ .name = "DAC3550A driver V " DACA_VERSION,
+ },
.id = I2C_DRIVERID_DACA,
- .flags = I2C_DF_NOTIFY,
.attach_adapter = daca_attach_adapter,
.detach_client = daca_detach_client,
};
/* Do a short sleep, just to make sure I2C bus is awake and paying
* attention to us
*/
- wait_ms(20);
+ msleep(20);
/* Write the sample rate reg the value it needs */
i2c_smbus_write_byte_data(daca_client, 1, 8);
daca_set_volume(cur_left_vol >> 5, cur_right_vol >> 5);
/* Another short delay, just to make sure the other I2C bus writes
* have taken...
*/
- wait_ms(20);
+ msleep(20);
/* Write the global config reg - invert right power amp,
* DAC on, use 5-volt mode */
i2c_smbus_write_byte_data(daca_client, 3, 0x45);
new_client->driver = &daca_driver;
new_client->flags = 0;
strcpy(new_client->name, client_name);
- new_client->id = daca_id++; /* racy... */
if (daca_init_client(new_client))
goto bail;