/* * drivers/mfd/si476x-cmd.c -- Subroutines implementing command * protocol of si476x series of chips * * Copyright (C) 2012 Innovative Converged Devices(ICD) * Copyright (C) 2013 Andrey Smirnov * * Author: Andrey Smirnov <andrew.smirnov@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * */#include<linux/module.h>#include<linux/completion.h>#include<linux/delay.h>#include<linux/atomic.h>#include<linux/i2c.h>#include<linux/device.h>#include<linux/gpio.h>#include<linux/videodev2.h>#include<linux/mfd/si476x-core.h>#include<asm/unaligned.h>#define msb(x) ((u8)((u16) x >> 8))#define lsb(x) ((u8)((u16) x & 0x00FF))#define CMD_POWER_UP 0x01#define CMD_POWER_UP_A10_NRESP 1#define CMD_POWER_UP_A10_NARGS 5#define CMD_POWER_UP_A20_NRESP 1#define CMD_POWER_UP_A20_NARGS 5#define POWER_UP_DELAY_MS 110#define CMD_POWER_DOWN 0x11#define CMD_POWER_DOWN_A10_NRESP 1