type
stringclasses
5 values
content
stringlengths
9
163k
functions
void baseband_xmm_power_init1_work(struct work_struct *work) { int value; pr_info("%s {\n", __func__); /* check if IPC_HSIC_ACTIVE high */ value = gpio_get_value(baseband_power_driver_data-> modem.xmm.ipc_hsic_active); if (value != 1) { pr_err("%s - expected IPC_HSIC_ACTIVE high!\n", __func__); return; }
functions
void baseband_xmm_power_init2_work(struct work_struct *work) { struct baseband_power_platform_data *data = baseband_power_driver_data; pr_info("%s\n", __func__); /* check input */ if (!data) return; /* register usb host controller only once */ if (register_hsic_device) { if (data->hsic_register) data->m...
functions
void baseband_xmm_power_L2_resume(void) { struct baseband_power_platform_data *data = baseband_power_driver_data; int value; unsigned long flags; pr_info("%s\n", __func__); if (!baseband_power_driver_data) return; /* claim the wakelock here to avoid any system suspend */ if (!wake_lock_active(&wakelock)) #if...
functions
void baseband_xmm_power_shortsusp(struct work_struct *work) { if (!usbdev || !&usbdev->dev) { pr_err("%s usbdev is invalid\n", __func__); return; }
functions
void baseband_xmm_power_defaultsusp(struct work_struct *work) { if (!usbdev || !&usbdev->dev) { pr_err("%s usbdev is invalid\n", __func__); return; }
functions
void baseband_xmm_power_L2_resume_work(struct work_struct *work) { struct usb_interface *intf; pr_info("%s {\n", __func__); if (!usbdev) { pr_info("%s - !usbdev\n", __func__); return; }
functions
void baseband_xmm_power_reset_on(void) { /* reset / power on sequence */ msleep(40); gpio_set_value(baseband_power_driver_data->modem.xmm.bb_rst, 1); msleep(1); gpio_set_value(baseband_power_driver_data->modem.xmm.bb_on, 1); udelay(40); gpio_set_value(baseband_power_driver_data->modem.xmm.bb_on, 0); }
functions
void baseband_xmm_power_work_func(struct work_struct *work) { struct baseband_xmm_power_work_t *bbxmm_work = (struct baseband_xmm_power_work_t *) work; pr_info("%s - work->sate=%d\n", __func__, bbxmm_work->state); switch (bbxmm_work->state) { case BBXMM_WORK_UNINIT: pr_info("BBXMM_WORK_UNINIT\n"); break; c...
functions
void baseband_xmm_device_add_handler(struct usb_device *udev) { struct usb_interface *intf = usb_ifnum_to_if(udev, 0); const struct usb_device_id *id; pr_info("%s \n",__func__); if (intf == NULL) return; id = usb_match_id(intf, xmm_pm_ids); if (id) { pr_info("persist_enabled: %u\n", udev->persist_enabled)...
functions
void baseband_xmm_device_remove_handler(struct usb_device *udev) { if (usbdev == udev) { pr_info("Remove device %d <%s %s>\n", udev->devnum, udev->manufacturer, udev->product); usbdev = 0; }
functions
int usb_xmm_notify(struct notifier_block *self, unsigned long action, void *blob) { switch (action) { case USB_DEVICE_ADD: baseband_xmm_device_add_handler(blob); break; case USB_DEVICE_REMOVE: baseband_xmm_device_remove_handler(blob); break; }
functions
int baseband_xmm_power_pm_notifier_event(struct notifier_block *this, unsigned long event, void *ptr) { struct baseband_power_platform_data *data = baseband_power_driver_data; unsigned long flags; if (!data) return NOTIFY_DONE; pr_info("%s: event %ld\n", __func__, event); switch (event) { case PM_SUSP...
functions
int baseband_xmm_power_driver_probe(struct platform_device *device) { struct baseband_power_platform_data *data = (struct baseband_power_platform_data *) device->dev.platform_data; struct device *dev = &device->dev; unsigned long flags; int err, ret=0; pr_info(MODULE_NAME"%s 0705 - xmm_wake_pin_miss. \n", _...
functions
int baseband_xmm_power_driver_remove(struct platform_device *device) { struct baseband_power_platform_data *data = (struct baseband_power_platform_data *) device->dev.platform_data; struct device *dev = &device->dev; pr_info("%s\n", __func__); /* check for platform data */ if (!data) return 0; unregiste...
functions
int baseband_xmm_power_driver_handle_resume( struct baseband_power_platform_data *data) { int value; unsigned long flags; unsigned long timeout; int delay = 10000; /* maxmum delay in msec */ //pr_info("%s\n", __func__); /* check for platform data */ if (!data) return 0; /* check if modem is on */ if (...
functions
int baseband_xmm_power_driver_suspend(struct device *dev) { // int delay = 10000; /* maxmum delay in msec */ // struct platform_device *pdev = to_platform_device(dev); //struct baseband_power_platform_data *pdata = pdev->dev.platform_data; //pr_info("%s\n", __func__); /* check if modem is on */ if (power_on...
functions
int baseband_xmm_power_driver_suspend(struct device *dev) { pr_info("%s\n", __func__); return 0; }
functions
int baseband_xmm_power_driver_resume(struct device *dev) { //struct platform_device *pdev = to_platform_device(dev); //struct baseband_power_platform_data *data // = (struct baseband_power_platform_data *) // pdev->dev.platform_data; pr_info("%s\n", __func__); #ifdef CONFIG_REMOVE_HSIC_L3_STATE /* check if mode...
functions
int baseband_xmm_power_suspend_noirq(struct device *dev) { unsigned long flags; pr_info("%s\n", __func__); spin_lock_irqsave(&xmm_lock, flags); system_suspending = false; if (wakeup_pending) { wakeup_pending = false; spin_unlock_irqrestore(&xmm_lock, flags); pr_info("%s:**Abort Suspend: reason CP WAKEUP**\n...
functions
int baseband_xmm_power_resume_noirq(struct device *dev) { pr_info("%s\n", __func__); return 0; }
functions
__init baseband_xmm_power_init(void) { /* HTC */ int mfg_mode = board_mfg_mode(); host_dbg_flag = 0; //pr_info("%s - host_dbg_flag<0x%x>, modem_ver<0x%x>, mfg_mode<%d>" // , __func__, host_dbg_flag, modem_ver, mfg_mode); if( mfg_mode ) { autosuspend_delay = 365*86400; short_autosuspend_delay = 365*86400; ...
functions
__exit baseband_xmm_power_exit(void) { pr_info("%s\n", __func__); platform_driver_unregister(&baseband_power_driver); //pm_qos_remove_request(&modem_boost_cpu_freq_req); }
functions
void save_orig_palette() { int i; for (i = 0; colors[i].fullname[0] != '\0'; i++) { color_content(colors[i].short_value, &original_colors[i].r, &original_colors[i].g, &original_colors[i].b); }
functions
void load_orig_palette() { int i; for (i = 0; colors[i].fullname[0] != '\0'; i++) { init_color(colors[i].short_value, original_colors[i].r, original_colors[i].g, original_colors[i].b); }
functions
void set_palette() { int i; if (can_change_color()) { for (i = 0; colors[i].fullname[0] != '\0'; i++) { if (init_color (colors[i].short_value, C_r(i), C_g(i), C_b(i)) == ERR) fprintf(stderr, "Failed to set [%d] color!\n", i); if (C_s(i) <= 7) { init_pair(i + 1, C_s(i), C_s(0)); ...
functions
else if (str[0] == 'b' || str[0] == 'B') { value = strtol(str + 1, NULL, 2); }
functions
else if (str[0] == '0') { value = strtol(str, NULL, 16); for (n = 0; n < strlen(str); n++) { if (!isxdigit(str[n])) { value = -1; break; }
functions
else if (str[0] == 'b' || str[0] == 'B') { value = strtol(str + 1, NULL, 2); }
functions
else if (str[0] == '0') { value = strtol(str, NULL, 16); for (n = 0; n < strlen(str); n++) { if (!isxdigit(str[n])) { value = -1; break; }
includes
#include <bsp/_bsp.h>
includes
#include <linux/module.h>
includes
#include <linux/init.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/completion.h>
includes
#include <linux/device.h>
includes
#include <linux/delay.h>
includes
#include <linux/pagemap.h>
includes
#include <linux/err.h>
includes
#include <linux/leds.h>
includes
#include <linux/scatterlist.h>
includes
#include <linux/log2.h>
includes
#include <linux/regulator/consumer.h>
includes
#include <linux/pm_runtime.h>
includes
#include <linux/suspend.h>
includes
#include <linux/fault-inject.h>
includes
#include <linux/random.h>
includes
#include <linux/wakelock.h>
includes
#include <linux/pm.h>
includes
#include <linux/slab.h>
includes
#include <linux/jiffies.h>
includes
#include <linux/mmc/card.h>
includes
#include <linux/mmc/host.h>
includes
#include <linux/mmc/mmc.h>
includes
#include <linux/mmc/sd.h>
includes
#include <trace/events/mmc.h>
defines
#define CREATE_TRACE_POINTS
defines
#define MMC_CORE_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */
defines
#define MMC_BKOPS_MAX_TIMEOUT (30 * 1000) /* max time to wait in ms */
defines
#define MMC_FLUSH_REQ_TIMEOUT_MS 30000 /* msec */
functions
int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay) { return queue_delayed_work(workqueue, work, delay); }
functions
void mmc_flush_scheduled_work(void) { flush_workqueue(workqueue); }
functions
void mmc_should_fail_request(struct mmc_host *host, struct mmc_request *mrq) { struct mmc_command *cmd = mrq->cmd; struct mmc_data *data = mrq->data; static const int data_errors[] = { -ETIMEDOUT, -EILSEQ, -EIO, }
functions
void mmc_should_fail_request(struct mmc_host *host, struct mmc_request *mrq) { }
functions
void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) { struct mmc_command *cmd = mrq->cmd; int err = cmd->error; #ifdef CONFIG_MMC_PERF_PROFILING ktime_t diff; #endif if (host->card && host->clk_scaling.enable) host->clk_scaling.busy_time_us += ktime_to_us(ktime_sub(ktime_get(), host->clk...
functions
CONFIG_MMC_PERF_PROFILING if (host->perf_enable) { diff = ktime_sub(ktime_get(), host->perf.start); if (mrq->data->flags == MMC_DATA_READ) { host->perf.rbytes_drv += mrq->data->bytes_xfered; host->perf.rtime_drv = ktime_add(host->perf.rtime_drv, diff); }
functions
void mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) { #ifdef CONFIG_MMC_DEBUG unsigned int i, sz; struct scatterlist *sg; #endif if (mrq->sbc) { pr_debug("<%s: starting CMD%u arg %08x flags %08x>\n", mmc_hostname(host), mrq->sbc->opcode, mrq->sbc->arg, mrq->sbc->flags); }
functions
void mmc_start_delayed_bkops(struct mmc_card *card) { if (!card || !card->ext_csd.bkops_en || mmc_card_doing_bkops(card)) return; if (card->bkops_info.sectors_changed < card->bkops_info.min_sectors_to_queue_delayed_work) return; pr_debug("%s: %s: queueing delayed_bkops_work\n", mmc_hostname(card->host)...
functions
void mmc_start_bkops(struct mmc_card *card, bool from_exception) { int err; BUG_ON(!card); if (!card->ext_csd.bkops_en) return; if ((card->bkops_info.cancel_delayed_work) && !from_exception) { pr_debug("%s: %s: cancel_delayed_work was set, exit\n", mmc_hostname(card->host), __func__); card->bkops_info.c...
functions
void mmc_start_idle_time_bkops(struct work_struct *work) { struct mmc_card *card = container_of(work, struct mmc_card, bkops_info.dw.work); /* * Prevent a race condition between mmc_stop_bkops and the delayed * BKOPS work in case the delayed work is executed on another CPU */ if (card->bkops_info.cancel_de...
functions
void mmc_wait_done(struct mmc_request *mrq) { complete(&mrq->completion); }
functions
int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq) { init_completion(&mrq->completion); mrq->done = mmc_wait_done; if (mmc_card_removed(host->card)) { mrq->cmd->error = -ENOMEDIUM; complete(&mrq->completion); return -ENOMEDIUM; }
functions
void mmc_wait_for_req_done(struct mmc_host *host, struct mmc_request *mrq) { struct mmc_command *cmd; while (1) { wait_for_completion_io(&mrq->completion); cmd = mrq->cmd; /* * If host has timed out waiting for the commands which can be * HPIed then let the caller handle the timeout error as it m...
functions
void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq, bool is_first_req) { if (host->ops->pre_req) { mmc_host_clk_hold(host); host->ops->pre_req(host, mrq, is_first_req); mmc_host_clk_release(host); }
functions
void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq, int err) { if (host->ops->post_req) { mmc_host_clk_hold(host); host->ops->post_req(host, mrq, err); mmc_host_clk_release(host); }
functions
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { __mmc_start_req(host, mrq); mmc_wait_for_req_done(host, mrq); }
functions
bool mmc_card_is_prog_state(struct mmc_card *card) { bool rc; struct mmc_command cmd; mmc_claim_host(card->host); memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = MMC_SEND_STATUS; if (!mmc_host_is_spi(card->host)) cmd.arg = card->rca << 16; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; rc = mmc_wait_for_cmd...
functions
int mmc_interrupt_hpi(struct mmc_card *card) { int err; u32 status; BUG_ON(!card); if (!card->ext_csd.hpi_en) { pr_info("%s: HPI enable bit unset\n", mmc_hostname(card->host)); return 1; }
functions
int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, int retries) { struct mmc_request mrq = {NULL}
functions
int mmc_stop_bkops(struct mmc_card *card) { int err = 0; BUG_ON(!card); /* * Notify the delayed work to be cancelled, in case it was already * removed from the queue, but was not started yet */ card->bkops_info.cancel_delayed_work = true; if (delayed_work_pending(&card->bkops_info.dw)) cancel_delayed_wor...
functions
int mmc_read_bkops_status(struct mmc_card *card) { int err; u8 *ext_csd; /* * In future work, we should consider storing the entire ext_csd. */ ext_csd = kmalloc(512, GFP_KERNEL); if (!ext_csd) { pr_err("%s: could not allocate buffer to receive the ext_csd.\n", mmc_hostname(card->host)); return -...
functions
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) { unsigned int mult; /* * SDIO cards only define an upper 1 s limit on access. */ if (mmc_card_sdio(card)) { data->timeout_ns = 1000000000; data->timeout_clks = 0; return; }
functions
int mmc_align_data_size(struct mmc_card *card, unsigned int sz) { /* * FIXME: We don't have a system for the controller to tell * the core about its problems yet, so for now we just 32-bit * align the size. */ sz = ((sz + 3) / 4) * 4; return sz; }
functions
int __mmc_claim_host(struct mmc_host *host, atomic_t *abort) { DECLARE_WAITQUEUE(wait, current); unsigned long flags; int stop; might_sleep(); add_wait_queue(&host->wq, &wait); spin_lock_irqsave(&host->lock, flags); while (1) { set_current_state(TASK_UNINTERRUPTIBLE); stop = abort ? atomic_read(abort) : 0...
functions
int mmc_try_claim_host(struct mmc_host *host) { int claimed_host = 0; unsigned long flags; spin_lock_irqsave(&host->lock, flags); if (!host->claimed || host->claimer == current) { host->claimed = 1; host->claimer = current; host->claim_cnt += 1; claimed_host = 1; }
functions
void mmc_release_host(struct mmc_host *host) { unsigned long flags; WARN_ON(!host->claimed); if (host->ops->disable && host->claim_cnt == 1) host->ops->disable(host); spin_lock_irqsave(&host->lock, flags); if (--host->claim_cnt) { /* Release for nested claim */ spin_unlock_irqrestore(&host->lock, flags); ...
functions
void mmc_set_ios(struct mmc_host *host) { struct mmc_ios *ios = &host->ios; pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u " "width %u timing %u\n", mmc_hostname(host), ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select, ios->vdd, ios->bus_width, ios->timing); if (ios->clock > 0...
functions
void mmc_set_chip_select(struct mmc_host *host, int mode) { mmc_host_clk_hold(host); host->ios.chip_select = mode; mmc_set_ios(host); mmc_host_clk_release(host); }
functions
void __mmc_set_clock(struct mmc_host *host, unsigned int hz) { WARN_ON(hz < host->f_min); if (hz > host->f_max) hz = host->f_max; host->ios.clock = hz; mmc_set_ios(host); }
functions
void mmc_set_clock(struct mmc_host *host, unsigned int hz) { mmc_host_clk_hold(host); __mmc_set_clock(host, hz); mmc_host_clk_release(host); }
functions
void mmc_gate_clock(struct mmc_host *host) { unsigned long flags; WARN_ON(!host->ios.clock); spin_lock_irqsave(&host->clk_lock, flags); host->clk_old = host->ios.clock; host->ios.clock = 0; host->clk_gated = true; spin_unlock_irqrestore(&host->clk_lock, flags); mmc_set_ios(host); }
functions
void mmc_ungate_clock(struct mmc_host *host) { /* * We should previously have gated the clock, so the clock shall * be 0 here! The clock may however be 0 during initialization, * when some request operations are performed before setting * the frequency. When ungate is requested in that situation * we just ig...
functions
void mmc_set_ungated(struct mmc_host *host) { unsigned long flags; /* * We've been given a new frequency while the clock is gated, * so make sure we regard this as ungating it. */ spin_lock_irqsave(&host->clk_lock, flags); host->clk_gated = false; spin_unlock_irqrestore(&host->clk_lock, flags); }
functions
void mmc_set_ungated(struct mmc_host *host) { }
functions
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) { mmc_host_clk_hold(host); host->ios.bus_mode = mode; mmc_set_ios(host); mmc_host_clk_release(host); }
functions
void mmc_set_bus_width(struct mmc_host *host, unsigned int width) { mmc_host_clk_hold(host); host->ios.bus_width = width; mmc_set_ios(host); mmc_host_clk_release(host); }
functions
int mmc_vdd_to_ocrbitnum(int vdd, bool low_bits) { const int max_bit = ilog2(MMC_VDD_35_36); int bit; if (vdd < 1650 || vdd > 3600) return -EINVAL; if (vdd >= 1650 && vdd <= 1950) return ilog2(MMC_VDD_165_195); if (low_bits) vdd -= 1; /* Base 2000 mV, step 100 mV, bit's base 8. */ bit = (vdd - 2000) / ...
functions
u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max) { u32 mask = 0; if (vdd_max < vdd_min) return 0; /* Prefer high bits for the boundary vdd_max values. */ vdd_max = mmc_vdd_to_ocrbitnum(vdd_max, false); if (vdd_max < 0) return 0; /* Prefer low bits for the boundary vdd_min values. */ vdd_min = mmc_vdd...
functions
int mmc_regulator_get_ocrmask(struct regulator *supply) { int result = 0; int count; int i; count = regulator_count_voltages(supply); if (count < 0) return count; for (i = 0; i < count; i++) { int vdd_uV; int vdd_mV; vdd_uV = regulator_list_voltage(supply, i); if (vdd_uV <= 0) continue; ...
functions
int mmc_regulator_set_ocr(struct mmc_host *mmc, struct regulator *supply, unsigned short vdd_bit) { int result = 0; int min_uV, max_uV; if (vdd_bit) { int tmp; int voltage; /* REVISIT mmc_vddrange_to_ocrmask() may have set some * bits this regulator doesn't quite support ... don't * be too ...
functions
else if (mmc->regulator_enabled) { result = regulator_disable(supply); if (result == 0) mmc->regulator_enabled = false; }