SCSI: zfcp: return early from slave_destroy if slave_alloc returned early
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / sigma.h
blobd0de882c0d96d5277f23306bf1d2884c40807292
1 /*
2 * Load firmware files from Analog Devices SigmaStudio
4 * Copyright 2009-2011 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
9 #ifndef __SIGMA_FIRMWARE_H__
10 #define __SIGMA_FIRMWARE_H__
12 #include <linux/firmware.h>
13 #include <linux/types.h>
15 struct i2c_client;
17 #define SIGMA_MAGIC "ADISIGM"
19 struct sigma_firmware {
20 const struct firmware *fw;
21 size_t pos;
24 struct sigma_firmware_header {
25 unsigned char magic[7];
26 u8 version;
27 __le32 crc;
30 enum {
31 SIGMA_ACTION_WRITEXBYTES = 0,
32 SIGMA_ACTION_WRITESINGLE,
33 SIGMA_ACTION_WRITESAFELOAD,
34 SIGMA_ACTION_DELAY,
35 SIGMA_ACTION_PLLWAIT,
36 SIGMA_ACTION_NOOP,
37 SIGMA_ACTION_END,
40 struct sigma_action {
41 u8 instr;
42 u8 len_hi;
43 __le16 len;
44 __be16 addr;
45 unsigned char payload[];
48 static inline u32 sigma_action_len(struct sigma_action *sa)
50 return (sa->len_hi << 16) | le16_to_cpu(sa->len);
53 extern int process_sigma_firmware(struct i2c_client *client, const char *name);
55 #endif