projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[s3c24xx] glamo-mmc: Limit clock rate.
[openwrt.git]
/
target
/
linux
/
s3c24xx
/
files-2.6.30
/
drivers
/
mfd
/
glamo
/
glamo-spi-gpio.c
diff --git
a/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-spi-gpio.c
b/target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-spi-gpio.c
index
b92e48a
..
6316b85
100644
(file)
--- a/
target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-spi-gpio.c
+++ b/
target/linux/s3c24xx/files-2.6.30/drivers/mfd/glamo/glamo-spi-gpio.c
@@
-21,7
+21,6
@@
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/spinlock.h>
-#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
@@
-38,8
+37,7
@@
struct glamo_spigpio {
struct spi_bitbang bitbang;
struct spi_master *master;
struct glamo_spigpio {
struct spi_bitbang bitbang;
struct spi_master *master;
- struct glamo_spigpio_info *info;
- struct glamo_core *glamo;
+ struct glamo_spigpio_platform_data *info;
};
static inline struct glamo_spigpio *to_sg(struct spi_device *spi)
};
static inline struct glamo_spigpio *to_sg(struct spi_device *spi)
@@
-50,20
+48,20
@@
static inline struct glamo_spigpio *to_sg(struct spi_device *spi)
static inline void setsck(struct spi_device *dev, int on)
{
struct glamo_spigpio *sg = to_sg(dev);
static inline void setsck(struct spi_device *dev, int on)
{
struct glamo_spigpio *sg = to_sg(dev);
- glamo_gpio_setpin(sg->
glamo
, sg->info->pin_clk, on ? 1 : 0);
+ glamo_gpio_setpin(sg->
info->core
, sg->info->pin_clk, on ? 1 : 0);
}
static inline void setmosi(struct spi_device *dev, int on)
{
struct glamo_spigpio *sg = to_sg(dev);
}
static inline void setmosi(struct spi_device *dev, int on)
{
struct glamo_spigpio *sg = to_sg(dev);
- glamo_gpio_setpin(sg->
glamo
, sg->info->pin_mosi, on ? 1 : 0);
+ glamo_gpio_setpin(sg->
info->core
, sg->info->pin_mosi, on ? 1 : 0);
}
static inline u32 getmiso(struct spi_device *dev)
{
struct glamo_spigpio *sg = to_sg(dev);
if (sg->info->pin_miso)
}
static inline u32 getmiso(struct spi_device *dev)
{
struct glamo_spigpio *sg = to_sg(dev);
if (sg->info->pin_miso)
- return glamo_gpio_getpin(sg->
glamo
, sg->info->pin_miso) ? 1 : 0;
+ return glamo_gpio_getpin(sg->
info->core
, sg->info->pin_miso) ? 1 : 0;
else
return 0;
}
else
return 0;
}
@@
-123,7
+121,7
@@
static void glamo_spigpio_chipsel(struct spi_device *spi, int value)
dev_dbg(&spi->dev, "chipsel %d: spi=%p, gs=%p, info=%p, handle=%p\n",
value, spi, gs, gs->info, gs->info->glamo);
#endif
dev_dbg(&spi->dev, "chipsel %d: spi=%p, gs=%p, info=%p, handle=%p\n",
value, spi, gs, gs->info, gs->info->glamo);
#endif
- glamo_gpio_setpin(gs->
glamo
, gs->info->pin_cs, value ? 0 : 1);
+ glamo_gpio_setpin(gs->
info->core
, gs->info->pin_cs, value ? 0 : 1);
}
}
@@
-153,7
+151,6
@@
static int glamo_spigpio_probe(struct platform_device *pdev)
master->bus_num = 2; /* FIXME: use dynamic number */
sp->master = spi_master_get(master);
master->bus_num = 2; /* FIXME: use dynamic number */
sp->master = spi_master_get(master);
- sp->glamo = sp->info->glamo;
sp->bitbang.master = sp->master;
sp->bitbang.chipselect = glamo_spigpio_chipsel;
sp->bitbang.master = sp->master;
sp->bitbang.chipselect = glamo_spigpio_chipsel;
@@
-163,20
+160,20
@@
static int glamo_spigpio_probe(struct platform_device *pdev)
sp->bitbang.txrx_word[SPI_MODE_3] = glamo_spigpio_txrx_mode3;
/* set state of spi pins */
sp->bitbang.txrx_word[SPI_MODE_3] = glamo_spigpio_txrx_mode3;
/* set state of spi pins */
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_clk, 0);
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_mosi, 0);
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_cs, 1);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_clk, 0);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_mosi, 0);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_cs, 1);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_clk);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_mosi);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_cs);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_clk);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_mosi);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_cs);
if (sp->info->pin_miso)
if (sp->info->pin_miso)
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_miso);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_miso);
/* bring the LCM panel out of reset if it isn't already */
/* bring the LCM panel out of reset if it isn't already */
- glamo_gpio_setpin(sp->
glamo
, GLAMO_GPIO4, 1);
- glamo_gpio_cfgpin(sp->
glamo
, GLAMO_GPIO4_OUTPUT);
+ glamo_gpio_setpin(sp->
info->core
, GLAMO_GPIO4, 1);
+ glamo_gpio_cfgpin(sp->
info->core
, GLAMO_GPIO4_OUTPUT);
msleep(90);
#if 0
msleep(90);
#if 0
@@
-214,49
+211,52
@@
static int glamo_spigpio_remove(struct platform_device *pdev)
return 0;
}
return 0;
}
-/*#define glamo_spigpio_suspend NULL
-#define glamo_spigpio_resume NULL
-*/
-
#ifdef CONFIG_PM
#ifdef CONFIG_PM
-
static int glamo_spigpio_suspend(struct platform_device *pdev, pm_message_t state
)
+
/*static int glamo_spigpio_suspend(struct device *dev
)
{
return 0;
{
return 0;
-}
+}
*/
-static int glamo_spigpio_resume(struct
platform_device *p
dev)
+static int glamo_spigpio_resume(struct
device *
dev)
{
{
- struct glamo_spigpio *sp =
platform_get_drvdata(p
dev);
+ struct glamo_spigpio *sp =
dev_get_drvdata(
dev);
if (!sp)
return 0;
/* set state of spi pins */
if (!sp)
return 0;
/* set state of spi pins */
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_clk, 0);
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_mosi, 0);
- glamo_gpio_setpin(sp->
glamo
, sp->info->pin_cs, 1);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_clk, 0);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_mosi, 0);
+ glamo_gpio_setpin(sp->
info->core
, sp->info->pin_cs, 1);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_clk);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_mosi);
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_cs);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_clk);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_mosi);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_cs);
if (sp->info->pin_miso)
if (sp->info->pin_miso)
- glamo_gpio_cfgpin(sp->
glamo
, sp->info->pin_miso);
+ glamo_gpio_cfgpin(sp->
info->core
, sp->info->pin_miso);
return 0;
}
return 0;
}
+
+static struct dev_pm_ops glamo_spigpio_pm_ops = {
+/* .suspend = glamo_spiogpio_suspend,*/
+ .resume_noirq = glamo_spigpio_resume,
+};
+
+#define GLAMO_SPIGPIO_PM_OPS (&glamo_spigpio_pm_ops)
+
+#else
+#define GLAMO_SPIGPIO_PM_OPS NULL
#endif
static struct platform_driver glamo_spi_drv = {
.probe = glamo_spigpio_probe,
.remove = glamo_spigpio_remove,
#endif
static struct platform_driver glamo_spi_drv = {
.probe = glamo_spigpio_probe,
.remove = glamo_spigpio_remove,
-#ifdef CONFIG_PM
- .suspend_late = glamo_spigpio_suspend,
- .resume_early = glamo_spigpio_resume,
-#endif
.driver = {
.name = "glamo-spi-gpio",
.owner = THIS_MODULE,
.driver = {
.name = "glamo-spi-gpio",
.owner = THIS_MODULE,
+ .pm = GLAMO_SPIGPIO_PM_OPS,
},
};
},
};
This page took
0.037062 seconds
and
4
git commands to generate.