1ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus/* 2cb7a01ac324bf2ee2c666f37ac867e4135f9785aMauro Carvalho Chehab * drivers/media/i2c/smiapp/smiapp.h 3ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 4ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * Generic driver for SMIA/SMIA++ compliant camera modules 5ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 6ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * Copyright (C) 2010--2012 Nokia Corporation 78c5dff905714446f8836b40a93bfeabd0aea8c82Sakari Ailus * Contact: Sakari Ailus <sakari.ailus@iki.fi> 8ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 9ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * This program is free software; you can redistribute it and/or 10ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * modify it under the terms of the GNU General Public License 11ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * version 2 as published by the Free Software Foundation. 12ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 13ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * This program is distributed in the hope that it will be useful, but 14ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * WITHOUT ANY WARRANTY; without even the implied warranty of 15ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * General Public License for more details. 17ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 18ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * You should have received a copy of the GNU General Public License 19ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * along with this program; if not, write to the Free Software 20ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 02110-1301 USA 22ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * 23ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus */ 24ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 25ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#ifndef __SMIAPP_PRIV_H_ 26ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define __SMIAPP_PRIV_H_ 27ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 28ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include <linux/mutex.h> 29ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include <media/v4l2-ctrls.h> 30ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include <media/v4l2-subdev.h> 31ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include <media/smiapp.h> 32ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 33f9b26cd8e2cb8979694c48ea642d30784e7aceb3Mauro Carvalho Chehab#include "smiapp-pll.h" 34ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include "smiapp-reg.h" 35ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include "smiapp-regs.h" 36ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include "smiapp-quirk.h" 37ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 38ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus/* 39ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * Standard SMIA++ constants 40ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus */ 41ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIA_VERSION_1 10 42ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_VERSION_0_8 8 /* Draft 0.8 */ 43ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_VERSION_0_9 9 /* Draft 0.9 */ 44ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_VERSION_1 10 45ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 46ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PROFILE_0 0 47ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PROFILE_1 1 48ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PROFILE_2 2 49ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 50ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_NVM_PAGE_SIZE 64 /* bytes */ 51ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 52ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_RESET_DELAY_CLOCKS 2400 53ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_RESET_DELAY(clk) \ 54ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus (1000 + (SMIAPP_RESET_DELAY_CLOCKS * 1000 \ 55ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus + (clk) / 1000 - 1) / ((clk) / 1000)) 56ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 570e2a6b7f2b9303410c93fd4724f9d36ebc7be1c3Sakari Ailus#define SMIAPP_COLOUR_COMPONENTS 4 580e2a6b7f2b9303410c93fd4724f9d36ebc7be1c3Sakari Ailus 59ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#include "smiapp-limits.h" 60ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 61ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_quirk; 62ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 63ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_MODULE_IDENT_FLAG_REV_LE (1 << 0) 64ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 65ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_module_ident { 66ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 manufacturer_id; 67ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u16 model_id; 68ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 revision_number_major; 69ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 70ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 flags; 71ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 72ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus char *name; 73ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus const struct smiapp_quirk *quirk; 74ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 75ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 76ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_module_info { 77ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 manufacturer_id; 78ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 model_id; 79ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 revision_number_major; 80ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 revision_number_minor; 81ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 82ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 module_year; 83ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 module_month; 84ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 module_day; 85ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 86ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 sensor_manufacturer_id; 87ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 sensor_model_id; 88ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 sensor_revision_number; 89ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 sensor_firmware_version; 90ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 91ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 smia_version; 92ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 smiapp_version; 93ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 94ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 smiapp_profile; 95ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 96ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus char *name; 97ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus const struct smiapp_quirk *quirk; 98ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 99ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 100ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_IDENT_FQ(manufacturer, model, rev, fl, _name, _quirk) \ 101ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus { .manufacturer_id = manufacturer, \ 102ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .model_id = model, \ 103ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .revision_number_major = rev, \ 104ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .flags = fl, \ 105ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .name = _name, \ 106ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .quirk = _quirk, } 107ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 108ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_IDENT_LQ(manufacturer, model, rev, _name, _quirk) \ 109ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus { .manufacturer_id = manufacturer, \ 110ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .model_id = model, \ 111ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .revision_number_major = rev, \ 112ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .flags = SMIAPP_MODULE_IDENT_FLAG_REV_LE, \ 113ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .name = _name, \ 114ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .quirk = _quirk, } 115ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 116ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_IDENT_L(manufacturer, model, rev, _name) \ 117ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus { .manufacturer_id = manufacturer, \ 118ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .model_id = model, \ 119ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .revision_number_major = rev, \ 120ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .flags = SMIAPP_MODULE_IDENT_FLAG_REV_LE, \ 121ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .name = _name, } 122ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 123ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_IDENT_Q(manufacturer, model, rev, _name, _quirk) \ 124ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus { .manufacturer_id = manufacturer, \ 125ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .model_id = model, \ 126ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .revision_number_major = rev, \ 127ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .flags = 0, \ 128ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .name = _name, \ 129ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .quirk = _quirk, } 130ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 131ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_IDENT(manufacturer, model, rev, _name) \ 132ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus { .manufacturer_id = manufacturer, \ 133ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .model_id = model, \ 134ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .revision_number_major = rev, \ 135ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .flags = 0, \ 136ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus .name = _name, } 137ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 138ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_reg_limits { 139ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 addr; 140ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus char *what; 141ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 142ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 143ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusextern struct smiapp_reg_limits smiapp_reg_limits[]; 144ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 145ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_csi_data_format { 146ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 code; 147ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 width; 148ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 compressed; 149ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 pixel_order; 150ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 151ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 152ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_SUBDEVS 3 153ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 154ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PA_PAD_SRC 0 155ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PAD_SINK 0 156ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PAD_SRC 1 157ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define SMIAPP_PADS 2 158ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 159ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_binning_subtype { 160ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 horizontal:4; 161ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 vertical:4; 162ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus} __packed; 163ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 164ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_subdev { 165ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_subdev sd; 166ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct media_pad pads[2]; 167ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_rect sink_fmt; 168ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_rect crop[2]; 169ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_rect compose; /* compose on sink */ 170ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus unsigned short sink_pad; 171ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus unsigned short source_pad; 172ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus int npads; 173ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_sensor *sensor; 174ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl_handler ctrl_handler; 175ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 176ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 177ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus/* 178ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * struct smiapp_sensor - Main device structure 179ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus */ 180ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailusstruct smiapp_sensor { 181ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus /* 182ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * "mutex" is used to serialise access to all fields here 183ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * except v4l2_ctrls at the end of the struct. "mutex" is also 184ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * used to serialise access to file handle specific 185ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * information. The exception to this rule is the power_mutex 186ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * below. 187ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus */ 188ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct mutex mutex; 189ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus /* 190ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * power_mutex is used to serialise power management related 191ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * activities. Acquiring "mutex" at that time isn't necessary 192ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus * since there are no other users anyway. 193ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus */ 194ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct mutex power_mutex; 195ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_subdev ssds[SMIAPP_SUBDEVS]; 196ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 ssds_used; 197ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_subdev *src; 198ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_subdev *binner; 199ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_subdev *scaler; 200ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_subdev *pixel_array; 201ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_platform_data *platform_data; 202ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct regulator *vana; 2032547428de05d5bc45d3144a0ebc51e3f249a2bc0Sakari Ailus struct clk *ext_clk; 204ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 limits[SMIAPP_LIMIT_LAST]; 205ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 nbinning_subtypes; 206ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_binning_subtype binning_subtypes[SMIAPP_BINNING_SUBTYPES]; 207ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 mbus_frame_fmts; 208ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus const struct smiapp_csi_data_format *csi_format; 209ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus const struct smiapp_csi_data_format *internal_csi_format; 210ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u32 default_mbus_frame_fmts; 211ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus int default_pixel_order; 212ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 213ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 binning_horizontal; 214ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 binning_vertical; 215ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 216ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 scale_m; 217ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 scaling_mode; 218ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 219ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 hvflip_inv_mask; /* H/VFLIP inversion due to sensor orientation */ 220ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 flash_capability; 221ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 frame_skip; 222ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 223ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus int power_count; 224ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 225ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus bool streaming; 226ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus bool dev_init_done; 227ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 228ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus u8 *nvm; /* nvm memory buffer */ 229ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus unsigned int nvm_size; /* bytes */ 230ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 231ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_module_info minfo; 232ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 233ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct smiapp_pll pll; 234ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 235ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus /* Pixel array controls */ 236ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *analog_gain; 237ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *exposure; 238ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *hflip; 239ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *vflip; 240ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *vblank; 241ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *hblank; 242ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *pixel_rate_parray; 243ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus /* src controls */ 244ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *link_freq; 245ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus struct v4l2_ctrl *pixel_rate_csi; 2460e2a6b7f2b9303410c93fd4724f9d36ebc7be1c3Sakari Ailus /* test pattern colour components */ 2470e2a6b7f2b9303410c93fd4724f9d36ebc7be1c3Sakari Ailus struct v4l2_ctrl *test_data[SMIAPP_COLOUR_COMPONENTS]; 248ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus}; 249ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 250ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define to_smiapp_subdev(_sd) \ 251ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus container_of(_sd, struct smiapp_subdev, sd) 252ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 253ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#define to_smiapp_sensor(_sd) \ 254ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus (to_smiapp_subdev(_sd)->sensor) 255ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus 256ccfc97bdb5ae8b8edc55169ac6924e08449836acSakari Ailus#endif /* __SMIAPP_PRIV_H_ */ 257