/linux-4.1.27/drivers/acpi/ |
H A D | sbs.c | 2 * sbs.c - ACPI Smart Battery System Driver ($Revision: 2.0 $) 45 #define ACPI_SBS_CLASS "sbs" 79 struct acpi_sbs *sbs; member in struct:acpi_battery 157 struct acpi_sbs *sbs = to_acpi_sbs(psy); sbs_get_ac_property() local 160 val->intval = sbs->charger_present; sbs_get_ac_property() 308 .name = "sbs-charger", 349 static int acpi_manager_get_info(struct acpi_sbs *sbs) acpi_manager_get_info() argument 354 result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_MANAGER, acpi_manager_get_info() 357 sbs->batteries_supported = battery_system_info & 0x000f; acpi_manager_get_info() 366 result = acpi_smbus_read(battery->sbs->hc, acpi_battery_get_info() 387 result = acpi_smbus_read(battery->sbs->hc, acpi_battery_get_state() 403 return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD, acpi_battery_get_alarm() 410 struct acpi_sbs *sbs = battery->sbs; acpi_battery_set_alarm() local 416 if (sbs->manager_present) { acpi_battery_set_alarm() 417 ret = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_MANAGER, acpi_battery_set_alarm() 424 ret = acpi_smbus_write(sbs->hc, SMBUS_WRITE_WORD, acpi_battery_set_alarm() 431 ret = acpi_smbus_write(sbs->hc, SMBUS_WRITE_WORD, ACPI_SBS_BATTERY, acpi_battery_set_alarm() 437 static int acpi_ac_get_present(struct acpi_sbs *sbs) acpi_ac_get_present() argument 442 result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_CHARGER, acpi_ac_get_present() 455 sbs->charger_present = (status >> 15) & 0x1; acpi_ac_get_present() 497 if (battery->sbs->manager_present) { acpi_battery_read() 498 result = acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD, acpi_battery_read() 504 acpi_smbus_write(battery->sbs->hc, SMBUS_WRITE_WORD, acpi_battery_read() 527 static int acpi_battery_add(struct acpi_sbs *sbs, int id) acpi_battery_add() argument 529 struct acpi_battery *battery = &sbs->battery[id]; acpi_battery_add() 534 battery->sbs = sbs; acpi_battery_add() 552 battery->bat = power_supply_register(&sbs->device->dev, acpi_battery_add() 566 ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), acpi_battery_add() 571 static void acpi_battery_remove(struct acpi_sbs *sbs, int id) acpi_battery_remove() argument 573 struct acpi_battery *battery = &sbs->battery[id]; acpi_battery_remove() 582 static int acpi_charger_add(struct acpi_sbs *sbs) acpi_charger_add() argument 585 struct power_supply_config psy_cfg = { .drv_data = sbs, }; acpi_charger_add() 587 result = acpi_ac_get_present(sbs); acpi_charger_add() 591 sbs->charger_exists = 1; acpi_charger_add() 592 sbs->charger = power_supply_register(&sbs->device->dev, acpi_charger_add() 594 if (IS_ERR(sbs->charger)) { acpi_charger_add() 595 result = PTR_ERR(sbs->charger); acpi_charger_add() 596 sbs->charger = NULL; acpi_charger_add() 599 ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device), acpi_charger_add() 600 ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line"); acpi_charger_add() 605 static void acpi_charger_remove(struct acpi_sbs *sbs) acpi_charger_remove() argument 607 if (sbs->charger) acpi_charger_remove() 608 power_supply_unregister(sbs->charger); acpi_charger_remove() 614 struct acpi_sbs *sbs = context; acpi_sbs_callback() local 616 u8 saved_charger_state = sbs->charger_present; acpi_sbs_callback() 619 if (sbs->charger_exists) { acpi_sbs_callback() 620 acpi_ac_get_present(sbs); acpi_sbs_callback() 621 if (sbs->charger_present != saved_charger_state) acpi_sbs_callback() 622 kobject_uevent(&sbs->charger->dev.kobj, KOBJ_CHANGE); acpi_sbs_callback() 625 if (sbs->manager_present) { acpi_sbs_callback() 627 if (!(sbs->batteries_supported & (1 << id))) acpi_sbs_callback() 629 bat = &sbs->battery[id]; acpi_sbs_callback() 658 struct acpi_sbs *sbs; acpi_sbs_add() local 664 sbs = kzalloc(sizeof(struct acpi_sbs), GFP_KERNEL); acpi_sbs_add() 665 if (!sbs) { acpi_sbs_add() 670 mutex_init(&sbs->lock); acpi_sbs_add() 672 sbs->hc = acpi_driver_data(device->parent); acpi_sbs_add() 673 sbs->device = device; acpi_sbs_add() 676 device->driver_data = sbs; acpi_sbs_add() 678 result = acpi_charger_add(sbs); acpi_sbs_add() 685 result = acpi_manager_get_info(sbs); acpi_sbs_add() 687 sbs->manager_present = 1; acpi_sbs_add() 689 if ((sbs->batteries_supported & (1 << id))) acpi_sbs_add() 690 acpi_battery_add(sbs, id); acpi_sbs_add() 694 if (!sbs->manager_present) acpi_sbs_add() 695 acpi_battery_add(sbs, 0); acpi_sbs_add() 697 acpi_smbus_register_callback(sbs->hc, acpi_sbs_callback, sbs); acpi_sbs_add() 706 struct acpi_sbs *sbs; acpi_sbs_remove() local 711 sbs = acpi_driver_data(device); acpi_sbs_remove() 712 if (!sbs) acpi_sbs_remove() 714 mutex_lock(&sbs->lock); acpi_sbs_remove() 715 acpi_smbus_unregister_callback(sbs->hc); acpi_sbs_remove() 717 acpi_battery_remove(sbs, id); acpi_sbs_remove() 718 acpi_charger_remove(sbs); acpi_sbs_remove() 719 mutex_unlock(&sbs->lock); acpi_sbs_remove() 720 mutex_destroy(&sbs->lock); acpi_sbs_remove() 721 kfree(sbs); acpi_sbs_remove() 728 struct acpi_sbs *sbs; acpi_sbs_resume() local 731 sbs = to_acpi_device(dev)->driver_data; acpi_sbs_resume() 732 acpi_sbs_callback(sbs); acpi_sbs_resume() 742 .name = "sbs",
|
H A D | Makefile | 78 obj-$(CONFIG_ACPI_SBS) += sbs.o
|
/linux-4.1.27/drivers/media/tuners/ |
H A D | tda827x.c | 351 u8 sbs; member in struct:tda827xa_data 356 { .lomax = 56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 1}, 357 { .lomax = 67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, 358 { .lomax = 81250000, .svco = 1, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, 359 { .lomax = 97500000, .svco = 2, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, 360 { .lomax = 113750000, .svco = 3, .spd = 3, .scr = 0, .sbs = 1, .gc3 = 1}, 361 { .lomax = 134500000, .svco = 0, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 362 { .lomax = 154000000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 363 { .lomax = 162500000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 364 { .lomax = 183000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 365 { .lomax = 195000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1}, 366 { .lomax = 227500000, .svco = 3, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1}, 367 { .lomax = 269000000, .svco = 0, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1}, 368 { .lomax = 290000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1}, 369 { .lomax = 325000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, 370 { .lomax = 390000000, .svco = 2, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, 371 { .lomax = 455000000, .svco = 3, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, 372 { .lomax = 520000000, .svco = 0, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, 373 { .lomax = 538000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1}, 374 { .lomax = 550000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, 375 { .lomax = 620000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 376 { .lomax = 650000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 377 { .lomax = 700000000, .svco = 2, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 378 { .lomax = 780000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 379 { .lomax = 820000000, .svco = 3, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 380 { .lomax = 870000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 381 { .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 0}, 382 { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0} 386 { .lomax = 50125000, .svco = 2, .spd = 4, .scr = 2, .sbs = 0, .gc3 = 3}, 387 { .lomax = 58500000, .svco = 3, .spd = 4, .scr = 2, .sbs = 0, .gc3 = 3}, 388 { .lomax = 69250000, .svco = 0, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3}, 389 { .lomax = 83625000, .svco = 1, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3}, 390 { .lomax = 97500000, .svco = 2, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3}, 391 { .lomax = 100250000, .svco = 2, .spd = 3, .scr = 2, .sbs = 1, .gc3 = 1}, 392 { .lomax = 117000000, .svco = 3, .spd = 3, .scr = 2, .sbs = 1, .gc3 = 1}, 393 { .lomax = 138500000, .svco = 0, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1}, 394 { .lomax = 167250000, .svco = 1, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1}, 395 { .lomax = 187000000, .svco = 2, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1}, 396 { .lomax = 200500000, .svco = 2, .spd = 2, .scr = 2, .sbs = 2, .gc3 = 1}, 397 { .lomax = 234000000, .svco = 3, .spd = 2, .scr = 2, .sbs = 2, .gc3 = 3}, 398 { .lomax = 277000000, .svco = 0, .spd = 1, .scr = 2, .sbs = 2, .gc3 = 3}, 399 { .lomax = 325000000, .svco = 1, .spd = 1, .scr = 2, .sbs = 2, .gc3 = 1}, 400 { .lomax = 334500000, .svco = 1, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 3}, 401 { .lomax = 401000000, .svco = 2, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 3}, 402 { .lomax = 468000000, .svco = 3, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 1}, 403 { .lomax = 535000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1}, 404 { .lomax = 554000000, .svco = 0, .spd = 0, .scr = 2, .sbs = 3, .gc3 = 1}, 405 { .lomax = 638000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1}, 406 { .lomax = 669000000, .svco = 1, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1}, 407 { .lomax = 720000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1}, 408 { .lomax = 802000000, .svco = 2, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1}, 409 { .lomax = 835000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1}, 410 { .lomax = 885000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1}, 411 { .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1}, 412 { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0} 416 { .lomax = 56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 3}, 417 { .lomax = 67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 3}, 418 { .lomax = 81250000, .svco = 1, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 3}, 419 { .lomax = 97500000, .svco = 2, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 3}, 420 { .lomax = 113750000, .svco = 3, .spd = 3, .scr = 0, .sbs = 1, .gc3 = 1}, 421 { .lomax = 134500000, .svco = 0, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 422 { .lomax = 154000000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 423 { .lomax = 162500000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 424 { .lomax = 183000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, 425 { .lomax = 195000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1}, 426 { .lomax = 227500000, .svco = 3, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 3}, 427 { .lomax = 269000000, .svco = 0, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 3}, 428 { .lomax = 325000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1}, 429 { .lomax = 390000000, .svco = 2, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 3}, 430 { .lomax = 455000000, .svco = 3, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 3}, 431 { .lomax = 520000000, .svco = 0, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, 432 { .lomax = 538000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1}, 433 { .lomax = 554000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, 434 { .lomax = 620000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 435 { .lomax = 650000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 436 { .lomax = 700000000, .svco = 2, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 437 { .lomax = 780000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 438 { .lomax = 820000000, .svco = 3, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, 439 { .lomax = 870000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, 440 { .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 0}, 441 { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0} 569 frequency_map[i].sbs; tda827xa_set_params() 698 tda827xa_analog[i].sbs; tda827xa_set_analog_params()
|
/linux-4.1.27/drivers/power/ |
H A D | sbs-battery.c | 32 #include <linux/power/sbs-battery.h> 431 /* sbs provides energy in units of 10mWh. sbs_unit_adjustment() 448 /* sbs provides battery temperature in 0.1K sbs_unit_adjustment() 456 /* sbs provides time to empty and time to full in minutes. sbs_unit_adjustment() 511 /* sbs spec says that this can be >100 % sbs_get_battery_capacity() 728 { .compatible = "sbs,sbs-battery" }, 754 if (!of_get_property(of_node, "sbs,i2c-retry-count", NULL) && sbs_of_populate_pdata() 755 !of_get_property(of_node, "sbs,poll-retry-count", NULL) && sbs_of_populate_pdata() 756 !of_get_property(of_node, "sbs,battery-detect-gpios", NULL)) sbs_of_populate_pdata() 764 rc = of_property_read_u32(of_node, "sbs,i2c-retry-count", &prop); sbs_of_populate_pdata() 768 rc = of_property_read_u32(of_node, "sbs,poll-retry-count", &prop); sbs_of_populate_pdata() 772 if (!of_get_property(of_node, "sbs,battery-detect-gpios", NULL)) { sbs_of_populate_pdata() 778 "sbs,battery-detect-gpios", 0, &gpio_flags); sbs_of_populate_pdata() 819 sbs_desc->name = devm_kasprintf(&client->dev, GFP_KERNEL, "sbs-%s", sbs_probe() 975 { "sbs-battery", 1 }, 985 .name = "sbs-battery",
|
H A D | Makefile | 31 obj-$(CONFIG_BATTERY_SBS) += sbs-battery.o
|
/linux-4.1.27/include/linux/power/ |
H A D | sbs-battery.h | 28 * struct sbs_platform_data - platform data for sbs devices
|
/linux-4.1.27/include/linux/ceph/ |
H A D | libceph.h | 29 #define CEPH_OPT_NOSHARE (1<<1) /* don't share client with other sbs */
|