leds-is31fl32xx.c (6ea24cf79e055f0a62a64baa8587e2254a493c7b) | leds-is31fl32xx.c (1d991b71b4fbbeab319154e9aa2f1e9c94976311) |
---|---|
1/* 2 * Driver for ISSI IS31FL32xx family of I2C LED controllers 3 * 4 * Copyright 2015 Allworx Corp. 5 * 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 408 unchanged lines hidden (view full) --- 417 418 return 0; 419 420err: 421 of_node_put(child); 422 return ret; 423} 424 | 1/* 2 * Driver for ISSI IS31FL32xx family of I2C LED controllers 3 * 4 * Copyright 2015 Allworx Corp. 5 * 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 408 unchanged lines hidden (view full) --- 417 418 return 0; 419 420err: 421 of_node_put(child); 422 return ret; 423} 424 |
425static const struct of_device_id of_is31fl31xx_match[] = { | 425static const struct of_device_id of_is31fl32xx_match[] = { |
426 { .compatible = "issi,is31fl3236", .data = &is31fl3236_cdef, }, 427 { .compatible = "issi,is31fl3235", .data = &is31fl3235_cdef, }, 428 { .compatible = "issi,is31fl3218", .data = &is31fl3218_cdef, }, 429 { .compatible = "si-en,sn3218", .data = &is31fl3218_cdef, }, 430 { .compatible = "issi,is31fl3216", .data = &is31fl3216_cdef, }, 431 { .compatible = "si-en,sn3216", .data = &is31fl3216_cdef, }, 432 {}, 433}; 434 | 426 { .compatible = "issi,is31fl3236", .data = &is31fl3236_cdef, }, 427 { .compatible = "issi,is31fl3235", .data = &is31fl3235_cdef, }, 428 { .compatible = "issi,is31fl3218", .data = &is31fl3218_cdef, }, 429 { .compatible = "si-en,sn3218", .data = &is31fl3218_cdef, }, 430 { .compatible = "issi,is31fl3216", .data = &is31fl3216_cdef, }, 431 { .compatible = "si-en,sn3216", .data = &is31fl3216_cdef, }, 432 {}, 433}; 434 |
435MODULE_DEVICE_TABLE(of, of_is31fl31xx_match); | 435MODULE_DEVICE_TABLE(of, of_is31fl32xx_match); |
436 437static int is31fl32xx_probe(struct i2c_client *client, 438 const struct i2c_device_id *id) 439{ 440 const struct is31fl32xx_chipdef *cdef; 441 const struct of_device_id *of_dev_id; 442 struct device *dev = &client->dev; 443 struct is31fl32xx_priv *priv; 444 int count; 445 int ret = 0; 446 | 436 437static int is31fl32xx_probe(struct i2c_client *client, 438 const struct i2c_device_id *id) 439{ 440 const struct is31fl32xx_chipdef *cdef; 441 const struct of_device_id *of_dev_id; 442 struct device *dev = &client->dev; 443 struct is31fl32xx_priv *priv; 444 int count; 445 int ret = 0; 446 |
447 of_dev_id = of_match_device(of_is31fl31xx_match, dev); | 447 of_dev_id = of_match_device(of_is31fl32xx_match, dev); |
448 if (!of_dev_id) 449 return -EINVAL; 450 451 cdef = of_dev_id->data; 452 453 count = of_get_child_count(dev->of_node); 454 if (!count) 455 return -EINVAL; --- 24 unchanged lines hidden (view full) --- 480 481 return is31fl32xx_reset_regs(priv); 482} 483 484/* 485 * i2c-core requires that id_table be non-NULL, even though 486 * it is not used for DeviceTree based instantiation. 487 */ | 448 if (!of_dev_id) 449 return -EINVAL; 450 451 cdef = of_dev_id->data; 452 453 count = of_get_child_count(dev->of_node); 454 if (!count) 455 return -EINVAL; --- 24 unchanged lines hidden (view full) --- 480 481 return is31fl32xx_reset_regs(priv); 482} 483 484/* 485 * i2c-core requires that id_table be non-NULL, even though 486 * it is not used for DeviceTree based instantiation. 487 */ |
488static const struct i2c_device_id is31fl31xx_id[] = { | 488static const struct i2c_device_id is31fl32xx_id[] = { |
489 {}, 490}; 491 | 489 {}, 490}; 491 |
492MODULE_DEVICE_TABLE(i2c, is31fl31xx_id); | 492MODULE_DEVICE_TABLE(i2c, is31fl32xx_id); |
493 494static struct i2c_driver is31fl32xx_driver = { 495 .driver = { 496 .name = "is31fl32xx", | 493 494static struct i2c_driver is31fl32xx_driver = { 495 .driver = { 496 .name = "is31fl32xx", |
497 .of_match_table = of_is31fl31xx_match, | 497 .of_match_table = of_is31fl32xx_match, |
498 }, 499 .probe = is31fl32xx_probe, 500 .remove = is31fl32xx_remove, | 498 }, 499 .probe = is31fl32xx_probe, 500 .remove = is31fl32xx_remove, |
501 .id_table = is31fl31xx_id, | 501 .id_table = is31fl32xx_id, |
502}; 503 504module_i2c_driver(is31fl32xx_driver); 505 506MODULE_AUTHOR("David Rivshin <drivshin@allworx.com>"); 507MODULE_DESCRIPTION("ISSI IS31FL32xx LED driver"); 508MODULE_LICENSE("GPL v2"); | 502}; 503 504module_i2c_driver(is31fl32xx_driver); 505 506MODULE_AUTHOR("David Rivshin <drivshin@allworx.com>"); 507MODULE_DESCRIPTION("ISSI IS31FL32xx LED driver"); 508MODULE_LICENSE("GPL v2"); |