18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * v3020.h - Registers definition and platform data structure for the v3020 RTC. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 58c2ecf20Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 68c2ecf20Sopenharmony_ci * for more details. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Copyright (C) 2006, 8D Technologies inc. 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci#ifndef __LINUX_V3020_H 118c2ecf20Sopenharmony_ci#define __LINUX_V3020_H 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/* The v3020 has only one data pin but which one 148c2ecf20Sopenharmony_ci * is used depends on the board. */ 158c2ecf20Sopenharmony_cistruct v3020_platform_data { 168c2ecf20Sopenharmony_ci int leftshift; /* (1<<(leftshift)) & readl() */ 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci unsigned int use_gpio:1; 198c2ecf20Sopenharmony_ci unsigned int gpio_cs; 208c2ecf20Sopenharmony_ci unsigned int gpio_wr; 218c2ecf20Sopenharmony_ci unsigned int gpio_rd; 228c2ecf20Sopenharmony_ci unsigned int gpio_io; 238c2ecf20Sopenharmony_ci}; 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#define V3020_STATUS_0 0x00 268c2ecf20Sopenharmony_ci#define V3020_STATUS_1 0x01 278c2ecf20Sopenharmony_ci#define V3020_SECONDS 0x02 288c2ecf20Sopenharmony_ci#define V3020_MINUTES 0x03 298c2ecf20Sopenharmony_ci#define V3020_HOURS 0x04 308c2ecf20Sopenharmony_ci#define V3020_MONTH_DAY 0x05 318c2ecf20Sopenharmony_ci#define V3020_MONTH 0x06 328c2ecf20Sopenharmony_ci#define V3020_YEAR 0x07 338c2ecf20Sopenharmony_ci#define V3020_WEEK_DAY 0x08 348c2ecf20Sopenharmony_ci#define V3020_WEEK 0x09 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#define V3020_IS_COMMAND(val) ((val)>=0x0E) 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#define V3020_CMD_RAM2CLOCK 0x0E 398c2ecf20Sopenharmony_ci#define V3020_CMD_CLOCK2RAM 0x0F 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#endif /* __LINUX_V3020_H */ 42