Merge branch 'clk-fixes' into clk-next
[linux-2.6-block.git] / drivers / media / i2c / smiapp / smiapp-regs.h
CommitLineData
ccfc97bd
SA
1/*
2 * include/media/smiapp/smiapp-regs.h
3 *
4 * Generic driver for SMIA/SMIA++ compliant camera modules
5 *
6 * Copyright (C) 2011--2012 Nokia Corporation
8c5dff90 7 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
ccfc97bd
SA
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
ccfc97bd
SA
17 */
18
19#ifndef SMIAPP_REGS_H
20#define SMIAPP_REGS_H
21
22#include <linux/i2c.h>
23#include <linux/types.h>
24
f5d65070
SA
25#define SMIAPP_REG_ADDR(reg) ((u16)reg)
26#define SMIAPP_REG_WIDTH(reg) ((u8)(reg >> 16))
27#define SMIAPP_REG_FLAGS(reg) ((u8)(reg >> 24))
28
ccfc97bd 29/* Use upper 8 bits of the type field for flags */
6fcc7a52 30#define SMIAPP_REG_FLAG_FLOAT (1 << 24)
ccfc97bd 31
6fcc7a52
SA
32#define SMIAPP_REG_8BIT 1
33#define SMIAPP_REG_16BIT 2
34#define SMIAPP_REG_32BIT 4
ccfc97bd 35
1e73eea7
SA
36struct smiapp_sensor;
37
6f7481b6 38int smiapp_read_no_quirk(struct smiapp_sensor *sensor, u32 reg, u32 *val);
1e73eea7 39int smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val);
ceb9e30e 40int smiapp_read_8only(struct smiapp_sensor *sensor, u32 reg, u32 *val);
6f7481b6 41int smiapp_write_no_quirk(struct smiapp_sensor *sensor, u32 reg, u32 val);
1e73eea7 42int smiapp_write(struct smiapp_sensor *sensor, u32 reg, u32 val);
ccfc97bd
SA
43
44#endif