···310310 default BACKLIGHT_PWM311311 help312312 Enable support for PXA2xx/PXA3xx PWM controllers313313+314314+config TOSA_BT315315+ tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"316316+ depends on MACH_TOSA317317+ select RFKILL318318+ help319319+ This is a simple driver that is able to control320320+ the state of built in bluetooth chip on tosa.321321+313322endif
+3-1
arch/arm/mach-pxa/Makefile
···4455# Common support (must be linked before board specific support)66obj-y += clock.o devices.o generic.o irq.o dma.o \77- time.o gpio.o77+ time.o gpio.o reset.o88obj-$(CONFIG_PM) += pm.o sleep.o standby.o99obj-$(CONFIG_CPU_FREQ) += cpu-pxa.o1010···6161ifeq ($(CONFIG_PCI),y)6262obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o6363endif6464+6565+obj-$(CONFIG_TOSA_BT) += tosa-bt.o
+96
arch/arm/mach-pxa/reset.c
···11+/*22+ * This program is free software; you can redistribute it and/or modify33+ * it under the terms of the GNU General Public License version 2 as44+ * published by the Free Software Foundation.55+ */66+#include <linux/kernel.h>77+#include <linux/module.h>88+#include <linux/delay.h>99+#include <linux/gpio.h>1010+#include <asm/io.h>1111+#include <asm/proc-fns.h>1212+1313+#include <asm/arch/pxa-regs.h>1414+#include <asm/arch/pxa2xx-regs.h>1515+1616+static void do_hw_reset(void);1717+1818+static int reset_gpio = -1;1919+2020+int init_gpio_reset(int gpio)2121+{2222+ int rc;2323+2424+ rc = gpio_request(gpio, "reset generator");2525+ if (rc) {2626+ printk(KERN_ERR "Can't request reset_gpio\n");2727+ goto out;2828+ }2929+3030+ rc = gpio_direction_input(gpio);3131+ if (rc) {3232+ printk(KERN_ERR "Can't configure reset_gpio for input\n");3333+ gpio_free(gpio);3434+ goto out;3535+ }3636+3737+out:3838+ if (!rc)3939+ reset_gpio = gpio;4040+4141+ return rc;4242+}4343+4444+/*4545+ * Trigger GPIO reset.4646+ * This covers various types of logic connecting gpio pin4747+ * to RESET pins (nRESET or GPIO_RESET):4848+ */4949+static void do_gpio_reset(void)5050+{5151+ BUG_ON(reset_gpio == -1);5252+5353+ /* drive it low */5454+ gpio_direction_output(reset_gpio, 0);5555+ mdelay(2);5656+ /* rising edge or drive high */5757+ gpio_set_value(reset_gpio, 1);5858+ mdelay(2);5959+ /* falling edge */6060+ gpio_set_value(reset_gpio, 0);6161+6262+ /* give it some time */6363+ mdelay(10);6464+6565+ WARN_ON(1);6666+ /* fallback */6767+ do_hw_reset();6868+}6969+7070+static void do_hw_reset(void)7171+{7272+ /* Initialize the watchdog and let it fire */7373+ OWER = OWER_WME;7474+ OSSR = OSSR_M3;7575+ OSMR3 = OSCR + 368640; /* ... in 100 ms */7676+}7777+7878+void arch_reset(char mode)7979+{8080+ if (cpu_is_pxa2xx())8181+ RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;8282+8383+ switch (mode) {8484+ case 's':8585+ /* Jump into ROM at address 0 */8686+ cpu_reset(0);8787+ break;8888+ case 'h':8989+ do_hw_reset();9090+ break;9191+ case 'g':9292+ do_gpio_reset();9393+ break;9494+ }9595+}9696+
···55menu "Multifunction device drivers"66 depends on HAS_IOMEM7788+config MFD_CORE99+ tristate1010+ default n1111+812config MFD_SM501913 tristate "Support for Silicon Motion SM501"1014 ---help---···4137 chips labeled "AIC2" and "AIC3", found on HTC Blueangel and4238 HTC Magician devices, respectively. Actual functionality is4339 handled by the leds-pasic3 and ds1wm drivers.4040+4141+config MFD_TC6393XB4242+ bool "Support Toshiba TC6393XB"4343+ depends on HAVE_GPIO_LIB4444+ select MFD_CORE4545+ help4646+ Support for Toshiba Mobile IO Controller TC6393XB44474548endmenu4649
···11+/*22+ * Tosa bluetooth built-in chip control.33+ *44+ * Later it may be shared with some other platforms.55+ *66+ * Copyright (c) 2008 Dmitry Baryshkov77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+ *1212+ */1313+#ifndef TOSA_BT_H1414+#define TOSA_BT_H1515+1616+struct tosa_bt_data {1717+ int gpio_pwr;1818+ int gpio_reset;1919+};2020+2121+#endif2222+
+55
include/linux/mfd/core.h
···11+#ifndef MFD_CORE_H22+#define MFD_CORE_H33+/*44+ * drivers/mfd/mfd-core.h55+ *66+ * core MFD support77+ * Copyright (c) 2006 Ian Molton88+ * Copyright (c) 2007 Dmitry Baryshkov99+ *1010+ * This program is free software; you can redistribute it and/or modify1111+ * it under the terms of the GNU General Public License version 2 as1212+ * published by the Free Software Foundation.1313+ *1414+ */1515+1616+#include <linux/platform_device.h>1717+1818+/*1919+ * This struct describes the MFD part ("cell").2020+ * After registration the copy of this structure will become the platform data2121+ * of the resulting platform_device2222+ */2323+struct mfd_cell {2424+ const char *name;2525+2626+ int (*enable)(struct platform_device *dev);2727+ int (*disable)(struct platform_device *dev);2828+ int (*suspend)(struct platform_device *dev);2929+ int (*resume)(struct platform_device *dev);3030+3131+ void *driver_data; /* driver-specific data */3232+3333+ /*3434+ * This resources can be specified relatievly to the parent device.3535+ * For accessing device you should use resources from device3636+ */3737+ int num_resources;3838+ const struct resource *resources;3939+};4040+4141+static inline struct mfd_cell *4242+mfd_get_cell(struct platform_device *pdev)4343+{4444+ return (struct mfd_cell *)pdev->dev.platform_data;4545+}4646+4747+extern int mfd_add_devices(4848+ struct platform_device *parent,4949+ const struct mfd_cell *cells, int n_devs,5050+ struct resource *mem_base,5151+ int irq_base);5252+5353+extern void mfd_remove_devices(struct platform_device *parent);5454+5555+#endif
+49
include/linux/mfd/tc6393xb.h
···11+/*22+ * Toshiba TC6393XB SoC support33+ *44+ * Copyright(c) 2005-2006 Chris Humbert55+ * Copyright(c) 2005 Dirk Opfer66+ * Copyright(c) 2005 Ian Molton <spyro@f2s.com>77+ * Copyright(c) 2007 Dmitry Baryshkov88+ *99+ * Based on code written by Sharp/Lineo for 2.4 kernels1010+ * Based on locomo.c1111+ *1212+ * This program is free software; you can redistribute it and/or modify1313+ * it under the terms of the GNU General Public License version 2 as1414+ * published by the Free Software Foundation.1515+ */1616+1717+#ifndef TC6393XB_H1818+#define TC6393XB_H1919+2020+/* Also one should provide the CK3P6MI clock */2121+struct tc6393xb_platform_data {2222+ u16 scr_pll2cr; /* PLL2 Control */2323+ u16 scr_gper; /* GP Enable */2424+ u32 scr_gpo_doecr; /* GPO Data OE Control */2525+ u32 scr_gpo_dsr; /* GPO Data Set */2626+2727+ int (*enable)(struct platform_device *dev);2828+ int (*disable)(struct platform_device *dev);2929+ int (*suspend)(struct platform_device *dev);3030+ int (*resume)(struct platform_device *dev);3131+3232+ int irq_base; /* a base for cascaded irq */3333+ int gpio_base;3434+3535+ struct tmio_nand_data *nand_data;3636+};3737+3838+/*3939+ * Relative to irq_base4040+ */4141+#define IRQ_TC6393_NAND 04242+#define IRQ_TC6393_MMC 14343+#define IRQ_TC6393_OHCI 24444+#define IRQ_TC6393_SERIAL 34545+#define IRQ_TC6393_FB 44646+4747+#define TC6393XB_NR_IRQS 84848+4949+#endif
+17
include/linux/mfd/tmio.h
···11+#ifndef MFD_TMIO_H22+#define MFD_TMIO_H33+44+/*55+ * data for the NAND controller66+ */77+struct tmio_nand_data {88+ struct nand_bbt_descr *badblock_pattern;99+ struct mtd_partition *partition;1010+ unsigned int num_partitions;1111+};1212+1313+#define TMIO_NAND_CONFIG "tmio-nand-config"1414+#define TMIO_NAND_CONTROL "tmio-nand-control"1515+#define TMIO_NAND_IRQ "tmio-nand"1616+1717+#endif
+1
sound/soc/pxa/Kconfig
···4848config SND_PXA2XX_SOC_TOSA4949 tristate "SoC AC97 Audio support for Tosa"5050 depends on SND_PXA2XX_SOC && MACH_TOSA5151+ depends on MFD_TC6393XB5152 select SND_PXA2XX_SOC_AC975253 select SND_SOC_WM97125354 help
+20-9
sound/soc/pxa/tosa.c
···2424#include <linux/module.h>2525#include <linux/moduleparam.h>2626#include <linux/device.h>2727+#include <linux/gpio.h>27282829#include <sound/core.h>2930#include <sound/pcm.h>···3231#include <sound/soc-dapm.h>33323433#include <asm/mach-types.h>3535-#include <asm/hardware/tmio.h>3434+#include <asm/arch/tosa.h>3635#include <asm/arch/pxa-regs.h>3736#include <asm/arch/hardware.h>3837#include <asm/arch/audio.h>···139138static int tosa_hp_event(struct snd_soc_dapm_widget *w,140139 struct snd_kcontrol *k, int event)141140{142142- if (SND_SOC_DAPM_EVENT_ON(event))143143- set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);144144- else145145- reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);141141+ gpio_set_value(TOSA_GPIO_L_MUTE, SND_SOC_DAPM_EVENT_ON(event) ? 1 :0);146142 return 0;147143}148144···259261 if (!machine_is_tosa())260262 return -ENODEV;261263264264+ ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");265265+ if (ret)266266+ return ret;267267+ gpio_direction_output(TOSA_GPIO_L_MUTE, 0);268268+262269 tosa_snd_device = platform_device_alloc("soc-audio", -1);263263- if (!tosa_snd_device)264264- return -ENOMEM;270270+ if (!tosa_snd_device) {271271+ ret = -ENOMEM;272272+ goto err_alloc;273273+ }265274266275 platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata);267276 tosa_snd_devdata.dev = &tosa_snd_device->dev;268277 ret = platform_device_add(tosa_snd_device);269278270270- if (ret)271271- platform_device_put(tosa_snd_device);279279+ if (!ret)280280+ return 0;281281+282282+ platform_device_put(tosa_snd_device);283283+284284+err_alloc:285285+ gpio_free(TOSA_GPIO_L_MUTE);272286273287 return ret;274288}···288278static void __exit tosa_exit(void)289279{290280 platform_device_unregister(tosa_snd_device);281281+ gpio_free(TOSA_GPIO_L_MUTE);291282}292283293284module_init(tosa_init);