/kernel/linux/linux-5.10/drivers/platform/chrome/ |
D | cros_ec.c | 37 struct cros_ec_device *ec_dev = data; in ec_irq_handler() local 39 ec_dev->last_event_time = cros_ec_get_time_ns(); in ec_irq_handler() 54 bool cros_ec_handle_event(struct cros_ec_device *ec_dev) in cros_ec_handle_event() argument 60 ret = cros_ec_get_next_event(ec_dev, &wake_event, &ec_has_more_events); in cros_ec_handle_event() 67 if (wake_event && device_may_wakeup(ec_dev->dev)) in cros_ec_handle_event() 68 pm_wakeup_event(ec_dev->dev, 0); in cros_ec_handle_event() 71 blocking_notifier_call_chain(&ec_dev->event_notifier, in cros_ec_handle_event() 72 0, ec_dev); in cros_ec_handle_event() 80 struct cros_ec_device *ec_dev = data; in ec_irq_thread() local 84 ec_has_more_events = cros_ec_handle_event(ec_dev); in ec_irq_thread() [all …]
|
D | cros_ec_proto.c | 55 static int prepare_packet(struct cros_ec_device *ec_dev, in prepare_packet() argument 63 BUG_ON(ec_dev->proto_version != EC_HOST_REQUEST_VERSION); in prepare_packet() 64 BUG_ON(msg->outsize + sizeof(*request) > ec_dev->dout_size); in prepare_packet() 66 out = ec_dev->dout; in prepare_packet() 88 static int send_command(struct cros_ec_device *ec_dev, in send_command() argument 94 if (ec_dev->proto_version > 2) in send_command() 95 xfer_fxn = ec_dev->pkt_xfer; in send_command() 97 xfer_fxn = ec_dev->cmd_xfer; in send_command() 105 dev_err_once(ec_dev->dev, in send_command() 111 ret = (*xfer_fxn)(ec_dev, msg); in send_command() [all …]
|
D | cros_ec_spi.c | 82 typedef int (*cros_ec_xfer_fn_t) (struct cros_ec_device *ec_dev, 98 struct cros_ec_device *ec_dev; member 117 static int terminate_request(struct cros_ec_device *ec_dev) in terminate_request() argument 119 struct cros_ec_spi *ec_spi = ec_dev->priv; in terminate_request() 139 dev_err(ec_dev->dev, in terminate_request() 156 static int receive_n_bytes(struct cros_ec_device *ec_dev, u8 *buf, int n) in receive_n_bytes() argument 158 struct cros_ec_spi *ec_spi = ec_dev->priv; in receive_n_bytes() 163 BUG_ON(buf - ec_dev->din + n > ec_dev->din_size); in receive_n_bytes() 174 dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret); in receive_n_bytes() 191 static int cros_ec_spi_receive_packet(struct cros_ec_device *ec_dev, in cros_ec_spi_receive_packet() argument [all …]
|
D | cros_ec_rpmsg.c | 65 static int cros_ec_cmd_xfer_rpmsg(struct cros_ec_device *ec_dev, in cros_ec_cmd_xfer_rpmsg() argument 79 static int cros_ec_pkt_xfer_rpmsg(struct cros_ec_device *ec_dev, in cros_ec_pkt_xfer_rpmsg() argument 82 struct cros_ec_rpmsg *ec_rpmsg = ec_dev->priv; in cros_ec_pkt_xfer_rpmsg() 91 len = cros_ec_prepare_tx(ec_dev, ec_msg); in cros_ec_pkt_xfer_rpmsg() 92 dev_dbg(ec_dev->dev, "prepared, len=%d\n", len); in cros_ec_pkt_xfer_rpmsg() 95 ret = rpmsg_send(ec_rpmsg->ept, ec_dev->dout, len); in cros_ec_pkt_xfer_rpmsg() 97 dev_err(ec_dev->dev, "rpmsg send failed\n"); in cros_ec_pkt_xfer_rpmsg() 104 dev_err(ec_dev->dev, "rpmsg send timeout\n"); in cros_ec_pkt_xfer_rpmsg() 109 response = (struct ec_host_response *)ec_dev->din; in cros_ec_pkt_xfer_rpmsg() 112 ret = cros_ec_check_result(ec_dev, ec_msg); in cros_ec_pkt_xfer_rpmsg() [all …]
|
D | cros_ec_i2c.c | 52 static int cros_ec_pkt_xfer_i2c(struct cros_ec_device *ec_dev, in cros_ec_pkt_xfer_i2c() argument 55 struct i2c_client *client = ec_dev->priv; in cros_ec_pkt_xfer_i2c() 75 BUG_ON(packet_len > ec_dev->din_size); in cros_ec_pkt_xfer_i2c() 76 in_buf = ec_dev->din; in cros_ec_pkt_xfer_i2c() 81 BUG_ON(packet_len > ec_dev->dout_size); in cros_ec_pkt_xfer_i2c() 82 out_buf = ec_dev->dout; in cros_ec_pkt_xfer_i2c() 90 ec_dev->dout++; in cros_ec_pkt_xfer_i2c() 91 ret = cros_ec_prepare_tx(ec_dev, msg); in cros_ec_pkt_xfer_i2c() 92 ec_dev->dout--; in cros_ec_pkt_xfer_i2c() 97 dev_dbg(ec_dev->dev, "i2c transfer failed: %d\n", ret); in cros_ec_pkt_xfer_i2c() [all …]
|
D | cros_ec_chardev.c | 34 struct cros_ec_dev *ec_dev; member 39 struct cros_ec_dev *ec_dev; member 70 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in ec_get_version() 98 struct cros_ec_device *ec_dev = priv->ec_dev->ec_dev; in cros_ec_chardev_mkbp_event() local 100 unsigned long event_bit = 1 << ec_dev->event_data.event_type; in cros_ec_chardev_mkbp_event() 101 int total_size = sizeof(*event) + ec_dev->event_size; in cros_ec_chardev_mkbp_event() 111 event->size = ec_dev->event_size; in cros_ec_chardev_mkbp_event() 112 event->event_type = ec_dev->event_data.event_type; in cros_ec_chardev_mkbp_event() 113 memcpy(event->data, &ec_dev->event_data.data, ec_dev->event_size); in cros_ec_chardev_mkbp_event() 163 struct cros_ec_dev *ec_dev = dev_get_drvdata(mdev->parent); in cros_ec_chardev_open() local [all …]
|
D | cros_ec_ishtp.c | 132 struct cros_ec_device *ec_dev; member 143 struct cros_ec_device *ec_dev = client_data->ec_dev; in ish_evt_handler() local 147 ec_has_more_events = cros_ec_handle_event(ec_dev); in ish_evt_handler() 326 client_data->ec_dev->last_event_time = timestamp; in process_recv() 450 static int prepare_cros_ec_rx(struct cros_ec_device *ec_dev, in prepare_cros_ec_rx() argument 459 rv = cros_ec_check_result(ec_dev, msg); in prepare_cros_ec_rx() 464 dev_err(ec_dev->dev, "Packet too long (%d bytes, expected %d)", in prepare_cros_ec_rx() 478 dev_dbg(ec_dev->dev, "Bad received packet checksum %d\n", sum); in prepare_cros_ec_rx() 485 static int cros_ec_pkt_xfer_ish(struct cros_ec_device *ec_dev, in cros_ec_pkt_xfer_ish() argument 489 struct ishtp_cl *cros_ish_cl = ec_dev->priv; in cros_ec_pkt_xfer_ish() [all …]
|
D | cros_ec_lpc.c | 315 struct cros_ec_device *ec_dev = data; in cros_ec_lpc_acpi_notify() local 319 ec_dev->last_event_time = cros_ec_get_time_ns(); in cros_ec_lpc_acpi_notify() 321 if (ec_dev->mkbp_event_supported) in cros_ec_lpc_acpi_notify() 323 ret = cros_ec_get_next_event(ec_dev, NULL, in cros_ec_lpc_acpi_notify() 327 &ec_dev->event_notifier, 0, in cros_ec_lpc_acpi_notify() 328 ec_dev); in cros_ec_lpc_acpi_notify() 340 struct cros_ec_device *ec_dev; in cros_ec_lpc_probe() local 382 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); in cros_ec_lpc_probe() 383 if (!ec_dev) in cros_ec_lpc_probe() 386 platform_set_drvdata(pdev, ec_dev); in cros_ec_lpc_probe() [all …]
|
D | cros_usbpd_notify.c | 68 static int cros_ec_pd_command(struct cros_ec_device *ec_dev, in cros_ec_pd_command() argument 89 ret = cros_ec_cmd_xfer_status(ec_dev, msg); in cros_ec_pd_command() 101 struct cros_ec_device *ec_dev) in cros_usbpd_get_event_and_notify() argument 111 if (!ec_dev) { in cros_usbpd_get_event_and_notify() 118 ret = cros_ec_pd_command(ec_dev, EC_CMD_PD_HOST_EVENT_STATUS, in cros_usbpd_get_event_and_notify() 147 struct cros_ec_device *ec_dev; in cros_usbpd_notify_probe_acpi() local 157 ec_dev = dev_get_drvdata(dev->parent); in cros_usbpd_notify_probe_acpi() 158 if (!ec_dev) { in cros_usbpd_notify_probe_acpi() 168 pdnotify->ec = ec_dev; in cros_usbpd_notify_probe_acpi() 217 struct cros_ec_device *ec_dev = (struct cros_ec_device *)data; in cros_usbpd_notify_plat() local [all …]
|
D | cros_ec.h | 11 int cros_ec_register(struct cros_ec_device *ec_dev); 12 int cros_ec_unregister(struct cros_ec_device *ec_dev); 14 int cros_ec_suspend(struct cros_ec_device *ec_dev); 15 int cros_ec_resume(struct cros_ec_device *ec_dev); 17 bool cros_ec_handle_event(struct cros_ec_device *ec_dev);
|
D | cros_ec_lightbar.c | 121 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in get_lightbar_version() 198 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in brightness_store() 258 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in led_rgb_store() 302 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in sequence_show() 338 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in lb_send_empty_cmd() 368 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in lb_manual_suspend_ctrl() 413 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in sequence_store() 439 max_size = min(EC_LB_PROG_LEN, ec->ec_dev->max_request - extra_bytes); in program_store() 470 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in program_store() 533 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_ec_lightbar_probe() local [all …]
|
D | cros_ec_debugfs.c | 77 ret = cros_ec_cmd_xfer_status(ec->ec_dev, &snapshot_msg); in cros_ec_console_log_work() 94 ret = cros_ec_cmd_xfer_status(ec->ec_dev, in cros_ec_console_log_work() 201 struct cros_ec_device *ec_dev = debug_info->ec->ec_dev; in cros_ec_pdinfo_read() local 233 if (cros_ec_cmd_xfer_status(ec_dev, msg) < 0) in cros_ec_pdinfo_read() 246 static bool cros_ec_uptime_is_supported(struct cros_ec_device *ec_dev) in cros_ec_uptime_is_supported() argument 257 ret = cros_ec_cmd_xfer_status(ec_dev, &msg.cmd); in cros_ec_uptime_is_supported() 269 struct cros_ec_device *ec_dev = debug_info->ec->ec_dev; in cros_ec_uptime_read() local 283 ret = cros_ec_cmd_xfer_status(ec_dev, &msg.cmd); in cros_ec_uptime_read() 337 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg) >= 0 && in ec_read_version_supported() 364 read_response_size = ec->ec_dev->max_response; in cros_ec_create_console_log() [all …]
|
D | cros_usbpd_logger.c | 30 struct cros_ec_dev *ec_dev; member 64 struct cros_ec_dev *ec_dev = logger->ec_dev; in ec_get_log_entry() local 70 msg->command = ec_dev->cmd_offset + EC_CMD_PD_GET_LOG_ENTRY; in ec_get_log_entry() 73 ret = cros_ec_cmd_xfer_status(ec_dev->ec_dev, msg); in ec_get_log_entry() 197 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_usbpd_logger_probe() local 206 logger->ec_dev = ec_dev; in cros_usbpd_logger_probe()
|
D | cros_ec_sysfs.c | 102 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in reboot_store() 131 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 152 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 166 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 188 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 223 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in flashinfo_show() 261 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_show() 298 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_store() 339 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_ec_sysfs_probe() local 343 ret = sysfs_create_group(&ec_dev->class_dev.kobj, &cros_ec_attr_group); in cros_ec_sysfs_probe() [all …]
|
D | cros_ec_vbc.c | 22 struct cros_ec_device *ecdev = ec->ec_dev; in vboot_context_read() 62 struct cros_ec_device *ecdev = ec->ec_dev; in vboot_context_write() 111 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_ec_vbc_probe() local 115 ret = sysfs_create_group(&ec_dev->class_dev.kobj, in cros_ec_vbc_probe() 126 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_ec_vbc_remove() local 128 sysfs_remove_group(&ec_dev->class_dev.kobj, in cros_ec_vbc_remove()
|
D | cros_ec_sensorhub_ring.c | 126 ret = cros_ec_cmd_xfer_status(sensorhub->ec->ec_dev, sensorhub->msg); in cros_ec_sensorhub_ring_fifo_enable() 789 if (cros_ec_cmd_xfer_status(ec->ec_dev, sensorhub->msg) < 0) in cros_ec_sensorhub_ring_handler() 827 ret = cros_ec_cmd_xfer_status(ec->ec_dev, sensorhub->msg); in cros_ec_sensorhub_ring_handler() 919 struct cros_ec_device *ec_dev; in cros_ec_sensorhub_event() local 922 ec_dev = sensorhub->ec->ec_dev; in cros_ec_sensorhub_event() 924 if (ec_dev->event_data.event_type != EC_MKBP_EVENT_SENSOR_FIFO) in cros_ec_sensorhub_event() 927 if (ec_dev->event_size != sizeof(ec_dev->event_data.data.sensor_fifo)) { in cros_ec_sensorhub_event() 928 dev_warn(ec_dev->dev, "Invalid fifo info size\n"); in cros_ec_sensorhub_event() 935 memcpy(sensorhub->fifo_info, &ec_dev->event_data.data.sensor_fifo.info, in cros_ec_sensorhub_event() 938 ec_dev->last_event_time; in cros_ec_sensorhub_event() [all …]
|
D | cros_ec_sensorhub.c | 67 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in cros_ec_sensorhub_register() 134 ec->ec_dev->max_response), GFP_KERNEL); in cros_ec_sensorhub_probe()
|
/kernel/linux/linux-5.10/include/linux/platform_data/ |
D | cros_ec_proto.h | 203 struct cros_ec_device *ec_dev; member 213 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 216 int cros_ec_check_result(struct cros_ec_device *ec_dev, 219 int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, 222 int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev, 225 int cros_ec_query_all(struct cros_ec_device *ec_dev); 227 int cros_ec_get_next_event(struct cros_ec_device *ec_dev, 231 u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
|
/kernel/linux/linux-5.10/drivers/regulator/ |
D | cros-ec-regulator.c | 17 struct cros_ec_device *ec_dev; member 63 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, in cros_ec_regulator_enable() 75 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, in cros_ec_regulator_disable() 88 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_IS_ENABLED, &cmd, in cros_ec_regulator_is_enabled() 115 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_VOLTAGE, &cmd, in cros_ec_regulator_get_voltage() 141 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_SET_VOLTAGE, &cmd, in cros_ec_regulator_set_voltage() 163 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_INFO, &cmd, in cros_ec_regulator_init_info() 202 drvdata->ec_dev = dev_get_drvdata(dev->parent); in cros_ec_regulator_probe()
|
/kernel/linux/linux-5.10/drivers/input/keyboard/ |
D | cros_ec_keyb.c | 328 static int cros_ec_keyb_info(struct cros_ec_device *ec_dev, in cros_ec_keyb_info() argument 351 ret = cros_ec_cmd_xfer_status(ec_dev, msg); in cros_ec_keyb_info() 357 dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", in cros_ec_keyb_info() 360 dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n", in cros_ec_keyb_info() 387 struct cros_ec_device *ec_dev = ckdev->ec; in cros_ec_keyb_query_switches() local 391 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_CURRENT, in cros_ec_keyb_query_switches() 438 struct cros_ec_device *ec_dev = ckdev->ec; in cros_ec_keyb_register_bs() local 448 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED, in cros_ec_keyb_register_bs() 455 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED, in cros_ec_keyb_register_bs() 470 phys = devm_kasprintf(dev, GFP_KERNEL, "%s/input1", ec_dev->phys_name); in cros_ec_keyb_register_bs() [all …]
|
/kernel/linux/linux-5.10/drivers/iio/pressure/ |
D | cros_ec_baro.c | 125 struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent); in cros_ec_baro_probe() local 131 if (!ec_dev || !ec_dev->ec_dev) { in cros_ec_baro_probe()
|
/kernel/linux/linux-5.10/drivers/power/supply/ |
D | cros_usbpd-charger.c | 47 struct cros_ec_dev *ec_dev; member 103 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_usbpd_charger_ec_command() local 112 msg->command = ec_dev->cmd_offset + command; in cros_usbpd_charger_ec_command() 540 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_usbpd_charger_probe() local 541 struct cros_ec_device *ec_device = ec_dev->ec_dev; in cros_usbpd_charger_probe() 556 charger->ec_dev = ec_dev; in cros_usbpd_charger_probe()
|
/kernel/linux/linux-5.10/drivers/mfd/ |
D | cros_ec_dev.c | 141 ec->ec_dev = dev_get_drvdata(dev->parent); in ec_device_probe() 214 if (IS_ENABLED(CONFIG_OF) && ec->ec_dev->dev->of_node) { in ec_device_probe() 238 node = ec->ec_dev->dev->of_node; in ec_device_probe()
|
/kernel/linux/linux-5.10/drivers/media/cec/platform/cros-ec/ |
D | cros-ec-cec.c | 263 struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent); in cros_ec_cec_probe() local 264 struct cros_ec_device *cros_ec = ec_dev->ec_dev; in cros_ec_cec_probe()
|
/kernel/linux/linux-5.10/drivers/rtc/ |
D | rtc-cros-ec.c | 319 struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent); in cros_ec_rtc_probe() local 320 struct cros_ec_device *cros_ec = ec_dev->ec_dev; in cros_ec_rtc_probe()
|