Lines Matching refs:pcf

26 	struct pcf50633 *pcf;  member
36 int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma) in pcf50633_mbc_usb_curlim_set() argument
38 struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); in pcf50633_mbc_usb_curlim_set()
58 ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC7, in pcf50633_mbc_usb_curlim_set()
61 dev_err(pcf->dev, "error setting usb curlim to %d mA\n", ma); in pcf50633_mbc_usb_curlim_set()
63 dev_info(pcf->dev, "usb curlim to %d mA\n", ma); in pcf50633_mbc_usb_curlim_set()
76 if (mbc->pcf->pdata->charger_reference_current_ma) { in pcf50633_mbc_usb_curlim_set()
77 mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma; in pcf50633_mbc_usb_curlim_set()
80 pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5); in pcf50633_mbc_usb_curlim_set()
83 mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2); in pcf50633_mbc_usb_curlim_set()
91 pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1, in pcf50633_mbc_usb_curlim_set()
94 pcf50633_reg_clear_bits(pcf, PCF50633_REG_MBCC1, in pcf50633_mbc_usb_curlim_set()
96 pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_MBCC1, in pcf50633_mbc_usb_curlim_set()
106 int pcf50633_mbc_get_status(struct pcf50633 *pcf) in pcf50633_mbc_get_status() argument
108 struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); in pcf50633_mbc_get_status()
115 chgmod = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2) in pcf50633_mbc_get_status()
137 int pcf50633_mbc_get_usb_online_status(struct pcf50633 *pcf) in pcf50633_mbc_get_usb_online_status() argument
139 struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev); in pcf50633_mbc_get_usb_online_status()
153 u8 mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2); in show_chgmode()
164 u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) & in show_usblim()
191 pcf50633_mbc_usb_curlim_set(mbc->pcf, ma); in set_usblim()
202 u8 mbcc5 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC5); in show_chglim()
205 if (!mbc->pcf->pdata->charger_reference_current_ma) in show_chglim()
208 ma = (mbc->pcf->pdata->charger_reference_current_ma * mbcc5) >> 8; in show_chglim()
221 if (!mbc->pcf->pdata->charger_reference_current_ma) in set_chglim()
228 mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma; in set_chglim()
231 pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5); in set_chglim()
262 pcf50633_mbc_usb_curlim_set(mbc->pcf, 0); in pcf50633_mbc_irq_handler()
275 if (mbc->pcf->pdata->mbc_event_callback) in pcf50633_mbc_irq_handler()
276 mbc->pcf->pdata->mbc_event_callback(mbc->pcf, irq); in pcf50633_mbc_irq_handler()
303 u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) & in usb_get_property()
324 u8 usblim = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCC7) & in ac_get_property()
395 mbc->pcf = dev_to_pcf50633(pdev->dev.parent); in pcf50633_mbc_probe()
399 pcf50633_register_irq(mbc->pcf, mbc_irq_handlers[i], in pcf50633_mbc_probe()
402 psy_cfg.supplied_to = mbc->pcf->pdata->batteries; in pcf50633_mbc_probe()
403 psy_cfg.num_supplicants = mbc->pcf->pdata->num_batteries; in pcf50633_mbc_probe()
411 dev_err(mbc->pcf->dev, "failed to register adapter\n"); in pcf50633_mbc_probe()
421 dev_err(mbc->pcf->dev, "failed to register usb\n"); in pcf50633_mbc_probe()
429 dev_err(mbc->pcf->dev, "failed to register ac\n"); in pcf50633_mbc_probe()
435 mbcs1 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS1); in pcf50633_mbc_probe()
451 pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]); in pcf50633_mbc_remove()