Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: cht-wc: Add charger-chip info for the Lenovo Yoga Tab 3 YT3-X90F

On x86 devices with a CHT Whiskey Cove PMIC the driver for
the I2C bus coming from the PMIC is responsible for instantiating
the i2c_client for the charger chip.

Add the necessary i2c_board_info for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230126153823.22146-3-hdegoede@redhat.com

authored by

Hans de Goede and committed by
Lee Jones
0e61637f 8d9ef694

+46
+46
drivers/i2c/busses/i2c-cht-wc.c
··· 380 380 .platform_data = &bq2589x_pdata, 381 381 }; 382 382 383 + /********** Lenovo Yogabook YT3-X90F charger settings **********/ 384 + static const char * const lenovo_yt3_bq25892_1_suppliers[] = { "cht_wcove_pwrsrc" }; 385 + 386 + /* 387 + * bq25892 charger settings for the round li-ion cells in the hinge, 388 + * this is the main / biggest battery. 389 + */ 390 + static const struct property_entry lenovo_yt3_bq25892_1_props[] = { 391 + PROPERTY_ENTRY_STRING_ARRAY("supplied-from", lenovo_yt3_bq25892_1_suppliers), 392 + PROPERTY_ENTRY_STRING("linux,secondary-charger-name", "bq25890-charger-0"), 393 + PROPERTY_ENTRY_U32("linux,iinlim-percentage", 60), 394 + PROPERTY_ENTRY_U32("linux,pump-express-vbus-max", 12000000), 395 + PROPERTY_ENTRY_BOOL("linux,skip-reset"), 396 + /* 397 + * The firmware sets everything to the defaults, leading to a low(ish) 398 + * charge-current and battery-voltage of 2048mA resp 4.2V. Use the 399 + * Android values instead of "linux,read-back-settings" to fix this. 400 + */ 401 + PROPERTY_ENTRY_U32("ti,charge-current", 3072000), 402 + PROPERTY_ENTRY_U32("ti,battery-regulation-voltage", 4352000), 403 + PROPERTY_ENTRY_U32("ti,termination-current", 128000), 404 + PROPERTY_ENTRY_U32("ti,precharge-current", 128000), 405 + PROPERTY_ENTRY_U32("ti,minimum-sys-voltage", 3700000), 406 + PROPERTY_ENTRY_BOOL("ti,use-ilim-pin"), 407 + /* Set 5V boost current-limit to 1.2A (MAX/POR values are 2.45A/1.4A) */ 408 + PROPERTY_ENTRY_U32("ti,boost-voltage", 4998000), 409 + PROPERTY_ENTRY_U32("ti,boost-max-current", 1200000), 410 + { } 411 + }; 412 + 413 + static const struct software_node lenovo_yt3_bq25892_1_node = { 414 + .properties = lenovo_yt3_bq25892_1_props, 415 + }; 416 + 417 + /* bq25892 charger for the round li-ion cells in the hinge */ 418 + static struct i2c_board_info lenovo_yoga_tab3_board_info = { 419 + .type = "bq25892", 420 + .addr = 0x6b, 421 + .dev_name = "bq25892_1", 422 + .swnode = &lenovo_yt3_bq25892_1_node, 423 + .platform_data = &bq2589x_pdata, 424 + }; 425 + 383 426 static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev) 384 427 { 385 428 struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); ··· 501 458 break; 502 459 case INTEL_CHT_WC_LENOVO_YOGABOOK1: 503 460 board_info = &lenovo_yogabook1_board_info; 461 + break; 462 + case INTEL_CHT_WC_LENOVO_YT3_X90: 463 + board_info = &lenovo_yoga_tab3_board_info; 504 464 break; 505 465 default: 506 466 dev_warn(&pdev->dev, "Unknown model, not instantiating charger device\n");