aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/i2c/pcf8523/chip.h
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2016-07-13 08:21:22 +0200
committerWerner Zeh <werner.zeh@siemens.com>2016-07-14 07:04:04 +0200
commit3cad2de6124623169af1f84e88f2ff66b59130fc (patch)
tree17c8c5aee598e61f072efebfdd9506832b078cb1 /src/drivers/i2c/pcf8523/chip.h
parent7804790226276dce0bf9c659bba061d46b5a184a (diff)
drivers/i2c: Add new driver for RTC type PCF8523
This driver enables the usage of an external RTC chip PCF8523 which is connected to the I2C bus. The I2C address of this device is fixed. One can change parameters in device tree so that the used setup can be adapted in device tree to match the configuration of the device on the mainboard. Change-Id: I2d7e161c9e12b720ec4925f1acfd1dd8ee6ee5f5 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/15641 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/drivers/i2c/pcf8523/chip.h')
-rw-r--r--src/drivers/i2c/pcf8523/chip.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/drivers/i2c/pcf8523/chip.h b/src/drivers/i2c/pcf8523/chip.h
new file mode 100644
index 0000000000..13cd401201
--- /dev/null
+++ b/src/drivers/i2c/pcf8523/chip.h
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Siemens AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include "pcf8523.h"
+
+struct drivers_i2c_pcf8523_config {
+ unsigned char cap_sel; /* Internal capacitor selection */
+ unsigned char second_int_en; /* Enable IRQ for seconds */
+ unsigned char alarm_int_en; /* Enable IRQ for alarm */
+ unsigned char correction_int_en;/* Enable IRQ for corrections */
+ unsigned char wdt_int_en; /* Enable IRQ for watchdog */
+ unsigned char tmrA_int_en; /* Enable IRQ for timer A */
+ unsigned char tmrB_int_en; /* Enable IRQ for timer B */
+ unsigned char power_mode; /* Set up power mode */
+ unsigned char bat_switch_int_en;/* Enable IRQ for battery switch */
+ unsigned char bat_low_int_en; /* Enable IRQ for low battery */
+ unsigned char offset_mode; /* Set up mode how to handle offset */
+ unsigned char offset_val; /* Value for offset adjustment */
+ unsigned char tmrA_mode; /* Operation mode of timer A */
+ unsigned char tmrA_int_mode; /* IRQ mode for timer A */
+ unsigned char tmrB_mode; /* Operation mode for timer B */
+ unsigned char tmrB_int_mode; /* IRQ mode for timer B */
+ unsigned char cof_selection; /* Set up "clock out" frequency */
+ unsigned char tmrA_prescaler; /* Prescaler for timer A */
+ unsigned char tmrB_prescaler; /* Prescaler for timer B */
+ unsigned char tmrB_pulse_cfg; /* Pulse width config for timer B */
+ unsigned char set_user_date; /* Use user date from device tree */
+ unsigned char user_year; /* User year to set */
+ unsigned char user_month; /* User month to set */
+ unsigned char user_day; /* User day to set */
+ unsigned char user_weekday; /* User weekday to set */
+};