Source
23
23
* 02111-1307, USA
24
24
*/
25
25
26
26
#include <linux/err.h>
27
27
#include <linux/i2c.h>
28
28
#include <linux/init.h>
29
29
#include <linux/interrupt.h>
30
30
#include <linux/irq.h>
31
31
#include <linux/mfd/core.h>
32
32
#include <linux/mfd/tps80031.h>
33
-
#include <linux/module.h>
34
33
#include <linux/pm.h>
35
34
#include <linux/regmap.h>
36
35
#include <linux/slab.h>
37
36
38
37
static struct resource tps80031_rtc_resources[] = {
39
38
{
40
39
.start = TPS80031_INT_RTC_ALARM,
41
40
.end = TPS80031_INT_RTC_ALARM,
42
41
.flags = IORESOURCE_IRQ,
43
42
},
509
508
regmap_del_irq_chip(client->irq, tps80031->irq_data);
510
509
511
510
fail_client_reg:
512
511
for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
513
512
if (tps80031->clients[i] && (tps80031->clients[i] != client))
514
513
i2c_unregister_device(tps80031->clients[i]);
515
514
}
516
515
return ret;
517
516
}
518
517
519
-
static int tps80031_remove(struct i2c_client *client)
520
-
{
521
-
struct tps80031 *tps80031 = i2c_get_clientdata(client);
522
-
int i;
523
-
524
-
if (tps80031_power_off_dev == tps80031) {
525
-
tps80031_power_off_dev = NULL;
526
-
pm_power_off = NULL;
527
-
}
528
-
529
-
mfd_remove_devices(tps80031->dev);
530
-
531
-
regmap_del_irq_chip(client->irq, tps80031->irq_data);
532
-
533
-
for (i = 0; i < TPS80031_NUM_SLAVES; i++) {
534
-
if (tps80031->clients[i] != client)
535
-
i2c_unregister_device(tps80031->clients[i]);
536
-
}
537
-
return 0;
538
-
}
539
-
540
518
static const struct i2c_device_id tps80031_id_table[] = {
541
519
{ "tps80031", TPS80031 },
542
520
{ "tps80032", TPS80032 },
543
521
{ }
544
522
};
545
-
MODULE_DEVICE_TABLE(i2c, tps80031_id_table);
546
523
547
524
static struct i2c_driver tps80031_driver = {
548
525
.driver = {
549
-
.name = "tps80031",
526
+
.name = "tps80031",
527
+
.suppress_bind_attrs = true,
550
528
},
551
529
.probe = tps80031_probe,
552
-
.remove = tps80031_remove,
553
530
.id_table = tps80031_id_table,
554
531
};
555
532
556
533
static int __init tps80031_init(void)
557
534
{
558
535
return i2c_add_driver(&tps80031_driver);
559
536
}
560
537
subsys_initcall(tps80031_init);
561
-
562
-
static void __exit tps80031_exit(void)
563
-
{
564
-
i2c_del_driver(&tps80031_driver);
565
-
}
566
-
module_exit(tps80031_exit);
567
-
568
-
MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
569
-
MODULE_DESCRIPTION("TPS80031 core driver");
570
-
MODULE_LICENSE("GPL v2");