Ondrej Zary | 4ab0620 | 2013-08-20 10:03:59 -0300 | [diff] [blame] | 1 | /* |
| 2 | * STK1135 registers |
| 3 | * |
| 4 | * Copyright (c) 2013 Ondrej Zary |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #define STK1135_REG_GCTRL 0x000 /* GPIO control */ |
| 22 | #define STK1135_REG_ICTRL 0x004 /* Interrupt control */ |
| 23 | #define STK1135_REG_IDATA 0x008 /* Interrupt data */ |
| 24 | #define STK1135_REG_RMCTL 0x00c /* Remote wakeup control */ |
| 25 | #define STK1135_REG_POSVA 0x010 /* Power-on strapping data */ |
| 26 | |
| 27 | #define STK1135_REG_SENSO 0x018 /* Sensor select options */ |
| 28 | #define STK1135_REG_PLLFD 0x01c /* PLL frequency divider */ |
| 29 | |
| 30 | #define STK1135_REG_SCTRL 0x100 /* Sensor control register */ |
| 31 | #define STK1135_REG_DCTRL 0x104 /* Decimation control register */ |
| 32 | #define STK1135_REG_CISPO 0x110 /* Capture image starting position */ |
| 33 | #define STK1135_REG_CIEPO 0x114 /* Capture image ending position */ |
| 34 | #define STK1135_REG_TCTRL 0x120 /* Test data control */ |
| 35 | |
| 36 | #define STK1135_REG_SICTL 0x200 /* Serial interface control register */ |
| 37 | #define STK1135_REG_SBUSW 0x204 /* Serial bus write */ |
| 38 | #define STK1135_REG_SBUSR 0x208 /* Serial bus read */ |
| 39 | #define STK1135_REG_SCSI 0x20c /* Software control serial interface */ |
| 40 | #define STK1135_REG_GSBWP 0x210 /* General serial bus write port */ |
| 41 | #define STK1135_REG_GSBRP 0x214 /* General serial bus read port */ |
| 42 | #define STK1135_REG_ASIC 0x2fc /* Alternate serial interface control */ |
| 43 | |
| 44 | #define STK1135_REG_TMGEN 0x300 /* Timing generator */ |
| 45 | #define STK1135_REG_TCP1 0x350 /* Timing control parameter 1 */ |
| 46 | |
| 47 | struct stk1135_pkt_header { |
| 48 | u8 flags; |
| 49 | u8 seq; |
| 50 | __le16 gpio; |
| 51 | } __packed; |
| 52 | |
| 53 | #define STK1135_HDR_FRAME_START (1 << 7) |
| 54 | #define STK1135_HDR_ODD (1 << 6) |
| 55 | #define STK1135_HDR_I2C_VBLANK (1 << 5) |
| 56 | |
| 57 | #define STK1135_HDR_SEQ_MASK 0x3f |