@@ -1075,10 +1075,33 @@ int gpmc_configure(int cmd, int wval)
1075
1075
}
1076
1076
EXPORT_SYMBOL (gpmc_configure );
1077
1077
1078
- void gpmc_update_nand_reg (struct gpmc_nand_regs * reg , int cs )
1078
+ static bool gpmc_nand_writebuffer_empty (void )
1079
+ {
1080
+ if (gpmc_read_reg (GPMC_STATUS ) & GPMC_STATUS_EMPTYWRITEBUFFERSTATUS )
1081
+ return true;
1082
+
1083
+ return false;
1084
+ }
1085
+
1086
+ static struct gpmc_nand_ops nand_ops = {
1087
+ .nand_writebuffer_empty = gpmc_nand_writebuffer_empty ,
1088
+ };
1089
+
1090
+ /**
1091
+ * gpmc_omap_get_nand_ops - Get the GPMC NAND interface
1092
+ * @regs: the GPMC NAND register map exclusive for NAND use.
1093
+ * @cs: GPMC chip select number on which the NAND sits. The
1094
+ * register map returned will be specific to this chip select.
1095
+ *
1096
+ * Returns NULL on error e.g. invalid cs.
1097
+ */
1098
+ struct gpmc_nand_ops * gpmc_omap_get_nand_ops (struct gpmc_nand_regs * reg , int cs )
1079
1099
{
1080
1100
int i ;
1081
1101
1102
+ if (cs >= gpmc_cs_num )
1103
+ return NULL ;
1104
+
1082
1105
reg -> gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
1083
1106
GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs ;
1084
1107
reg -> gpmc_nand_address = gpmc_base + GPMC_CS0_OFFSET +
@@ -1110,34 +1133,6 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
1110
1133
reg -> gpmc_bch_result6 [i ] = gpmc_base + GPMC_ECC_BCH_RESULT_6 +
1111
1134
i * GPMC_BCH_SIZE ;
1112
1135
}
1113
- }
1114
-
1115
- static bool gpmc_nand_writebuffer_empty (void )
1116
- {
1117
- if (gpmc_read_reg (GPMC_STATUS ) & GPMC_STATUS_EMPTYWRITEBUFFERSTATUS )
1118
- return true;
1119
-
1120
- return false;
1121
- }
1122
-
1123
- static struct gpmc_nand_ops nand_ops = {
1124
- .nand_writebuffer_empty = gpmc_nand_writebuffer_empty ,
1125
- };
1126
-
1127
- /**
1128
- * gpmc_omap_get_nand_ops - Get the GPMC NAND interface
1129
- * @regs: the GPMC NAND register map exclusive for NAND use.
1130
- * @cs: GPMC chip select number on which the NAND sits. The
1131
- * register map returned will be specific to this chip select.
1132
- *
1133
- * Returns NULL on error e.g. invalid cs.
1134
- */
1135
- struct gpmc_nand_ops * gpmc_omap_get_nand_ops (struct gpmc_nand_regs * reg , int cs )
1136
- {
1137
- if (cs >= gpmc_cs_num )
1138
- return NULL ;
1139
-
1140
- gpmc_update_nand_reg (reg , cs );
1141
1136
1142
1137
return & nand_ops ;
1143
1138
}
0 commit comments