aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/bfin_sport_uart.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2009-01-02 08:49:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:42 -0500
commit6ef53066ff7991d5f9670340e92d42ee1776bbe4 (patch)
treebd650d7708e108aadcd70de54da938166507ff3f /drivers/serial/bfin_sport_uart.c
parent60c20fb8c00a2b23308ae4517f145383bc66d291 (diff)
__FUNCTION__ is gcc-specific, use __func__
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/bfin_sport_uart.c')
-rw-r--r--drivers/serial/bfin_sport_uart.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index dd8564d2505..529c0ff7952 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -99,7 +99,7 @@ static void sport_stop_tx(struct uart_port *port);
99 99
100static inline void tx_one_byte(struct sport_uart_port *up, unsigned int value) 100static inline void tx_one_byte(struct sport_uart_port *up, unsigned int value)
101{ 101{
102 pr_debug("%s value:%x\n", __FUNCTION__, value); 102 pr_debug("%s value:%x\n", __func__, value);
103 /* Place a Start and Stop bit */ 103 /* Place a Start and Stop bit */
104 __asm__ volatile ( 104 __asm__ volatile (
105 "R2 = b#01111111100;\n\t" 105 "R2 = b#01111111100;\n\t"
@@ -110,7 +110,7 @@ static inline void tx_one_byte(struct sport_uart_port *up, unsigned int value)
110 :"=r"(value) 110 :"=r"(value)
111 :"0"(value) 111 :"0"(value)
112 :"R2", "R3"); 112 :"R2", "R3");
113 pr_debug("%s value:%x\n", __FUNCTION__, value); 113 pr_debug("%s value:%x\n", __func__, value);
114 114
115 SPORT_PUT_TX(up, value); 115 SPORT_PUT_TX(up, value);
116} 116}
@@ -120,7 +120,7 @@ static inline unsigned int rx_one_byte(struct sport_uart_port *up)
120 unsigned int value, extract; 120 unsigned int value, extract;
121 121
122 value = SPORT_GET_RX32(up); 122 value = SPORT_GET_RX32(up);
123 pr_debug("%s value:%x\n", __FUNCTION__, value); 123 pr_debug("%s value:%x\n", __func__, value);
124 124
125 /* Extract 8 bits data */ 125 /* Extract 8 bits data */
126 __asm__ volatile ( 126 __asm__ volatile (
@@ -151,12 +151,12 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate)
151 /* Set TCR1 and TCR2 */ 151 /* Set TCR1 and TCR2 */
152 SPORT_PUT_TCR1(up, (LTFS | ITFS | TFSR | TLSBIT | ITCLK)); 152 SPORT_PUT_TCR1(up, (LTFS | ITFS | TFSR | TLSBIT | ITCLK));
153 SPORT_PUT_TCR2(up, 10); 153 SPORT_PUT_TCR2(up, 10);
154 pr_debug("%s TCR1:%x, TCR2:%x\n", __FUNCTION__, SPORT_GET_TCR1(up), SPORT_GET_TCR2(up)); 154 pr_debug("%s TCR1:%x, TCR2:%x\n", __func__, SPORT_GET_TCR1(up), SPORT_GET_TCR2(up));
155 155
156 /* Set RCR1 and RCR2 */ 156 /* Set RCR1 and RCR2 */
157 SPORT_PUT_RCR1(up, (RCKFE | LARFS | LRFS | RFSR | IRCLK)); 157 SPORT_PUT_RCR1(up, (RCKFE | LARFS | LRFS | RFSR | IRCLK));
158 SPORT_PUT_RCR2(up, 28); 158 SPORT_PUT_RCR2(up, 28);
159 pr_debug("%s RCR1:%x, RCR2:%x\n", __FUNCTION__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up)); 159 pr_debug("%s RCR1:%x, RCR2:%x\n", __func__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up));
160 160
161 tclkdiv = sclk/(2 * baud_rate) - 1; 161 tclkdiv = sclk/(2 * baud_rate) - 1;
162 tfsdiv = 12; 162 tfsdiv = 12;
@@ -166,7 +166,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate)
166 SPORT_PUT_RCLKDIV(up, rclkdiv); 166 SPORT_PUT_RCLKDIV(up, rclkdiv);
167 SSYNC(); 167 SSYNC();
168 pr_debug("%s sclk:%d, baud_rate:%d, tclkdiv:%d, tfsdiv:%d, rclkdiv:%d\n", 168 pr_debug("%s sclk:%d, baud_rate:%d, tclkdiv:%d, tfsdiv:%d, rclkdiv:%d\n",
169 __FUNCTION__, sclk, baud_rate, tclkdiv, tfsdiv, rclkdiv); 169 __func__, sclk, baud_rate, tclkdiv, tfsdiv, rclkdiv);
170 170
171 return 0; 171 return 0;
172} 172}
@@ -231,7 +231,7 @@ static int sport_startup(struct uart_port *port)
231 char buffer[20]; 231 char buffer[20];
232 int retval; 232 int retval;
233 233
234 pr_debug("%s enter\n", __FUNCTION__); 234 pr_debug("%s enter\n", __func__);
235 memset(buffer, 20, '\0'); 235 memset(buffer, 20, '\0');
236 snprintf(buffer, 20, "%s rx", up->name); 236 snprintf(buffer, 20, "%s rx", up->name);
237 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up); 237 retval = request_irq(up->rx_irq, sport_uart_rx_irq, IRQF_SAMPLE_RANDOM, buffer, up);
@@ -320,7 +320,7 @@ static unsigned int sport_tx_empty(struct uart_port *port)
320 unsigned int stat; 320 unsigned int stat;
321 321
322 stat = SPORT_GET_STAT(up); 322 stat = SPORT_GET_STAT(up);
323 pr_debug("%s stat:%04x\n", __FUNCTION__, stat); 323 pr_debug("%s stat:%04x\n", __func__, stat);
324 if (stat & TXHRE) { 324 if (stat & TXHRE) {
325 return TIOCSER_TEMT; 325 return TIOCSER_TEMT;
326 } else 326 } else
@@ -329,13 +329,13 @@ static unsigned int sport_tx_empty(struct uart_port *port)
329 329
330static unsigned int sport_get_mctrl(struct uart_port *port) 330static unsigned int sport_get_mctrl(struct uart_port *port)
331{ 331{
332 pr_debug("%s enter\n", __FUNCTION__); 332 pr_debug("%s enter\n", __func__);
333 return (TIOCM_CTS | TIOCM_CD | TIOCM_DSR); 333 return (TIOCM_CTS | TIOCM_CD | TIOCM_DSR);
334} 334}
335 335
336static void sport_set_mctrl(struct uart_port *port, unsigned int mctrl) 336static void sport_set_mctrl(struct uart_port *port, unsigned int mctrl)
337{ 337{
338 pr_debug("%s enter\n", __FUNCTION__); 338 pr_debug("%s enter\n", __func__);
339} 339}
340 340
341static void sport_stop_tx(struct uart_port *port) 341static void sport_stop_tx(struct uart_port *port)
@@ -343,7 +343,7 @@ static void sport_stop_tx(struct uart_port *port)
343 struct sport_uart_port *up = (struct sport_uart_port *)port; 343 struct sport_uart_port *up = (struct sport_uart_port *)port;
344 unsigned int stat; 344 unsigned int stat;
345 345
346 pr_debug("%s enter\n", __FUNCTION__); 346 pr_debug("%s enter\n", __func__);
347 347
348 stat = SPORT_GET_STAT(up); 348 stat = SPORT_GET_STAT(up);
349 while(!(stat & TXHRE)) { 349 while(!(stat & TXHRE)) {
@@ -366,21 +366,21 @@ static void sport_start_tx(struct uart_port *port)
366{ 366{
367 struct sport_uart_port *up = (struct sport_uart_port *)port; 367 struct sport_uart_port *up = (struct sport_uart_port *)port;
368 368
369 pr_debug("%s enter\n", __FUNCTION__); 369 pr_debug("%s enter\n", __func__);
370 /* Write data into SPORT FIFO before enable SPROT to transmit */ 370 /* Write data into SPORT FIFO before enable SPROT to transmit */
371 sport_uart_tx_chars(up); 371 sport_uart_tx_chars(up);
372 372
373 /* Enable transmit, then an interrupt will generated */ 373 /* Enable transmit, then an interrupt will generated */
374 SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) | TSPEN)); 374 SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) | TSPEN));
375 SSYNC(); 375 SSYNC();
376 pr_debug("%s exit\n", __FUNCTION__); 376 pr_debug("%s exit\n", __func__);
377} 377}
378 378
379static void sport_stop_rx(struct uart_port *port) 379static void sport_stop_rx(struct uart_port *port)
380{ 380{
381 struct sport_uart_port *up = (struct sport_uart_port *)port; 381 struct sport_uart_port *up = (struct sport_uart_port *)port;
382 382
383 pr_debug("%s enter\n", __FUNCTION__); 383 pr_debug("%s enter\n", __func__);
384 /* Disable sport to stop rx */ 384 /* Disable sport to stop rx */
385 SPORT_PUT_RCR1(up, (SPORT_GET_RCR1(up) & ~RSPEN)); 385 SPORT_PUT_RCR1(up, (SPORT_GET_RCR1(up) & ~RSPEN));
386 SSYNC(); 386 SSYNC();
@@ -388,19 +388,19 @@ static void sport_stop_rx(struct uart_port *port)
388 388
389static void sport_enable_ms(struct uart_port *port) 389static void sport_enable_ms(struct uart_port *port)
390{ 390{
391 pr_debug("%s enter\n", __FUNCTION__); 391 pr_debug("%s enter\n", __func__);
392} 392}
393 393
394static void sport_break_ctl(struct uart_port *port, int break_state) 394static void sport_break_ctl(struct uart_port *port, int break_state)
395{ 395{
396 pr_debug("%s enter\n", __FUNCTION__); 396 pr_debug("%s enter\n", __func__);
397} 397}
398 398
399static void sport_shutdown(struct uart_port *port) 399static void sport_shutdown(struct uart_port *port)
400{ 400{
401 struct sport_uart_port *up = (struct sport_uart_port *)port; 401 struct sport_uart_port *up = (struct sport_uart_port *)port;
402 402
403 pr_debug("%s enter\n", __FUNCTION__); 403 pr_debug("%s enter\n", __func__);
404 404
405 /* Disable sport */ 405 /* Disable sport */
406 SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) & ~TSPEN)); 406 SPORT_PUT_TCR1(up, (SPORT_GET_TCR1(up) & ~TSPEN));
@@ -421,7 +421,7 @@ static void sport_shutdown(struct uart_port *port)
421static void sport_set_termios(struct uart_port *port, 421static void sport_set_termios(struct uart_port *port,
422 struct termios *termios, struct termios *old) 422 struct termios *termios, struct termios *old)
423{ 423{
424 pr_debug("%s enter, c_cflag:%08x\n", __FUNCTION__, termios->c_cflag); 424 pr_debug("%s enter, c_cflag:%08x\n", __func__, termios->c_cflag);
425 uart_update_timeout(port, CS8 ,port->uartclk); 425 uart_update_timeout(port, CS8 ,port->uartclk);
426} 426}
427 427
@@ -429,18 +429,18 @@ static const char *sport_type(struct uart_port *port)
429{ 429{
430 struct sport_uart_port *up = (struct sport_uart_port *)port; 430 struct sport_uart_port *up = (struct sport_uart_port *)port;
431 431
432 pr_debug("%s enter\n", __FUNCTION__); 432 pr_debug("%s enter\n", __func__);
433 return up->name; 433 return up->name;
434} 434}
435 435
436static void sport_release_port(struct uart_port *port) 436static void sport_release_port(struct uart_port *port)
437{ 437{
438 pr_debug("%s enter\n", __FUNCTION__); 438 pr_debug("%s enter\n", __func__);
439} 439}
440 440
441static int sport_request_port(struct uart_port *port) 441static int sport_request_port(struct uart_port *port)
442{ 442{
443 pr_debug("%s enter\n", __FUNCTION__); 443 pr_debug("%s enter\n", __func__);
444 return 0; 444 return 0;
445} 445}
446 446
@@ -448,13 +448,13 @@ static void sport_config_port(struct uart_port *port, int flags)
448{ 448{
449 struct sport_uart_port *up = (struct sport_uart_port *)port; 449 struct sport_uart_port *up = (struct sport_uart_port *)port;
450 450
451 pr_debug("%s enter\n", __FUNCTION__); 451 pr_debug("%s enter\n", __func__);
452 up->port.type = PORT_BFIN_SPORT; 452 up->port.type = PORT_BFIN_SPORT;
453} 453}
454 454
455static int sport_verify_port(struct uart_port *port, struct serial_struct *ser) 455static int sport_verify_port(struct uart_port *port, struct serial_struct *ser)
456{ 456{
457 pr_debug("%s enter\n", __FUNCTION__); 457 pr_debug("%s enter\n", __func__);
458 return 0; 458 return 0;
459} 459}
460 460
@@ -527,7 +527,7 @@ static int sport_uart_suspend(struct platform_device *dev, pm_message_t state)
527{ 527{
528 struct sport_uart_port *sport = platform_get_drvdata(dev); 528 struct sport_uart_port *sport = platform_get_drvdata(dev);
529 529
530 pr_debug("%s enter\n", __FUNCTION__); 530 pr_debug("%s enter\n", __func__);
531 if (sport) 531 if (sport)
532 uart_suspend_port(&sport_uart_reg, &sport->port); 532 uart_suspend_port(&sport_uart_reg, &sport->port);
533 533
@@ -538,7 +538,7 @@ static int sport_uart_resume(struct platform_device *dev)
538{ 538{
539 struct sport_uart_port *sport = platform_get_drvdata(dev); 539 struct sport_uart_port *sport = platform_get_drvdata(dev);
540 540
541 pr_debug("%s enter\n", __FUNCTION__); 541 pr_debug("%s enter\n", __func__);
542 if (sport) 542 if (sport)
543 uart_resume_port(&sport_uart_reg, &sport->port); 543 uart_resume_port(&sport_uart_reg, &sport->port);
544 544
@@ -547,7 +547,7 @@ static int sport_uart_resume(struct platform_device *dev)
547 547
548static int sport_uart_probe(struct platform_device *dev) 548static int sport_uart_probe(struct platform_device *dev)
549{ 549{
550 pr_debug("%s enter\n", __FUNCTION__); 550 pr_debug("%s enter\n", __func__);
551 sport_uart_ports[dev->id].port.dev = &dev->dev; 551 sport_uart_ports[dev->id].port.dev = &dev->dev;
552 uart_add_one_port(&sport_uart_reg, &sport_uart_ports[dev->id].port); 552 uart_add_one_port(&sport_uart_reg, &sport_uart_ports[dev->id].port);
553 platform_set_drvdata(dev, &sport_uart_ports[dev->id]); 553 platform_set_drvdata(dev, &sport_uart_ports[dev->id]);
@@ -559,7 +559,7 @@ static int sport_uart_remove(struct platform_device *dev)
559{ 559{
560 struct sport_uart_port *sport = platform_get_drvdata(dev); 560 struct sport_uart_port *sport = platform_get_drvdata(dev);
561 561
562 pr_debug("%s enter\n", __FUNCTION__); 562 pr_debug("%s enter\n", __func__);
563 platform_set_drvdata(dev, NULL); 563 platform_set_drvdata(dev, NULL);
564 564
565 if (sport) 565 if (sport)
@@ -582,7 +582,7 @@ static int __init sport_uart_init(void)
582{ 582{
583 int ret; 583 int ret;
584 584
585 pr_debug("%s enter\n", __FUNCTION__); 585 pr_debug("%s enter\n", __func__);
586 ret = uart_register_driver(&sport_uart_reg); 586 ret = uart_register_driver(&sport_uart_reg);
587 if (ret != 0) { 587 if (ret != 0) {
588 printk(KERN_ERR "Failed to register %s:%d\n", 588 printk(KERN_ERR "Failed to register %s:%d\n",
@@ -597,13 +597,13 @@ static int __init sport_uart_init(void)
597 } 597 }
598 598
599 599
600 pr_debug("%s exit\n", __FUNCTION__); 600 pr_debug("%s exit\n", __func__);
601 return ret; 601 return ret;
602} 602}
603 603
604static void __exit sport_uart_exit(void) 604static void __exit sport_uart_exit(void)
605{ 605{
606 pr_debug("%s enter\n", __FUNCTION__); 606 pr_debug("%s enter\n", __func__);
607 platform_driver_unregister(&sport_uart_driver); 607 platform_driver_unregister(&sport_uart_driver);
608 uart_unregister_driver(&sport_uart_reg); 608 uart_unregister_driver(&sport_uart_reg);
609} 609}