--- /dev/null
+#
+# (C) Copyright 2010
+#
+# Donghwa Lee <dh09.lee@samsung.com>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 $(TOPDIR)/config.mk
+
+LIB := $(obj)libswi.o
+
+COBJS-$(CONFIG_SWI) += swi.o
+
+COBJS := $(COBJS-y)
+SRCS := $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+
+all: $(LIB)
+
+$(LIB): $(obj).depend $(OBJS)
+ $(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
--- /dev/null
+/*
+ * linux/driver/swi/swi.c
+ *
+ * Single-Wired Interface Driver.
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ * Donghwa Lee <dh09.lee@samsung.com>
+ *
+ * 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
+ * MERCHANTAswiLITY 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <common.h>
+#include <asm/arch/gpio.h>
+#include <swi.h>
+
+struct swi_platform_data *swi;
+
+int swi_transfer_command(unsigned int command)
+{
+ switch (command) {
+ case SWI_LOW:
+ gpio_set_value(swi->swi_bank, swi->controller_data, 0);
+ break;
+ case SWI_HIGH:
+ gpio_set_value(swi->swi_bank, swi->controller_data, 1);
+ break;
+ case SWI_CHANGE:
+ gpio_direction_output(swi->swi_bank, swi->controller_data, 0);
+ udelay(swi->low_period);
+
+ gpio_set_value(swi->swi_bank, swi->controller_data, 1);
+ udelay(swi->high_period);
+ break;
+ default:
+ printf("invalid command.\n");
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * register SWI devices for a given board.
+ *
+ * @info : array of chip descriptors.
+ * @n : how many descriptors are provided.
+ */
+void swi_set_platform_data(struct swi_platform_data *pd)
+{
+ if (pd == NULL) {
+ printf("pd is NULL.\n");
+ return;
+ }
+
+ swi = pd;
+}