From 24231aceacd46a6b5f1c29dda6c97a436495555d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 6 Jun 2017 09:46:01 +0200 Subject: drivers/i2c/ck505: Add generic driver to configure clockgen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the ics/954309 driver with a more generic version to accommodate clockgens with a different amount of registers. It also features a mask to only touch certain bits of the clockgen. TODO: set appropriate mask for X60/T60 since the datasheets for their clockgens can be found. Change-Id: Ie43c4de7891a39f2f443e78213ecd688134e68d7 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/20042 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/drivers/ics/954309/Kconfig | 2 -- src/drivers/ics/954309/Makefile.inc | 1 - src/drivers/ics/954309/chip.h | 30 ---------------- src/drivers/ics/954309/ics954309.c | 68 ------------------------------------- 4 files changed, 101 deletions(-) delete mode 100644 src/drivers/ics/954309/Kconfig delete mode 100644 src/drivers/ics/954309/Makefile.inc delete mode 100644 src/drivers/ics/954309/chip.h delete mode 100644 src/drivers/ics/954309/ics954309.c (limited to 'src/drivers/ics/954309') diff --git a/src/drivers/ics/954309/Kconfig b/src/drivers/ics/954309/Kconfig deleted file mode 100644 index 43840a3b37..0000000000 --- a/src/drivers/ics/954309/Kconfig +++ /dev/null @@ -1,2 +0,0 @@ -config DRIVERS_ICS_954309 - bool diff --git a/src/drivers/ics/954309/Makefile.inc b/src/drivers/ics/954309/Makefile.inc deleted file mode 100644 index 1c66a8ca9a..0000000000 --- a/src/drivers/ics/954309/Makefile.inc +++ /dev/null @@ -1 +0,0 @@ -ramstage-$(CONFIG_DRIVERS_ICS_954309) += ics954309.c diff --git a/src/drivers/ics/954309/chip.h b/src/drivers/ics/954309/chip.h deleted file mode 100644 index cc52857917..0000000000 --- a/src/drivers/ics/954309/chip.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 Sven Schnelle - * - * 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. - */ - -struct drivers_ics_954309_config { - u8 reg0; - u8 reg1; - u8 reg2; - u8 reg3; - u8 reg4; - u8 reg5; - u8 reg6; - u8 reg7; - u8 reg8; - u8 reg9; - u8 reg10; - u8 reg11; -}; diff --git a/src/drivers/ics/954309/ics954309.c b/src/drivers/ics/954309/ics954309.c deleted file mode 100644 index a3d1d810af..0000000000 --- a/src/drivers/ics/954309/ics954309.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 Sven Schnelle - * - * 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 -#include -#include -#include -#include -#include -#include -#include "chip.h" -#include - -static void ics954309_init(struct device *dev) -{ - struct drivers_ics_954309_config *config; - u8 initdata[12]; - - if (!dev->enabled || dev->path.type != DEVICE_PATH_I2C) - return; - - config = dev->chip_info; - - initdata[0] = config->reg0; - initdata[1] = config->reg1; - initdata[2] = config->reg2; - initdata[3] = config->reg3; - initdata[4] = config->reg4; - initdata[5] = config->reg5; - initdata[6] = config->reg6; - initdata[7] = config->reg7; - initdata[8] = config->reg8; - initdata[9] = config->reg9; - initdata[10] = config->reg10; - initdata[11] = config->reg11; - - smbus_block_write(dev, 0, 12, initdata); -} - -static struct device_operations ics954309_operations = { - .read_resources = DEVICE_NOOP, - .set_resources = DEVICE_NOOP, - .enable_resources = DEVICE_NOOP, - .init = ics954309_init, -}; - -static void enable_dev(struct device *dev) -{ - dev->ops = &ics954309_operations; -} - -struct chip_operations drivers_ics_954309_ops = { - CHIP_NAME("ICS 954309 Clock generator") - .enable_dev = enable_dev, -}; -- cgit v1.2.3