2011-03-23 06:34:40 +07:00
|
|
|
/*
|
|
|
|
* Load firmware files from Analog Devices SigmaStudio
|
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Analog Devices Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the GPL-2 or later.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SIGMA_FIRMWARE_H__
|
|
|
|
#define __SIGMA_FIRMWARE_H__
|
|
|
|
|
|
|
|
#include <linux/firmware.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
struct i2c_client;
|
|
|
|
|
|
|
|
#define SIGMA_MAGIC "ADISIGM"
|
|
|
|
|
|
|
|
struct sigma_firmware {
|
|
|
|
const struct firmware *fw;
|
|
|
|
size_t pos;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sigma_firmware_header {
|
|
|
|
unsigned char magic[7];
|
|
|
|
u8 version;
|
2011-11-28 15:44:16 +07:00
|
|
|
__le32 crc;
|
2011-03-23 06:34:40 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
SIGMA_ACTION_WRITEXBYTES = 0,
|
|
|
|
SIGMA_ACTION_WRITESINGLE,
|
|
|
|
SIGMA_ACTION_WRITESAFELOAD,
|
|
|
|
SIGMA_ACTION_DELAY,
|
|
|
|
SIGMA_ACTION_PLLWAIT,
|
|
|
|
SIGMA_ACTION_NOOP,
|
|
|
|
SIGMA_ACTION_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sigma_action {
|
|
|
|
u8 instr;
|
|
|
|
u8 len_hi;
|
2011-11-28 15:44:16 +07:00
|
|
|
__le16 len;
|
|
|
|
__be16 addr;
|
2011-03-23 06:34:40 +07:00
|
|
|
unsigned char payload[];
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline u32 sigma_action_len(struct sigma_action *sa)
|
|
|
|
{
|
2011-11-28 15:44:16 +07:00
|
|
|
return (sa->len_hi << 16) | le16_to_cpu(sa->len);
|
2011-03-23 06:34:40 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
extern int process_sigma_firmware(struct i2c_client *client, const char *name);
|
|
|
|
|
|
|
|
#endif
|