blob: 934130bc4cc19dd548c5c15897a328e2ab01257c [file] [log] [blame]
Sakari Ailusccfc97b2012-03-03 17:19:52 -03001/*
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
Sakari Ailus8c5dff92012-10-28 06:44:17 -03007 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
Sakari Ailusccfc97b2012-03-03 17:19:52 -03008 *
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.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef SMIAPP_REGS_H
26#define SMIAPP_REGS_H
27
28#include <linux/i2c.h>
29#include <linux/types.h>
30
31/* Use upper 8 bits of the type field for flags */
Sakari Ailus6fcc7a52014-04-11 05:47:21 -030032#define SMIAPP_REG_FLAG_FLOAT (1 << 24)
Sakari Ailusccfc97b2012-03-03 17:19:52 -030033
Sakari Ailus6fcc7a52014-04-11 05:47:21 -030034#define SMIAPP_REG_8BIT 1
35#define SMIAPP_REG_16BIT 2
36#define SMIAPP_REG_32BIT 4
Sakari Ailusccfc97b2012-03-03 17:19:52 -030037
Sakari Ailus1e73eea2012-04-22 08:55:10 -030038struct smiapp_sensor;
39
40int smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val);
Sakari Ailusceb9e302012-04-22 09:11:26 -030041int smiapp_read_8only(struct smiapp_sensor *sensor, u32 reg, u32 *val);
Sakari Ailus1e73eea2012-04-22 08:55:10 -030042int smiapp_write(struct smiapp_sensor *sensor, u32 reg, u32 val);
Sakari Ailusccfc97b2012-03-03 17:19:52 -030043
44#endif