aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 11:41:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 11:41:13 -0400
commitb10a8b7238d7b034f28d32a85bb05c48475f132a (patch)
tree8e70e816757c2a517de6fb721dd9ac2276619c26 /drivers
parent37eaf8c7463e53cf1acf025fb566fb6c4573297f (diff)
parent8b2224dc6a5b46cfa1d54ab1fe82107351c66443 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (72 commits) sh: SuperH Mobile CEU and camera platform data for AP325RXA sh: Update smc911x platform data for AP325RXA sh: SuperH Mobile LCDC platform data for AP325RXA sh: Add SuperH Mobile CEU platform data for Migo-R sh: Add SuperH Mobile LCDC platform data for Migo-R sh: Move asid_cache() out of ifdef to fix SH-3/4 nommu build. sh: Workaround for __put_user_asm() bug with gcc 4.x on big-endian. sh: Wire up new syscalls. sh: fix uImage Entry Point sh_keysc: remove request_mem_region() and release_mem_region() sh: Don't miss pending signals returning to user mode after signal processing sh: Use clk_always_enable() on sh7366 sh: Use clk_always_enable() on sh7343 / SE77343 sh: Use clk_always_enable() on sh7722 / Migo-R / SE7722 sh: Use clk_always_enable() on sh7723 / ap325rxa sh: Introduce clk_always_enable() function sh: Show all clocks and their state in /proc/clocks sh: Merge sh7343 and sh7722 clock code sh: Add SuperH Mobile MSTPCR bits to clock framework sh: Use arch_flags to simplify sh7722 siu clock code ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/sh_keysc.c27
-rw-r--r--drivers/serial/sh-sci.c17
-rw-r--r--drivers/serial/sh-sci.h38
3 files changed, 50 insertions, 32 deletions
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index 8486abc457ed..c600ab7f93e8 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -158,25 +158,18 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
158 memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata)); 158 memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata));
159 pdata = &priv->pdata; 159 pdata = &priv->pdata;
160 160
161 res = request_mem_region(res->start, res_size(res), pdev->name);
162 if (res == NULL) {
163 dev_err(&pdev->dev, "failed to request I/O memory\n");
164 error = -EBUSY;
165 goto err1;
166 }
167
168 priv->iomem_base = ioremap_nocache(res->start, res_size(res)); 161 priv->iomem_base = ioremap_nocache(res->start, res_size(res));
169 if (priv->iomem_base == NULL) { 162 if (priv->iomem_base == NULL) {
170 dev_err(&pdev->dev, "failed to remap I/O memory\n"); 163 dev_err(&pdev->dev, "failed to remap I/O memory\n");
171 error = -ENXIO; 164 error = -ENXIO;
172 goto err2; 165 goto err1;
173 } 166 }
174 167
175 priv->input = input_allocate_device(); 168 priv->input = input_allocate_device();
176 if (!priv->input) { 169 if (!priv->input) {
177 dev_err(&pdev->dev, "failed to allocate input device\n"); 170 dev_err(&pdev->dev, "failed to allocate input device\n");
178 error = -ENOMEM; 171 error = -ENOMEM;
179 goto err3; 172 goto err2;
180 } 173 }
181 174
182 input = priv->input; 175 input = priv->input;
@@ -194,7 +187,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
194 error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev); 187 error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev);
195 if (error) { 188 if (error) {
196 dev_err(&pdev->dev, "failed to request IRQ\n"); 189 dev_err(&pdev->dev, "failed to request IRQ\n");
197 goto err4; 190 goto err3;
198 } 191 }
199 192
200 for (i = 0; i < SH_KEYSC_MAXKEYS; i++) { 193 for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
@@ -206,7 +199,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
206 error = input_register_device(input); 199 error = input_register_device(input);
207 if (error) { 200 if (error) {
208 dev_err(&pdev->dev, "failed to register input device\n"); 201 dev_err(&pdev->dev, "failed to register input device\n");
209 goto err5; 202 goto err4;
210 } 203 }
211 204
212 iowrite16((sh_keysc_mode[pdata->mode].kymd << 8) | 205 iowrite16((sh_keysc_mode[pdata->mode].kymd << 8) |
@@ -214,14 +207,12 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
214 iowrite16(0, priv->iomem_base + KYOUTDR_OFFS); 207 iowrite16(0, priv->iomem_base + KYOUTDR_OFFS);
215 iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS); 208 iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS);
216 return 0; 209 return 0;
217 err5:
218 free_irq(irq, pdev);
219 err4: 210 err4:
220 input_free_device(input); 211 free_irq(irq, pdev);
221 err3: 212 err3:
222 iounmap(priv->iomem_base); 213 input_free_device(input);
223 err2: 214 err2:
224 release_mem_region(res->start, res_size(res)); 215 iounmap(priv->iomem_base);
225 err1: 216 err1:
226 platform_set_drvdata(pdev, NULL); 217 platform_set_drvdata(pdev, NULL);
227 kfree(priv); 218 kfree(priv);
@@ -232,7 +223,6 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
232static int __devexit sh_keysc_remove(struct platform_device *pdev) 223static int __devexit sh_keysc_remove(struct platform_device *pdev)
233{ 224{
234 struct sh_keysc_priv *priv = platform_get_drvdata(pdev); 225 struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
235 struct resource *res;
236 226
237 iowrite16(KYCR2_IRQ_DISABLED, priv->iomem_base + KYCR2_OFFS); 227 iowrite16(KYCR2_IRQ_DISABLED, priv->iomem_base + KYCR2_OFFS);
238 228
@@ -240,9 +230,6 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev)
240 free_irq(platform_get_irq(pdev, 0), pdev); 230 free_irq(platform_get_irq(pdev, 0), pdev);
241 iounmap(priv->iomem_base); 231 iounmap(priv->iomem_base);
242 232
243 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
244 release_mem_region(res->start, res_size(res));
245
246 platform_set_drvdata(pdev, NULL); 233 platform_set_drvdata(pdev, NULL);
247 kfree(priv); 234 kfree(priv);
248 return 0; 235 return 0;
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 208e42ba9455..3df2aaec829f 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -410,7 +410,6 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
410#endif 410#endif
411 411
412#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ 412#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
413 defined(CONFIG_CPU_SUBTYPE_SH7763) || \
414 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 413 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
415 defined(CONFIG_CPU_SUBTYPE_SH7785) 414 defined(CONFIG_CPU_SUBTYPE_SH7785)
416static inline int scif_txroom(struct uart_port *port) 415static inline int scif_txroom(struct uart_port *port)
@@ -422,6 +421,22 @@ static inline int scif_rxroom(struct uart_port *port)
422{ 421{
423 return sci_in(port, SCRFDR) & 0xff; 422 return sci_in(port, SCRFDR) & 0xff;
424} 423}
424#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
425static inline int scif_txroom(struct uart_port *port)
426{
427 if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/
428 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff);
429 else /* SCIF2 */
430 return SCIF2_TXROOM_MAX - (sci_in(port, SCFDR) >> 8);
431}
432
433static inline int scif_rxroom(struct uart_port *port)
434{
435 if((port->mapbase == 0xffe00000) || (port->mapbase == 0xffe08000)) /* SCIF0/1*/
436 return sci_in(port, SCRFDR) & 0xff;
437 else /* SCIF2 */
438 return sci_in(port, SCFDR) & SCIF2_RFDC_MASK;
439}
425#else 440#else
426static inline int scif_txroom(struct uart_port *port) 441static inline int scif_txroom(struct uart_port *port)
427{ 442{
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index eb84833233fd..cd728df6a01a 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -123,8 +123,9 @@
123#elif defined(CONFIG_CPU_SUBTYPE_SH7763) 123#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
124# define SCSPTR0 0xffe00024 /* 16 bit SCIF */ 124# define SCSPTR0 0xffe00024 /* 16 bit SCIF */
125# define SCSPTR1 0xffe08024 /* 16 bit SCIF */ 125# define SCSPTR1 0xffe08024 /* 16 bit SCIF */
126# define SCSPTR2 0xffe10020 /* 16 bit SCIF/IRDA */
126# define SCIF_ORER 0x0001 /* overrun error bit */ 127# define SCIF_ORER 0x0001 /* overrun error bit */
127# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 128# define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
128# define SCIF_ONLY 129# define SCIF_ONLY
129#elif defined(CONFIG_CPU_SUBTYPE_SH7770) 130#elif defined(CONFIG_CPU_SUBTYPE_SH7770)
130# define SCSPTR0 0xff923020 /* 16 bit SCIF */ 131# define SCSPTR0 0xff923020 /* 16 bit SCIF */
@@ -188,6 +189,7 @@
188 defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ 189 defined(CONFIG_CPU_SUBTYPE_SH7750S) || \
189 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 190 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
190 defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ 191 defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
192 defined(CONFIG_CPU_SUBTYPE_SH7763) || \
191 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 193 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
192 defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 194 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
193 defined(CONFIG_CPU_SUBTYPE_SHX3) 195 defined(CONFIG_CPU_SUBTYPE_SHX3)
@@ -225,14 +227,21 @@
225#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 227#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
226 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 228 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
227 defined(CONFIG_CPU_SUBTYPE_SH7721) 229 defined(CONFIG_CPU_SUBTYPE_SH7721)
228#define SCIF_ORER 0x0200 230# define SCIF_ORER 0x0200
229#define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) 231# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER)
230#define SCIF_RFDC_MASK 0x007f 232# define SCIF_RFDC_MASK 0x007f
231#define SCIF_TXROOM_MAX 64 233# define SCIF_TXROOM_MAX 64
234#elif defined(CONFIG_CPU_SUBTYPE_SH7763)
235# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK )
236# define SCIF_RFDC_MASK 0x007f
237# define SCIF_TXROOM_MAX 64
238/* SH7763 SCIF2 support */
239# define SCIF2_RFDC_MASK 0x001f
240# define SCIF2_TXROOM_MAX 16
232#else 241#else
233#define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK) 242# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
234#define SCIF_RFDC_MASK 0x001f 243# define SCIF_RFDC_MASK 0x001f
235#define SCIF_TXROOM_MAX 16 244# define SCIF_TXROOM_MAX 16
236#endif 245#endif
237 246
238#if defined(SCI_ONLY) 247#if defined(SCI_ONLY)
@@ -445,11 +454,16 @@ SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
445 defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 454 defined(CONFIG_CPU_SUBTYPE_SH7763) || \
446 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 455 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
447 defined(CONFIG_CPU_SUBTYPE_SH7785) 456 defined(CONFIG_CPU_SUBTYPE_SH7785)
448SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
449SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16) 457SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
450SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16) 458SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
451SCIF_FNS(SCSPTR, 0, 0, 0x24, 16) 459SCIF_FNS(SCSPTR, 0, 0, 0x24, 16)
452SCIF_FNS(SCLSR, 0, 0, 0x28, 16) 460SCIF_FNS(SCLSR, 0, 0, 0x28, 16)
461#if defined(CONFIG_CPU_SUBTYPE_SH7763)
462/* SH7763 SCIF2 */
463SCIF_FNS(SCFDR, 0, 0, 0x1C, 16)
464SCIF_FNS(SCSPTR2, 0, 0, 0x20, 16)
465SCIF_FNS(SCLSR2, 0, 0, 0x24, 16)
466#endif /* CONFIG_CPU_SUBTYPE_SH7763 */
453#else 467#else
454SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) 468SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
455#if defined(CONFIG_CPU_SUBTYPE_SH7722) 469#if defined(CONFIG_CPU_SUBTYPE_SH7722)
@@ -652,6 +666,9 @@ static inline int sci_rxd_in(struct uart_port *port)
652 return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */ 666 return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; /* SCIF */
653 if (port->mapbase == 0xffe08000) 667 if (port->mapbase == 0xffe08000)
654 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 668 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
669 if (port->mapbase == 0xffe10000)
670 return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF/IRDA */
671
655 return 1; 672 return 1;
656} 673}
657#elif defined(CONFIG_CPU_SUBTYPE_SH7770) 674#elif defined(CONFIG_CPU_SUBTYPE_SH7770)
@@ -764,8 +781,7 @@ static inline int sci_rxd_in(struct uart_port *port)
764 * -- Mitch Davis - 15 Jul 2000 781 * -- Mitch Davis - 15 Jul 2000
765 */ 782 */
766 783
767#if defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 784#if defined(CONFIG_CPU_SUBTYPE_SH7780) || \
768 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
769 defined(CONFIG_CPU_SUBTYPE_SH7785) 785 defined(CONFIG_CPU_SUBTYPE_SH7785)
770#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) 786#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1)
771#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 787#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \