Skip to content

Commit 17e1a0e

Browse files
minipack: Change I2C bus 0 clock to 400KHz (torvalds#135)
Summary: 1. Change I2C bus 0 clock to 400KHz 2. Add retry when get BIC update status fail Pull Request resolved: facebookexternal/openbmc.accton#135 Reviewed By: tomrepo Differential Revision: D14145628 Pulled By: mikechoifb fbshipit-source-id: 8013c4d8aa
1 parent 7c5d8d4 commit 17e1a0e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

arch/arm/plat-aspeed/dev-i2c-common.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ static struct ast_i2c_driver_data ast_i2c_data_1M = {
5050
.get_i2c_clock = ast_get_pclk,
5151
};
5252

53+
static struct ast_i2c_driver_data ast_i2c_data_400K = {
54+
.bus_clk = 400000, //bus clock 400KHz
55+
.master_dma = MASTER_XFER_MODE,
56+
.slave_dma = SLAVE_XFER_MODE,
57+
.request_pool_buff_page = request_pool_buff_page,
58+
.free_pool_buff_page = free_pool_buff_page,
59+
.get_i2c_clock = ast_get_pclk,
60+
};
61+
5362
static u64 ast_i2c_dma_mask = 0xffffffffUL;
5463
static struct resource ast_i2c_dev0_resources[] = {
5564
[0] = {
@@ -72,6 +81,8 @@ static struct platform_device ast_i2c_dev0_device = {
7281
.coherent_dma_mask = 0xffffffff,
7382
#if defined(CONFIG_AST_I2C_0_1M)
7483
.platform_data = &ast_i2c_data_1M,
84+
#elif defined(CONFIG_AST_I2C_0_400K)
85+
.platform_data = &ast_i2c_data_400K,
7586
#else
7687
.platform_data = &ast_i2c_data,
7788
#endif
@@ -437,6 +448,8 @@ void __init ast_add_device_i2c_common(void)
437448
}
438449
#if defined(CONFIG_AST_I2C_0_1M)
439450
ast_i2c_data_1M.reg_gr = ast_i2c_data.reg_gr;// 1MHz reg_gr setting
451+
#elif defined(CONFIG_AST_I2C_0_400K)
452+
ast_i2c_data_400K.reg_gr = ast_i2c_data.reg_gr;// 400KHz reg_gr setting
440453
#endif
441454
platform_device_register(&ast_i2c_dev0_device);
442455
platform_device_register(&ast_i2c_dev1_device);

drivers/i2c/busses/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ config AST_I2C_0_1M
359359
bool "AST I2C0 speed 1MHz"
360360
depends on I2C_AST
361361

362+
config AST_I2C_0_400K
363+
bool "AST I2C0 speed 400KHz"
364+
depends on I2C_AST
365+
362366
config AST_I2C_SLAVE_MODE
363367
bool "AST I2C Slave mode"
364368
depends on I2C_AST

0 commit comments

Comments
 (0)