From patchwork Fri Nov 27 04:31:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 63265 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAR4aufM004722 for ; Fri, 27 Nov 2009 04:36:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751766AbZK0Egt (ORCPT ); Thu, 26 Nov 2009 23:36:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753411AbZK0Egt (ORCPT ); Thu, 26 Nov 2009 23:36:49 -0500 Received: from mail-yw0-f182.google.com ([209.85.211.182]:46931 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbZK0Egs (ORCPT ); Thu, 26 Nov 2009 23:36:48 -0500 Received: by ywh12 with SMTP id 12so1356070ywh.21 for ; Thu, 26 Nov 2009 20:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=bjh32kPyS3Sx45VYFkCWjc+AtXEcik4fyNnay4AaZqg=; b=q4h4T8ndPDUhv781jvwsgMLId/0tj33DpNr+R+CXw+3i20PW6XLHsTJ3nhBYuPC+62 jtRShQC7JIU9v8rEofPiJJKMBsEKpJu/nlH25zChb5oj5ToI6tznttW9kvipORL8+Jg7 2jm82VAmHoiC+XxcjQJIg+Z0oazUxgvluQTEM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=RaRJ8vAYoagqGTZgckeck7aQV8xwPkh0SZh/k0XYHo8Nh+sX6vBAUqquhgiOA8g/oz PxQrFVRBb7DIub0Rn0IzeHiBURlc+XvHBHs77DZeoLtghaa0HY9Wp0TFXAtbDVKCZYrw vNChHU5q+1lkLnGC4boX1ms0Zr8OpJoESQPvI= Received: by 10.90.159.16 with SMTP id h16mr911342age.24.1259296614571; Thu, 26 Nov 2009 20:36:54 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 35sm655000yxh.69.2009.11.26.20.36.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Nov 2009 20:36:53 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, ian@mnementh.co.uk, sameo@linux.intel.com Date: Fri, 27 Nov 2009 13:31:27 +0900 Message-Id: <20091127043127.13567.23641.sendpatchset@rxone.opensource.se> Subject: [PATCH] mfd: Add power control platform data to SDHI driver Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/drivers/mfd/sh_mobile_sdhi.c +++ work/drivers/mfd/sh_mobile_sdhi.c 2009-11-27 13:14:24.000000000 +0900 @@ -24,6 +24,7 @@ #include #include +#include struct sh_mobile_sdhi { struct clk *clk; @@ -50,6 +51,15 @@ static struct mfd_cell sh_mobile_sdhi_ce .resources = sh_mobile_sdhi_resources, }; +static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state) +{ + struct platform_device *pdev = to_platform_device(tmio->dev.parent); + struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; + + if (p && p->set_pwr) + p->set_pwr(pdev, state); +} + static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) { struct sh_mobile_sdhi *priv; @@ -87,6 +97,7 @@ static int __init sh_mobile_sdhi_probe(s /* FIXME: silly const unsigned int hclk */ *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk); + priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); priv->cell_mmc.driver_data = &priv->mmc_data; --- /dev/null +++ work/include/linux/mfd/sh_mobile_sdhi.h 2009-11-27 13:10:34.000000000 +0900 @@ -0,0 +1,8 @@ +#ifndef __SH_MOBILE_SDHI_H__ +#define __SH_MOBILE_SDHI_H__ + +struct sh_mobile_sdhi_info { + void (*set_pwr)(struct platform_device *pdev, int state); +}; + +#endif /* __SH_MOBILE_SDHI_H__ */