/linux-6.1.9/drivers/platform/chrome/ |
D | cros_ec.c | 41 struct cros_ec_device *ec_dev = data; in cros_ec_irq_handler() local 43 ec_dev->last_event_time = cros_ec_get_time_ns(); in cros_ec_irq_handler() 58 static bool cros_ec_handle_event(struct cros_ec_device *ec_dev) in cros_ec_handle_event() argument 64 ret = cros_ec_get_next_event(ec_dev, &wake_event, &ec_has_more_events); in cros_ec_handle_event() 71 if (wake_event && device_may_wakeup(ec_dev->dev)) in cros_ec_handle_event() 72 pm_wakeup_event(ec_dev->dev, 0); in cros_ec_handle_event() 75 blocking_notifier_call_chain(&ec_dev->event_notifier, in cros_ec_handle_event() 76 0, ec_dev); in cros_ec_handle_event() 90 struct cros_ec_device *ec_dev = data; in cros_ec_irq_thread() local 94 ec_has_more_events = cros_ec_handle_event(ec_dev); in cros_ec_irq_thread() [all …]
|
D | cros_ec_proto.c | 55 static int prepare_tx(struct cros_ec_device *ec_dev, in prepare_tx() argument 63 if (msg->outsize + sizeof(*request) > ec_dev->dout_size) in prepare_tx() 66 out = ec_dev->dout; in prepare_tx() 88 static int prepare_tx_legacy(struct cros_ec_device *ec_dev, in prepare_tx_legacy() argument 98 out = ec_dev->dout; in prepare_tx_legacy() 110 static int cros_ec_xfer_command(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) in cros_ec_xfer_command() argument 115 if (ec_dev->proto_version > 2) in cros_ec_xfer_command() 116 xfer_fxn = ec_dev->pkt_xfer; in cros_ec_xfer_command() 118 xfer_fxn = ec_dev->cmd_xfer; in cros_ec_xfer_command() 126 dev_err_once(ec_dev->dev, "missing EC transfer API, cannot send command\n"); in cros_ec_xfer_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 if (buf - ec_dev->din + n > ec_dev->din_size) in receive_n_bytes() 175 dev_err(ec_dev->dev, "spi transfer failed: %d\n", ret); in receive_n_bytes() 192 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() 94 dev_dbg(ec_dev->dev, "prepared, len=%d\n", len); in cros_ec_pkt_xfer_rpmsg() 97 ret = rpmsg_send(ec_rpmsg->ept, ec_dev->dout, len); in cros_ec_pkt_xfer_rpmsg() 99 dev_err(ec_dev->dev, "rpmsg send failed\n"); in cros_ec_pkt_xfer_rpmsg() 106 dev_err(ec_dev->dev, "rpmsg send timeout\n"); in cros_ec_pkt_xfer_rpmsg() 111 response = (struct ec_host_response *)ec_dev->din; in cros_ec_pkt_xfer_rpmsg() 114 ret = cros_ec_check_result(ec_dev, ec_msg); in cros_ec_pkt_xfer_rpmsg() [all …]
|
D | cros_ec_proto_test.c | 18 struct cros_ec_device ec_dev; member 28 struct cros_ec_device *ec_dev = &priv->ec_dev; in cros_ec_proto_test_prepare_tx_legacy_normal() local 33 ec_dev->proto_version = 2; in cros_ec_proto_test_prepare_tx_legacy_normal() 42 ret = cros_ec_prepare_tx(ec_dev, msg); in cros_ec_proto_test_prepare_tx_legacy_normal() 45 KUNIT_EXPECT_EQ(test, ec_dev->dout[0], EC_CMD_VERSION0); in cros_ec_proto_test_prepare_tx_legacy_normal() 46 KUNIT_EXPECT_EQ(test, ec_dev->dout[1], EC_CMD_HELLO); in cros_ec_proto_test_prepare_tx_legacy_normal() 47 KUNIT_EXPECT_EQ(test, ec_dev->dout[2], EC_PROTO2_MAX_PARAM_SIZE); in cros_ec_proto_test_prepare_tx_legacy_normal() 49 KUNIT_EXPECT_EQ(test, ec_dev->dout[EC_MSG_TX_HEADER_BYTES + 0], 0xde); in cros_ec_proto_test_prepare_tx_legacy_normal() 50 KUNIT_EXPECT_EQ(test, ec_dev->dout[EC_MSG_TX_HEADER_BYTES + 1], 0xad); in cros_ec_proto_test_prepare_tx_legacy_normal() 51 KUNIT_EXPECT_EQ(test, ec_dev->dout[EC_MSG_TX_HEADER_BYTES + 2], 0xbe); in cros_ec_proto_test_prepare_tx_legacy_normal() [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 if (packet_len > ec_dev->din_size) { in cros_ec_pkt_xfer_i2c() 79 in_buf = ec_dev->din; in cros_ec_pkt_xfer_i2c() 84 if (packet_len > ec_dev->dout_size) { in cros_ec_pkt_xfer_i2c() 88 out_buf = ec_dev->dout; in cros_ec_pkt_xfer_i2c() 96 ec_dev->dout++; in cros_ec_pkt_xfer_i2c() 97 ret = cros_ec_prepare_tx(ec_dev, msg); in cros_ec_pkt_xfer_i2c() 100 ec_dev->dout--; in cros_ec_pkt_xfer_i2c() 105 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 | 135 struct cros_ec_device *ec_dev; member 147 cros_ec_irq_thread(0, client_data->ec_dev); in ish_evt_handler() 325 client_data->ec_dev->last_event_time = timestamp; in process_recv() 449 static int prepare_cros_ec_rx(struct cros_ec_device *ec_dev, in prepare_cros_ec_rx() argument 458 rv = cros_ec_check_result(ec_dev, msg); in prepare_cros_ec_rx() 463 dev_err(ec_dev->dev, "Packet too long (%d bytes, expected %d)", in prepare_cros_ec_rx() 477 dev_dbg(ec_dev->dev, "Bad received packet checksum %d\n", sum); in prepare_cros_ec_rx() 484 static int cros_ec_pkt_xfer_ish(struct cros_ec_device *ec_dev, in cros_ec_pkt_xfer_ish() argument 488 struct ishtp_cl *cros_ish_cl = ec_dev->priv; in cros_ec_pkt_xfer_ish() 491 struct cros_ish_in_msg *in_msg = (struct cros_ish_in_msg *)ec_dev->din; in cros_ec_pkt_xfer_ish() [all …]
|
D | cros_ec_lpc.c | 317 struct cros_ec_device *ec_dev = data; in cros_ec_lpc_acpi_notify() local 321 ec_dev->last_event_time = cros_ec_get_time_ns(); in cros_ec_lpc_acpi_notify() 323 if (ec_dev->mkbp_event_supported) in cros_ec_lpc_acpi_notify() 325 ret = cros_ec_get_next_event(ec_dev, NULL, in cros_ec_lpc_acpi_notify() 329 &ec_dev->event_notifier, 0, in cros_ec_lpc_acpi_notify() 330 ec_dev); in cros_ec_lpc_acpi_notify() 342 struct cros_ec_device *ec_dev; in cros_ec_lpc_probe() local 397 ec_dev = devm_kzalloc(dev, sizeof(*ec_dev), GFP_KERNEL); in cros_ec_lpc_probe() 398 if (!ec_dev) in cros_ec_lpc_probe() 401 platform_set_drvdata(pdev, ec_dev); in cros_ec_lpc_probe() [all …]
|
D | cros_usbpd_notify.c | 57 struct cros_ec_device *ec_dev) in cros_usbpd_get_event_and_notify() argument 67 if (!ec_dev) { in cros_usbpd_get_event_and_notify() 74 ret = cros_ec_cmd(ec_dev, 0, EC_CMD_PD_HOST_EVENT_STATUS, in cros_usbpd_get_event_and_notify() 101 struct cros_ec_device *ec_dev; in cros_usbpd_notify_probe_acpi() local 111 ec_dev = dev_get_drvdata(dev->parent); in cros_usbpd_notify_probe_acpi() 112 if (!ec_dev) { in cros_usbpd_notify_probe_acpi() 122 pdnotify->ec = ec_dev; in cros_usbpd_notify_probe_acpi() 171 struct cros_ec_device *ec_dev = (struct cros_ec_device *)data; in cros_usbpd_notify_plat() local 172 u32 host_event = cros_ec_get_host_event(ec_dev); in cros_usbpd_notify_plat() 179 cros_usbpd_get_event_and_notify(pdnotify->dev, ec_dev); in cros_usbpd_notify_plat() [all …]
|
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_ec.h | 13 int cros_ec_register(struct cros_ec_device *ec_dev); 14 void cros_ec_unregister(struct cros_ec_device *ec_dev); 16 int cros_ec_suspend(struct cros_ec_device *ec_dev); 17 int cros_ec_resume(struct cros_ec_device *ec_dev);
|
D | cros_kunit_util.c | 24 int cros_kunit_ec_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) in cros_kunit_ec_xfer_mock() argument 52 int cros_kunit_ec_cmd_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) in cros_kunit_ec_cmd_xfer_mock() argument 55 return cros_kunit_ec_xfer_mock(ec_dev, msg); in cros_kunit_ec_cmd_xfer_mock() 58 int cros_kunit_ec_pkt_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg) in cros_kunit_ec_pkt_xfer_mock() argument 61 return cros_kunit_ec_xfer_mock(ec_dev, msg); in cros_kunit_ec_pkt_xfer_mock() 106 int cros_kunit_readmem_mock(struct cros_ec_device *ec_dev, unsigned int offset, in cros_kunit_readmem_mock() argument
|
D | cros_kunit_util.h | 31 int cros_kunit_ec_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg); 32 int cros_kunit_ec_cmd_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg); 33 int cros_kunit_ec_pkt_xfer_mock(struct cros_ec_device *ec_dev, struct cros_ec_command *msg); 43 int cros_kunit_readmem_mock(struct cros_ec_device *ec_dev, unsigned int offset,
|
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 | 103 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in reboot_store() 132 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 153 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 167 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 189 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in version_show() 224 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in flashinfo_show() 262 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_show() 299 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in kb_wake_angle_store() 340 struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent); in cros_ec_sysfs_probe() local 344 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 …]
|
/linux-6.1.9/include/linux/platform_data/ |
D | cros_ec_proto.h | 205 struct cros_ec_device *ec_dev; member 215 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev, 218 int cros_ec_check_result(struct cros_ec_device *ec_dev, 221 int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, 224 int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev, 227 int cros_ec_query_all(struct cros_ec_device *ec_dev); 229 int cros_ec_get_next_event(struct cros_ec_device *ec_dev, 233 u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev); 239 int cros_ec_cmd(struct cros_ec_device *ec_dev, unsigned int version, int command, void *outdata,
|
/linux-6.1.9/drivers/power/supply/ |
D | cros_peripheral_charger.c | 40 struct cros_ec_dev *ec_dev; member 62 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_pchg_ec_command() local 71 msg->command = ec_dev->cmd_offset + command; in cros_pchg_ec_command() 245 struct cros_ec_device *ec_dev = data; in cros_ec_notify() local 250 if (ec_dev->event_data.event_type != EC_MKBP_EVENT_PCHG || in cros_ec_notify() 251 ec_dev->event_size != sizeof(host_event)) in cros_ec_notify() 254 host_event = get_unaligned_le32(&ec_dev->event_data.data.host_event); in cros_ec_notify() 265 struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent); in cros_pchg_probe() local 266 struct cros_ec_device *ec_device = ec_dev->ec_dev; in cros_pchg_probe() 281 charger->ec_dev = ec_dev; in cros_pchg_probe() [all …]
|
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()
|
/linux-6.1.9/drivers/regulator/ |
D | cros-ec-regulator.c | 17 struct cros_ec_device *ec_dev; member 33 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, in cros_ec_regulator_enable() 45 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_ENABLE, &cmd, in cros_ec_regulator_disable() 58 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_IS_ENABLED, &cmd, in cros_ec_regulator_is_enabled() 85 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_VOLTAGE, &cmd, in cros_ec_regulator_get_voltage() 111 return cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_SET_VOLTAGE, &cmd, in cros_ec_regulator_set_voltage() 133 ret = cros_ec_cmd(data->ec_dev, 0, EC_CMD_REGULATOR_GET_INFO, &cmd, in cros_ec_regulator_init_info() 172 drvdata->ec_dev = dev_get_drvdata(dev->parent); in cros_ec_regulator_probe()
|
/linux-6.1.9/drivers/input/keyboard/ |
D | cros_ec_keyb.c | 334 static int cros_ec_keyb_info(struct cros_ec_device *ec_dev, in cros_ec_keyb_info() argument 357 ret = cros_ec_cmd_xfer_status(ec_dev, msg); in cros_ec_keyb_info() 363 dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", in cros_ec_keyb_info() 366 dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n", in cros_ec_keyb_info() 393 struct cros_ec_device *ec_dev = ckdev->ec; in cros_ec_keyb_query_switches() local 397 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_CURRENT, in cros_ec_keyb_query_switches() 447 struct cros_ec_device *ec_dev = ckdev->ec; in cros_ec_keyb_register_bs() local 457 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED, in cros_ec_keyb_register_bs() 464 ret = cros_ec_keyb_info(ec_dev, EC_MKBP_INFO_SUPPORTED, in cros_ec_keyb_register_bs() 479 phys = devm_kasprintf(dev, GFP_KERNEL, "%s/input1", ec_dev->phys_name); in cros_ec_keyb_register_bs() [all …]
|
/linux-6.1.9/drivers/iio/pressure/ |
D | cros_ec_baro.c | 126 struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent); in cros_ec_baro_probe() local 132 if (!ec_dev || !ec_dev->ec_dev) { in cros_ec_baro_probe()
|