Home
last modified time | relevance | path

Searched full:ec (Results 1 – 25 of 642) sorted by relevance

12345678910>>...26

/linux/drivers/acpi/
H A Dec.c3 * ec.c - ACPI Embedded Controller Driver (v3)
17 #define pr_fmt(fmt) "ACPI: EC: " fmt
41 /* EC status register */
46 #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */
50 * This leads to lots of practical timing issues for the host EC driver.
51 * The following variations are defined (from the target EC firmware's
60 * kind of EC firmware has implemented an event queue and will
80 /* EC commands */
89 #define ACPI_EC_DELAY 500 /* Wait 500ms max. during EC ops */
91 #define ACPI_EC_UDELAY_POLL 550 /* Wait 1ms for EC transaction polling */
[all …]
/linux/arch/arm/mach-rpc/
H A Decard.c58 ecard_t *ec; member
70 void (*init)(ecard_t *ec);
77 static void atomwide_3p_quirk(ecard_t *ec);
121 struct expansion_card *ec = req->ec; in ecard_task_reset() local
124 res = ec->slot_no == 8 in ecard_task_reset()
125 ? &ec->resource[ECARD_RES_MEMC] in ecard_task_reset()
126 : ec->easi in ecard_task_reset()
127 ? &ec->resource[ECARD_RES_EASI] in ecard_task_reset()
128 : &ec->resource[ECARD_RES_IOCSYNC]; in ecard_task_reset()
130 ecard_loader_reset(res->start, ec->loader); in ecard_task_reset()
[all …]
/linux/drivers/platform/arm64/
H A Dlenovo-thinkpad-t14s.c76 * codes used by the EC. For example 0x16 (T14S_EC_EVT_KEY_FN_F7) is mapped
93 struct t14s_ec *ec; member
118 struct t14s_ec *ec = context; in t14s_ec_write() local
119 struct i2c_client *client = to_i2c_client(ec->dev); in t14s_ec_write()
134 struct t14s_ec *ec = context; in t14s_ec_read() local
135 struct i2c_client *client = to_i2c_client(ec->dev); in t14s_ec_read()
174 static int t14s_ec_read_evt(struct t14s_ec *ec, u8 *val) in t14s_ec_read_evt() argument
176 struct i2c_client *client = to_i2c_client(ec->dev); in t14s_ec_read_evt()
209 static void t14s_ec_write_sequence(struct t14s_ec *ec, u8 reg, u8 val, u8 cnt) in t14s_ec_write_sequence() argument
214 regmap_write(ec->regmap, reg, val); in t14s_ec_write_sequence()
[all …]
H A Dlenovo-yoga-c630.c38 static int yoga_c630_ec_request(struct yoga_c630_ec *ec, u8 *req, size_t req_len, in yoga_c630_ec_request() argument
43 lockdep_assert_held(&ec->lock); in yoga_c630_ec_request()
45 ret = i2c_smbus_write_i2c_block_data(ec->client, LENOVO_EC_REQUEST_REG, in yoga_c630_ec_request()
50 return i2c_smbus_read_i2c_block_data(ec->client, LENOVO_EC_RESPONSE_REG, in yoga_c630_ec_request()
54 int yoga_c630_ec_read8(struct yoga_c630_ec *ec, u8 addr) in yoga_c630_ec_read8() argument
60 guard(mutex)(&ec->lock); in yoga_c630_ec_read8()
63 ret = yoga_c630_ec_request(ec, req, sizeof(req), &val, 1); in yoga_c630_ec_read8()
71 int yoga_c630_ec_read16(struct yoga_c630_ec *ec, u8 addr) in yoga_c630_ec_read16() argument
82 guard(mutex)(&ec->lock); in yoga_c630_ec_read16()
85 ret = yoga_c630_ec_request(ec, req, sizeof(req), &lsb, 1); in yoga_c630_ec_read16()
[all …]
H A Dhuawei-gaokun-ec.c3 * huawei-gaokun-ec - An EC driver for HUAWEI Matebook E Go
19 #include <linux/platform_data/huawei-gaokun-ec.h>
118 struct mutex lock; /* EC transaction lock */
125 static int gaokun_ec_request(struct gaokun_ec *ec, const u8 *req, in gaokun_ec_request() argument
128 struct i2c_client *client = ec->client; in gaokun_ec_request()
144 guard(mutex)(&ec->lock); in gaokun_ec_request()
153 dev_err(&client->dev, "EC transaction error %d\n", ret); in gaokun_ec_request()
165 * gaokun_ec_read - Read from EC
166 * @ec: The gaokun_ec structure
171 * This function is used to read data after writing a magic sequence to EC.
[all …]
H A Dacer-aspire1-ec.c94 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()
[all …]
/linux/drivers/md/
H A Ddm-ebs-target.c37 static inline sector_t __sector_to_block(struct ebs_c *ec, sector_t sector) in __sector_to_block() argument
39 return sector >> ec->block_shift; in __sector_to_block()
48 static inline unsigned int __nr_blocks(struct ebs_c *ec, struct bio *bio) in __nr_blocks() argument
50 sector_t end_sector = __block_mod(bio->bi_iter.bi_sector, ec->u_bs) + bio_sectors(bio); in __nr_blocks()
52 return __sector_to_block(ec, end_sector) + (__block_mod(end_sector, ec->u_bs) ? 1 : 0); in __nr_blocks()
65 static int __ebs_rw_bvec(struct ebs_c *ec, enum req_op op, struct bio_vec *bv, in __ebs_rw_bvec() argument
72 unsigned int buf_off = to_bytes(__block_mod(iter->bi_sector, ec->u_bs)); in __ebs_rw_bvec()
73 sector_t block = __sector_to_block(ec, iter->bi_sector); in __ebs_rw_bvec()
83 cur_len = min(dm_bufio_get_block_size(ec->bufio) - buf_off, bv_len); in __ebs_rw_bvec()
86 if (op == REQ_OP_READ || buf_off || bv_len < dm_bufio_get_block_size(ec->bufio)) in __ebs_rw_bvec()
[all …]
/linux/drivers/platform/chrome/wilco_ec/
H A Dcore.c7 * This is the entry point for the drivers that control the Wilco EC.
15 #include <linux/platform_data/wilco-ec.h>
20 #define DRV_NAME "wilco-ec"
41 struct wilco_ec_device *ec; in wilco_ec_probe() local
44 ec = devm_kzalloc(dev, sizeof(*ec), GFP_KERNEL); in wilco_ec_probe()
45 if (!ec) in wilco_ec_probe()
48 platform_set_drvdata(pdev, ec); in wilco_ec_probe()
49 ec->dev = dev; in wilco_ec_probe()
50 mutex_init(&ec->mailbox_lock); in wilco_ec_probe()
52 ec->data_size = sizeof(struct wilco_ec_response) + EC_MAILBOX_DATA_SIZE; in wilco_ec_probe()
[all …]
H A Dmailbox.c7 * The Wilco EC is similar to a typical ChromeOS embedded controller.
9 * protocol, but with some important differences. The EC firmware does
21 #include <linux/platform_data/wilco-ec.h>
32 /* Version of EC protocol */
41 /* EC response flags */
43 #define EC_CMDR_PENDING BIT(1) /* Write pending to EC */
44 #define EC_CMDR_BUSY BIT(2) /* EC is busy processing a command */
48 * wilco_ec_response_timed_out() - Wait for EC response.
49 * @ec: EC device.
51 * Return: true if EC timed out, false if EC did not time out.
[all …]
H A Dkeyboard_leds.c7 * Since the EC will never change the backlight level of its own accord,
14 #include <linux/platform_data/wilco-ec.h>
22 struct wilco_ec_device *ec; member
33 * struct wilco_keyboard_leds_msg - Message to/from EC for keyboard LED control.
35 * @status: Set by EC to 0 on success, 0xFF on failure.
55 static int send_kbbl_msg(struct wilco_ec_device *ec, in send_kbbl_msg() argument
69 ret = wilco_ec_mailbox(ec, &msg); in send_kbbl_msg()
71 dev_err(ec->dev, in send_kbbl_msg()
79 static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) in set_kbbl() argument
91 ret = send_kbbl_msg(ec, &request, &response); in set_kbbl()
[all …]
/linux/drivers/platform/olpc/
H A Dolpc-ec.c19 #include <linux/olpc-ec.h>
42 /* Pending EC commands */
49 * EC event mask to be applied during suspend (defining wakeup
55 * Running an EC command while suspending means we don't always finish
56 * the command before the machine suspends. This means that the EC
58 * of time (while the OS is asleep) the EC times out and restarts its
61 * the EC... and everyone's uphappy.
79 struct olpc_ec_priv *ec = container_of(w, struct olpc_ec_priv, worker); in olpc_ec_worker() local
84 spin_lock_irqsave(&ec->cmd_q_lock, flags); in olpc_ec_worker()
85 if (!list_empty(&ec->cmd_q)) { in olpc_ec_worker()
[all …]
/linux/drivers/mfd/
H A Dcros_ec_dev.c20 #define DRV_NAME "cros-ec-dev"
74 { .name = "cros-ec-cec", },
78 { .name = "cros-ec-gpio", },
82 { .name = "cros-ec-rtc", },
86 { .name = "cros-ec-sensorhub", },
99 { .name = "cros-ec-wdt", }
103 { .name = "cros-ec-led", },
162 { .name = "cros-ec-chardev", },
163 { .name = "cros-ec-debugfs", },
164 { .name = "cros-ec-hwmon", },
[all …]
H A Dntxec.c150 struct ntxec *ec; in ntxec_probe() local
156 ec = devm_kmalloc(&client->dev, sizeof(*ec), GFP_KERNEL); in ntxec_probe()
157 if (!ec) in ntxec_probe()
160 ec->dev = &client->dev; in ntxec_probe()
162 ec->regmap = devm_regmap_init_i2c(client, &regmap_config); in ntxec_probe()
163 if (IS_ERR(ec->regmap)) { in ntxec_probe()
164 dev_err(ec->dev, "Failed to set up regmap for device\n"); in ntxec_probe()
165 return PTR_ERR(ec->regmap); in ntxec_probe()
169 res = regmap_read(ec->regmap, NTXEC_REG_VERSION, &version); in ntxec_probe()
171 dev_err(ec->dev, "Failed to read firmware version number\n"); in ntxec_probe()
[all …]
/linux/Documentation/devicetree/bindings/embedded-controller/
H A Dgoogle,cros-ec.yaml4 $id: http://devicetree.org/schemas/embedded-controller/google,cros-ec.yaml#
14 Google's ChromeOS EC is a microcontroller which talks to the AP and
16 The EC can be connected through various interfaces (I2C, SPI, and others)
23 For implementations of the EC connected through I2C.
24 const: google,cros-ec-i2c
26 For implementations of the EC connected through SPI.
27 const: google,cros-ec-spi
31 - const: google,cros-ec-fp
32 - const: google,cros-ec-spi
34 For implementations of the EC connected through RPMSG.
[all …]
/linux/crypto/
H A Djitterentropy.c183 static void jent_apt_init(struct rand_data *ec, unsigned int osr) in jent_apt_init() argument
190 ec->apt_cutoff = jent_apt_cutoff_lookup[ in jent_apt_init()
192 ec->apt_cutoff_permanent = jent_apt_cutoff_permanent_lookup[ in jent_apt_init()
195 ec->apt_cutoff = jent_apt_cutoff_lookup[osr - 1]; in jent_apt_init()
196 ec->apt_cutoff_permanent = in jent_apt_init()
203 * @ec [in] Reference to entropy collector
205 static void jent_apt_reset(struct rand_data *ec, unsigned int delta_masked) in jent_apt_reset() argument
208 ec->apt_count = 0; in jent_apt_reset()
209 ec->apt_base = delta_masked; in jent_apt_reset()
210 ec->apt_observations = 0; in jent_apt_reset()
[all …]
/linux/drivers/platform/chrome/
H A Dcros_ec_sensorhub.c21 #define DRV_NAME "cros-ec-sensorhub"
57 struct cros_ec_dev *ec = sensorhub->ec; in cros_ec_sensorhub_register() local
72 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in cros_ec_sensorhub_register()
74 /* The EC is still busy initializing sensors. */ in cros_ec_sensorhub_register()
81 dev_err(dev, "no info for EC sensor %d : %d/%d\n", in cros_ec_sensorhub_register()
92 name = "cros-ec-accel"; in cros_ec_sensorhub_register()
95 name = "cros-ec-baro"; in cros_ec_sensorhub_register()
98 name = "cros-ec-gyro"; in cros_ec_sensorhub_register()
101 name = "cros-ec-mag"; in cros_ec_sensorhub_register()
104 name = "cros-ec-prox"; in cros_ec_sensorhub_register()
[all …]
H A Dcros_ec_debugfs.c2 // Debug logs for the ChromeOS EC
21 #define DRV_NAME "cros-ec-debugfs"
31 MODULE_PARM_DESC(log_poll_period_ms, "EC log polling period(ms)");
37 * struct cros_ec_debugfs - EC debugging information.
39 * @ec: EC device this debugfs information belongs to
42 * @read_msg: preallocated EC command and buffer to read console log
44 * @log_poll_work: recurring task to poll EC for new console log data
47 * when EC panic
50 struct cros_ec_dev *ec; member
52 /* EC log */
[all …]
H A DKconfig81 Controller (EC) providing keyboard, battery and power services.
83 protocol for talking to the EC is defined by the bus driver.
94 EC through an I2C bus. This uses a simple byte-level protocol with
102 If you say Y here, you get support for talking to the ChromeOS EC
104 checksum. Also since there's no addition EC-to-host interrupt, this
115 If you say Y here, you get support for talking to the ChromeOS EC
128 If you say Y here, you get support for talking to the ChromeOS EC
129 through a SPI bus, using a byte-level protocol. Since the EC's
137 If you say Y here, you get support for talking to the ChromeOS EC
148 If you say Y here, you get support for talking to the ChromeOS EC
[all …]
H A Dcros_ec_proto.c2 // ChromeOS EC communication protocol helper functions
117 int (*xfer_fxn)(struct cros_ec_device *ec, struct cros_ec_command *msg); in cros_ec_xfer_command()
127 * the EC is trying to use protocol v2, on an underlying in cros_ec_xfer_command()
130 dev_err_once(ec_dev->dev, "missing EC transfer API, cannot send command\n"); in cros_ec_xfer_command()
154 /* Query the EC's status until it's no longer busy or we encounter an error. */ in cros_ec_wait_until_complete()
198 * This is used by all ChromeOS EC drivers to prepare the outgoing message
215 * @ec_dev: EC device.
218 * This is used by ChromeOS EC drivers to check the ec_msg->result for
249 * @ec_dev: EC device to call
322 * is not supported or EC is already in RW, so there is in cros_ec_rwsig_continue()
[all …]
/linux/drivers/edac/
H A Dmce_amd.c147 static bool f12h_mc0_mce(u16 ec, u8 xec) in f12h_mc0_mce() argument
151 if (MEM_ERROR(ec)) { in f12h_mc0_mce()
152 u8 ll = LL(ec); in f12h_mc0_mce()
158 pr_cont("Data/Tag %s error.\n", R4_MSG(ec)); in f12h_mc0_mce()
165 static bool f10h_mc0_mce(u16 ec, u8 xec) in f10h_mc0_mce() argument
167 if (R4(ec) == R4_GEN && LL(ec) == LL_L1) { in f10h_mc0_mce()
171 return f12h_mc0_mce(ec, xec); in f10h_mc0_mce()
174 static bool k8_mc0_mce(u16 ec, u8 xec) in k8_mc0_mce() argument
176 if (BUS_ERROR(ec)) { in k8_mc0_mce()
181 return f10h_mc0_mce(ec, xec); in k8_mc0_mce()
[all …]
/linux/include/linux/platform_data/
H A Dwilco-ec.h15 #define WILCO_EC_FLAG_NO_RESPONSE BIT(0) /* EC does not respond */
31 * @data_buffer: Buffer used for EC communication. The same buffer
33 * @data_size: Size of the data buffer used for EC communication.
75 * @result: Result code from the EC. Non-zero indicates an error.
91 * @WILCO_EC_MSG_LEGACY: Legacy EC messages for standard EC behavior.
92 * @WILCO_EC_MSG_PROPERTY: Get/Set/Sync EC controlled NVRAM property.
93 * @WILCO_EC_MSG_TELEMETRY: Request telemetry data from the EC.
105 * @request_size: Number of bytes to send to the EC.
107 * @response_size: Number of bytes to read from EC.
121 * wilco_ec_mailbox() - Send request to the EC and receive the response.
[all …]
H A Dcros_ec_proto.h29 * The EC is unresponsive for a time after a reboot command. Add a
56 * EC panic is not covered by the standard (0-F) ACPI notify values.
57 * Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF
63 * Command interface between EC and AP, for LPC, I2C and SPI interfaces.
80 * struct cros_ec_command - Information about a ChromeOS EC command.
84 * @insize: Max number of bytes to accept from the EC.
85 * @result: EC's response to the command (separate from communication failure).
86 * @data: Where to put the incoming data from EC and outgoing data to EC.
98 * struct cros_ec_device - Information about a ChromeOS EC device.
102 * @cmd_readmem: Direct read of the EC memory-mapped region, if supported.
[all …]
/linux/Documentation/ABI/testing/
H A Ddebugfs-cros-ec1 What: /sys/kernel/debug/<cros-ec-device>/console_log
5 If the EC supports the CONSOLE_READ command type, this file
6 can be used to grab the EC logs. The kernel polls for the log
10 What: /sys/kernel/debug/<cros-ec-device>/panicinfo
14 This file dumps the EC panic information from the previous
16 type is supported by the EC.
18 What: /sys/kernel/debug/<cros-ec-device>/pdinfo
27 What: /sys/kernel/debug/<cros-ec-device>/uptime
31 A u32 providing the time since EC booted in ms. This is
32 is used for synchronizing the AP host time with the EC
[all …]
/linux/drivers/ata/
H A Dpata_icside.c64 struct expansion_card *ec; member
83 /* Prototype: pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr)
86 static void pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr) in pata_icside_irqenable_arcin_v5() argument
88 struct pata_icside_state *state = ec->irq_data; in pata_icside_irqenable_arcin_v5()
93 /* Prototype: pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr)
96 static void pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr) in pata_icside_irqdisable_arcin_v5() argument
98 struct pata_icside_state *state = ec->irq_data; in pata_icside_irqdisable_arcin_v5()
110 /* Prototype: pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
113 static void pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr) in pata_icside_irqenable_arcin_v6() argument
115 struct pata_icside_state *state = ec->irq_data; in pata_icside_irqenable_arcin_v6()
[all …]
/linux/drivers/pwm/
H A Dpwm-cros-ec.c3 * Expose a PWM controlled by the ChromeOS EC to the host processor.
19 * struct cros_ec_pwm_device - Driver data for EC PWM
21 * @ec: Pointer to EC device
25 struct cros_ec_device *ec; member
51 struct cros_ec_device *ec = ec_pwm->ec; in cros_ec_pwm_set_duty() local
71 dev_err(ec->dev, "Invalid PWM type index: %d\n", index); in cros_ec_pwm_set_duty()
80 return cros_ec_cmd_xfer_status(ec, msg); in cros_ec_pwm_set_duty()
83 static int cros_ec_pwm_get_duty(struct cros_ec_device *ec, bool use_pwm_type, u8 index) in cros_ec_pwm_get_duty() argument
106 dev_err(ec->dev, "Invalid PWM type index: %d\n", index); in cros_ec_pwm_get_duty()
115 ret = cros_ec_cmd_xfer_status(ec, msg); in cros_ec_pwm_get_duty()
[all …]

12345678910>>...26