-/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
static uint32_t *msm_mpm_rising_edge;
static uint32_t *msm_mpm_polarity;
-enum {
- MSM_MPM_DEBUG_NON_DETECTABLE_IRQ = BIT(0),
- MSM_MPM_DEBUG_PENDING_IRQ = BIT(1),
- MSM_MPM_DEBUG_WRITE = BIT(2),
- MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE = BIT(3),
-};
-
-static int msm_mpm_debug_mask = 1;
-module_param_named(
- debug_mask, msm_mpm_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP
-);
-
enum mpm_state {
MSM_MPM_GIC_IRQ_MAPPING_DONE = BIT(0),
MSM_MPM_GPIO_IRQ_MAPPING_DONE = BIT(1),
unsigned int offset = reg * MSM_MPM_REG_WIDTH + subreg_index + 2;
__raw_writel(value, msm_mpm_dev_data.mpm_request_reg_base + offset * 4);
- if (MSM_MPM_DEBUG_WRITE & msm_mpm_debug_mask)
- pr_info("%s: reg %u.%u: 0x%08x\n",
- __func__, reg, subreg_index, value);
}
static inline void msm_mpm_send_interrupt(void)
static bool msm_mpm_interrupts_detectable(int d, bool from_idle)
{
unsigned long *irq_bitmap;
- bool debug_mask, ret = false;
+ bool ret = false;
struct mpm_irqs *unlisted = &unlisted_irqs[d];
if (!msm_mpm_is_initialized())
return false;
- if (from_idle) {
+ if (from_idle)
irq_bitmap = unlisted->enabled_irqs;
- debug_mask = msm_mpm_debug_mask &
- MSM_MPM_DEBUG_NON_DETECTABLE_IRQ_IDLE;
- } else {
+ else
irq_bitmap = unlisted->wakeup_irqs;
- debug_mask = msm_mpm_debug_mask &
- MSM_MPM_DEBUG_NON_DETECTABLE_IRQ;
- }
ret = (bool) bitmap_empty(irq_bitmap, unlisted->size);
- if (debug_mask && !ret) {
- int i = 0;
- i = find_first_bit(irq_bitmap, unlisted->size);
- pr_info("%s(): %s preventing system sleep modes during %s\n",
- __func__, unlisted->domain_name,
- from_idle ? "idle" : "suspend");
-
- while (i < unlisted->size) {
- pr_info("\thwirq: %d\n", i);
- i = find_next_bit(irq_bitmap, unlisted->size, i + 1);
- }
- }
-
return ret;
}
pending = msm_mpm_read(MSM_MPM_REG_STATUS, i);
pending &= enabled_intr[i];
- if (MSM_MPM_DEBUG_PENDING_IRQ & msm_mpm_debug_mask)
- pr_info("%s: enabled_intr.%d pending.%d: 0x%08x 0x%08lx\n",
- __func__, i, i, enabled_intr[i], pending);
-
k = find_first_bit(&pending, 32);
while (k < 32) {
unsigned int mpm_irq = 32 * i + k;
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
return 0;
}
-static void msm_rpm_print_sleep_buffer(struct slp_buf *s)
-{
- char buf[DEBUG_PRINT_BUFFER_SIZE] = {0};
- int pos;
- int buflen = DEBUG_PRINT_BUFFER_SIZE;
- char ch[5] = {0};
- struct kvp *e;
- uint32_t type;
- unsigned int id;
-
- if (!s)
- return;
-
- if (!s->valid)
- return;
-
- type = get_rsc_type(s->buf);
- id = get_rsc_id(s->buf);
-
- memcpy(ch, &type, sizeof(u32));
-
- pos = scnprintf(buf, buflen,
- "Sleep request type = 0x%08x(%s)",
- type, ch);
- pos += scnprintf(buf + pos, buflen - pos, " id = 0%x",
- id);
- for_each_kvp(s->buf, e) {
- uint32_t i;
- char *data = get_data(e);
-
- memcpy(ch, &e->k, sizeof(u32));
-
- pos += scnprintf(buf + pos, buflen - pos,
- "\n\t\tkey = 0x%08x(%s)",
- e->k, ch);
- pos += scnprintf(buf + pos, buflen - pos,
- " sz= %d data =", e->s);
-
- for (i = 0; i < e->s; i++)
- pos += scnprintf(buf + pos, buflen - pos,
- " 0x%02X", data[i]);
- }
- pos += scnprintf(buf + pos, buflen - pos, "\n");
- printk(buf);
-}
static struct msm_rpm_driver_data msm_rpm_data = {
.smd_open = COMPLETION_INITIALIZER(msm_rpm_data.smd_open),
if (!s->valid)
continue;
- if (print)
- msm_rpm_print_sleep_buffer(s);
-
set_msg_id(s->buf, msm_rpm_get_next_msg_id());
if (!glink_enabled)