/linux/drivers/misc/echo/ |
H A D | echo.c | 106 static inline void lms_adapt_bg(struct oslec_state *ec, int clean, int shift) in lms_adapt_bg() argument 122 offset2 = ec->curr_pos; in lms_adapt_bg() 123 offset1 = ec->taps - offset2; in lms_adapt_bg() 125 for (i = ec->taps - 1; i >= offset1; i--) { in lms_adapt_bg() 126 exp = (ec->fir_state_bg.history[i - offset1] * factor); in lms_adapt_bg() 127 ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); in lms_adapt_bg() 130 exp = (ec->fir_state_bg.history[i + offset2] * factor); in lms_adapt_bg() 131 ec->fir_taps16[1][i] += (int16_t) ((exp + (1 << 14)) >> 15); in lms_adapt_bg() 145 struct oslec_state *ec; in oslec_create() local 149 ec = kzalloc(sizeof(*ec), GFP_KERNEL); in oslec_create() [all …]
|
/linux/drivers/acpi/ |
H A D | ec.c | 3 * ec.c - ACPI Embedded Controller Driver (v3) 17 #define pr_fmt(fmt) "ACPI: EC: " fmt 38 /* EC status register */ 43 #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ 47 * This leads to lots of practical timing issues for the host EC driver. 48 * The following variations are defined (from the target EC firmware's 57 * kind of EC firmware has implemented an event queue and will 77 /* EC commands */ 86 #define ACPI_EC_DELAY 500 /* Wait 500ms max. during EC ops */ 88 #define ACPI_EC_UDELAY_POLL 550 /* Wait 1ms for EC transaction polling */ [all …]
|
/linux/arch/arm/mach-rpc/ |
H A D | ecard.c | 58 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/md/ |
H A D | dm-ebs-target.c | 37 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 D | core.c | 7 * 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 D | mailbox.c | 7 * 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 D | keyboard_leds.c | 7 * 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 D | olpc-ec.c | 19 #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/platform/arm64/ |
H A D | lenovo-yoga-c630.c | 38 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 D | acer-aspire1-ec.c | 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() [all …]
|
/linux/Documentation/devicetree/bindings/mfd/ |
H A D | google,cros-ec.yaml | 4 $id: http://devicetree.org/schemas/mfd/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/drivers/mfd/ |
H A D | cros_ec_dev.c | 20 #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", }, 100 { .name = "cros-ec-wdt", } 104 { .name = "cros-ec-led", }, 150 { .name = "cros-ec-chardev", }, 151 { .name = "cros-ec-debugfs", }, 152 { .name = "cros-ec-hwmon", }, [all …]
|
H A D | ntxec.c | 150 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, ®map_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/drivers/edac/ |
H A D | mce_amd.c | 146 static bool f12h_mc0_mce(u16 ec, u8 xec) in f12h_mc0_mce() argument 150 if (MEM_ERROR(ec)) { in f12h_mc0_mce() 151 u8 ll = LL(ec); in f12h_mc0_mce() 157 pr_cont("Data/Tag %s error.\n", R4_MSG(ec)); in f12h_mc0_mce() 164 static bool f10h_mc0_mce(u16 ec, u8 xec) in f10h_mc0_mce() argument 166 if (R4(ec) == R4_GEN && LL(ec) == LL_L1) { in f10h_mc0_mce() 170 return f12h_mc0_mce(ec, xec); in f10h_mc0_mce() 173 static bool k8_mc0_mce(u16 ec, u8 xec) in k8_mc0_mce() argument 175 if (BUS_ERROR(ec)) { in k8_mc0_mce() 180 return f10h_mc0_mce(ec, xec); in k8_mc0_mce() [all …]
|
/linux/crypto/ |
H A D | jitterentropy.c | 183 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 D | cros_ec_sensorhub.c | 20 #define DRV_NAME "cros-ec-sensorhub" 55 struct cros_ec_dev *ec = sensorhub->ec; in cros_ec_sensorhub_register() local 68 ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); in cros_ec_sensorhub_register() 70 dev_warn(dev, "no info for EC sensor %d : %d/%d\n", in cros_ec_sensorhub_register() 77 name = "cros-ec-accel"; in cros_ec_sensorhub_register() 80 name = "cros-ec-baro"; in cros_ec_sensorhub_register() 83 name = "cros-ec-gyro"; in cros_ec_sensorhub_register() 86 name = "cros-ec-mag"; in cros_ec_sensorhub_register() 89 name = "cros-ec-prox"; in cros_ec_sensorhub_register() 92 name = "cros-ec-light"; in cros_ec_sensorhub_register() [all …]
|
H A D | Kconfig | 70 Controller (EC) providing keyboard, battery and power services. 72 protocol for talking to the EC is defined by the bus driver. 83 EC through an I2C bus. This uses a simple byte-level protocol with 91 If you say Y here, you get support for talking to the ChromeOS EC 93 checksum. Also since there's no addition EC-to-host interrupt, this 104 If you say Y here, you get support for talking to the ChromeOS EC 117 If you say Y here, you get support for talking to the ChromeOS EC 118 through a SPI bus, using a byte-level protocol. Since the EC's 126 If you say Y here, you get support for talking to the ChromeOS EC 137 If you say Y here, you get support for talking to the ChromeOS EC [all …]
|
H A D | cros_ec.c | 3 * ChromeOS EC multi-function device 7 * The ChromeOS EC multi function device is used to mux all the requests 8 * to the EC device for its multiple features: keyboard controller, 50 * cros_ec_handle_event() - process and forward pending events on EC 53 * Call this function in a loop when the kernel is notified that the EC has 145 "EC detected sleep transition timeout. Total sleep transitions: %d", in cros_ec_sleep_event() 172 * cros_ec_register() - Register a new ChromeOS EC, using the provided info. 191 ec_dev->ec = NULL; in cros_ec_register() 209 dev_err(dev, "Cannot identify the EC: error %d\n", err); in cros_ec_register() 218 "chromeos-ec", ec_dev); in cros_ec_register() [all …]
|
/linux/include/linux/platform_data/ |
H A D | wilco-ec.h | 15 #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 D | cros_ec_proto.h | 29 * The EC is unresponsive for a time after a reboot command. Add a 45 * EC panic is not covered by the standard (0-F) ACPI notify values. 46 * Arbitrarily choosing B0 to notify ec panic, which is in the 84-BF 52 * Command interface between EC and AP, for LPC, I2C and SPI interfaces. 69 * struct cros_ec_command - Information about a ChromeOS EC command. 73 * @insize: Max number of bytes to accept from the EC. 74 * @result: EC's response to the command (separate from communication failure). 75 * @data: Where to put the incoming data from EC and outgoing data to EC. 87 * struct cros_ec_device - Information about a ChromeOS EC device. 91 * @cmd_readmem: Direct read of the EC memory-mapped region, if supported. [all …]
|
/linux/Documentation/ABI/testing/ |
H A D | debugfs-cros-ec | 1 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 D | pata_icside.c | 64 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 D | pwm-cros-ec.c | 3 * 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 72 dev_err(ec->dev, "Invalid PWM type index: %d\n", index); in cros_ec_pwm_set_duty() 81 return cros_ec_cmd_xfer_status(ec, msg); in cros_ec_pwm_set_duty() 84 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 108 dev_err(ec->dev, "Invalid PWM type index: %d\n", index); in cros_ec_pwm_get_duty() 117 ret = cros_ec_cmd_xfer_status(ec, msg); in cros_ec_pwm_get_duty() [all …]
|
/linux/drivers/scsi/arm/ |
H A D | powertec.c | 62 struct expansion_card *ec; member 68 /* Prototype: void powertecscsi_irqenable(ec, irqnr) 70 * Params : ec - expansion card structure 74 powertecscsi_irqenable(struct expansion_card *ec, int irqnr) in powertecscsi_irqenable() argument 76 struct powertec_info *info = ec->irq_data; in powertecscsi_irqenable() 80 /* Prototype: void powertecscsi_irqdisable(ec, irqnr) 82 * Params : ec - expansion card structure 86 powertecscsi_irqdisable(struct expansion_card *ec, int irqnr) in powertecscsi_irqdisable() argument 88 struct powertec_info *info = ec->irq_data; in powertecscsi_irqdisable() 193 host->hostt->name, info->info.scsi.type, info->ec->slot_no, in powertecscsi_info() [all …]
|
/linux/arch/arm/include/asm/ |
H A D | ecard.h | 113 void (*irqenable)(ecard_t *ec, int irqnr); 114 void (*irqdisable)(ecard_t *ec, int irqnr); 115 int (*irqpending)(ecard_t *ec); 116 void (*fiqenable)(ecard_t *ec, int fiqnr); 117 void (*fiqdisable)(ecard_t *ec, int fiqnr); 118 int (*fiqpending)(ecard_t *ec); 130 #define ecard_resource_start(ec,nr) ((ec)->resource[nr].start) argument 131 #define ecard_resource_end(ec,nr) ((ec)->resource[nr].end) argument 132 #define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \ argument 133 (ec)->resource[nr].start + 1) [all …]
|