Lines Matching defs:charger
92 /* Lowest charger voltage is 3.39V -> 0x4E */
105 /*External charger control*/
221 * @ac_conn: This will be true when the AC charger has been plugged
223 * charger is enabled
225 * charger is enabled
231 * @invalid_charger_detect_state State when forcing AB to use invalid charger
236 * @adc_main_charger_v ADC channel for main charger voltage
237 * @adc_main_charger_c ADC channel for main charger current
238 * @adc_vbus_v ADC channel for USB charger voltage
239 * @adc_usb_charger_c ADC channel for USB charger current
243 * @max_usb_in_curr: Max USB charger input current
244 * @ac_chg: AC charger power supply
245 * @usb_chg: USB charger power supply
246 * @ac: Structure that holds the AC charger properties
247 * @usb: Structure that holds the USB charger properties
254 * @check_usbchgnotok_work: Work for checking USB charger not ok status
255 * @kick_wd_work: Work for kicking the charger watchdog in case
257 * @ac_charger_attached_work: Work for checking if AC charger is still
259 * @usb_charger_attached_work: Work for checking if USB charger is still
261 * @ac_work: Work for checking AC charger connection
346 * should always be disabled when no charger is connected.
477 * ab8500_charger_get_ac_voltage() - get ac charger voltage
480 * Returns ac charger voltage (on success)
486 /* Only measure voltage if the charger is connected */
498 * ab8500_charger_ac_cv() - check if the main charger is in CV mode
501 * Returns ac charger CV mode (on success) else error code
508 /* Only check CV mode if the charger is online */
537 /* Only measure voltage if the charger is connected */
549 * ab8500_charger_get_usb_current() - get usb charger current
552 * This function returns the usb charger current.
559 /* Only measure current if the charger is online */
571 * ab8500_charger_get_ac_current() - get ac charger current
574 * This function returns the ac charger current.
581 /* Only measure current if the charger is online */
593 * ab8500_charger_usb_cv() - check if the usb charger is in CV mode
596 * Returns ac charger CV mode (on success) else error code
603 /* Only check CV mode if the charger is online */
628 * Returns the type of charger connected.
632 * interrupts of the charger detection
646 /* Check for AC charger */
657 /* Check for USB charger */
663 * charger was connected. Try waiting a little
729 * Dedicated charger level minus maximum current accessory
738 * Dedicated charger level minus 120mA (20mA for ACA and
762 dev_dbg(di->dev, "USB Type - Legacy charger.\n");
921 * This array maps the raw hex value to charger voltage used by the AB8500
1106 * @reg: select what charger register to check
1109 * Checks if charger source has not collapsed. If it has, further stepping
1122 * ab8500_charger_set_current() - set charger current
1124 * @ich: charger current, in mA
1125 * @reg: select what charger register to set
1127 * Set charger current.
1128 * There is no state machine in the AB to step up/down the charger
1131 * this charger current step-up/down here.
1202 dev_dbg(di->dev, "%s set charger current: %d mA for reg: 0x%02x\n",
1250 * @ich_in: charger input current limit
1293 * ab8500_charger_set_main_in_curr() - set main charger input current
1295 * @ich_in: input charger current, in mA
1297 * Set main charger input current.
1308 * ab8500_charger_set_output_curr() - set charger output current
1310 * @ich_out: output charger current, in mA
1312 * Set charger output current.
1375 static int ab8500_charger_ac_en(struct ux500_charger *charger,
1384 struct ab8500_charger *di = to_ab8500_charger_ac_device_info(charger);
1389 dev_err(di->dev, "AC charger not connected\n");
1401 * there is a charger enabled. Normally the VDD ADC supply
1434 /* MainChInputCurr: current that can be drawn from the charger*/
1475 * kick the charger watchdog even when no charger is
1476 * connected. This is only valid once the AC charger
1479 * by the charger driver when the AC charger
1547 * @ich_out: charger output current
1552 static int ab8500_charger_usb_en(struct ux500_charger *charger,
1560 struct ab8500_charger *di = to_ab8500_charger_usb_device_info(charger);
1565 dev_err(di->dev, "USB charger not connected\n");
1574 * there is a charger enabled. Normally the VDD ADC supply
1706 /*Toggle External charger control pin*/
1726 * @charger: pointer to the ux500_charger structure
1728 * @iset: charger output current
1730 * Check if the VBUS charger has been disconnected and reconnected without
1733 static int ab8500_charger_usb_check_enable(struct ux500_charger *charger,
1739 struct ab8500_charger *di = to_ab8500_charger_usb_device_info(charger);
1750 dev_dbg(di->dev, "USB charger ctrl: 0x%02x\n", usbch_ctrl1);
1765 dev_err(di->dev, "Failed to enable VBUS charger %d\n",
1775 * @charger: pointer to the ux500_charger structure
1777 * @iset: charger output current
1779 * Check if the AC charger has been disconnected and reconnected without
1782 static int ab8500_charger_ac_check_enable(struct ux500_charger *charger,
1788 struct ab8500_charger *di = to_ab8500_charger_ac_device_info(charger);
1799 dev_dbg(di->dev, "AC charger ctrl: 0x%02x\n", mainch_ctrl1);
1815 dev_err(di->dev, "failed to enable AC charger %d\n",
1824 * ab8500_charger_watchdog_kick() - kick charger watchdog
1827 * Kick charger watchdog
1830 static int ab8500_charger_watchdog_kick(struct ux500_charger *charger)
1835 if (charger->psy->desc->type == POWER_SUPPLY_TYPE_MAINS)
1836 di = to_ab8500_charger_ac_device_info(charger);
1837 else if (charger->psy->desc->type == POWER_SUPPLY_TYPE_USB)
1838 di = to_ab8500_charger_usb_device_info(charger);
1851 * ab8500_charger_update_charger_current() - update charger current
1854 * Update the charger output current for the specified charger
1857 static int ab8500_charger_update_charger_current(struct ux500_charger *charger,
1863 if (charger->psy->desc->type == POWER_SUPPLY_TYPE_MAINS)
1864 di = to_ab8500_charger_ac_device_info(charger);
1865 else if (charger->psy->desc->type == POWER_SUPPLY_TYPE_USB)
1866 di = to_ab8500_charger_usb_device_info(charger);
1939 * charger when charging with at some specific levels. This issue is only valid
1983 * ab8500_charger_check_hw_failure_work() - check main charger failure
1986 * Work queue function for checking the main charger status
2033 * Work queue function for kicking the charger watchdog.
2036 * logic. That means we have to continuously kick the charger
2037 * watchdog even when no charger is connected. This is only
2038 * valid once the AC charger has been enabled. This is
2040 * watchdog have to be kicked by the charger driver
2041 * when the AC charger is disabled
2061 * ab8500_charger_ac_work() - work to get and set main charger status
2064 * Work queue function for checking the main charger status
2075 * synchronously, we have the check if the main charger is
2308 "Invalid charger detected, state= 0\n");
2309 /*Enable charger*/
2313 /*Enable charger detection*/
2324 "Invalid charger detected, state= 1\n");
2325 /*Stop charger detection*/
2359 /* No valid charger type detected */
2456 * Work queue function for checking the USB charger Not OK status
2551 * ab8500_charger_mainchunplugdet_handler() - main charger unplugged
2561 dev_dbg(di->dev, "Main charger unplugged\n");
2572 * ab8500_charger_mainchplugdet_handler() - main charger plugged
2582 dev_dbg(di->dev, "Main charger plugged\n");
2596 * ab8500_charger_mainextchnotok_handler() - main charger not ok
2606 dev_dbg(di->dev, "Main charger not ok\n");
2617 * ab8500_charger_mainchthprotr_handler() - Die temp is above main charger
2629 "Die temp above Main charger thermal protection threshold\n");
2636 * ab8500_charger_mainchthprotf_handler() - Die temp is below main charger
2648 "Die temp ok for Main charger thermal protection threshold\n");
2756 * ab8500_charger_usbchthprotr_handler() - Die temp is above usb charger
2768 "Die temp above USB charger thermal protection threshold\n");
2775 * ab8500_charger_usbchthprotf_handler() - Die temp is below usb charger
2787 "Die temp ok for USB charger thermal protection threshold\n");
2794 * ab8500_charger_usbchargernotokr_handler() - USB charger not ok detected
2804 dev_dbg(di->dev, "Not allowed USB charger detected\n");
2824 * The charger that was online when the watchdog expired
2850 dev_dbg(di->dev, "VBUS charger drop ended\n");
2934 * for the AC charger
3002 * for the USB charger
3016 * due to too high output current from the USB charger
3030 * ab8500_charger_init_hw_registers() - Set up charger related registers
3033 * Set up charger OVV, watchdog and maximum voltage registers as well as
3040 /* Setup maximum charger current and voltage for ABB cut2.0 */
3129 dev_err(di->dev, "failed to set charger watchdog timeout\n");
3162 * ab8500 charger driver interrupts and their respective isr
3197 /* TODO: State is fabricate here. See if charger really needs USB
3236 * logic. That means we have to continuously kick the charger
3237 * watchdog even when no charger is connected. This is only
3238 * valid once the AC charger has been enabled. This is
3240 * watchdog have to be kicked by the charger driver
3241 * when the AC charger is disabled
3329 /* Unregister external charger enable notifier */
3406 dev_err(&pdev->dev, "failed to get ADC main charger voltage\n");
3414 dev_err(&pdev->dev, "failed to get ADC main charger current\n");
3421 dev_err(&pdev->dev, "failed to get ADC USB charger voltage\n");
3429 dev_err(&pdev->dev, "failed to get ADC USB charger current\n");
3462 /*notifier for external charger enabling*/
3482 /* Create a work queue for the charger */
3505 * logic. That means we have to continuously kick the charger
3506 * watchdog even when no charger is connected. This is only
3507 * valid once the AC charger has been enabled. This is
3509 * watchdog have to be kicked by the charger driver
3510 * when the AC charger is disabled
3527 /* Init work for charger detection */
3542 * is a charger connected to avoid erroneous BTEMP_HIGH/LOW
3560 /* Register AC charger class */
3566 dev_err(di->dev, "failed to register AC charger\n");
3572 /* Register USB charger class */
3578 dev_err(di->dev, "failed to register USB charger\n");
3597 /* Identify the connected charger types during startup */
3679 { .compatible = "stericsson,ab8500-charger", },
3690 .name = "ab8500-charger",
3710 MODULE_ALIAS("platform:ab8500-charger");
3711 MODULE_DESCRIPTION("AB8500 charger management driver");