From patchwork Wed Jul 10 04:10:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 257962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qe0-x23e.google.com (mail-qe0-x23e.google.com [IPv6:2607:f8b0:400d:c02::23e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id CBEAE2C0209 for ; Wed, 10 Jul 2013 14:10:43 +1000 (EST) Received: by mail-qe0-f62.google.com with SMTP id q19sf1909614qeb.17 for ; Tue, 09 Jul 2013 21:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:x-beenthere:from:to:cc:subject:date:message-id :x-mailer:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-google-group-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=91NHAZxDMZYVxivL99eiEgaqeZ1d0hEYF3FSUC8vAss=; b=vP+h4FUtBfYf/mQca2Fw+nNwvnOcaPbBIy2UPiTrW0PyTc9UdROZStGZys+06NvhN8 ftm+PYU5e9ewa+XdHQRxeerwOkRRH9yQR6lRAUAVHFylKrvnKxj4D32iqyASzhoSs+wU Gqb2tB0lisgWLb8ire16sHeLRjALLCDMeB81jilWEr0hqhNdJ0gwQ+qngZj9+CfIBcsJ T1wPghKHWNL3Hc0g3/qijhPNAfIO3w/9kudzbs/B4NHIWkWEWGjdRnGyFDFwOMzN3wAZ lnC70mMBifLyF+fBDzcKj8osTlFW0RNdtVDFL1oL7TC7nav8Joh960de+jZqG335UzZM NDKg== X-Received: by 10.50.45.35 with SMTP id j3mr1532692igm.3.1373429440646; Tue, 09 Jul 2013 21:10:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.67.36 with SMTP id k4ls5779908igt.8.canary; Tue, 09 Jul 2013 21:10:40 -0700 (PDT) X-Received: by 10.66.121.169 with SMTP id ll9mr2636414pab.38.1373429440376; Tue, 09 Jul 2013 21:10:40 -0700 (PDT) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net. [2001:558:fe2d:43:76:96:30:56]) by gmr-mx.google.com with ESMTP id cw1si3379388pbb.0.2013.07.09.21.10.40 for ; Tue, 09 Jul 2013 21:10:40 -0700 (PDT) Received-SPF: neutral (google.com: 2001:558:fe2d:43:76:96:30:56 is neither permitted nor denied by best guess record for domain of shuah.kh@samsung.com) client-ip=2001:558:fe2d:43:76:96:30:56; Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta06.emeryville.ca.mail.comcast.net with comcast id yTvE1l0071GXsucA6UAg7c; Wed, 10 Jul 2013 04:10:40 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta07.emeryville.ca.mail.comcast.net with comcast id yUAe1l00G0MU7Qa8UUAenA; Wed, 10 Jul 2013 04:10:39 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id AC33F80340; Tue, 9 Jul 2013 22:10:57 -0600 (MDT) From: Shuah Khan To: rafael.j.wysocki@intel.com, bhelgaas@google.com, a.zummo@towertech.it, key@linux.vnet.ibm.com, mail@srajiv.net, tpmdd@selhorst.net, tpmdd@sirrix.com, matthew.garrett@nebula.com Cc: Shuah Khan , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, tpmdd-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, shuahkhan@gmail.com Subject: [rtc-linux] [PATCH 4/4] platform: Convert apple-gmux driver to dev_pm_ops from legacy pm_ops Date: Tue, 9 Jul 2013 22:10:34 -0600 Message-Id: <1373429434-3981-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Original-Sender: shuah.kh@samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:558:fe2d:43:76:96:30:56 is neither permitted nor denied by best guess record for domain of shuah.kh@samsung.com) smtp.mail=shuah.kh@samsung.com; dkim=pass (test mode) header.i=@comcast.net Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Convert drivers/platform/x86/apple-gmux to use dev_pm_ops instead of legacy pm_ops. This patch depends on pnp driver bus ops change to invoke pnp_driver dev_pm_ops. Signed-off-by: Shuah Khan --- drivers/platform/x86/apple-gmux.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index f74bfcb..8eea2ef 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -393,17 +393,21 @@ static void gmux_notify_handler(acpi_handle device, u32 value, void *context) complete(&gmux_data->powerchange_done); } -static int gmux_suspend(struct pnp_dev *pnp, pm_message_t state) +static int gmux_suspend(struct device *dev) { + struct pnp_dev *pnp = to_pnp_dev(dev); struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); + gmux_data->resume_client_id = gmux_active_client(gmux_data); gmux_disable_interrupts(gmux_data); return 0; } -static int gmux_resume(struct pnp_dev *pnp) +static int gmux_resume(struct device *dev) { + struct pnp_dev *pnp = to_pnp_dev(dev); struct apple_gmux_data *gmux_data = pnp_get_drvdata(pnp); + gmux_enable_interrupts(gmux_data); gmux_switchto(gmux_data->resume_client_id); if (gmux_data->power_state == VGA_SWITCHEROO_OFF) @@ -605,13 +609,19 @@ static const struct pnp_device_id gmux_device_ids[] = { {"", 0} }; +static const struct dev_pm_ops gmux_dev_pm_ops = { + .suspend = gmux_suspend, + .resume = gmux_resume, +}; + static struct pnp_driver gmux_pnp_driver = { .name = "apple-gmux", .probe = gmux_probe, .remove = gmux_remove, .id_table = gmux_device_ids, - .suspend = gmux_suspend, - .resume = gmux_resume + .driver = { + .pm = &gmux_dev_pm_ops, + }, }; static int __init apple_gmux_init(void)