summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2018-12-24 23:34:39 +0800
committerZhuohao Lee <zhuohao@chromium.org>2018-12-24 23:55:42 +0800
commit81a8b2a1932ce58bb30c4c1bbaa0feb4291341dc (patch)
treef62257574b1e585602cdb3a1468da2ad242654d6
parentafac1a2cab2ab0420ff0c7dce68bb32d1c400bee (diff)
downloadchrome-ec-81a8b2a1932ce58bb30c4c1bbaa0feb4291341dc.tar.gz
karma: fix ec build error
This patch fixes the build error which is caused by the cherry-pick CL:1385767. BUG=b:121546793 BRANCH=firmware-kalista-11343.B TEST=build pass
-rw-r--r--board/karma/board.c109
-rw-r--r--board/karma/board.h6
-rw-r--r--board/karma/build.mk1
3 files changed, 0 insertions, 116 deletions
diff --git a/board/karma/board.c b/board/karma/board.c
deleted file mode 100644
index 49f1b919a3..0000000000
--- a/board/karma/board.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Copyright 2018 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.
- */
-
-#include "console.h"
-#include "gpio.h"
-#include "hooks.h"
-#include "i2c.h"
-#include "task.h"
-#include "timer.h"
-
-#define CPRINTS(format, args...) cprints(CC_GPIO, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_GPIO, format, ## args)
-
-#define I2C_ADDR_OZ554 0x62
-#define OZ554_DATA_SIZE 6
-
-struct oz554_value {
- uint8_t offset;
- uint8_t data;
-};
-
-/* This ordering is suggested by vendor. */
-static const struct oz554_value oz554_order[] = {
- /*
- * Reigster 0x01: Operation frequency control
- * Frequency selection: 300(KHz)
- * Short circuit protection: 8(V)
- */
- {.offset = 1, .data = 0x43},
- /*
- * Reigster 0x02: LED current amplitude control
- * ISET Resistor: 10.2(Kohm)
- * Maximum LED current: 1636/10.2 = 160.4(mA)
- * Setting LED current: 65(mA)
- */
- {.offset = 2, .data = 0x65},
- /*
- * Reigster 0x03: LED backlight Status
- * Status function: Read only
- */
- {.offset = 3, .data = 0x00},
- /*
- * Reigster 0x04: LED current control with SMBus
- * SMBus PWM function: None Use
- */
- {.offset = 4, .data = 0x00},
- /*
- * Reigster 0x05: OVP, OCP control
- * Over Current Protection: 0.5(V)
- * Panel LED Voltage(Max): 47.8(V)
- * OVP setting: 54(V)
- */
- {.offset = 5, .data = 0x97},
- /*
- * Reigster 0x00: Dimming mode and string ON/OFF control
- * String Selection: 4(Number)
- * Interface Selection: 1
- * Brightness mode: 3
- */
- {.offset = 0, .data = 0xF2},
-};
-BUILD_ASSERT(ARRAY_SIZE(oz554_order) == OZ554_DATA_SIZE);
-
-static void set_oz554_reg(void)
-{
- int i, rv;
-
- for (i = 0; i < OZ554_DATA_SIZE; ++i) {
- rv = i2c_write8(
- NPCX_I2C_PORT1,
- I2C_ADDR_OZ554,
- oz554_order[i].offset,
- oz554_order[i].data);
-
- if (rv) {
- CPRINTS("Write OZ554 register index %d failed, rv = %d"
- , i, rv);
- break;
- }
- }
-}
-
-static void backlight_enable_deferred(void)
-{
- if (gpio_get_level(GPIO_PANEL_BACKLIGHT_EN))
- set_oz554_reg();
-}
-DECLARE_DEFERRED(backlight_enable_deferred);
-
-void backlight_enable_interrupt(enum gpio_signal signal)
-{
- hook_call_deferred(&backlight_enable_deferred_data, 30 * MSEC);
-}
-
-static void karma_chipset_resume(void)
-{
- /* Enable panel backlight interrupt. */
- gpio_enable_interrupt(GPIO_PANEL_BACKLIGHT_EN);
-}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, karma_chipset_resume, HOOK_PRIO_DEFAULT);
-
-static void karma_chipset_shutdown(void)
-{
- /* Disable panel backlight interrupt. */
- gpio_disable_interrupt(GPIO_PANEL_BACKLIGHT_EN);
-}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, karma_chipset_shutdown, HOOK_PRIO_DEFAULT);
diff --git a/board/karma/board.h b/board/karma/board.h
index 85c4642fcb..372b18509b 100644
--- a/board/karma/board.h
+++ b/board/karma/board.h
@@ -10,10 +10,4 @@
#include "baseboard.h"
-#ifndef __ASSEMBLER__
-
-void backlight_enable_interrupt(enum gpio_signal signal);
-
-#endif /* !__ASSEMBLER__ */
-
#endif /* __CROS_EC_BOARD_H */
diff --git a/board/karma/build.mk b/board/karma/build.mk
index 82d7890946..05884cf221 100644
--- a/board/karma/build.mk
+++ b/board/karma/build.mk
@@ -9,4 +9,3 @@
CHIP:=npcx
CHIP_VARIANT:=npcx5m6g
BASEBOARD:=kalista
-board-y=board.o