Lines Matching full:ec

94 	struct aspire_ec *ec = data;  in aspire_ec_irq_handler()  local
108 id = i2c_smbus_read_byte_data(ec->client, ASPIRE_EC_EVENT); in aspire_ec_irq_handler()
110 dev_err(&ec->client->dev, "Failed to read event id: %pe\n", ERR_PTR(id)); in aspire_ec_irq_handler()
124 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_WATCHDOG, &tmp, sizeof(tmp)); in aspire_ec_irq_handler()
126 aspire_ec_ram_write(ec->client, ASPIRE_EC_RAM_WATCHDOG, tmp); in aspire_ec_irq_handler()
131 input_report_switch(ec->idev, SW_LID, 1); in aspire_ec_irq_handler()
132 input_sync(ec->idev); in aspire_ec_irq_handler()
137 input_report_switch(ec->idev, SW_LID, 0); in aspire_ec_irq_handler()
138 input_sync(ec->idev); in aspire_ec_irq_handler()
146 power_supply_changed(ec->bat_psy); in aspire_ec_irq_handler()
147 power_supply_changed(ec->adp_psy); in aspire_ec_irq_handler()
151 if (ec->bridge_configured) in aspire_ec_irq_handler()
152 drm_bridge_hpd_notify(&ec->bridge, connector_status_disconnected); in aspire_ec_irq_handler()
156 if (ec->bridge_configured) in aspire_ec_irq_handler()
157 drm_bridge_hpd_notify(&ec->bridge, connector_status_connected); in aspire_ec_irq_handler()
176 dev_warn(&ec->client->dev, "Unknown event id=0x%x\n", id); in aspire_ec_irq_handler()
234 struct aspire_ec *ec = power_supply_get_drvdata(psy); in aspire_ec_bat_psy_get_property() local
239 i2c_smbus_read_i2c_block_data(ec->client, ASPIRE_EC_FG_STATIC, sizeof(sdat), (u8 *)&sdat); in aspire_ec_bat_psy_get_property()
240 i2c_smbus_read_i2c_block_data(ec->client, ASPIRE_EC_FG_DYNAMIC, sizeof(ddat), (u8 *)&ddat); in aspire_ec_bat_psy_get_property()
326 .name = "aspire-ec-bat",
337 struct aspire_ec *ec = power_supply_get_drvdata(psy); in aspire_ec_adp_psy_get_property() local
342 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_ADP, &tmp, sizeof(tmp)); in aspire_ec_adp_psy_get_property()
358 .name = "aspire-ec-adp",
376 struct aspire_ec *ec = container_of(work, struct aspire_ec, work); in aspire_ec_bridge_update_hpd_work() local
379 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_HPD_STATUS, &tmp, sizeof(tmp)); in aspire_ec_bridge_update_hpd_work()
381 drm_bridge_hpd_notify(&ec->bridge, connector_status_connected); in aspire_ec_bridge_update_hpd_work()
383 drm_bridge_hpd_notify(&ec->bridge, connector_status_disconnected); in aspire_ec_bridge_update_hpd_work()
388 struct aspire_ec *ec = container_of(bridge, struct aspire_ec, bridge); in aspire_ec_bridge_hpd_enable() local
390 schedule_work(&ec->work); in aspire_ec_bridge_hpd_enable()
404 struct aspire_ec *ec = i2c_get_clientdata(to_i2c_client(dev)); in fn_lock_show() local
407 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_KBD_MODE, &tmp, sizeof(tmp)); in fn_lock_show()
415 struct aspire_ec *ec = i2c_get_clientdata(to_i2c_client(dev)); in fn_lock_store() local
425 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_KBD_MODE, &tmp, sizeof(tmp)); in fn_lock_store()
432 aspire_ec_ram_write(ec->client, ASPIRE_EC_RAM_KBD_MODE, tmp); in fn_lock_store()
450 struct aspire_ec *ec; in aspire_ec_probe() local
454 ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL); in aspire_ec_probe()
455 if (!ec) in aspire_ec_probe()
458 ec->client = client; in aspire_ec_probe()
459 i2c_set_clientdata(client, ec); in aspire_ec_probe()
462 psy_cfg.drv_data = ec; in aspire_ec_probe()
463 ec->bat_psy = devm_power_supply_register(dev, &aspire_ec_bat_psy_desc, &psy_cfg); in aspire_ec_probe()
464 if (IS_ERR(ec->bat_psy)) in aspire_ec_probe()
465 return dev_err_probe(dev, PTR_ERR(ec->bat_psy), in aspire_ec_probe()
468 ec->adp_psy = devm_power_supply_register(dev, &aspire_ec_adp_psy_desc, &psy_cfg); in aspire_ec_probe()
469 if (IS_ERR(ec->adp_psy)) in aspire_ec_probe()
470 return dev_err_probe(dev, PTR_ERR(ec->adp_psy), in aspire_ec_probe()
474 ec->idev = devm_input_allocate_device(dev); in aspire_ec_probe()
475 if (!ec->idev) in aspire_ec_probe()
478 ec->idev->name = "aspire-ec"; in aspire_ec_probe()
479 ec->idev->phys = "aspire-ec/input0"; in aspire_ec_probe()
480 input_set_capability(ec->idev, EV_SW, SW_LID); in aspire_ec_probe()
482 ret = input_register_device(ec->idev); in aspire_ec_probe()
498 INIT_WORK(&ec->work, aspire_ec_bridge_update_hpd_work); in aspire_ec_probe()
499 ec->bridge.funcs = &aspire_ec_bridge_funcs; in aspire_ec_probe()
500 ec->bridge.of_node = to_of_node(fwnode); in aspire_ec_probe()
501 ec->bridge.ops = DRM_BRIDGE_OP_HPD; in aspire_ec_probe()
502 ec->bridge.type = DRM_MODE_CONNECTOR_USB; in aspire_ec_probe()
504 ret = devm_drm_bridge_add(dev, &ec->bridge); in aspire_ec_probe()
510 ec->bridge_configured = true; in aspire_ec_probe()
515 dev_name(dev), ec); in aspire_ec_probe()
524 struct aspire_ec *ec = i2c_get_clientdata(to_i2c_client(dev)); in aspire_ec_resume() local
527 aspire_ec_ram_read(ec->client, ASPIRE_EC_RAM_LID_STATUS, &tmp, sizeof(tmp)); in aspire_ec_resume()
528 input_report_switch(ec->idev, SW_LID, !!(tmp & ASPIRE_EC_LID_OPEN)); in aspire_ec_resume()
529 input_sync(ec->idev); in aspire_ec_resume()
535 { "aspire1-ec", },
541 { .compatible = "acer,aspire1-ec", },
550 .name = "aspire-ec",