Lars-Peter Clausen | 6b10998 | 2014-06-06 14:09:17 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Load Analog Devices SigmaStudio firmware files |
| 3 | * |
| 4 | * Copyright 2009-2011 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/i2c.h> |
| 10 | #include <linux/export.h> |
| 11 | #include <linux/module.h> |
| 12 | |
| 13 | #include "sigmadsp.h" |
| 14 | |
| 15 | static int sigma_action_write_i2c(void *control_data, |
| 16 | const struct sigma_action *sa, size_t len) |
| 17 | { |
| 18 | return i2c_master_send(control_data, (const unsigned char *)&sa->addr, |
| 19 | len); |
| 20 | } |
| 21 | |
| 22 | int process_sigma_firmware(struct i2c_client *client, const char *name) |
| 23 | { |
| 24 | struct sigma_firmware ssfw; |
| 25 | |
| 26 | ssfw.control_data = client; |
| 27 | ssfw.write = sigma_action_write_i2c; |
| 28 | |
| 29 | return _process_sigma_firmware(&client->dev, &ssfw, name); |
| 30 | } |
| 31 | EXPORT_SYMBOL(process_sigma_firmware); |
| 32 | |
| 33 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); |
| 34 | MODULE_DESCRIPTION("SigmaDSP I2C firmware loader"); |
| 35 | MODULE_LICENSE("GPL"); |