[FE training-materials-updates] kernel-serial-iomem: fix indentation
Alexandre Belloni
alexandre.belloni at free-electrons.com
Thu Nov 7 20:50:25 CET 2013
Repository : git://git.free-electrons.com/training-materials.git
On branch : master
Link : http://git.free-electrons.com/training-materials/commit/?id=e21ef12fa55c27f95f011d9c342b1efb122ed08f
>---------------------------------------------------------------
commit e21ef12fa55c27f95f011d9c342b1efb122ed08f
Author: Alexandre Belloni <alexandre.belloni at free-electrons.com>
Date: Thu Nov 7 14:49:39 2013 -0500
kernel-serial-iomem: fix indentation
Signed-off-by: Alexandre Belloni <alexandre.belloni at free-electrons.com>
>---------------------------------------------------------------
e21ef12fa55c27f95f011d9c342b1efb122ed08f
labs/kernel-serial-iomem/kernel-serial-iomem.tex | 87 +++++++++++-----------
1 file changed, 43 insertions(+), 44 deletions(-)
diff --git a/labs/kernel-serial-iomem/kernel-serial-iomem.tex b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
index 547a0f0..b26ca17 100644
--- a/labs/kernel-serial-iomem/kernel-serial-iomem.tex
+++ b/labs/kernel-serial-iomem/kernel-serial-iomem.tex
@@ -52,51 +52,50 @@ file and create declarations for UART2 and UART4 in the pin muxing
section:
\begin{verbatim}
- /* Pins 21 (TX) and 22 (RX) of connector P9 */
- uart2_pins: uart2_pins {
- pinctrl-single,pins = <
- 0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* spi0_d0.uart2_tx, MODE 1 */
- 0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_sclk.uart2_rx, MODE 1 */
- >;
- };
-
- /* Pins 11 (RX) and 13 (TX) of connector P9 */
- uart4_pins: uart4_pins {
- pinctrl-single,pins = <
- 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_wpn.uart4_tx, MODE 6 */
- 0x70 (PIN_INPUT_PULLUP | MUX_MODE6) /* gpmc_wait0.uart4_rx, MODE 6 */
- >;
- };
+ /* Pins 21 (TX) and 22 (RX) of connector P9 */
+ uart2_pins: uart2_pins {
+ pinctrl-single,pins = <
+ 0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* spi0_d0.uart2_tx, MODE 1 */
+ 0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* spi0_sclk.uart2_rx, MODE 1 */
+ >;
+ };
+
+ /* Pins 11 (RX) and 13 (TX) of connector P9 */
+ uart4_pins: uart4_pins {
+ pinctrl-single,pins = <
+ 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_wpn.uart4_tx, MODE 6 */
+ 0x70 (PIN_INPUT_PULLUP | MUX_MODE6) /* gpmc_wait0.uart4_rx, MODE 6 */
+ >;
+ };
\end{verbatim}
Then, declare the corresponding devices:
\begin{verbatim}
- uartfe2: feserial at 48024000 {
- compatible = "free-electrons,serial";
- /* Tell the OMAP harware power management that the block
- must be enabled, otherwise it's switched off
- Caution: starting counting at 1, not 0 */
- ti,hwmods = "uart3";
- clock-frequency = <48000000>;
- reg = <0x48024000 0x2000>;
- interrupts = <74>;
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&uart2_pins>;
- };
-
- uartfe4: feserial at 481a8000 {
- compatible = "free-electrons,serial";
- ti,hwmods = "uart5";
- clock-frequency = <48000000>;
- reg = <0x481a8000 0x2000>;
- interrupts = <45>;
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&uart4_pins>;
- };
-
+ uartfe2: feserial at 48024000 {
+ compatible = "free-electrons,serial";
+ /* Tell the OMAP harware power management that the block
+ must be enabled, otherwise it's switched off
+ Caution: starting counting at 1, not 0 */
+ ti,hwmods = "uart3";
+ clock-frequency = <48000000>;
+ reg = <0x48024000 0x2000>;
+ interrupts = <74>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins>;
+ };
+
+ uartfe4: feserial at 481a8000 {
+ compatible = "free-electrons,serial";
+ ti,hwmods = "uart5";
+ clock-frequency = <48000000>;
+ reg = <0x481a8000 0x2000>;
+ interrupts = <45>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart4_pins>;
+ };
\end{verbatim}
Note: we are calling these devices with \code{uartfe} instead of
@@ -231,14 +230,14 @@ We are now ready to read and write registers!
Add the below lines to the probe function:
\begin{verbatim}
- pm_runtime_enable(&pdev->dev);
- pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_get_sync(&pdev->dev);
\end{verbatim}
And add the below line to the \code{remove()} routine:
\begin{verbatim}
- pm_runtime_disable(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
\end{verbatim}
\subsection{Line and baud rate configuration}
@@ -258,7 +257,7 @@ property from the device tree, in this case \code{clock-frequency}:
reg_write(dev, UART_LCR_DLAB, UART_LCR);
reg_write(dev, baud_divisor & 0xff, UART_DLL);
reg_write(dev, (baud_divisor >> 8) & 0xff, UART_DLM);
- reg_write(dev, UART_LCR_WLEN8, UART_LCR);
+ reg_write(dev, UART_LCR_WLEN8, UART_LCR);
\end{verbatim}
Declare \code{baud_divisor} and \code{uartclk} as \code{unsigned int}.
More information about the training-materials-updates
mailing list