linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yifeng Li <tomli@tomli.me>
To: Lee Jones <lee.jones@linaro.org>, linux-mips@vger.kernel.org
Cc: Yifeng Li <tomli@tomli.me>, Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Huacai Chen <chenhc@lemote.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/7] mips: loongson64: remove yeeloong_report_lid_status from pm.c
Date: Sun,  3 Mar 2019 01:53:31 +0800	[thread overview]
Message-ID: <20190302175334.5103-5-tomli@tomli.me> (raw)
In-Reply-To: <20190302175334.5103-1-tomli@tomli.me>

There is some complicated logic in lemote-2f/pm.c. During wakeup, it
creates a delayed_work to execute a callback to the function
yeeloong_report_lid_status(). It's only purpose is to report the current
status of the laptop lid switch, and this callback function wan not
implemented in the mainline kernel.

This level of overenginnering hardly makes sense. All we need is to report
the laptop lid switch unconditionally upon wakeup in the future PM code,
which is being worked on.

Signed-off-by: Yifeng Li <tomli@tomli.me>
---
 arch/mips/loongson64/lemote-2f/pm.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/mips/loongson64/lemote-2f/pm.c b/arch/mips/loongson64/lemote-2f/pm.c
index 4ee7e9864700..ebe4b57535f0 100644
--- a/arch/mips/loongson64/lemote-2f/pm.c
+++ b/arch/mips/loongson64/lemote-2f/pm.c
@@ -80,17 +80,6 @@ void setup_wakeup_events(void)
 	}
 }
 
-static struct delayed_work lid_task;
-static int initialized;
-/* yeeloong_report_lid_status will be implemented in yeeloong_laptop.c */
-sci_handler yeeloong_report_lid_status;
-EXPORT_SYMBOL(yeeloong_report_lid_status);
-static void yeeloong_lid_update_task(struct work_struct *work)
-{
-	if (yeeloong_report_lid_status)
-		yeeloong_report_lid_status(KB3310B_BIT_LID_DETECT_ON);
-}
-
 int wakeup_loongson(void)
 {
 	int irq;
@@ -119,17 +108,6 @@ int wakeup_loongson(void)
 			lid_status = kb3310b_read(KB3310B_REG_LID_DETECT);
 			/* wakeup cpu when people open the LID */
 			if (lid_status == KB3310B_BIT_LID_DETECT_ON) {
-				/* If we call it directly here, the WARNING
-				 * will be sent out by getnstimeofday
-				 * via "WARN_ON(timekeeping_suspended);"
-				 * because we can not schedule in suspend mode.
-				 */
-				if (initialized == 0) {
-					INIT_DELAYED_WORK(&lid_task,
-						yeeloong_lid_update_task);
-					initialized = 1;
-				}
-				schedule_delayed_work(&lid_task, 1);
 				return 1;
 			}
 		}
-- 
2.20.1


  parent reply	other threads:[~2019-03-02 17:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02 17:53 [PATCH 0/7] Preliminary Platform Driver Support for Lemote Yeeloong Laptops Yifeng Li
2019-03-02 17:53 ` [PATCH 1/7] mfd: yeeloong_kb3310b: support KB3310B EC for Lemote Yeeloong laptops Yifeng Li
     [not found]   ` <201903040432.qyPxOrOQ%fengguang.wu@intel.com>
2019-03-04  0:24     ` Tom Li
2019-03-04  0:37   ` kbuild test robot
2019-03-04 10:14     ` Lee Jones
2019-03-04 12:19       ` Tom Li
2019-03-02 17:53 ` [PATCH 2/7] mips: loongson64: select MFD_YEELOONG_KB3310B for LEMOTE_MACH2F Yifeng Li
2019-03-02 17:53 ` [PATCH 3/7] mips: loongson64: remove ec_kb3310b.c, use MFD driver Yifeng Li
2019-03-02 17:53 ` Yifeng Li [this message]
2019-03-02 17:53 ` [PATCH 5/7] mips: loongson64: register per-board platform drivers for lemote-2f Yifeng Li
2019-03-02 17:53 ` [PATCH 6/7] mips: loongson64: Support System Control Interrupts for Lemote Yeeloong Yifeng Li
2019-03-02 17:53 ` [PATCH 7/7] MAINTAINERS: add myself as a maintainer of MIPS/Loongson2 platform code Yifeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190302175334.5103-5-tomli@tomli.me \
    --to=tomli@tomli.me \
    --cc=chenhc@lemote.com \
    --cc=jhogan@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).