Mike Frysinger | e359dc2 | 2011-03-22 16:34:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Load firmware files from Analog Devices SigmaStudio |
| 3 | * |
| 4 | * Copyright 2009-2011 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __SIGMA_FIRMWARE_H__ |
| 10 | #define __SIGMA_FIRMWARE_H__ |
| 11 | |
Lars-Peter Clausen | 38fd54e | 2011-11-28 09:44:20 +0100 | [diff] [blame] | 12 | #include <linux/device.h> |
| 13 | #include <linux/regmap.h> |
| 14 | |
Lars-Peter Clausen | 6b10998 | 2014-06-06 14:09:17 +0200 | [diff] [blame] | 15 | struct sigma_action { |
| 16 | u8 instr; |
| 17 | u8 len_hi; |
| 18 | __le16 len; |
| 19 | __be16 addr; |
| 20 | unsigned char payload[]; |
| 21 | } __packed; |
| 22 | |
| 23 | struct sigma_firmware { |
| 24 | const struct firmware *fw; |
| 25 | size_t pos; |
| 26 | |
| 27 | void *control_data; |
| 28 | int (*write)(void *control_data, const struct sigma_action *sa, |
| 29 | size_t len); |
| 30 | }; |
| 31 | |
| 32 | int _process_sigma_firmware(struct device *dev, |
| 33 | struct sigma_firmware *ssfw, const char *name); |
| 34 | |
Mike Frysinger | e359dc2 | 2011-03-22 16:34:40 -0700 | [diff] [blame] | 35 | struct i2c_client; |
| 36 | |
Mike Frysinger | e359dc2 | 2011-03-22 16:34:40 -0700 | [diff] [blame] | 37 | extern int process_sigma_firmware(struct i2c_client *client, const char *name); |
Lars-Peter Clausen | 38fd54e | 2011-11-28 09:44:20 +0100 | [diff] [blame] | 38 | extern int process_sigma_firmware_regmap(struct device *dev, |
| 39 | struct regmap *regmap, const char *name); |
Mike Frysinger | e359dc2 | 2011-03-22 16:34:40 -0700 | [diff] [blame] | 40 | |
| 41 | #endif |