summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-16 13:23:10 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-23 20:07:25 +0000
commit8cf03ac0563294fbdeca2dc133d06f0b51c9a546 (patch)
tree6b07c493e7567a3221d8592b4337d2787d6bc531
parent2464d08e4d310a3f63208f22df4502c5250c4b58 (diff)
downloadchrome-ec-8cf03ac0563294fbdeca2dc133d06f0b51c9a546.tar.gz
Move source files to driver/ and power/ subdirs
The common/ subdir was getting cluttered. Move drivers for external components to a new driver/ tree, and move what used to be called chipset_*.c to a new power/ directory. This does not move/rename header files or CONFIG options. That will be done in subsequent steps, since moving and modifying .c files in the same CL is harder to review. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I67a3003dc8564783a320335cf0e9620a21982d5e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/173601 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org>
-rw-r--r--Makefile7
-rw-r--r--Makefile.rules3
-rw-r--r--common/battery.c (renamed from common/battery_common.c)0
-rw-r--r--common/build.mk41
-rw-r--r--common/charger.c (renamed from common/charger_common.c)0
-rw-r--r--common/flash.c (renamed from common/flash_common.c)0
-rw-r--r--common/gpio.c (renamed from common/gpio_common.c)0
-rw-r--r--common/i2c.c (renamed from common/i2c_common.c)0
-rw-r--r--common/pwm.c (renamed from common/pwm_common.c)0
-rw-r--r--common/system.c (renamed from common/system_common.c)0
-rw-r--r--driver/battery/bq20z453.c (renamed from common/battery_bq20z453.c)0
-rw-r--r--driver/battery/bq27541.c (renamed from common/battery_bq27541.c)0
-rw-r--r--driver/battery/link.c (renamed from common/battery_link.c)0
-rw-r--r--driver/battery/smart.c (renamed from common/battery_smart.c)0
-rw-r--r--driver/build.mk34
-rw-r--r--driver/charger/bq24192.c (renamed from common/charger_bq24192.c)0
-rw-r--r--driver/charger/bq24707a.c (renamed from common/charger_bq24707a.c)0
-rw-r--r--driver/charger/bq24715.c (renamed from common/charger_bq24715.c)0
-rw-r--r--driver/charger/bq24725.c (renamed from common/charger_bq24725.c)0
-rw-r--r--driver/charger/bq24738.c (renamed from common/charger_bq24738.c)0
-rw-r--r--driver/led/ds2413.c (renamed from common/led_driver_ds2413.c)0
-rw-r--r--driver/led/lp5562.c (renamed from common/led_driver_lp5562.c)0
-rw-r--r--driver/regulator_ir357x.c (renamed from common/regulator_ir357x.c)0
-rw-r--r--driver/temp_sensor/g781.c (renamed from common/temp_sensor_g781.c)0
-rw-r--r--driver/temp_sensor/tmp006.c (renamed from common/temp_sensor_tmp006.c)0
-rw-r--r--driver/usb_switch_tsu6721.c (renamed from common/usb_switch_tsu6721.c)0
-rw-r--r--power/baytrail.c (renamed from common/chipset_baytrail.c)0
-rw-r--r--power/build.mk15
-rw-r--r--power/gaia.c (renamed from common/chipset_gaia.c)0
-rw-r--r--power/haswell.c (renamed from common/chipset_haswell.c)0
-rw-r--r--power/ivybridge.c (renamed from common/chipset_ivybridge.c)0
-rw-r--r--power/tegra.c (renamed from common/chipset_tegra.c)0
-rw-r--r--power/x86_common.c (renamed from common/chipset_x86_common.c)0
33 files changed, 71 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 8cd526109c..10a9c1f019 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,8 @@ include board/$(BOARD)/build.mk
include chip/$(CHIP)/build.mk
include core/$(CORE)/build.mk
include common/build.mk
+include driver/build.mk
+include power/build.mk
include test/build.mk
include util/build.mk
include util/lock/build.mk
@@ -60,7 +62,10 @@ all-y+=$(call objs_from_dir,chip/$(CHIP),chip)
all-y+=$(call objs_from_dir,board/$(BOARD),board)
all-y+=$(call objs_from_dir,private,private)
all-y+=$(call objs_from_dir,common,common)
+all-y+=$(call objs_from_dir,driver,driver)
+all-y+=$(call objs_from_dir,power,power)
all-y+=$(call objs_from_dir,test,$(PROJECT))
-dirs=core/$(CORE) chip/$(CHIP) board/$(BOARD) private common test util
+dirs=core/$(CORE) chip/$(CHIP) board/$(BOARD) private common power test util
+dirs+=$(shell find driver -type d)
include Makefile.rules
diff --git a/Makefile.rules b/Makefile.rules
index c14049c30a..527e0934ef 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -165,7 +165,8 @@ $(out)/util/burn_my_ec: $(out)/$(PROJECT).bin
.PHONY: FORCE
cscope.files: FORCE
@-rm -f cscope.out
- @find chip/${CHIP} board/${BOARD} common core include -name '*.[chS]' \
+ @find chip/${CHIP} board/${BOARD} common core driver power include \
+ -name '*.[chS]' \
-not -name '*test*' -not -name '*mock*' -not -name '*~*' \
> cscope.files
diff --git a/common/battery_common.c b/common/battery.c
index 25c4bcf1f9..25c4bcf1f9 100644
--- a/common/battery_common.c
+++ b/common/battery.c
diff --git a/common/build.mk b/common/build.mk
index 02d841e9ee..bd1bccdc82 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -7,28 +7,20 @@
#
common-y=main.o util.o console_output.o uart_buffering.o
-common-y+=memory_commands.o shared_mem.o system_common.o hooks.o
-common-y+=gpio_common.o version.o printf.o queue.o
+common-y+=memory_commands.o shared_mem.o system.o hooks.o
+common-y+=gpio.o version.o printf.o queue.o
common-y+=throttle_ap.o
common-$(CONFIG_BACKLIGHT_LID)+=backlight_lid.o
-common-$(CONFIG_BATTERY_BQ20Z453)+=battery_bq20z453.o
-common-$(CONFIG_BATTERY_BQ27541)+=battery_common.o battery_bq27541.o
-common-$(CONFIG_BATTERY_LINK)+=battery_link.o
-common-$(CONFIG_BATTERY_SMART)+=battery_common.o battery_smart.o
-common-$(CONFIG_CHARGER)+=charge_state.o charger_common.o
-common-$(CONFIG_CHARGER_BQ24192)+=charger_bq24192.o
-common-$(CONFIG_CHARGER_BQ24715)+=charger_bq24715.o
-common-$(CONFIG_CHARGER_BQ24725)+=charger_bq24725.o
-common-$(CONFIG_CHARGER_BQ24707A)+=charger_bq24707a.o
-common-$(CONFIG_CHARGER_BQ24738)+=charger_bq24738.o
+# TODO(rspangler): Why do these include battery_common but the other batteries
+# don't? Perhaps should use CONFIG_CMD_BATTERY instead, since all that's in
+# battery.c is the battery console command?
+common-$(CONFIG_BATTERY_BQ27541)+=battery.o
+common-$(CONFIG_BATTERY_SMART)+=battery.o
+common-$(CONFIG_CHARGER)+=charge_state.o charger.o
+# TODO(rspangler): This is really the charge state machine for ARM, not the
+# charger driver for the tps65090. Rename.
common-$(CONFIG_CHARGER_TPS65090)+=pmu_tps65090_charger.o
-common-$(CONFIG_CHIPSET_BAYTRAIL)+=chipset_baytrail.o
-common-$(CONFIG_CHIPSET_GAIA)+=chipset_gaia.o
-common-$(CONFIG_CHIPSET_TEGRA)+=chipset_tegra.o
-common-$(CONFIG_CHIPSET_HASWELL)+=chipset_haswell.o
-common-$(CONFIG_CHIPSET_IVYBRIDGE)+=chipset_ivybridge.o
-common-$(CONFIG_CHIPSET_X86)+=chipset_x86_common.o
common-$(CONFIG_PMU_POWERINFO)+=pmu_tps65090_powerinfo.o
common-$(CONFIG_PMU_TPS65090)+=pmu_tps65090.o
common-$(CONFIG_EOPTION)+=eoption.o
@@ -37,33 +29,28 @@ common-$(CONFIG_EXTPOWER_GPIO)+=extpower_gpio.o
common-$(CONFIG_EXTPOWER_KIRBY)+=extpower_kirby.o
common-$(CONFIG_EXTPOWER_SNOW)+=extpower_snow.o
common-$(CONFIG_EXTPOWER_SPRING)+=extpower_spring.o
+# TODO(rspangler): Rename to CONFIG_PWM_FAN.
common-$(CONFIG_FAN)+=pwm_fan.o
-common-$(CONFIG_FLASH)+=flash_common.o
+common-$(CONFIG_FLASH)+=flash.o
common-$(CONFIG_FMAP)+=fmap.o
-common-$(CONFIG_I2C)+=i2c_common.o
+common-$(CONFIG_I2C)+=i2c.o
common-$(CONFIG_I2C_ARBITRATION)+=i2c_arbitration.o
common-$(CONFIG_KEYBOARD_PROTOCOL_8042)+=keyboard_8042.o
common-$(CONFIG_KEYBOARD_PROTOCOL_MKBP)+=keyboard_mkbp.o
common-$(CONFIG_KEYBOARD_TEST)+=keyboard_test.o
common-$(CONFIG_LED_COMMON)+=led_common.o
-common-$(CONFIG_LED_DRIVER_DS2413)+=led_driver_ds2413.o
-common-$(CONFIG_LED_DRIVER_LP5562)+=led_driver_lp5562.o
common-$(CONFIG_LID_SWITCH)+=lid_switch.o
common-$(CONFIG_LPC)+=port80.o
common-$(CONFIG_ONEWIRE)+=onewire.o
common-$(CONFIG_POWER_BUTTON)+=power_button.o
common-$(CONFIG_POWER_BUTTON_X86)+=power_button_x86.o
common-$(CONFIG_PSTORE)+=pstore_commands.o
-common-$(CONFIG_PWM)+=pwm_common.o
+common-$(CONFIG_PWM)+=pwm.o
common-$(CONFIG_PWM_KBLIGHT)+=pwm_kblight.o
-common-$(CONFIG_REGULATOR_IR357X)+=regulator_ir357x.o
common-$(CONFIG_SWITCH)+=switch.o
common-$(CONFIG_TEMP_SENSOR)+=temp_sensor.o thermal.o
-common-$(CONFIG_TEMP_SENSOR_G781)+=temp_sensor_g781.o
-common-$(CONFIG_TEMP_SENSOR_TMP006)+=temp_sensor_tmp006.o
common-$(CONFIG_USB_PORT_POWER_DUMB)+=usb_port_power_dumb.o
common-$(CONFIG_USB_PORT_POWER_SMART)+=usb_port_power_smart.o
-common-$(CONFIG_USB_SWITCH_TSU6721)+=usb_switch_tsu6721.o
common-$(CONFIG_WIRELESS)+=wireless.o
common-$(HAS_TASK_CHIPSET)+=chipset.o
common-$(HAS_TASK_CONSOLE)+=console.o
diff --git a/common/charger_common.c b/common/charger.c
index 15bdf8f73c..15bdf8f73c 100644
--- a/common/charger_common.c
+++ b/common/charger.c
diff --git a/common/flash_common.c b/common/flash.c
index c2773f6dd0..c2773f6dd0 100644
--- a/common/flash_common.c
+++ b/common/flash.c
diff --git a/common/gpio_common.c b/common/gpio.c
index e310814847..e310814847 100644
--- a/common/gpio_common.c
+++ b/common/gpio.c
diff --git a/common/i2c_common.c b/common/i2c.c
index ed3a888872..ed3a888872 100644
--- a/common/i2c_common.c
+++ b/common/i2c.c
diff --git a/common/pwm_common.c b/common/pwm.c
index 3a3073d142..3a3073d142 100644
--- a/common/pwm_common.c
+++ b/common/pwm.c
diff --git a/common/system_common.c b/common/system.c
index 4af045a641..4af045a641 100644
--- a/common/system_common.c
+++ b/common/system.c
diff --git a/common/battery_bq20z453.c b/driver/battery/bq20z453.c
index cda3a7cbdb..cda3a7cbdb 100644
--- a/common/battery_bq20z453.c
+++ b/driver/battery/bq20z453.c
diff --git a/common/battery_bq27541.c b/driver/battery/bq27541.c
index 3dce19ea54..3dce19ea54 100644
--- a/common/battery_bq27541.c
+++ b/driver/battery/bq27541.c
diff --git a/common/battery_link.c b/driver/battery/link.c
index a7877529a8..a7877529a8 100644
--- a/common/battery_link.c
+++ b/driver/battery/link.c
diff --git a/common/battery_smart.c b/driver/battery/smart.c
index 29af6286ad..29af6286ad 100644
--- a/common/battery_smart.c
+++ b/driver/battery/smart.c
diff --git a/driver/build.mk b/driver/build.mk
new file mode 100644
index 0000000000..013cfb4159
--- /dev/null
+++ b/driver/build.mk
@@ -0,0 +1,34 @@
+# -*- makefile -*-
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Drivers for off-chip devices
+#
+
+# Batteries
+driver-$(CONFIG_BATTERY_BQ20Z453)+=battery/bq20z453.o
+driver-$(CONFIG_BATTERY_BQ27541)+=battery/bq27541.o
+driver-$(CONFIG_BATTERY_LINK)+=battery/link.o
+driver-$(CONFIG_BATTERY_SMART)+=battery/smart.o
+
+# Battery charger ICs
+driver-$(CONFIG_CHARGER_BQ24192)+=charger/bq24192.o
+driver-$(CONFIG_CHARGER_BQ24707A)+=charger/bq24707a.o
+driver-$(CONFIG_CHARGER_BQ24715)+=charger/bq24715.o
+driver-$(CONFIG_CHARGER_BQ24725)+=charger/bq24725.o
+driver-$(CONFIG_CHARGER_BQ24738)+=charger/bq24738.o
+
+# LED drivers
+driver-$(CONFIG_LED_DRIVER_DS2413)+=led/ds2413.o
+driver-$(CONFIG_LED_DRIVER_LP5562)+=led/lp5562.o
+
+# Voltage regulators
+driver-$(CONFIG_REGULATOR_IR357X)+=regulator_ir357x.o
+
+# Temperature sensors
+driver-$(CONFIG_TEMP_SENSOR_G781)+=temp_sensor/g781.o
+driver-$(CONFIG_TEMP_SENSOR_TMP006)+=temp_sensor/tmp006.o
+
+# USB switches
+driver-$(CONFIG_USB_SWITCH_TSU6721)+=usb_switch_tsu6721.o
diff --git a/common/charger_bq24192.c b/driver/charger/bq24192.c
index 72f778d367..72f778d367 100644
--- a/common/charger_bq24192.c
+++ b/driver/charger/bq24192.c
diff --git a/common/charger_bq24707a.c b/driver/charger/bq24707a.c
index 43bd32eb91..43bd32eb91 100644
--- a/common/charger_bq24707a.c
+++ b/driver/charger/bq24707a.c
diff --git a/common/charger_bq24715.c b/driver/charger/bq24715.c
index d90b35b021..d90b35b021 100644
--- a/common/charger_bq24715.c
+++ b/driver/charger/bq24715.c
diff --git a/common/charger_bq24725.c b/driver/charger/bq24725.c
index 3e418c7216..3e418c7216 100644
--- a/common/charger_bq24725.c
+++ b/driver/charger/bq24725.c
diff --git a/common/charger_bq24738.c b/driver/charger/bq24738.c
index 057e71c12f..057e71c12f 100644
--- a/common/charger_bq24738.c
+++ b/driver/charger/bq24738.c
diff --git a/common/led_driver_ds2413.c b/driver/led/ds2413.c
index 9babd75992..9babd75992 100644
--- a/common/led_driver_ds2413.c
+++ b/driver/led/ds2413.c
diff --git a/common/led_driver_lp5562.c b/driver/led/lp5562.c
index fd92fae26f..fd92fae26f 100644
--- a/common/led_driver_lp5562.c
+++ b/driver/led/lp5562.c
diff --git a/common/regulator_ir357x.c b/driver/regulator_ir357x.c
index c6966b7e31..c6966b7e31 100644
--- a/common/regulator_ir357x.c
+++ b/driver/regulator_ir357x.c
diff --git a/common/temp_sensor_g781.c b/driver/temp_sensor/g781.c
index 389b12629e..389b12629e 100644
--- a/common/temp_sensor_g781.c
+++ b/driver/temp_sensor/g781.c
diff --git a/common/temp_sensor_tmp006.c b/driver/temp_sensor/tmp006.c
index 19d66d87aa..19d66d87aa 100644
--- a/common/temp_sensor_tmp006.c
+++ b/driver/temp_sensor/tmp006.c
diff --git a/common/usb_switch_tsu6721.c b/driver/usb_switch_tsu6721.c
index 1eaa74de55..1eaa74de55 100644
--- a/common/usb_switch_tsu6721.c
+++ b/driver/usb_switch_tsu6721.c
diff --git a/common/chipset_baytrail.c b/power/baytrail.c
index 7de5aaac01..7de5aaac01 100644
--- a/common/chipset_baytrail.c
+++ b/power/baytrail.c
diff --git a/power/build.mk b/power/build.mk
new file mode 100644
index 0000000000..1c176a3db9
--- /dev/null
+++ b/power/build.mk
@@ -0,0 +1,15 @@
+# -*- makefile -*-
+# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Power management for application processor and peripherals
+#
+
+# TODO(rspangler): rename _CHIPSET to _POWER
+power-$(CONFIG_CHIPSET_BAYTRAIL)+=baytrail.o
+power-$(CONFIG_CHIPSET_GAIA)+=gaia.o
+power-$(CONFIG_CHIPSET_HASWELL)+=haswell.o
+power-$(CONFIG_CHIPSET_IVYBRIDGE)+=ivybridge.o
+power-$(CONFIG_CHIPSET_TEGRA)+=tegra.o
+power-$(CONFIG_CHIPSET_X86)+=x86_common.o
diff --git a/common/chipset_gaia.c b/power/gaia.c
index fd5d5fb7a6..fd5d5fb7a6 100644
--- a/common/chipset_gaia.c
+++ b/power/gaia.c
diff --git a/common/chipset_haswell.c b/power/haswell.c
index 95823ae418..95823ae418 100644
--- a/common/chipset_haswell.c
+++ b/power/haswell.c
diff --git a/common/chipset_ivybridge.c b/power/ivybridge.c
index 7a8dfd12aa..7a8dfd12aa 100644
--- a/common/chipset_ivybridge.c
+++ b/power/ivybridge.c
diff --git a/common/chipset_tegra.c b/power/tegra.c
index 3484a266ae..3484a266ae 100644
--- a/common/chipset_tegra.c
+++ b/power/tegra.c
diff --git a/common/chipset_x86_common.c b/power/x86_common.c
index add033906e..add033906e 100644
--- a/common/chipset_x86_common.c
+++ b/power/x86_common.c