aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/pcf50606-gpo.c
diff options
context:
space:
mode:
authormerge <null@invalid>2009-01-22 13:55:32 +0000
committerAndy Green <agreen@octopus.localdomain>2009-01-22 13:55:32 +0000
commitaa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch)
treefbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/mfd/pcf50606-gpo.c
parentf2d78193eae5dccd3d588d2c8ea0866efc368332 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mfd/pcf50606-gpo.c')
-rw-r--r--drivers/mfd/pcf50606-gpo.c128
1 files changed, 0 insertions, 128 deletions
diff --git a/drivers/mfd/pcf50606-gpo.c b/drivers/mfd/pcf50606-gpo.c
deleted file mode 100644
index 28b6d77ad80..00000000000
--- a/drivers/mfd/pcf50606-gpo.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* Philips PCF50606 GPO Driver
- *
- * (C) 2006-2008 by Openmoko, Inc.
- * Author: Balaji Rao <balajirrao@openmoko.org>
- * All rights reserved.
- *
- * Broken down from monstrous PCF50606 driver mainly by
- * Harald Welte, Andy Green and Werner Almesberger
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include <linux/mfd/pcf50606/core.h>
-#include <linux/mfd/pcf50606/gpo.h>
-#include <linux/mfd/pcf50606/pmic.h>
-
-void pcf50606_gpo_set_active(struct pcf50606 *pcf, int gpo, int val)
-{
- u8 reg, value, mask;
-
- reg = gpo;
- value = val;
- mask = 0x07;
-
- if (gpo == PCF50606_GPO2) {
- value = val << 4;
- mask = 0x07 << 4;
- }
- pcf50606_reg_set_bit_mask(pcf, reg, mask, value);
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_set_active);
-
-int pcf50606_gpo_get_active(struct pcf50606 *pcf, int gpo)
-{
- u8 reg, value, shift = 0;
-
- reg = gpo;
- if (gpo == PCF50606_GPO2)
- shift = 4;
-
- value = pcf50606_reg_read(pcf, reg);
-
- return (value >> shift) & 0x07;
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_get_active);
-
-void pcf50606_gpo_set_standby(struct pcf50606 *pcf, int gpo, int val)
-{
- u8 reg;
-
- if (gpo == PCF50606_GPO1 || gpo == PCF50606_GPO2) {
- dev_err(pcf->dev, "Can't set standby settings for GPO[12]n");
- return;
- }
-
- reg = gpo;
-
- pcf50606_reg_set_bit_mask(pcf, gpo, 0x07 << 3, val);
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_set_standby);
-
-int pcf50606_gpo_get_standby(struct pcf50606 *pcf, int gpo)
-{
- u8 reg, value;
-
- if (gpo == PCF50606_GPO1 || gpo == PCF50606_GPO2) {
- dev_err(pcf->dev, "Can't get standby settings for GPO[12]n");
- return -EINVAL;
- }
-
- reg = gpo;
- value = pcf50606_reg_read(pcf, reg);
-
- return (value >> 3) & 0x07;
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_get_standby);
-
-void pcf50606_gpo_invert_set(struct pcf50606 *pcf, int gpo, int invert)
-{
- u8 reg, value, mask;
-
- reg = gpo;
- value = !!invert << 6;
- mask = 0x01 << 6;
-
- if (gpo == PCF50606_GPO1) {
- mask = 0x01 << 4;
- value = !!invert << 4;
- }
- else if (gpo == PCF50606_GPO2) {
- mask = 0x01 << 7;
- value = !!invert << 7;
- }
-
- pcf50606_reg_set_bit_mask(pcf, reg, mask, value);
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_invert_set);
-
-int pcf50606_gpo_invert_get(struct pcf50606 *pcf, int gpo)
-{
- u8 reg, value, shift;
-
- reg = gpo;
- shift = 6;
-
- if (gpo == PCF50606_GPO1)
- shift = 4;
- else if (gpo == PCF50606_GPO2)
- shift = 7;
-
- value = pcf50606_reg_read(pcf, reg);
-
- return (value >> shift) & 0x01;
-}
-EXPORT_SYMBOL_GPL(pcf50606_gpo_invert_get);