1. 09 9月, 2014 15 次提交
  2. 09 8月, 2014 1 次提交
  3. 07 8月, 2014 1 次提交
  4. 05 8月, 2014 1 次提交
  5. 02 8月, 2014 3 次提交
  6. 28 7月, 2014 5 次提交
  7. 24 7月, 2014 3 次提交
  8. 23 7月, 2014 2 次提交
  9. 19 7月, 2014 1 次提交
  10. 18 7月, 2014 8 次提交
    • Y
      serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers · aef9a7bd
      Yoshihiro YUNOMAE 提交于
      Add tunable RX interrupt trigger I/F of FIFO buffers.
      
      Serial devices are used as not only message communication devices but control
      or sending communication devices. For the latter uses, normally small data
      will be exchanged, so user applications want to receive data unit as soon as
      possible for real-time tendency. If we have a sensor which sends a 1 byte data
      each time and must control a device based on the sensor feedback, the RX
      interrupt should be triggered for each data.
      
      According to HW specification of serial UART devices, RX interrupt trigger
      can be changed, but the trigger is hard-coded. For example, RX interrupt trigger
      in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current driver sets
      the trigger to only 8bytes.
      
      This patch makes some devices change RX interrupt trigger from userland.
      
      <How to use>
      - Read current setting
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       8
      
      - Write user setting
       # echo 1 > /sys/class/tty/ttyS0/rx_trig_bytes
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       1
      
      <Support uart devices>
      - 16550A and Tegra (1, 4, 8, or 14 bytes)
      - 16650V2 (8, 16, 24, or 28 bytes)
      - 16654 (8, 16, 56, or 60 bytes)
      - 16750 (1, 16, 32, or 56 bytes)
      
      <Change log>
      Changes in V9:
       - Use attr_group instead of dev_spec_attr_group of uart_port structure
      
      Changes in V8:
       - Divide this patch from V7's patch based on Greg's comment
      
      Changes in V7:
       - Add Documentation
       - Change I/F name from rx_int_trig to rx_trig_bytes because the name
         rx_int_trig is hard to understand how users specify the value
      
      Changes in V6:
       - Move FCR_RX_TRIG_* definition in 8250.h to include/uapi/linux/serial_reg.h,
         rename those to UART_FCR_R_TRIG_*, and use UART_FCR_TRIGGER_MASK to
         UART_FCR_R_TRIG_BITS()
       - Change following function names:
          convert_fcr2val() => fcr_get_rxtrig_bytes()
          convert_val2rxtrig() => bytes_to_fcr_rxtrig()
       - Fix typo in serial8250_do_set_termios()
       - Delete the verbose error message pr_info() in bytes_to_fcr_rxtrig()
       - Rename *rx_int_trig/rx_trig* to *rxtrig* for several functions or variables
         (but UI remains rx_int_trig)
       - Change the meaningless variable name 'val' to 'bytes' following functions:
          fcr_get_rxtrig_bytes(), bytes_to_fcr_rxtrig(), do_set_rxtrig(),
          do_serial8250_set_rxtrig(), and serial8250_set_attr_rxtrig()
       - Use up->fcr in order to get rxtrig_bytes instead of rx_trig_raw in
         fcr_get_rxtrig_bytes()
       - Use conf_type->rxtrig_bytes[0] instead of switch statement for support check
         in register_dev_spec_attr_grp()
       - Delete the checking whether a user changed FCR or not when minimum buffer
         is needed in serial8250_do_set_termios()
      
      Changes in V5.1:
       - Fix FCR_RX_TRIG_MAX_STATE definition
      
      Changes in V5:
       - Support Tegra, 16650V2, 16654, and 16750
       - Store default FCR value to up->fcr when the port is first created
       - Add rx_trig_byte[] in uart_config[] for each device and use rx_trig_byte[]
         in convert_fcr2val() and convert_val2rxtrig()
      
      Changes in V4:
       - Introduce fifo_bug flag in uart_8250_port structure
         This is enabled only when parity is enabled and UART_BUG_PARITY is enabled
         for up->bugs. If this flag is enabled, user cannot set RX trigger.
       - Return -EOPNOTSUPP when it does not support device at convert_fcr2val() and
         at convert_val2rxtrig()
       - Set the nearest lower RX trigger when users input a meaningless value at
         convert_val2rxtrig()
       - Check whether p->fcr is existing at serial8250_clear_and_reinit_fifos()
       - Set fcr = up->fcr in the begging of serial8250_do_set_termios()
      
      Changes in V3:
       - Change I/F from ioctl(2) to sysfs(rx_int_trig)
      
      Changed in V2:
       - Use _IOW for TIOCSFIFORTRIG definition
       - Pass the interrupt trigger value itself
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aef9a7bd
    • G
      Serial: allow port drivers to have a default attribute group · 266dcff0
      Greg Kroah-Hartman 提交于
      Some serial drivers (like 8250), want to add sysfs files.  We need to do
      so in a race-free way, so allow any port to be able to specify an
      attribute group that should be added at device creation time.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      266dcff0
    • D
      tty: kgdb_nmi: Automatically manage tty enable · c8b29f04
      Daniel Thompson 提交于
      At present it is not possible to boot with the ttyNMI0 console treating
      character input normally, instead character input triggers a prompt
      telling the user how to trigger the knock detector and enter the
      debugger. To use the console normally requires that kdb be entered and
      the nmi_console command be used to enable the console (or if only kgdb
      is present then gdb must directly manipulate the value of
      kgdb_nmi_tty_enabled).
      
      This patch automates the management of kgdb_nmi_tty_enabled by keeping
      track of the number of file handles that are open for reading and using
      that to determine how to tty should operate.
      
      The approach means that:
      
      1. Behaviour before init starts is unchanged.
      
      2. If the userspace runs a getty or some other interactive process on
         /dev/console (or explicitly on /dev/ttyNMI0) the tty will treat
         character input like any other tty.
      
      3. If the userspace doesn't use /dev/console or if it uses /dev/console
         only to log messages (O_WRONLY) then the user prompt is retained.
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: linux-serial@vger.kernel.org
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: kgdb-bugreport@lists.sourceforge.net
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c8b29f04
    • T
      serial: altera_jtaguart: Adpot uart_console_write() · 3d1c90d4
      Tobias Klauser 提交于
      Follow commit 2970b7f5 ("serial: altera: Adopt
      uart_console_write()") and don't open code the LF to LFCR conversion in
      altera_jtaguart either. Use uart_console_write() instead.
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d1c90d4
    • N
      serial: samsung: improve code clarity by defining a variable · 4622eb68
      Naveen Krishna Chatradhi 提交于
      The of_node is derived from pdev for every usage, define a
      device_node variable instead.
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4622eb68
    • N
      serial: samsung: correct the case and default order in switch · 3bcce591
      Naveen Krishna Chatradhi 提交于
      The cases should comes before default in a switch.
      
      Even if we want the case and default to share same code.
      Its good to define the case first followed by default.
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3bcce591
    • N
      serial: samsung: get fifosize via device tree · 135f07c3
      Naveen Krishna Chatradhi 提交于
      UART modules on some SoCs only differ in the fifosize of each
      UART channel. Its useless to duplicate the drv_data structure
      or create a compatible name for such a change.
      
      We can get fifosize via the device tree nodes (not mandating it).
      
      Also updates the documentation.
      Signed-off-by: NNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Reviewed-by: NTomasz Figa <t.figa@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      135f07c3
    • A
      serial: 8250: introduce up_to_u8250p() helper · b1261c86
      Andy Shevchenko 提交于
      It helps to cast struct uart_port to struct uart_8250_port at runtime.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1261c86