Home | History | Annotate | Line # | Download | only in ic
      1 /*      $NetBSD: msm6242breg.h,v 1.2 2013/02/04 17:19:17 phx Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 2012 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Radoslaw Kujawa.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  */
     31 
     32 #ifndef _MSM6242BREG_H_
     33 #define _MSM6242BREG_H_
     34 
     35 #define MSM6242B_1SECOND	0x0
     36 #define MSM6242B_10SECOND	0x1
     37 #define MSM6242B_1MINUTE	0x2
     38 #define MSM6242B_10MINUTE	0x3
     39 #define MSM6242B_1HOUR		0x4
     40 
     41 #define MSM6242B_10HOUR_PMAM	0x5
     42 #define MSM6242B_10HOUR_MASK		0x3
     43 #define MSM6242B_PMAM_BIT		__BIT(2)
     44 
     45 #define MSM6242B_1DAY		0x6
     46 #define MSM6242B_10DAY		0x7
     47 #define MSM6242B_1MONTH		0x8
     48 #define MSM6242B_10MONTH	0x9
     49 #define MSM6242B_1YEAR		0xA
     50 #define MSM6242B_10YEAR		0xB
     51 #define MSM6242B_WEEK		0xC
     52 
     53 #define	MSM6242B_CONTROL_D	0xD
     54 #define MSM6242B_CONTROL_D_HOLD		__BIT(0)
     55 #define MSM6242B_CONTROL_D_BUSY		__BIT(1)
     56 #define MSM6242B_CONTROL_D_IRQF		__BIT(2)
     57 #define MSM6242B_CONTROL_D_30SECADJ	__BIT(3)
     58 
     59 #define	MSM6242B_CONTROL_E	0xE
     60 
     61 #define	MSM6242B_CONTROL_F	0xF
     62 #define	MSM6242B_CONTROL_F_24H		__BIT(2)
     63 
     64 #define MSM6242B_MASK		0xF	/* 4 significant bits only */
     65 #define MSM6242B_SIZE		0x10
     66 
     67 #define MSM6242B_BASE_YEAR	1900
     68 
     69 #endif /* _MSM6242BREG_H_ */
     70