Merge "msm: clock-8610: Allow measurement of clocks in the WCNSS"
diff --git a/Documentation/devicetree/bindings/arm/msm/clock-krait-8974.txt b/Documentation/devicetree/bindings/arm/msm/clock-krait-8974.txt
index ee9a286..d9ccb09 100644
--- a/Documentation/devicetree/bindings/arm/msm/clock-krait-8974.txt
+++ b/Documentation/devicetree/bindings/arm/msm/clock-krait-8974.txt
@@ -41,6 +41,8 @@
- qcom,hfpll-user-vco-mask:
The mask to be used when programming the VCO selection
bits in the user control register.
+- qcom,pvs-config-ver:
+ The version of the data in qcom,speedX-pvsY-bin-vZ.
Example:
qcom,clock-krait@f9016000 {
diff --git a/Documentation/devicetree/bindings/arm/msm/cpr-regulator.txt b/Documentation/devicetree/bindings/arm/msm/cpr-regulator.txt
index 99de826..9af81da 100644
--- a/Documentation/devicetree/bindings/arm/msm/cpr-regulator.txt
+++ b/Documentation/devicetree/bindings/arm/msm/cpr-regulator.txt
@@ -11,7 +11,7 @@
bits to indicate what bin (and voltage range) a chip is in.
Required properties:
-- compatible: Must be "qti,cpr-regulator"
+- compatible: Must be "qcom,cpr-regulator"
- reg: Register addresses for RBCPR, RBCPR clock
select, PVS and CPR eFuse address
- reg-names: Register names. Must be "rbcpr", "rbcpr_clk",
@@ -22,41 +22,41 @@
should be 1 for SVS corner
- regulator-max-microvolt: Maximum corner value as max constraint, which
should be 4 for SUPER_TURBO or 3 for TURBO
-- qti,pvs-init-voltage: A list of integers whose length is equal to 2
- to the power of qti,pvs-fuse[num-of-bits]. The
+- qcom,pvs-init-voltage: A list of integers whose length is equal to 2
+ to the power of qcom,pvs-fuse[num-of-bits]. The
location or 0-based index of an element in the
list corresponds to the bin number. The value of
each integer corresponds to the initial voltage
of the PVS bin in turbo mode in microvolts.
-- qti,pvs-corner-ceiling-slow: Ceiling voltages of all corners for APC_PVS_SLOW
-- qti,pvs-corner-ceiling-nom: Ceiling voltages of all corners for APC_PVS_NOM
-- qti,pvs-corner-ceiling-fast: Ceiling voltages of all corners for APC_PVS_FAST
+- qcom,pvs-corner-ceiling-slow: Ceiling voltages of all corners for APC_PVS_SLOW
+- qcom,pvs-corner-ceiling-nom: Ceiling voltages of all corners for APC_PVS_NOM
+- qcom,pvs-corner-ceiling-fast: Ceiling voltages of all corners for APC_PVS_FAST
The ceiling voltages for each of above three
properties may look like this:
0 (SVS voltage): 1050000 uV
1 (NORMAL voltage): 1150000 uV
2 (TURBO voltage): 1275000 uV
- vdd-apc-supply: Regulator to supply VDD APC power
-- qti,vdd-apc-step-up-limit: Limit of vdd-apc-supply steps for scaling up.
-- qti,vdd-apc-step-down-limit: Limit of vdd-apc-supply steps for scaling down.
-- qti,cpr-ref-clk: The reference clock in kHz.
-- qti,cpr-timer-delay: The delay in microseconds for the timer interval.
-- qti,cpr-timer-cons-up: Consecutive number of timer interval (qti,cpr-timer-delay)
+- qcom,vdd-apc-step-up-limit: Limit of vdd-apc-supply steps for scaling up.
+- qcom,vdd-apc-step-down-limit: Limit of vdd-apc-supply steps for scaling down.
+- qcom,cpr-ref-clk: The reference clock in kHz.
+- qcom,cpr-timer-delay: The delay in microseconds for the timer interval.
+- qcom,cpr-timer-cons-up: Consecutive number of timer interval (qcom,cpr-timer-delay)
occurred before issuing UP interrupt.
-- qti,cpr-timer-cons-down: Consecutive number of timer interval (qti,cpr-timer-delay)
+- qcom,cpr-timer-cons-down: Consecutive number of timer interval (qcom,cpr-timer-delay)
occurred before issuing DOWN interrupt.
-- qti,cpr-irq-line: Internal interrupt route signal of RBCPR, one of 0, 1 or 2.
-- qti,cpr-step-quotient: Number of CPR quotient (Ring Oscillator(RO) count) per vdd-apc-supply step
+- qcom,cpr-irq-line: Internal interrupt route signal of RBCPR, one of 0, 1 or 2.
+- qcom,cpr-step-quotient: Number of CPR quotient (Ring Oscillator(RO) count) per vdd-apc-supply step
to issue error_steps.
-- qti,cpr-up-threshold: The threshold for CPR to issue interrupt when
+- qcom,cpr-up-threshold: The threshold for CPR to issue interrupt when
error_steps is greater than it when stepping up.
-- qti,cpr-down-threshold: The threshold for CPR to issue interrupt when
+- qcom,cpr-down-threshold: The threshold for CPR to issue interrupt when
error_steps is greater than it when stepping down.
-- qti,cpr-idle-clocks: Idle clock cycles RO can be in.
-- qti,cpr-gcnt-time: The time for gate count in microseconds.
-- qti,cpr-apc-volt-step: The voltage in microvolt per CPR step, such as 5000uV.
+- qcom,cpr-idle-clocks: Idle clock cycles RO can be in.
+- qcom,cpr-gcnt-time: The time for gate count in microseconds.
+- qcom,cpr-apc-volt-step: The voltage in microvolt per CPR step, such as 5000uV.
-- qti,pvs-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
+- qcom,pvs-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
compare with in order to decide if the redundant PVS fuse bits would be
used instead of the original bits and method to read fuse row, reading
register through SCM or directly. The 5 elements with index [0..4] are:
@@ -70,19 +70,19 @@
Otherwise, the original PVS bits should be selected. If the 5th
element is 0, read the fuse row from register directly. Otherwise,
read it through SCM.
-- qti,pvs-fuse: Array of 4 elements to indicate the bits for PVS fuse and read method.
+- qcom,pvs-fuse: Array of 4 elements to indicate the bits for PVS fuse and read method.
The array should have index and value like this:
[0] => the PVS fuse row number
[1] => LSB bit position of the bits
[2] => number of bits
[3] => fuse reading method, 0 for direct reading or 1 for SCM reading
-- qti,pvs-fuse-redun: Array of 4 elements to indicate the bits for redundant PVS fuse.
+- qcom,pvs-fuse-redun: Array of 4 elements to indicate the bits for redundant PVS fuse.
The array should have index and value like this:
[0] => the redundant PVS fuse row number
[1] => LSB bit position of the bits
[2] => number of bits
[3] => fuse reading method, 0 for direct reading or 1 for SCM reading
-- qti,cpr-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
+- qcom,cpr-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
compare with in order to decide if the redundant CPR fuse bits would be
used instead of the original bits and method to read fuse row, using SCM
to read or read register directly. The 5 elements with index [0..4] are:
@@ -96,32 +96,32 @@
Otherwise, the original CPR bits should be selected. If the 5th element
is 0, read the fuse row from register directly. Otherwise, read it through
SCM.
-- qti,cpr-fuse-row: Array of row number of CPR fuse and method to read that row. It should have
+- qcom,cpr-fuse-row: Array of row number of CPR fuse and method to read that row. It should have
index and value like this:
[0] => the fuse row number
[1] => fuse reading method, 0 for direct reading or 1 for SCM reading
-- qti,cpr-fuse-bp-cpr-disable: Bit position of the bit to indicate if CPR should be disable
-- qti,cpr-fuse-bp-scheme: Bit position of the bit to indicate if it's a global/local scheme
-- qti,cpr-fuse-target-quot: Array of bit positions in fuse for Target Quotient of all corners.
+- qcom,cpr-fuse-bp-cpr-disable: Bit position of the bit to indicate if CPR should be disable
+- qcom,cpr-fuse-bp-scheme: Bit position of the bit to indicate if it's a global/local scheme
+- qcom,cpr-fuse-target-quot: Array of bit positions in fuse for Target Quotient of all corners.
It should have index and value like this:
[0] => bit position of the LSB bit for SVS target quotient
[1] => bit position of the LSB bit for NOMINAL target quotient
[2] => bit position of the LSB bit for TURBO target quotient
-- qti,cpr-fuse-ro-sel: Array of bit positions in fuse for RO select of all corners.
+- qcom,cpr-fuse-ro-sel: Array of bit positions in fuse for RO select of all corners.
It should have index and value like this:
[0] => bit position of the LSB bit for SVS RO select bits
[1] => bit position of the LSB bit for NOMINAL RO select bits
[2] => bit position of the LSB bit for TURBO RO select bits
-- qti,cpr-fuse-redun-row: Array of row number of redundant CPR fuse and method to read that
+- qcom,cpr-fuse-redun-row: Array of row number of redundant CPR fuse and method to read that
row. It should have index and value like this:
[0] => the redundant fuse row number
[1] => the value to indicate reading the fuse row directly or using SCM
-- qti,cpr-fuse-redun-target-quot: Array of bit positions in fuse for redundant Target Quotient of all corners.
+- qcom,cpr-fuse-redun-target-quot: Array of bit positions in fuse for redundant Target Quotient of all corners.
It should have index and value like this:
[0] => bit position of the LSB bit for redundant SVS target quotient
[1] => bit position of the LSB bit for redundant NOMINAL target quotient
[2] => bit position of the LSB bit for redundant TURBO target quotient
-- qti,cpr-fuse-redun-ro-sel: Array of bit positions in eFuse for redundant RO select.
+- qcom,cpr-fuse-redun-ro-sel: Array of bit positions in eFuse for redundant RO select.
It should have index and value like this:
[0] => bit position of the LSB bit for redundant SVS RO select bits
[1] => bit position of the LSB bit for redundant NOMINAL RO select bits
@@ -131,23 +131,23 @@
Optional properties:
- vdd-mx-supply: Regulator to supply memory power as dependency
of VDD APC.
-- qti,vdd-mx-vmax: The maximum voltage in uV for vdd-mx-supply. This
+- qcom,vdd-mx-vmax: The maximum voltage in uV for vdd-mx-supply. This
is required when vdd-mx-supply is present.
-- qti,vdd-mx-vmin-method: The method to determine the minimum voltage for
+- qcom,vdd-mx-vmin-method: The method to determine the minimum voltage for
vdd-mx-supply, which can be one of following
choices compared with VDD APC:
0 => equal to the voltage(vmin) of VDD APC
1 => equal to PVS corner ceiling voltage
2 => equal to slow speed corner ceiling
- 3 => equal to qti,vdd-mx-vmax
+ 3 => equal to qcom,vdd-mx-vmax
This is required when vdd-mx-supply is present.
-- qti,cpr-fuse-redun-bp-cpr-disable: Redundant bit position of the bit to indicate if CPR should be disable
-- qti,cpr-fuse-redun-bp-scheme: Redundant bit position of the bit to indicate if it's a global/local scheme
+- qcom,cpr-fuse-redun-bp-cpr-disable: Redundant bit position of the bit to indicate if CPR should be disable
+- qcom,cpr-fuse-redun-bp-scheme: Redundant bit position of the bit to indicate if it's a global/local scheme
This property is required if cpr-fuse-redun-bp-cpr-disable
is present, and vise versa.
-- qti,cpr-enable: Present: CPR enabled by default.
+- qcom,cpr-enable: Present: CPR enabled by default.
Not Present: CPR disable by default.
-- qti,cpr-fuse-cond-min-volt-sel: Array of 5 elements to indicate where to read the bits, what value to
+- qcom,cpr-fuse-cond-min-volt-sel: Array of 5 elements to indicate where to read the bits, what value to
compare with in order to decide if the conditional minimum apc voltage needs
to be applied and the fuse reading method.
The 5 elements with index[0..4] are:
@@ -159,11 +159,11 @@
When the value of the fuse bits specified by first 3 elements is not equal to
the value in 4th element, then set the apc voltage for all parts running
at each voltage corner to be not lower than the voltage defined
- using "qti,cpr-cond-min-voltage".
-- qti,cpr-cond-min-voltage: Minimum voltage in microvolts for SVS, NOM and TURBO mode if the fuse bits
- defined in qti,cpr-fuse-cond-min-volt-sel have not been programmed with the
+ using "qcom,cpr-cond-min-voltage".
+- qcom,cpr-cond-min-voltage: Minimum voltage in microvolts for SVS, NOM and TURBO mode if the fuse bits
+ defined in qcom,cpr-fuse-cond-min-volt-sel have not been programmed with the
expected data. This is required if cpr-fuse-cond-min-volt-sel is present.
-- qti,cpr-fuse-uplift-sel: Array of 5 elements to indicate where to read the bits, what value to
+- qcom,cpr-fuse-uplift-sel: Array of 5 elements to indicate where to read the bits, what value to
compare with in order to enable or disable the pvs voltage uplift workaround,
and the fuse reading method.
The 5 elements with index[0..4] are:
@@ -175,7 +175,7 @@
[4]: => fuse reading method, 0 for direct reading or 1 for SCM reading.
When the value of the fuse bits specified by first 3 elements equals to the
value in 4th element, the pvs voltage uplift workaround will be enabled.
-- qti,speed-bin-fuse-sel: Array of 4 elements to indicate where to read the speed bin of the processor,
+- qcom,speed-bin-fuse-sel: Array of 4 elements to indicate where to read the speed bin of the processor,
and the fuse reading method.
The 4 elements with index[0..3] are:
[0]: => the fuse row number of the selector;
@@ -183,36 +183,45 @@
[2]: => number of the bits;
[3]: => fuse reading method, 0 for direct reading or 1 for SCM reading.
This is required if cpr-fuse-uplift-disable-sel is present.
-- qti,cpr-uplift-voltage: Uplift in microvolts used for increasing pvs init voltage. If this property is present,
+- qcom,cpr-uplift-voltage: Uplift in microvolts used for increasing pvs init voltage. If this property is present,
This is required if cpr-fuse-uplift-disable-sel is present.
-- qti,cpr-uplift-max-volt: Maximum voltage in microvolts used for pvs voltage uplift workaround to limit
+- qcom,cpr-uplift-max-volt: Maximum voltage in microvolts used for pvs voltage uplift workaround to limit
the maximum pvs voltage.
This is required if cpr-fuse-uplift-disable-sel is present.
-- qti,cpr-uplift-quotient: Three numbers used for pvs voltage uplift workaround to be added to the target
+- qcom,cpr-uplift-quotient: Three numbers used for pvs voltage uplift workaround to be added to the target
quotient for each corner.
The 3 quotient increment with index[0..2] are:
[0]: => for SVS corner target quotient;
[1]: => for NORM corner target quotient;
[2]: => for TURBO corner target quotient;
This is required if cpr-fuse-uplift-disable-sel is present.
-- qti,cpr-uplift-speed-bin: The speed bin value corresponding to one type of processor which needs to apply the
+- qcom,cpr-uplift-speed-bin: The speed bin value corresponding to one type of processor which needs to apply the
pvs voltage uplift workaround.
This is required if cpr-fuse-uplift-disable-sel is present.
-- qti,cpr-quot-adjust-table: Array of 4-tuples in which each 4-tuple indicates the speed bin
- of the CPU, the frequency of the CPU, the quotient adjustment and the voltage corner to use.
- The 4 elements in one 4-tuple are:
- [0]: => the speed bin of the CPU;
- [1]: => the frequency in kHz of the CPU;
- [2]: => the quotient adjustment of the corresponding frequency;
- [3]: => the voltage corner to use.
- If the speed bin in a tuple is eqaul to the speed bin of the CPU, then the quotient
- adjustment would be subtracted from the quotient value of the voltage corner
- when the CPU is running at that frequency.
+- qcom,cpr-quot-adjust-table: Array of triples in which each triple indicates the speed bin of the CPU, the virtual
+ corner to use and the quotient adjustment.
+ The 3 elements in one triple are:
+ [0]: => the speed bin of the CPU.
+ [1]: => the virtual voltage corner to use.
+ [2]: => the quotient adjustment for the corresponding virtual corner.
+ If the speed bin in a triple is equal to the speed bin of the CPU, the adjustment would
+ be subtracted from the quotient value of the voltage corner when the CPU is running at
+ that virtual corner. Each virtual corner value must be in the range 1 to the number of
+ elements in qcom,cpr-corner-map.
+- qcom,cpr-corner-map: Array of elements of fuse corner value for each virtual corner.
+ The location or 1-based index of an element in the list corresponds to
+ the virtual corner value. For example, the first element in the list is the fuse corner
+ value that virtual corner 1 maps to.
+ This is required if qcom,cpr-quot-adjust-table is present.
+- qcom,cpr-quotient-adjustment: Present: CPR adjusts quotient value. The
+ adjustment equals to the quotient adjustment
+ in millivolts multiply the KV value.
+ Not Present: CPR will not adjust quotient value.
Example:
apc_vreg_corner: regulator@f9018000 {
status = "okay";
- compatible = "qti,cpr-regulator";
+ compatible = "qcom,cpr-regulator";
reg = <0xf9018000 0x1000>, <0xfc4b8000 0x1000>;
reg-names = "rbcpr", "efuse_addr";
interrupts = <0 15 0>;
@@ -220,11 +229,11 @@
regulator-min-microvolt = <1>;
regulator-max-microvolt = <3>;
- qti,pvs-fuse = <22 6 5 1>;
- qti,pvs-fuse-redun-sel = <22 24 3 2 1>;
- qti,pvs-fuse-redun = <22 27 5 1>;
+ qcom,pvs-fuse = <22 6 5 1>;
+ qcom,pvs-fuse-redun-sel = <22 24 3 2 1>;
+ qcom,pvs-fuse-redun = <22 27 5 1>;
- qti,pvs-init-voltage = <1330000 1330000 1330000 1320000
+ qcom,pvs-init-voltage = <1330000 1330000 1330000 1320000
1310000 1300000 1290000 1280000
1270000 1260000 1250000 1240000
1230000 1220000 1210000 1200000
@@ -232,47 +241,48 @@
1150000 1140000 1140000 1140000
1140000 1140000 1140000 1140000
1140000 1140000 1140000 1140000>;
- qti,pvs-corner-ceiling-slow = <1050000 1160000 1275000>;
- qti,pvs-corner-ceiling-nom = <975000 1075000 1200000>;
- qti,pvs-corner-ceiling-fast = <900000 1000000 1140000>;
+ qcom,pvs-corner-ceiling-slow = <1050000 1160000 1275000>;
+ qcom,pvs-corner-ceiling-nom = <975000 1075000 1200000>;
+ qcom,pvs-corner-ceiling-fast = <900000 1000000 1140000>;
vdd-apc-supply = <&pm8226_s2>;
vdd-mx-supply = <&pm8226_l3_ao>;
- qti,vdd-mx-vmax = <1350000>;
- qti,vdd-mx-vmin-method = <1>;
- qti,vdd-apc-step-up-limit = <1>;
- qti,vdd-apc-step-down-limit = <1>;
- qti,cpr-ref-clk = <19200>;
- qti,cpr-timer-delay = <5000>;
- qti,cpr-timer-cons-up = <1>;
- qti,cpr-timer-cons-down = <2>;
- qti,cpr-irq-line = <0>;
- qti,cpr-step-quotient = <15>;
- qti,cpr-up-threshold = <1>;
- qti,cpr-down-threshold = <2>;
- qti,cpr-idle-clocks = <5>;
- qti,cpr-gcnt-time = <1>;
- qti,cpr-apc-volt-step = <5000>;
+ qcom,vdd-mx-vmax = <1350000>;
+ qcom,vdd-mx-vmin-method = <1>;
+ qcom,vdd-apc-step-up-limit = <1>;
+ qcom,vdd-apc-step-down-limit = <1>;
+ qcom,cpr-ref-clk = <19200>;
+ qcom,cpr-timer-delay = <5000>;
+ qcom,cpr-timer-cons-up = <1>;
+ qcom,cpr-timer-cons-down = <2>;
+ qcom,cpr-irq-line = <0>;
+ qcom,cpr-step-quotient = <15>;
+ qcom,cpr-up-threshold = <1>;
+ qcom,cpr-down-threshold = <2>;
+ qcom,cpr-idle-clocks = <5>;
+ qcom,cpr-gcnt-time = <1>;
+ qcom,cpr-apc-volt-step = <5000>;
- qti,cpr-fuse-row = <138 1>;
- qti,cpr-fuse-bp-cpr-disable = <36>;
- qti,cpr-fuse-bp-scheme = <37>;
- qti,cpr-fuse-target-quot = <24 12 0>;
- qti,cpr-fuse-ro-sel = <54 38 41>;
- qti,cpr-fuse-redun-sel = <138 57 1 1 1>;
- qti,cpr-fuse-redun-row = <139 1>;
- qti,cpr-fuse-redun-target-quot = <24 12 0>;
- qti,cpr-fuse-redun-ro-sel = <46 36 39>;
- qti,cpr-fuse-cond-min-volt-sel = <54 42 6 7 1>;
- qti,cpr-cond-min-voltage = <1140000>;
- qti,cpr-fuse-uplift-sel = <22 53 1 0 0>;
- qti,cpr-uplift-voltage = <50000>;
- qti,cpr-uplift-quotient = <0 0 120>;
- qti,cpr-uplift-max-volt = <1350000>;
- qti,cpr-uplift-speed-bin = <1>;
- qti,speed-bin-fuse-sel = <22 0 3 0>;
- qti,cpr-quot-adjust-table = <1 998400 450 3>,
- <1 1094400 375 3>, <1 1190400 300 3>,
- <1 1305600 225 3>, <1 1344000 187 3>,
- <1 1401600 150 3>, <1 1497600 75 3>;
+ qcom,cpr-fuse-row = <138 1>;
+ qcom,cpr-fuse-bp-cpr-disable = <36>;
+ qcom,cpr-fuse-bp-scheme = <37>;
+ qcom,cpr-fuse-target-quot = <24 12 0>;
+ qcom,cpr-fuse-ro-sel = <54 38 41>;
+ qcom,cpr-fuse-redun-sel = <138 57 1 1 1>;
+ qcom,cpr-fuse-redun-row = <139 1>;
+ qcom,cpr-fuse-redun-target-quot = <24 12 0>;
+ qcom,cpr-fuse-redun-ro-sel = <46 36 39>;
+ qcom,cpr-fuse-cond-min-volt-sel = <54 42 6 7 1>;
+ qcom,cpr-cond-min-voltage = <1140000>;
+ qcom,cpr-fuse-uplift-sel = <22 53 1 0 0>;
+ qcom,cpr-uplift-voltage = <50000>;
+ qcom,cpr-uplift-quotient = <0 0 120>;
+ qcom,cpr-uplift-max-volt = <1350000>;
+ qcom,cpr-uplift-speed-bin = <1>;
+ qcom,speed-bin-fuse-sel = <22 0 3 0>;
+ qcom,cpr-corner-map = <1 1 2 2 3 3 3 3 3 3 3 3>;
+ qcom,cpr-quot-adjust-table = <1 1 0>, <1 2 0>, <1 3 0>,
+ <1 4 0>, <1 5 450>, <1 6 375>,
+ <1 7 300>, <1 8 225>, <1 9 187>,
+ <1 10 150>, <1 11 75>, <1 12 0>;
};
diff --git a/Documentation/devicetree/bindings/arm/msm/cpubw.txt b/Documentation/devicetree/bindings/arm/msm/cpubw.txt
new file mode 100644
index 0000000..1dc3835
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/cpubw.txt
@@ -0,0 +1,30 @@
+MSM CPU bandwidth device
+
+cpubw is a device that represents the CPU subsystem master ports in a MSM SoC
+and the related info that is needed to make CPU to DDR bandwidth votes.
+
+Required properties:
+- compatible: Must be "qcom,cpubw"
+- qcom,cpu-mem-ports: A list of tuples where each tuple consists of a bus
+ master (CPU subsystem) port number and a bus slave
+ (memory) port number.
+- qcom,bw-tbl: A list of meaningful instantaneous bandwidth values
+ (in MB/s) that can be requested from the CPU
+ subsystem to DDR. The list of values depend on the
+ supported DDR frequencies and the bus widths.
+
+Example:
+
+ qcom,cpubw {
+ compatible = "qcom,cpubw";
+ qcom,cpu-mem-ports = <1 512>, <2 512>;
+ qcom,bw-tbl =
+ < 572 /* 75 MHz */ >,
+ < 1144 /* 150 MHz */ >,
+ < 1525 /* 200 MHz */ >,
+ < 2342 /* 307 MHz */ >,
+ < 3509 /* 460 MHz */ >,
+ < 4684 /* 614 MHz */ >,
+ < 6103 /* 800 MHz */ >,
+ < 7102 /* 931 MHz */ >;
+ };
diff --git a/Documentation/devicetree/bindings/arm/msm/kraitbw-l2pm.txt b/Documentation/devicetree/bindings/arm/msm/kraitbw-l2pm.txt
new file mode 100644
index 0000000..17d55d4
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/kraitbw-l2pm.txt
@@ -0,0 +1,18 @@
+MSM Krait L2 performance monitor counters for bandwidth measurement device
+
+krait-l2pm is a device that represents the Krait L2 PM counters that can be
+used to measure the bandwidth of read/write traffic from the Krait CPU
+subsystem.
+
+Required properties:
+- compatible: Must be "qcom,kraitbw_l2pm"
+- interrupts: Lists the L2 PM counter overflow IRQ.
+- qcom,bytes-per-beat: The number of bytes transferred in one data beat from
+ the Krait CPU subsystem.
+
+Example:
+ qcom,kraitbw-l2pm {
+ compatible = "qcom,kraitbw-l2pm";
+ interrupts = <0 1 1>;
+ qcom,bytes-per-beat = <8>;
+ };
diff --git a/Documentation/devicetree/bindings/arm/msm/msm-cpufreq.txt b/Documentation/devicetree/bindings/arm/msm/msm-cpufreq.txt
index 02514d4..fed49c9 100644
--- a/Documentation/devicetree/bindings/arm/msm/msm-cpufreq.txt
+++ b/Documentation/devicetree/bindings/arm/msm/msm-cpufreq.txt
@@ -9,23 +9,15 @@
- compatible: Must be "qcom,msm-cpufreq"
- qcom,cpufreq-table: A list of tuples where each tuple consists of a
usable CPU frequency (KHz), an optional cache
- frequency (KHz) and an optional memory bandwidth
+ frequency (KHz) and a mandatory memory bandwidth
value (MBPS) listed in that order. The cache
frequencies shall not be listed if the device cannot
- run the cache asynchronous to one or more CPUs. The
- memory bandwidth values shall not be listed if the
- optional cpu-mem-ports property is not supplied.
-
-Optional properties:
-- qcom,cpu-mem-ports: A list of tuples where each tuple consists of a bus
- master (CPU) port number and a bus slave (memory)
- port number.
+ run the cache asynchronous to one or more CPUs.
Example:
qcom,msm-cpufreq@0 {
regs = <0 4>
compatible = "qcom,msm-cpufreq";
- qcom,cpu-mem-ports = <1 512>, <2 513>;
qcom,cpufreq-table =
< 300000 300000 600 >,
< 422400 422400 1200 >,
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
index 0e236f2..113ded8 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
@@ -142,6 +142,8 @@
0 = default value.
- qcom,mdss-dsi-bl-max-level: Specifies the max backlight level supported by the panel.
255 = default value.
+- qcom,mdss-brightness-max-level: Specifies the max brightness level supported.
+ 255 = default value.
- qcom,mdss-dsi-interleave-mode: Specifies interleave mode.
0 = default value.
- qcom,mdss-dsi-panel-type: Specifies the panel operating mode.
diff --git a/Documentation/devicetree/bindings/fb/mdss-edp.txt b/Documentation/devicetree/bindings/fb/mdss-edp.txt
index 2070c64..fd8d14f 100644
--- a/Documentation/devicetree/bindings/fb/mdss-edp.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-edp.txt
@@ -26,6 +26,8 @@
Optional properties:
- qcom,cont-splash-enabled: Boolean used to enable continuous splash mode.
+- qcom,mdss-brightness-max-level: Specifies the max brightness level supported.
+ 255 = default value.
Example:
mdss_edp: qcom,mdss_edp@fd923400 {
diff --git a/Documentation/devicetree/bindings/hwmon/qpnp-adc-voltage.txt b/Documentation/devicetree/bindings/hwmon/qpnp-adc-voltage.txt
index ae7d039..1be5504 100644
--- a/Documentation/devicetree/bindings/hwmon/qpnp-adc-voltage.txt
+++ b/Documentation/devicetree/bindings/hwmon/qpnp-adc-voltage.txt
@@ -65,6 +65,8 @@
3 : Returns current across 0.1 ohm resistor.
4 : Returns XO thermistor voltage in degree's Centigrade.
5 : Returns result in degC for 150k pull-up.
+ 9 : Conversion to temperature based on -15~55 allowable
+ battery charging tempeature setting for btm parameters.
- qcom,hw-settle-time : Settling period for the channel before ADC read.
Select from the following unsigned int.
0 : 0us
diff --git a/Documentation/usb/uicc.txt b/Documentation/usb/uicc.txt
new file mode 100644
index 0000000..7bf4d86
--- /dev/null
+++ b/Documentation/usb/uicc.txt
@@ -0,0 +1,161 @@
+Introduction
+============
+
+This feature requires supporting Mass Storage and Integrated Circuit Card
+interfaces exposed by the UICC (Universal Integrated Circuit Card) device.
+The MSM acts as a USB host and UICC acts as a peripheral. The UICC device
+that is used here is also referred to as Mega-SIM. This feature will be
+supported on MSM8x26.
+
+Hardware description
+====================
+
+The USB3503 HSIC (High Speed Inter Chip) hub's down stream port is modified
+to support Inter-Chip USB for connecting the UICC device. The USB3503 is
+connected to MSM via HSIC interface. The UICC device operates in Full Speed
+mode.
+
+The UICC device will support CCID (Integrated Circuit Card interface Device)
+specification. This interface supports 1 Bulk In, 1 Bulk Out and 1 Interrupt
+endpoint. The Interrupt endpoint is used by the device to send asynchronous
+notifications like card insertion/removal and hardware error events.
+The Bulk endpoints are used for the data communication.
+
+The UICC device will support the Mass Storage Bulk Only 1.0 specification.
+It supports SCSI Transparent subclass '06', corresponding to support of the
+SCSI Primary Command set. It implements SCSI Peripheral Device Type '00'
+(TYPE_DISK) corresponding to a direct access SCSI block device.
+
+Software description
+====================
+
+The MSM HSIC controller driver(drivers/usb/host/ehci-msm-hsic.c) takes care
+of HSIC PHY and link management. The USB3503 HSIC hub is managed by the SMSC
+hub driver(drivers/misc/smsc_hubc.c). Both these drivers are well tested on
+APQ8074 dragon board and are re-used to support this feature.
+
+The mass storage interface is managed by the standard Linux USB storage driver.
+This driver interfaces with SCSI and block layers to export the disk to
+user space.
+
+A new USB driver is implemented to manage the CCID interface. This driver is
+referred to as USB CCID driver in this document. This driver is implemented
+as a pass-through module and provides the character device interface to
+user space. The CCID specification is implemented in the user space.
+
+The CCID command and responses are exchanged over the Bulk endpoints. The
+user space application uses write() and read() calls to send commands and
+receive responses.
+
+The CCID class specific requests are sent over the control endpoint. As
+control requests have a specific format, ioctls are implemented.
+
+The UICC device sends asynchronous notifications over the interrupt endpoint.
+The card insertion/removal and hardware error events are sent to user space
+via an ioctl().
+
+Design Goals:
+============
+
+1. Re-use the existing services available in user space. This is achieved
+by implementing the kernel USB CCID driver as a pass-through module.
+
+2. Support runtime card insertion/removal.
+
+3. Support runtime power management.
+
+4. Support Multiple card configuration. More than 1 IC can be connected to
+the USB UICC device.
+
+Power Management
+================
+
+The USB core uses the runtime PM framework to auto suspend the USB devices that
+are not in use. The Auto-suspend is forbidden for all devices except hub class
+devices. The USB CCID driver enables auto-suspend for the UICC device.
+
+An USB device can be suspended only when all of its interfaces are suspended.
+The USB storage interface device acts as a parent device to the underlying
+SCSI host, target and block devices. Runtime PM must be enabled for the
+SCSI device to allow USB storage interface suspend. The SCSI device runtime
+suspend and auto-suspend timeout will be configured from user space via sysfs
+files.
+
+The HSIC platform device and USB3503 HUB device will be runtime suspended
+only after the USB UICC device is suspended.
+
+SMP/multi-core
+==============
+
+The USB CCID driver does not allow multiple clients to open the device file
+concurrently. -EBUSY will be returned if open() is attempted when the
+file is already opened.
+
+The write() and read() methods are implemented synchronously. If another
+write() is called when a previous write() is in progress, -EBUSY is
+returned. The same is applicable to read().
+
+Mutexes will be used to prevent concurrent open(), read() and write() access.
+
+Interface
+=========
+
+A character device file (/dev/ccid_bridge) will be exposed by the USB CCID
+driver. open(), read(), write(), ioctl() and close() methods are implemented.
+This device node is accessible only to the root by default. User space init
+or udev scripts should change the permissions of this device file if it needs
+to be accessed by non-root applications.
+
+open(): The open() is blocked until the UICC device is detected and the CCID
+interface probe is completed. Returns the appropriate error code in case of
+failure.
+
+read(): An URB is submitted on the Bulk In endpoint. The read() is blocked
+until the URB is completed and the data is copied to the user space buffer
+upon success. An appropriate error code is returned in case of failure.
+-ENODEV must be treated as a serious error and no further I/O will be
+attempted.
+
+write(): An URB is submitted on the Bulk Out endpoint. The write() is blocked
+until the URB is completed. An appropriate error code is returned in case of
+failure. -ENODEV must be treated as a serious error and no further I/O will be
+attempted.
+
+ioctl(): The ioctl() method is required for facilitating Control transfers and
+Interrupt transfers.
+
+USB_CCID_GET_CLASS_DESC: This read-only ioctl returns the smart card class
+descriptor as described in the 5.1 section of USB smart card class spec.
+
+USB_CCID_ABORT: This write-only ioctl sends A ABORT class specific request on
+control endpoint. The class request details are mentioned in section 5.3.1.
+
+USB_CCID_GET_CLOCK_FREQUENCIES: This read and write ioctl returns the clock
+frequencies supported by the CCID device. A GET_CLOCK_FREQUENCIES class request
+is sent on the control endpoint. The class request details are mentioned in
+section 5.3.2.
+
+USB_CCID_GET_DATA_RATES: This read and write ioctl returns the data rates
+supported by the CCID device. A GET_DATA_RATES class request is sent on the
+control endpoint. The class request details are mentioned in section 5.3.3.
+
+USB_CCID_GET_EVENT: This read-only ioctl returns the asynchronous event sent
+by the UICC device. The ioctl() is blocked until such event is received from
+the UICC device. This ioctl() returns -ENOENT error code when the device
+does not have an interrupt endpoint and does not support remote wakeup
+capability.
+
+close(): Cancels any ongoing I/O before it returns.
+
+Config options
+==============
+
+Turn on USB_EHCI_MSM_HSIC, USB_HSIC_SMSC_HUB and USB_CCID_BRIDGE configs to
+enable this feature.
+
+References
+==========
+
+Specification for Integrated Circuit(s) Cards Interface Devices
+
+Smart Cards; UICC-Terminal interface; Physical and logical characteristics
diff --git a/arch/arm/boot/dts/msm-pm8226.dtsi b/arch/arm/boot/dts/msm-pm8226.dtsi
index 6d506cc..a13e66a 100644
--- a/arch/arm/boot/dts/msm-pm8226.dtsi
+++ b/arch/arm/boot/dts/msm-pm8226.dtsi
@@ -860,22 +860,6 @@
qcom,current = <625>;
};
- pm8226_flash1: qcom,flash_1 {
- qcom,max-current = <1000>;
- qcom,default-state = "off";
- qcom,headroom = <3>;
- qcom,duration = <1280>;
- qcom,clamp-curr = <200>;
- qcom,startup-dly = <3>;
- qcom,safety-timer;
- linux,default-trigger =
- "flash1_trigger";
- label = "flash";
- qcom,id = <2>;
- linux,name = "led:flash_1";
- qcom,current = <625>;
- };
-
pm8226_torch: qcom,flash_torch {
qcom,max-current = <200>;
qcom,default-state = "off";
diff --git a/arch/arm/boot/dts/msm8226-camera-sensor-cdp.dtsi b/arch/arm/boot/dts/msm8226-camera-sensor-cdp.dtsi
index fa5c739..20bb2aa 100644
--- a/arch/arm/boot/dts/msm8226-camera-sensor-cdp.dtsi
+++ b/arch/arm/boot/dts/msm8226-camera-sensor-cdp.dtsi
@@ -17,7 +17,7 @@
cell-index = <0>;
compatible = "qcom,camera-led-flash";
qcom,flash-type = <1>;
- qcom,flash-source = <&pm8226_flash0 &pm8226_flash1>;
+ qcom,flash-source = <&pm8226_flash0>;
qcom,torch-source = <&pm8226_torch>;
};
};
diff --git a/arch/arm/boot/dts/msm8226-camera-sensor-mtp.dtsi b/arch/arm/boot/dts/msm8226-camera-sensor-mtp.dtsi
index 5d1e1c8..07a4383 100644
--- a/arch/arm/boot/dts/msm8226-camera-sensor-mtp.dtsi
+++ b/arch/arm/boot/dts/msm8226-camera-sensor-mtp.dtsi
@@ -17,7 +17,7 @@
cell-index = <0>;
compatible = "qcom,camera-led-flash";
qcom,flash-type = <1>;
- qcom,flash-source = <&pm8226_flash0 &pm8226_flash1>;
+ qcom,flash-source = <&pm8226_flash0>;
qcom,torch-source = <&pm8226_torch>;
};
};
diff --git a/arch/arm/boot/dts/msm8226-camera-sensor-qrd.dtsi b/arch/arm/boot/dts/msm8226-camera-sensor-qrd.dtsi
index fd6d618..0436600 100644
--- a/arch/arm/boot/dts/msm8226-camera-sensor-qrd.dtsi
+++ b/arch/arm/boot/dts/msm8226-camera-sensor-qrd.dtsi
@@ -17,7 +17,7 @@
cell-index = <0>;
compatible = "qcom,camera-led-flash";
qcom,flash-type = <1>;
- qcom,flash-source = <&pm8226_flash0 &pm8226_flash1>;
+ qcom,flash-source = <&pm8226_flash0>;
qcom,torch-source = <&pm8226_torch>;
};
};
diff --git a/arch/arm/boot/dts/msm8226-qrd-skuf.dtsi b/arch/arm/boot/dts/msm8226-qrd-skuf.dtsi
index 2e32ac4..c3fcedb 100755
--- a/arch/arm/boot/dts/msm8226-qrd-skuf.dtsi
+++ b/arch/arm/boot/dts/msm8226-qrd-skuf.dtsi
@@ -82,7 +82,7 @@
avdd-supply = <&tp_power>;
goodix,panel-coords = <0 0 720 1200>;
goodix,display-coords = <0 0 720 1080>;
- goodix,button-map= <158 102 139>;
+ goodix,button-map= <139 172 158>;
goodix,product-id = "915";
goodix,cfg-data0 = [
41 D0 02 00 05 05 35 11 01 0F
diff --git a/arch/arm/boot/dts/msm8226-regulator.dtsi b/arch/arm/boot/dts/msm8226-regulator.dtsi
index 63da606..0146367 100644
--- a/arch/arm/boot/dts/msm8226-regulator.dtsi
+++ b/arch/arm/boot/dts/msm8226-regulator.dtsi
@@ -30,74 +30,76 @@
&soc {
apc_vreg_corner: regulator@f9018000 {
status = "okay";
- compatible = "qti,cpr-regulator";
+ compatible = "qcom,cpr-regulator";
reg = <0xf9018000 0x1000>, <0xf9011064 4>, <0xfc4b8000 0x1000>;
reg-names = "rbcpr", "rbcpr_clk", "efuse_addr";
interrupts = <0 15 0>;
regulator-name = "apc_corner";
regulator-min-microvolt = <1>;
- regulator-max-microvolt = <3>;
+ regulator-max-microvolt = <12>;
- qti,pvs-fuse-redun-sel = <22 24 3 2 0>;
- qti,pvs-fuse = <22 6 5 0>;
- qti,pvs-fuse-redun = <22 27 5 0>;
+ qcom,pvs-fuse-redun-sel = <22 24 3 2 0>;
+ qcom,pvs-fuse = <22 6 5 0>;
+ qcom,pvs-fuse-redun = <22 27 5 0>;
- qti,pvs-init-voltage = <1275000 1275000 1275000 1275000 1275000
+ qcom,pvs-init-voltage = <1275000 1275000 1275000 1275000 1275000
1275000 1260000 1245000 1230000 1215000
1200000 1185000 1170000 1155000 1140000
1140000 1140000 1140000 1140000 1140000
1150000 1140000 1140000 1140000 1140000
1140000 1140000 1140000 1275000 1275000
1275000 1275000>;
- qti,pvs-corner-ceiling-slow = <1050000 1150000 1275000>;
- qti,pvs-corner-ceiling-nom = <1050000 1075000 1200000>;
- qti,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
+ qcom,pvs-corner-ceiling-slow = <1050000 1150000 1275000>;
+ qcom,pvs-corner-ceiling-nom = <1050000 1075000 1200000>;
+ qcom,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
vdd-apc-supply = <&pm8226_s2>;
vdd-mx-supply = <&pm8226_l3_ao>;
- qti,vdd-mx-vmax = <1350000>;
- qti,vdd-mx-vmin-method = <1>;
+ qcom,vdd-mx-vmax = <1350000>;
+ qcom,vdd-mx-vmin-method = <1>;
- qti,cpr-ref-clk = <19200>;
- qti,cpr-timer-delay = <5000>;
- qti,cpr-timer-cons-up = <0>;
- qti,cpr-timer-cons-down = <2>;
- qti,cpr-irq-line = <0>;
- qti,cpr-step-quotient = <15>;
- qti,cpr-up-threshold = <0>;
- qti,cpr-down-threshold = <10>;
- qti,cpr-idle-clocks = <0>;
- qti,cpr-gcnt-time = <1>;
- qti,vdd-apc-step-up-limit = <1>;
- qti,vdd-apc-step-down-limit = <1>;
- qti,cpr-apc-volt-step = <5000>;
+ qcom,cpr-ref-clk = <19200>;
+ qcom,cpr-timer-delay = <5000>;
+ qcom,cpr-timer-cons-up = <0>;
+ qcom,cpr-timer-cons-down = <2>;
+ qcom,cpr-irq-line = <0>;
+ qcom,cpr-step-quotient = <15>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <10>;
+ qcom,cpr-idle-clocks = <0>;
+ qcom,cpr-gcnt-time = <1>;
+ qcom,vdd-apc-step-up-limit = <1>;
+ qcom,vdd-apc-step-down-limit = <1>;
+ qcom,cpr-apc-volt-step = <5000>;
- qti,cpr-fuse-redun-sel = <138 57 1 1 0>;
- qti,cpr-fuse-row = <138 0>;
- qti,cpr-fuse-bp-cpr-disable = <36>;
- qti,cpr-fuse-bp-scheme = <37>;
- qti,cpr-fuse-target-quot = <24 12 0>;
- qti,cpr-fuse-ro-sel = <54 38 41>;
- qti,cpr-fuse-redun-row = <139 0>;
- qti,cpr-fuse-redun-target-quot = <24 12 0>;
- qti,cpr-fuse-redun-ro-sel = <46 36 39>;
+ qcom,cpr-fuse-redun-sel = <138 57 1 1 0>;
+ qcom,cpr-fuse-row = <138 0>;
+ qcom,cpr-fuse-bp-cpr-disable = <36>;
+ qcom,cpr-fuse-bp-scheme = <37>;
+ qcom,cpr-fuse-target-quot = <24 12 0>;
+ qcom,cpr-fuse-ro-sel = <54 38 41>;
+ qcom,cpr-fuse-redun-row = <139 0>;
+ qcom,cpr-fuse-redun-target-quot = <24 12 0>;
+ qcom,cpr-fuse-redun-ro-sel = <46 36 39>;
- qti,cpr-enable;
- qti,cpr-fuse-cond-min-volt-sel = <54 42 6 7 1>;
- qti,cpr-cond-min-voltage = <1140000>;
- qti,cpr-fuse-uplift-sel = <22 53 1 0 0>;
- qti,cpr-uplift-voltage = <50000>;
- qti,cpr-uplift-quotient = <0 0 120>;
- qti,cpr-uplift-max-volt = <1350000>;
- qti,cpr-uplift-speed-bin = <1>;
- qti,speed-bin-fuse-sel = <22 0 3 0>;
- qti,cpr-quot-adjust-table = <1 300000 0 1>,
- <1 384000 0 1>, <1 600000 0 2>,
- <1 787200 0 2>, <1 998400 450 3>,
- <1 1094400 375 3>, <1 1190400 300 3>,
- <1 1305600 225 3>, <1 1344000 187 3>,
- <1 1401600 150 3>, <1 1497600 75 3>,
- <1 1593600 0 3>;
+ qcom,cpr-enable;
+ qcom,cpr-fuse-cond-min-volt-sel = <54 42 6 7 1>;
+ qcom,cpr-cond-min-voltage = <1140000>;
+ qcom,cpr-fuse-uplift-sel = <22 53 1 0 0>;
+ qcom,cpr-uplift-voltage = <50000>;
+ qcom,cpr-uplift-quotient = <0 0 120>;
+ qcom,cpr-uplift-max-volt = <1350000>;
+ qcom,cpr-uplift-speed-bin = <1>;
+ qcom,speed-bin-fuse-sel = <22 0 3 0>;
+ qcom,cpr-corner-map = <1 1 2 2 3 3 3 3 3 3 3 3>;
+ qcom,cpr-quot-adjust-table =
+ <1 5 450>,
+ <1 6 375>,
+ <1 7 300>,
+ <1 8 225>,
+ <1 9 187>,
+ <1 10 150>,
+ <1 11 75>;
};
};
diff --git a/arch/arm/boot/dts/msm8226-v2.dtsi b/arch/arm/boot/dts/msm8226-v2.dtsi
index 4149169..089d415 100644
--- a/arch/arm/boot/dts/msm8226-v2.dtsi
+++ b/arch/arm/boot/dts/msm8226-v2.dtsi
@@ -52,20 +52,20 @@
};
&apc_vreg_corner {
- qti,pvs-init-voltage = <1330000 1330000 1330000 1320000 1310000
+ qcom,pvs-init-voltage = <1330000 1330000 1330000 1320000 1310000
1300000 1290000 1280000 1270000 1260000
1250000 1240000 1230000 1220000 1210000
1200000 1190000 1180000 1170000 1160000
1150000 1140000 1140000 1140000 1140000
1140000 1140000 1140000 1140000 1140000
1140000 1140000>;
- qti,pvs-corner-ceiling-slow = <1050000 1150000 1280000>;
- qti,pvs-corner-ceiling-nom = <1050000 1080000 1200000>;
- qti,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
- qti,cpr-step-quotient = <30>;
- qti,cpr-up-threshold = <0>;
- qti,cpr-down-threshold = <5>;
- qti,cpr-apc-volt-step = <10000>;
+ qcom,pvs-corner-ceiling-slow = <1050000 1150000 1280000>;
+ qcom,pvs-corner-ceiling-nom = <1050000 1080000 1200000>;
+ qcom,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
+ qcom,cpr-step-quotient = <30>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <5>;
+ qcom,cpr-apc-volt-step = <10000>;
};
&msm_gpu {
@@ -80,39 +80,46 @@
reg-names = "rcg-base", "efuse";
qcom,speed0-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1190400000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1190400000 7>;
qcom,speed6-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1190400000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1190400000 7>;
qcom,speed2-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1401600000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1401600000 10>;
qcom,speed5-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1401600000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1401600000 10>;
qcom,speed4-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1401600000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1401600000 10>;
qcom,speed7-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1401600000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1401600000 10>;
qcom,speed1-bin-v2 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1593600000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ < 998400000 5>,
+ <1094400000 6>,
+ <1190400000 7>,
+ <1305600000 8>,
+ <1344000000 9>,
+ <1401600000 10>,
+ <1497600000 11>,
+ <1593600000 12>;
};
};
diff --git a/arch/arm/boot/dts/msm8226.dtsi b/arch/arm/boot/dts/msm8226.dtsi
index baa81cc..e0304f5 100644
--- a/arch/arm/boot/dts/msm8226.dtsi
+++ b/arch/arm/boot/dts/msm8226.dtsi
@@ -1011,30 +1011,39 @@
clock-names = "clk-4", "clk-5";
qcom,speed0-bin-v0 =
< 0 0>,
- < 384000000 1>,
- < 787200000 2>,
- <1190400000 3>;
+ < 384000000 2>,
+ < 787200000 4>,
+ <1190400000 7>;
cpu-vdd-supply = <&apc_vreg_corner>;
};
+ qcom,cpubw {
+ compatible = "qcom,cpubw";
+ qcom,cpu-mem-ports = <1 512>;
+ qcom,bw-tbl =
+ < 1525 /* 200 MHz */ >,
+ < 2441 /* 320 MHz */ >,
+ < 3051 /* 400 MHz */ >,
+ < 4066 /* 533 MHz */ >;
+ };
+
qcom,msm-cpufreq@0 {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
- qcom,cpu-mem-ports = <1 512>;
qcom,cpufreq-table =
- < 300000 1600 /* 200 MHz */ >,
- < 384000 1600 /* 200 MHz */ >,
- < 600000 1600 /* 200 MHz */ >,
- < 787200 3200 /* 400 MHz */ >,
- < 998400 4264 /* 533 MHz */ >,
- < 1094400 4264 /* 533 MHz */ >,
- < 1190400 4264 /* 533 MHz */ >,
- < 1305600 4264 /* 533 MHz */ >,
- < 1344000 4264 /* 533 MHz */ >,
- < 1401600 4264 /* 533 MHz */ >,
- < 1497600 4264 /* 533 MHz */ >,
- < 1593600 4264 /* 533 MHz */ >;
+ < 300000 1525 >,
+ < 384000 1525 >,
+ < 600000 1525 >,
+ < 787200 3051 >,
+ < 998400 4066 >,
+ < 1094400 4066 >,
+ < 1190400 4066 >,
+ < 1305600 4066 >,
+ < 1344000 4066 >,
+ < 1401600 4066 >,
+ < 1497600 4066 >,
+ < 1593600 4066 >;
};
qcom,ocmem@fdd00000 {
diff --git a/arch/arm/boot/dts/msm8610-qrd-skuab.dtsi b/arch/arm/boot/dts/msm8610-qrd-skuab.dtsi
index a22958a..943a333 100644
--- a/arch/arm/boot/dts/msm8610-qrd-skuab.dtsi
+++ b/arch/arm/boot/dts/msm8610-qrd-skuab.dtsi
@@ -101,6 +101,20 @@
qcom,y-offset = <0>;
};
+ i2c@f9924000 { /* BLSP-1 QUP-2 */
+ nfc-nci@e {
+ compatible = "qcom,nfc-nci";
+ reg = <0x0e>;
+ qcom,irq-gpio = <&msmgpio 77 0x00>;
+ qcom,dis-gpio = <&msmgpio 93 0x00>;
+ qcom,clk-en-gpio = <&msmgpio 78 0x00>;
+ qcom,clk-src = "GPCLK2";
+ interrupt-parent = <&msmgpio>;
+ interrupts = <77 0>;
+ qcom,clk-gpio = <&msmgpio 75 0x00>;
+ };
+ };
+
i2c@f9925000 {
fsl@1c {
compatible = "fsl,mma8x5x";
diff --git a/arch/arm/boot/dts/msm8610-regulator.dtsi b/arch/arm/boot/dts/msm8610-regulator.dtsi
index 543f59e..1340612 100644
--- a/arch/arm/boot/dts/msm8610-regulator.dtsi
+++ b/arch/arm/boot/dts/msm8610-regulator.dtsi
@@ -30,61 +30,62 @@
&soc {
apc_vreg_corner: regulator@f9018000 {
status = "okay";
- compatible = "qti,cpr-regulator";
+ compatible = "qcom,cpr-regulator";
reg = <0xf9018000 0x1000>, <0xf9011064 4>, <0xfc4b8000 0x1000>;
reg-names = "rbcpr", "rbcpr_clk", "efuse_addr";
interrupts = <0 15 0>;
regulator-name = "apc_corner";
regulator-min-microvolt = <1>;
- regulator-max-microvolt = <3>;
+ regulator-max-microvolt = <12>;
- qti,pvs-fuse-redun-sel = <53 25 3 2 1>;
- qti,pvs-fuse = <23 6 5 1>;
- qti,pvs-fuse-redun = <61 47 5 1>;
+ qcom,pvs-fuse-redun-sel = <53 25 3 2 1>;
+ qcom,pvs-fuse = <23 6 5 1>;
+ qcom,pvs-fuse-redun = <61 47 5 1>;
- qti,pvs-init-voltage = <1275000 1275000 1275000 1275000 1275000
+ qcom,pvs-init-voltage = <1275000 1275000 1275000 1275000 1275000
1275000 1275000 1275000 1275000 1275000
1275000 1275000 1275000 1275000 1275000
1275000 1275000 1275000 1275000 1275000
1275000 1275000 1275000 1275000 1275000
1275000 1275000 1275000 1275000 1275000
1275000 1275000>;
- qti,pvs-corner-ceiling-slow = <1150000 1150000 1275000>;
- qti,pvs-corner-ceiling-nom = <1075000 1075000 1275000>;
- qti,pvs-corner-ceiling-fast = <1050000 1050000 1275000>;
+ qcom,pvs-corner-ceiling-slow = <1050000 1150000 1275000>;
+ qcom,pvs-corner-ceiling-nom = <1050000 1075000 1275000>;
+ qcom,pvs-corner-ceiling-fast = <1050000 1050000 1275000>;
vdd-apc-supply = <&pm8110_s2>;
vdd-mx-supply = <&pm8110_l3_ao>;
- qti,vdd-mx-vmax = <1350000>;
- qti,vdd-mx-vmin-method = <1>;
+ qcom,vdd-mx-vmax = <1350000>;
+ qcom,vdd-mx-vmin-method = <1>;
- qti,cpr-ref-clk = <19200>;
- qti,cpr-timer-delay = <5000>;
- qti,cpr-timer-cons-up = <0>;
- qti,cpr-timer-cons-down = <2>;
- qti,cpr-irq-line = <0>;
- qti,cpr-step-quotient = <15>;
- qti,cpr-up-threshold = <0>;
- qti,cpr-down-threshold = <10>;
- qti,cpr-idle-clocks = <5>;
- qti,cpr-gcnt-time = <1>;
- qti,vdd-apc-step-up-limit = <1>;
- qti,vdd-apc-step-down-limit = <1>;
- qti,cpr-apc-volt-step = <5000>;
+ qcom,cpr-ref-clk = <19200>;
+ qcom,cpr-timer-delay = <5000>;
+ qcom,cpr-timer-cons-up = <0>;
+ qcom,cpr-timer-cons-down = <2>;
+ qcom,cpr-irq-line = <0>;
+ qcom,cpr-step-quotient = <15>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <10>;
+ qcom,cpr-idle-clocks = <5>;
+ qcom,cpr-gcnt-time = <1>;
+ qcom,vdd-apc-step-up-limit = <1>;
+ qcom,vdd-apc-step-down-limit = <1>;
+ qcom,cpr-apc-volt-step = <5000>;
- qti,cpr-fuse-redun-sel = <53 25 3 2 1>;
- qti,cpr-fuse-row = <61 1>;
- qti,cpr-fuse-bp-cpr-disable = <39>;
- qti,cpr-fuse-bp-scheme = <40>;
- qti,cpr-fuse-target-quot = <27 15 3>;
- qti,cpr-fuse-ro-sel = <47 41 44>;
- qti,cpr-fuse-redun-row = <52 1>;
- qti,cpr-fuse-redun-bp-cpr-disable = <24>;
- qti,cpr-fuse-redun-bp-scheme = <25>;
- qti,cpr-fuse-redun-target-quot = <32 12 0>;
- qti,cpr-fuse-redun-ro-sel = <44 26 29>;
+ qcom,cpr-fuse-redun-sel = <53 25 3 2 1>;
+ qcom,cpr-fuse-row = <61 1>;
+ qcom,cpr-fuse-bp-cpr-disable = <39>;
+ qcom,cpr-fuse-bp-scheme = <40>;
+ qcom,cpr-fuse-target-quot = <27 15 3>;
+ qcom,cpr-fuse-ro-sel = <47 41 44>;
+ qcom,cpr-fuse-redun-row = <52 1>;
+ qcom,cpr-fuse-redun-bp-cpr-disable = <24>;
+ qcom,cpr-fuse-redun-bp-scheme = <25>;
+ qcom,cpr-fuse-redun-target-quot = <32 12 0>;
+ qcom,cpr-fuse-redun-ro-sel = <44 26 29>;
+ qcom,cpr-corner-map = <1 1 2 2 3 3 3 3 3 3 3 3>;
- qti,cpr-enable;
+ qcom,cpr-enable;
};
};
diff --git a/arch/arm/boot/dts/msm8610.dtsi b/arch/arm/boot/dts/msm8610.dtsi
index 03ef738..558f8c2 100644
--- a/arch/arm/boot/dts/msm8610.dtsi
+++ b/arch/arm/boot/dts/msm8610.dtsi
@@ -535,6 +535,8 @@
i2c@f9924000 { /* BLSP-1 QUP-3 */
cell-index = <2>;
compatible = "qcom,i2c-qup";
+ #address-cells = <1>;
+ #size-cells = <0>;
reg-names = "qup_phys_addr";
reg = <0xf9924000 0x1000>;
interrupt-names = "qup_err_intr";
diff --git a/arch/arm/boot/dts/msm8926-camera-sensor-qrd.dtsi b/arch/arm/boot/dts/msm8926-camera-sensor-qrd.dtsi
index 9b812da..ac2d908 100644
--- a/arch/arm/boot/dts/msm8926-camera-sensor-qrd.dtsi
+++ b/arch/arm/boot/dts/msm8926-camera-sensor-qrd.dtsi
@@ -17,7 +17,7 @@
cell-index = <0>;
compatible = "qcom,camera-led-flash";
qcom,flash-type = <1>;
- qcom,flash-source = <&pm8226_flash0 &pm8226_flash1>;
+ qcom,flash-source = <&pm8226_flash0>;
qcom,torch-source = <&pm8226_torch>;
};
};
diff --git a/arch/arm/boot/dts/msm8926-qrd-skug-pvt.dts b/arch/arm/boot/dts/msm8926-qrd-skug-pvt.dts
new file mode 100644
index 0000000..2a45592
--- /dev/null
+++ b/arch/arm/boot/dts/msm8926-qrd-skug-pvt.dts
@@ -0,0 +1,27 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/dts-v1/;
+/include/ "msm8926-qrd-skug.dtsi"
+
+/ {
+ model = "Qti MSM 8926 QRD SKUG PVT";
+ compatible = "qcom,msm8926-qrd", "qcom,msm8926", "qcom,qrd";
+ qcom,board-id = <0x2000b 5>;
+};
+
+&pm8226_vadc {
+ chan@30 {
+ label = "batt_therm";
+ qcom,scale-function = <9>;
+ };
+};
diff --git a/arch/arm/boot/dts/msm8926-qrd-skug.dts b/arch/arm/boot/dts/msm8926-qrd-skug.dts
index 15a2d58..4aab4f9 100644
--- a/arch/arm/boot/dts/msm8926-qrd-skug.dts
+++ b/arch/arm/boot/dts/msm8926-qrd-skug.dts
@@ -11,9 +11,7 @@
*/
/dts-v1/;
-/include/ "msm8926.dtsi"
-/include/ "msm8226-qrd.dtsi"
-/include/ "msm8926-camera-sensor-qrd.dtsi"
+/include/ "msm8926-qrd-skug.dtsi"
/ {
model = "Qualcomm MSM 8926 QRD SKUG";
@@ -21,88 +19,3 @@
qcom,board-id = <11 5>;
};
-&qrd_batterydata {
- qcom,rpull-up-kohm = <100>;
- qcom,vref-batt-therm = <1800000>;
-
- /include/ "batterydata-qrd-4v2-2000mah.dtsi"
-};
-
-&pm8226_bms {
- qcom,battery-data = <&qrd_batterydata>;
-};
-
-&pm8226_chg {
- qcom,battery-data = <&qrd_batterydata>;
-};
-
-&soc {
- i2c@f9927000 { /* BLSP1 QUP5 */
- focaltech@38 {
- compatible = "focaltech,5x06";
- reg = <0x38>;
- interrupt-parent = <&msmgpio>;
- interrupts = <17 0x2>;
- vdd-supply = <&pm8226_l19>;
- vcc_i2c-supply = <&pm8226_lvs1>;
- focaltech,name = "ft5336";
- focaltech,family-id = <0x14>;
- focaltech,reset-gpio = <&msmgpio 16 0x00>;
- focaltech,irq-gpio = <&msmgpio 17 0x00>;
- focaltech,display-coords = <0 0 720 1280>;
- focaltech,panel-coords = <0 0 720 1400>;
- focaltech,button-map= <139 102 158>;
- focaltech,no-force-update;
- focaltech,i2c-pull-up;
- focaltech,group-id = <1>;
- focaltech,hard-reset-delay-ms = <20>;
- focaltech,soft-reset-delay-ms = <200>;
- focaltech,num-max-touches = <5>;
- focaltech,fw-name = "ft_8926_qrd_fw.bin";
- focaltech,fw-delay-aa-ms = <30>;
- focaltech,fw-delay-55-ms = <30>;
- focaltech,fw-upgrade-id1 = <0x11>;
- focaltech,fw-upgrade-id2 = <0x11>;
- focaltech,fw-delay-readid-ms = <10>;
- focaltech,fw-delay-era-flsh-ms = <2000>;
- focaltech,fw-auto-cal;
- focaltech,ignore-id-check;
- };
- };
-
- gen-vkeys {
- compatible = "qcom,gen-vkeys";
- label = "ft5x06_ts";
- qcom,disp-maxx = <720>;
- qcom,disp-maxy = <1280>;
- qcom,panel-maxx = <720>;
- qcom,panel-maxy = <1404>;
- qcom,key-codes = <139 172 158>;
- qcom,y-offset = <0>;
- };
-
- gpio-leds {
- compatible = "gpio-leds";
- keypad-backlight {
- gpios = <&msmgpio 34 0>;
- label = "button-backlight";
- linux,default-trigger = "none";
- };
- };
-};
-
-&spmi_bus {
- qcom,pm8226@0 {
- qcom,leds@a100 {
- status = "disable";
- };
- };
-};
-
-&mdss_dsi0 {
- qcom,dsi-pref-prim-pan = <&dsi_ssd2080m_720_vid>;
-};
-
-&dsi_ssd2080m_720_vid {
- qcom,cont-splash-enabled;
-};
diff --git a/arch/arm/boot/dts/msm8926-qrd-skug.dtsi b/arch/arm/boot/dts/msm8926-qrd-skug.dtsi
new file mode 100644
index 0000000..fea5a9e
--- /dev/null
+++ b/arch/arm/boot/dts/msm8926-qrd-skug.dtsi
@@ -0,0 +1,101 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/include/ "msm8926.dtsi"
+/include/ "msm8226-qrd.dtsi"
+/include/ "msm8926-camera-sensor-qrd.dtsi"
+
+&qrd_batterydata {
+ qcom,rpull-up-kohm = <100>;
+ qcom,vref-batt-therm = <1800000>;
+
+ /include/ "batterydata-qrd-4v2-2000mah.dtsi"
+};
+
+&pm8226_bms {
+ qcom,battery-data = <&qrd_batterydata>;
+};
+
+&pm8226_chg {
+ qcom,battery-data = <&qrd_batterydata>;
+};
+
+&soc {
+ i2c@f9927000 { /* BLSP1 QUP5 */
+ focaltech@38 {
+ compatible = "focaltech,5x06";
+ reg = <0x38>;
+ interrupt-parent = <&msmgpio>;
+ interrupts = <17 0x2>;
+ vdd-supply = <&pm8226_l19>;
+ vcc_i2c-supply = <&pm8226_lvs1>;
+ focaltech,name = "ft5336";
+ focaltech,family-id = <0x14>;
+ focaltech,reset-gpio = <&msmgpio 16 0x00>;
+ focaltech,irq-gpio = <&msmgpio 17 0x00>;
+ focaltech,display-coords = <0 0 720 1280>;
+ focaltech,panel-coords = <0 0 720 1400>;
+ focaltech,button-map= <139 102 158>;
+ focaltech,no-force-update;
+ focaltech,i2c-pull-up;
+ focaltech,group-id = <1>;
+ focaltech,hard-reset-delay-ms = <20>;
+ focaltech,soft-reset-delay-ms = <200>;
+ focaltech,num-max-touches = <5>;
+ focaltech,fw-name = "ft_8926_qrd_fw.bin";
+ focaltech,fw-delay-aa-ms = <30>;
+ focaltech,fw-delay-55-ms = <30>;
+ focaltech,fw-upgrade-id1 = <0x11>;
+ focaltech,fw-upgrade-id2 = <0x11>;
+ focaltech,fw-delay-readid-ms = <10>;
+ focaltech,fw-delay-era-flsh-ms = <2000>;
+ focaltech,fw-auto-cal;
+ focaltech,ignore-id-check;
+ };
+ };
+
+ gen-vkeys {
+ compatible = "qcom,gen-vkeys";
+ label = "ft5x06_ts";
+ qcom,disp-maxx = <720>;
+ qcom,disp-maxy = <1280>;
+ qcom,panel-maxx = <720>;
+ qcom,panel-maxy = <1404>;
+ qcom,key-codes = <139 172 158>;
+ qcom,y-offset = <0>;
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+ keypad-backlight {
+ gpios = <&msmgpio 34 0>;
+ label = "button-backlight";
+ linux,default-trigger = "none";
+ };
+ };
+};
+
+&spmi_bus {
+ qcom,pm8226@0 {
+ qcom,leds@a100 {
+ status = "disable";
+ };
+ };
+};
+
+&mdss_dsi0 {
+ qcom,dsi-pref-prim-pan = <&dsi_ssd2080m_720_vid>;
+};
+
+&dsi_ssd2080m_720_vid {
+ qcom,cont-splash-enabled;
+};
diff --git a/arch/arm/boot/dts/msm8926.dtsi b/arch/arm/boot/dts/msm8926.dtsi
index 0b876a1..963c1b8 100644
--- a/arch/arm/boot/dts/msm8926.dtsi
+++ b/arch/arm/boot/dts/msm8926.dtsi
@@ -39,10 +39,45 @@
vdd_mss-supply = <&pm8226_s5>;
};
- qcom,acpuclk@f9011050 {
+ qcom,clock-a7@f9011050 {
reg = <0xf9011050 0x8>,
<0xfc4b80b0 0x8>;
- reg-names = "rcg_base", "pte_efuse";
+ reg-names = "rcg-base", "efuse";
+ qcom,speed0-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1190400000 3>;
+ qcom,speed6-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1190400000 3>;
+ qcom,speed2-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1401600000 3>;
+ qcom,speed5-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1401600000 3>;
+ qcom,speed4-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1401600000 3>;
+ qcom,speed7-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1401600000 3>;
+ qcom,speed1-bin-v1 =
+ < 0 0>,
+ < 384000000 1>,
+ < 787200000 2>,
+ <1593600000 3>;
};
qcom,msm-thermal {
@@ -116,20 +151,21 @@
};
&apc_vreg_corner {
- qti,pvs-init-voltage = <1350000 1340000 1330000 1320000 1310000
+ qcom,pvs-init-voltage = <1350000 1340000 1330000 1320000 1310000
1300000 1290000 1280000 1270000 1260000
1250000 1240000 1230000 1220000 1210000
1200000 1190000 1180000 1170000 1160000
1150000 1140000 1140000 1140000 1140000
1140000 1140000 1140000 1140000 1140000
1140000 1140000>;
- qti,pvs-corner-ceiling-slow = <1050000 1150000 1280000>;
- qti,pvs-corner-ceiling-nom = <1050000 1080000 1200000>;
- qti,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
- qti,cpr-step-quotient = <30>;
- qti,cpr-up-threshold = <0>;
- qti,cpr-down-threshold = <5>;
- qti,cpr-apc-volt-step = <10000>;
+ qcom,pvs-corner-ceiling-slow = <1050000 1150000 1280000>;
+ qcom,pvs-corner-ceiling-nom = <1050000 1080000 1200000>;
+ qcom,pvs-corner-ceiling-fast = <1050000 1050000 1100000>;
+ qcom,cpr-step-quotient = <30>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <1>;
+ qcom,cpr-apc-volt-step = <10000>;
+ qcom,cpr-quotient-adjustment = <96>;
};
&tsens {
diff --git a/arch/arm/boot/dts/msm8974-camera-sensor-mtp.dtsi b/arch/arm/boot/dts/msm8974-camera-sensor-mtp.dtsi
index 9d44bda..29e2aaa 100644
--- a/arch/arm/boot/dts/msm8974-camera-sensor-mtp.dtsi
+++ b/arch/arm/boot/dts/msm8974-camera-sensor-mtp.dtsi
@@ -16,6 +16,7 @@
cell-index = <0>;
compatible = "qcom,camera-led-flash";
qcom,flash-type = <1>;
+ qcom,torch-source = <&pm8941_torch>;
qcom,flash-source = <&pm8941_flash0 &pm8941_flash1>;
};
};
diff --git a/arch/arm/boot/dts/msm8974-v2-pm.dtsi b/arch/arm/boot/dts/msm8974-v2-pm.dtsi
index e2d40f7..cdd5fde 100644
--- a/arch/arm/boot/dts/msm8974-v2-pm.dtsi
+++ b/arch/arm/boot/dts/msm8974-v2-pm.dtsi
@@ -212,6 +212,7 @@
<50 172>, /* usb1_hs_async_wakeup_irq */
<53 104>, /* mdss_irq */
<62 222>, /* ee0_krait_hlos_spmi_periph_irq */
+ <0xff 33>, /* APCC_qgicL2PerfMonIrptReq */
<0xff 34>, /* APCC_qgicL2ErrorIrptReq */
<0xff 35>, /* WDT_barkInt */
<0xff 40>, /* qtimer_phy_irq */
diff --git a/arch/arm/boot/dts/msm8974-v2.dtsi b/arch/arm/boot/dts/msm8974-v2.dtsi
index 9176117..5607257 100644
--- a/arch/arm/boot/dts/msm8974-v2.dtsi
+++ b/arch/arm/boot/dts/msm8974-v2.dtsi
@@ -122,7 +122,7 @@
qcom,dec-ocmem-ab-ib = <0 0>,
<176000 519000>,
<456000 519000>,
- <864000 519000>,
+ <864000 629000>,
<1728000 1038000>,
<2766000 1661000>,
<3456000 2076000>,
diff --git a/arch/arm/boot/dts/msm8974.dtsi b/arch/arm/boot/dts/msm8974.dtsi
index a912da8..4babf11 100644
--- a/arch/arm/boot/dts/msm8974.dtsi
+++ b/arch/arm/boot/dts/msm8974.dtsi
@@ -1515,25 +1515,45 @@
< 2265600000 925000 691 >;
};
+ qcom,cpubw {
+ compatible = "qcom,cpubw";
+ qcom,cpu-mem-ports = <1 512>, <2 512>;
+ qcom,bw-tbl =
+ < 572 /* 75 MHz */ >,
+ < 1144 /* 150 MHz */ >,
+ < 1525 /* 200 MHz */ >,
+ < 2342 /* 307 MHz */ >,
+ < 3509 /* 460 MHz */ >,
+ < 4684 /* 614 MHz */ >,
+ < 6103 /* 800 MHz */ >,
+ < 7102 /* 931 MHz */ >;
+ };
+
+ qcom,kraitbw-l2pm {
+ compatible = "qcom,kraitbw-l2pm";
+ interrupts = <0 1 1>;
+ qcom,bytes-per-beat = <8>;
+ };
+
qcom,msm-cpufreq@0 {
reg = <0 4>;
compatible = "qcom,msm-cpufreq";
- qcom,cpu-mem-ports = <1 512>, <2 512>;
qcom,cpufreq-table =
- < 300000 300000 600 /* 75 MHz */ >,
- < 422400 422400 1200 /* 150 MHz */ >,
- < 652800 499200 1600 /* 200 MHz */ >,
- < 729600 576000 2456 /* 307 MHz */ >,
- < 883200 576000 2456 /* 307 MHz */ >,
- < 960000 960000 3680 /* 460 MHz */ >,
- < 1036800 1036800 3680 /* 460 MHz */ >,
- < 1190400 1036800 3680 /* 460 MHz */ >,
- < 1267200 1267200 4912 /* 614 MHz */ >,
- < 1497600 1497600 4912 /* 614 MHz */ >,
- < 1574400 1574400 6400 /* 800 MHz */ >,
- < 1728000 1651200 6400 /* 800 MHz */ >,
- < 1958400 1728000 7448 /* 931 MHz */ >,
- < 2265600 1728000 7448 /* 931 MHz */ >;
+ < 300000 300000 572 >,
+ < 422400 422400 1144 >,
+ < 652800 499200 1525 >,
+ < 729600 576000 2342 >,
+ < 883200 576000 2342 >,
+ < 960000 960000 3509 >,
+ < 1036800 1036800 3509 >,
+ < 1190400 1036800 3509 >,
+ < 1267200 1267200 4684 >,
+ < 1497600 1497600 4684 >,
+ < 1574400 1574400 6103 >,
+ < 1728000 1651200 6103 >,
+ < 1958400 1728000 7102 >,
+ < 2265600 1728000 7102 >,
+ < 2457600 1728000 7102 >;
};
usb3: qcom,ssusb@f9200000 {
diff --git a/arch/arm/boot/dts/msm8974pro-pm.dtsi b/arch/arm/boot/dts/msm8974pro-pm.dtsi
index 938a2cc..29aeccd 100644
--- a/arch/arm/boot/dts/msm8974pro-pm.dtsi
+++ b/arch/arm/boot/dts/msm8974pro-pm.dtsi
@@ -214,7 +214,10 @@
<50 172>, /* usb1_hs_async_wakeup_irq */
<53 104>, /* mdss_irq */
<62 222>, /* ee0_krait_hlos_spmi_periph_irq */
- <0xff 33>, /*l2_perf_mon*/
+ <0xff 18>, /* APCx_qgicQTmrSecPhysIrptReq */
+ <0xff 19>, /* APCx_qgicQTmrSecPhysIrptReq */
+ <0xff 25>, /* APCx_qgicExtFaultIrptReq */
+ <0xff 33>, /* APCC_qgicL2PerfMonIrptReq */
<0xff 34>, /* APCC_qgicL2ErrorIrptReq */
<0xff 35>, /* WDT_barkInt */
<0xff 40>, /* qtimer_phy_irq */
@@ -237,7 +240,10 @@
<0xff 105>, /* iommu_pmon_nonsecure_irq */
<0xff 109>, /* ocmem_dm_nonsec_irq */
<0xff 126>, /* bam_irq[0] */
+ <0xff 140>, /* uart_dm_intr */
<0xff 155>, /* sdcc_irq[0] */
+ <0xff 157>, /* sdcc_irq[0] */
+ <0xff 159>, /* sdcc_irq[0] */
<0xff 163>, /* usb30_ee1_irq */
<0xff 170>, /* sdcc_pwr_cmd_irq */
<0xff 173>, /* o_wcss_apss_smd_hi */
@@ -270,6 +276,8 @@
<0xff 207>, /* rpm_ipc(27) */
<0xff 211>, /* usb_dwc3_otg */
<0xff 240>, /* summary_irq_kpss */
+ <0xff 253>, /* sdcc_pwr_cmd_irq */
+ <0xff 256>, /* sdcc_pwr_cmd_irq */
<0xff 268>, /* bam_irq[1] */
<0xff 270>, /* bam_irq[0] */
<0xff 271>; /* bam_irq[0] */
diff --git a/arch/arm/boot/dts/msm8974pro-pm8941.dtsi b/arch/arm/boot/dts/msm8974pro-pm8941.dtsi
index 2c06c3c..8b13c9f 100644
--- a/arch/arm/boot/dts/msm8974pro-pm8941.dtsi
+++ b/arch/arm/boot/dts/msm8974pro-pm8941.dtsi
@@ -38,28 +38,32 @@
&krait0_vreg {
regulator-max-microvolt = <1120000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
};
&krait1_vreg {
regulator-max-microvolt = <1120000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
};
&krait2_vreg {
regulator-max-microvolt = <1120000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
};
&krait3_vreg {
regulator-max-microvolt = <1120000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
};
&tspp {
vdd_cx-supply = <&pm8841_s2_corner>;
};
+&pm8841_s2_corner {
+ qcom,init-smps-mode = <0>; /* Allow AUTO mode for VDD_CX. */
+};
+
&krait_regulator_pmic {
status = "ok";
diff --git a/arch/arm/boot/dts/msm8974pro-pma8084-regulator.dtsi b/arch/arm/boot/dts/msm8974pro-pma8084-regulator.dtsi
index 00e3b8b..79d7412 100644
--- a/arch/arm/boot/dts/msm8974pro-pma8084-regulator.dtsi
+++ b/arch/arm/boot/dts/msm8974pro-pma8084-regulator.dtsi
@@ -494,7 +494,7 @@
qcom,retention-voltage = <675000>;
qcom,ldo-default-voltage = <750000>;
qcom,ldo-threshold-voltage = <850000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
qcom,cpu-num = <0>;
};
@@ -510,7 +510,7 @@
qcom,retention-voltage = <675000>;
qcom,ldo-default-voltage = <750000>;
qcom,ldo-threshold-voltage = <850000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
qcom,cpu-num = <1>;
};
@@ -526,7 +526,7 @@
qcom,retention-voltage = <675000>;
qcom,ldo-default-voltage = <750000>;
qcom,ldo-threshold-voltage = <850000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
qcom,cpu-num = <2>;
};
@@ -542,7 +542,7 @@
qcom,retention-voltage = <675000>;
qcom,ldo-default-voltage = <750000>;
qcom,ldo-threshold-voltage = <850000>;
- qcom,ldo-delta-voltage = <25000>;
+ qcom,ldo-delta-voltage = <12500>;
qcom,cpu-num = <3>;
};
};
diff --git a/arch/arm/boot/dts/msm8974pro-pma8084.dtsi b/arch/arm/boot/dts/msm8974pro-pma8084.dtsi
index 71fbeae..c06ebf8 100644
--- a/arch/arm/boot/dts/msm8974pro-pma8084.dtsi
+++ b/arch/arm/boot/dts/msm8974pro-pma8084.dtsi
@@ -191,6 +191,10 @@
vdd_cx-supply = <&pma8084_s2_corner>;
};
+&pma8084_s2_corner {
+ qcom,init-smps-mode = <0>; /* Allow AUTO mode for VDD_CX. */
+};
+
&krait_regulator_pmic {
status = "ok";
diff --git a/arch/arm/boot/dts/msm8974pro.dtsi b/arch/arm/boot/dts/msm8974pro.dtsi
index 41f02fe..7481b5c 100755
--- a/arch/arm/boot/dts/msm8974pro.dtsi
+++ b/arch/arm/boot/dts/msm8974pro.dtsi
@@ -1548,25 +1548,6 @@
< 2457600000 970000 802 >;
};
- qcom,msm-cpufreq@0 {
- qcom,cpufreq-table =
- < 300000 300000 300 /* 37.5 MHz */ >,
- < 422400 422400 300 /* 37.5 MHz */ >,
- < 652800 499200 300 /* 37.5 MHz */ >,
- < 729600 576000 300 /* 37.5 MHz */ >,
- < 883200 576000 300 /* 37.5 MHz */ >,
- < 960000 960000 300 /* 37.5 MHz */ >,
- < 1036800 1036800 300 /* 37.5 MHz */ >,
- < 1190400 1036800 300 /* 37.5 MHz */ >,
- < 1267200 1267200 300 /* 37.5 MHz */ >,
- < 1497600 1497600 300 /* 37.5 MHz */ >,
- < 1574400 1574400 300 /* 37.5 MHz */ >,
- < 1728000 1651200 300 /* 37.5 MHz */ >,
- < 1958400 1728000 300 /* 37.5 MHz */ >,
- < 2265600 1728000 300 /* 37.5 MHz */ >,
- < 2496000 1728000 300 /* 37.5 MHz */ >;
- };
-
i2c@f9928000 { /* BLSP-1 QUP-6 */
cell-index = <3>;
compatible = "qcom,i2c-qup";
@@ -1635,42 +1616,42 @@
reg = <0>;
qcom,gpu-freq = <578000000>;
qcom,bus-freq = <14>;
- qcom,io-fraction = <33>;
+ qcom,io-fraction = <101>;
};
qcom,gpu-pwrlevel@1 {
reg = <1>;
qcom,gpu-freq = <462400000>;
qcom,bus-freq = <11>;
- qcom,io-fraction = <66>;
+ qcom,io-fraction = <101>;
};
qcom,gpu-pwrlevel@2 {
reg = <2>;
qcom,gpu-freq = <389000000>;
qcom,bus-freq = <8>;
- qcom,io-fraction = <66>;
+ qcom,io-fraction = <101>;
};
qcom,gpu-pwrlevel@3 {
reg = <3>;
- qcom,gpu-freq = <320000000>;
+ qcom,gpu-freq = <330000000>;
qcom,bus-freq = <5>;
- qcom,io-fraction = <100>;
+ qcom,io-fraction = <101>;
};
qcom,gpu-pwrlevel@4 {
reg = <4>;
qcom,gpu-freq = <200000000>;
qcom,bus-freq = <2>;
- qcom,io-fraction = <100>;
+ qcom,io-fraction = <101>;
};
qcom,gpu-pwrlevel@5 {
reg = <5>;
qcom,gpu-freq = <27000000>;
qcom,bus-freq = <0>;
- qcom,io-fraction = <0>;
+ qcom,io-fraction = <101>;
};
};
};
diff --git a/arch/arm/configs/apq8084_defconfig b/arch/arm/configs/apq8084_defconfig
index 968a5ee..823e4f8 100644
--- a/arch/arm/configs/apq8084_defconfig
+++ b/arch/arm/configs/apq8084_defconfig
@@ -301,6 +301,11 @@
# CONFIG_LCD_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_UHID=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_EHCI_HCD=y
diff --git a/arch/arm/configs/msm8226-perf_defconfig b/arch/arm/configs/msm8226-perf_defconfig
index 1e32cfa..6c3898c 100644
--- a/arch/arm/configs/msm8226-perf_defconfig
+++ b/arch/arm/configs/msm8226-perf_defconfig
@@ -216,6 +216,7 @@
CONFIG_BT_HCISMD=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
+CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
@@ -348,6 +349,8 @@
CONFIG_UHID=y
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_MON=y
@@ -356,6 +359,7 @@
CONFIG_USB_EHCI_MSM=y
CONFIG_USB_EHCI_MSM_HSIC=y
CONFIG_USB_ACM=y
+CONFIG_USB_CCID_BRIDGE=y
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
diff --git a/arch/arm/configs/msm8226_defconfig b/arch/arm/configs/msm8226_defconfig
index cedb6dc..e14118d 100644
--- a/arch/arm/configs/msm8226_defconfig
+++ b/arch/arm/configs/msm8226_defconfig
@@ -373,6 +373,8 @@
CONFIG_UHID=y
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_MON=y
@@ -381,6 +383,7 @@
CONFIG_USB_EHCI_MSM=y
CONFIG_USB_EHCI_MSM_HSIC=y
CONFIG_USB_ACM=y
+CONFIG_USB_CCID_BRIDGE=y
CONFIG_USB_STORAGE=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
diff --git a/arch/arm/configs/msm8610-perf_defconfig b/arch/arm/configs/msm8610-perf_defconfig
index e46bfef..b5119b7 100644
--- a/arch/arm/configs/msm8610-perf_defconfig
+++ b/arch/arm/configs/msm8610-perf_defconfig
@@ -78,7 +78,6 @@
CONFIG_KSM=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_KSM=y
-CONFIG_ENABLE_VMALLOC_SAVING=y
CONFIG_CP_ACCESS=y
CONFIG_USE_OF=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
@@ -207,6 +206,7 @@
CONFIG_BT_HCISMD=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
+CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_CMA=y
CONFIG_CMA_SIZE_MBYTES=4
CONFIG_BLK_DEV_LOOP=y
@@ -328,6 +328,8 @@
CONFIG_UHID=y
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
diff --git a/arch/arm/configs/msm8610_defconfig b/arch/arm/configs/msm8610_defconfig
index 899ed30..165b841 100644
--- a/arch/arm/configs/msm8610_defconfig
+++ b/arch/arm/configs/msm8610_defconfig
@@ -79,7 +79,6 @@
CONFIG_KSM=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_KSM=y
-CONFIG_ENABLE_VMALLOC_SAVING=y
CONFIG_CP_ACCESS=y
CONFIG_USE_OF=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
@@ -351,6 +350,8 @@
CONFIG_UHID=y
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
diff --git a/arch/arm/configs/msm8974-perf_defconfig b/arch/arm/configs/msm8974-perf_defconfig
index 10f2919..737d98d 100755
--- a/arch/arm/configs/msm8974-perf_defconfig
+++ b/arch/arm/configs/msm8974-perf_defconfig
@@ -245,6 +245,7 @@
CONFIG_MSM_BT_POWER=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
+CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_RFKILL=y
CONFIG_GENLOCK=y
CONFIG_GENLOCK_MISCDEVICE=y
@@ -389,6 +390,7 @@
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_XHCI_HCD=y
diff --git a/arch/arm/configs/msm8974_defconfig b/arch/arm/configs/msm8974_defconfig
index 0b9ba76..e5be6d5 100755
--- a/arch/arm/configs/msm8974_defconfig
+++ b/arch/arm/configs/msm8974_defconfig
@@ -82,7 +82,6 @@
CONFIG_MSM_L1_ERR_LOG=y
CONFIG_MSM_L2_ERP_PRINT_ACCESS_ERRORS=y
CONFIG_MSM_L2_ERP_PORT_PANIC=y
-CONFIG_MSM_L2_ERP_1BIT_PANIC=y
CONFIG_MSM_L2_ERP_2BIT_PANIC=y
CONFIG_MSM_CACHE_DUMP=y
CONFIG_MSM_CACHE_DUMP_ON_PANIC=y
@@ -397,6 +396,7 @@
CONFIG_HID_APPLE=y
CONFIG_HID_MAGICMOUSE=y
CONFIG_HID_MICROSOFT=y
+CONFIG_HID_ELECOM=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_SUSPEND=y
CONFIG_USB_XHCI_HCD=y
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index e1fc42f..d3e2eb6 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -141,6 +141,8 @@
struct pmu_hw_events *(*get_hw_events)(void);
int (*test_set_event_constraints)(struct perf_event *event);
int (*clear_event_constraints)(struct perf_event *event);
+ void (*save_pm_registers)(void *hcpu);
+ void (*restore_pm_registers)(void *hcpu);
};
#define to_arm_pmu(p) (container_of(p, struct arm_pmu, pmu))
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 2a3ab6e..7814288 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -197,6 +197,9 @@
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
u64 delta, prev_raw_count, new_raw_count;
+ if (event->state <= PERF_EVENT_STATE_OFF)
+ return 0;
+
again:
prev_raw_count = local64_read(&hwc->prev_count);
new_raw_count = armpmu->read_counter(idx);
@@ -425,15 +428,37 @@
return err;
}
-void
+#ifdef CONFIG_SMP
+static __ref int armpmu_cpu_up(int cpu)
+{
+ int ret = 0;
+
+ if (!cpumask_test_cpu(cpu, cpu_online_mask)) {
+ ret = cpu_up(cpu);
+ if (ret)
+ pr_err("Failed to bring up CPU: %d, ret: %d\n",
+ cpu, ret);
+ }
+ return ret;
+}
+#else
+static inline int armpmu_cpu_up(int cpu)
+{
+ return 0;
+}
+#endif
+
+void __ref
multicore_free_irq(int irq)
{
int cpu;
+ struct irq_desc *desc = irq_to_desc(irq);
if (irq >= 0) {
- for_each_cpu(cpu, cpu_online_mask) {
- smp_call_function_single(cpu,
- disable_irq_callback, &irq, 1);
+ for_each_cpu(cpu, desc->percpu_enabled) {
+ if (!armpmu_cpu_up(cpu))
+ smp_call_function_single(cpu,
+ disable_irq_callback, &irq, 1);
}
free_percpu_irq(irq, &pmu_irq_cookie);
}
@@ -716,6 +741,7 @@
armpmu->pmu.start = armpmu_start;
armpmu->pmu.stop = armpmu_stop;
armpmu->pmu.read = armpmu_read;
+ armpmu->pmu.events_across_hotplug = 1;
}
int armpmu_register(struct arm_pmu *armpmu, char *name, int type)
@@ -826,62 +852,6 @@
return 0;
}
-/*
- * PMU hardware loses all context when a CPU goes offline.
- * When a CPU is hotplugged back in, since some hardware registers are
- * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
- * junk values out of them.
- */
-static int __cpuinit pmu_cpu_notify(struct notifier_block *b,
- unsigned long action, void *hcpu)
-{
- int irq;
-
- if (cpu_has_active_perf((int)hcpu)) {
- switch ((action & ~CPU_TASKS_FROZEN)) {
-
- case CPU_DOWN_PREPARE:
- /*
- * If this is on a multicore CPU, we need
- * to disarm the PMU IRQ before disappearing.
- */
- if (cpu_pmu &&
- cpu_pmu->plat_device->dev.platform_data) {
- irq = platform_get_irq(cpu_pmu->plat_device, 0);
- smp_call_function_single((int)hcpu,
- disable_irq_callback, &irq, 1);
- }
- return NOTIFY_DONE;
-
- case CPU_UP_PREPARE:
- /*
- * If this is on a multicore CPU, we need
- * to arm the PMU IRQ before appearing.
- */
- if (cpu_pmu &&
- cpu_pmu->plat_device->dev.platform_data) {
- irq = platform_get_irq(cpu_pmu->plat_device, 0);
- smp_call_function_single((int)hcpu,
- enable_irq_callback, &irq, 1);
- }
- return NOTIFY_DONE;
-
- case CPU_STARTING:
- if (cpu_pmu && cpu_pmu->reset) {
- cpu_pmu->reset(NULL);
- return NOTIFY_OK;
- }
- default:
- return NOTIFY_DONE;
- }
- }
-
- if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
- return NOTIFY_DONE;
-
- return NOTIFY_OK;
-}
-
static void armpmu_update_counters(void)
{
struct pmu_hw_events *hw_events;
@@ -902,6 +872,79 @@
}
}
+/*
+ * PMU hardware loses all context when a CPU goes offline.
+ * When a CPU is hotplugged back in, since some hardware registers are
+ * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
+ * junk values out of them.
+ */
+static int __cpuinit pmu_cpu_notify(struct notifier_block *b,
+ unsigned long action, void *hcpu)
+{
+ int irq;
+ struct pmu *pmu;
+ int cpu = (int)hcpu;
+
+ switch ((action & ~CPU_TASKS_FROZEN)) {
+ case CPU_DOWN_PREPARE:
+ if (cpu_pmu && cpu_pmu->save_pm_registers)
+ smp_call_function_single(cpu,
+ cpu_pmu->save_pm_registers,
+ hcpu, 1);
+ break;
+ case CPU_STARTING:
+ if (cpu_pmu && cpu_pmu->restore_pm_registers)
+ smp_call_function_single(cpu,
+ cpu_pmu->restore_pm_registers,
+ hcpu, 1);
+ }
+
+ if (cpu_has_active_perf((int)hcpu)) {
+ switch ((action & ~CPU_TASKS_FROZEN)) {
+
+ case CPU_DOWN_PREPARE:
+ armpmu_update_counters();
+ /*
+ * If this is on a multicore CPU, we need
+ * to disarm the PMU IRQ before disappearing.
+ */
+ if (cpu_pmu &&
+ cpu_pmu->plat_device->dev.platform_data) {
+ irq = platform_get_irq(cpu_pmu->plat_device, 0);
+ smp_call_function_single((int)hcpu,
+ disable_irq_callback, &irq, 1);
+ }
+ return NOTIFY_DONE;
+
+ case CPU_STARTING:
+ /*
+ * If this is on a multicore CPU, we need
+ * to arm the PMU IRQ before appearing.
+ */
+ if (cpu_pmu &&
+ cpu_pmu->plat_device->dev.platform_data) {
+ irq = platform_get_irq(cpu_pmu->plat_device, 0);
+ enable_irq_callback(&irq);
+ }
+
+ if (cpu_pmu && cpu_pmu->reset) {
+ __get_cpu_var(from_idle) = 1;
+ cpu_pmu->reset(NULL);
+ pmu = &cpu_pmu->pmu;
+ pmu->pmu_enable(pmu);
+ return NOTIFY_OK;
+ }
+ default:
+ return NOTIFY_DONE;
+ }
+ }
+
+ if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
+ return NOTIFY_DONE;
+
+ return NOTIFY_OK;
+}
+
static struct notifier_block __cpuinitdata pmu_cpu_notifier = {
.notifier_call = pmu_cpu_notify,
};
@@ -913,6 +956,8 @@
struct pmu *pmu;
switch (cmd) {
case CPU_PM_ENTER:
+ if (cpu_pmu && cpu_pmu->save_pm_registers)
+ cpu_pmu->save_pm_registers((void *)smp_processor_id());
if (cpu_has_active_perf((int)v)) {
armpmu_update_counters();
pmu = &cpu_pmu->pmu;
@@ -922,6 +967,9 @@
case CPU_PM_ENTER_FAILED:
case CPU_PM_EXIT:
+ if (cpu_pmu && cpu_pmu->restore_pm_registers)
+ cpu_pmu->restore_pm_registers(
+ (void *)smp_processor_id());
if (cpu_has_active_perf((int)v) && cpu_pmu->reset) {
/*
* Flip this bit so armpmu_enable knows it needs
diff --git a/arch/arm/kernel/perf_event_msm_krait.c b/arch/arm/kernel/perf_event_msm_krait.c
index 5708d74..1fb5fd3 100644
--- a/arch/arm/kernel/perf_event_msm_krait.c
+++ b/arch/arm/kernel/perf_event_msm_krait.c
@@ -572,6 +572,33 @@
return 1;
}
+static DEFINE_PER_CPU(u32, krait_pm_pmactlr);
+
+static void krait_save_pm_registers(void *hcpu)
+{
+ u32 val;
+ u32 cpu = (int)hcpu;
+
+ /* Read PMACTLR */
+ asm volatile("mrc p15, 0, %0, c9, c15, 5" : "=r" (val));
+ per_cpu(krait_pm_pmactlr, cpu) = val;
+
+ armv7pmu_save_pm_registers(hcpu);
+}
+
+static void krait_restore_pm_registers(void *hcpu)
+{
+ u32 val;
+ u32 cpu = (int)hcpu;
+
+ val = per_cpu(krait_pm_pmactlr, cpu);
+ if (val != 0)
+ /* Restore PMACTLR */
+ asm volatile("mcr p15, 0, %0, c9, c15, 5" : : "r" (val));
+
+ armv7pmu_restore_pm_registers(hcpu);
+}
+
static struct arm_pmu krait_pmu = {
.handle_irq = armv7pmu_handle_irq,
.enable = krait_pmu_enable_event,
@@ -585,6 +612,8 @@
.test_set_event_constraints = msm_test_set_ev_constraint,
.clear_event_constraints = msm_clear_ev_constraint,
.max_period = (1LLU << 32) - 1,
+ .save_pm_registers = krait_save_pm_registers,
+ .restore_pm_registers = krait_restore_pm_registers,
};
/* NRCCG format for perf RAW codes. */
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 58e9068..7c7a9d1 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -1238,6 +1238,29 @@
&armv7_a7_perf_cache_map, 0xFF);
}
+static DEFINE_PER_CPU(u32, armv7_pm_pmuserenr);
+
+static void armv7pmu_save_pm_registers(void *hcpu)
+{
+ u32 val;
+ u32 cpu = (int)hcpu;
+
+ /* Read PMUSERENR */
+ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r" (val));
+ per_cpu(armv7_pm_pmuserenr, cpu) = val;
+}
+
+static void armv7pmu_restore_pm_registers(void *hcpu)
+{
+ u32 val;
+ u32 cpu = (int)hcpu;
+
+ val = per_cpu(armv7_pm_pmuserenr, cpu);
+ if (val != 0)
+ /* Restore PMUSERENR */
+ asm volatile("mcr p15, 0, %0, c9, c14, 0" : : "r" (val));
+}
+
static struct arm_pmu armv7pmu = {
.handle_irq = armv7pmu_handle_irq,
.enable = armv7pmu_enable_event,
@@ -1249,6 +1272,8 @@
.stop = armv7pmu_stop,
.reset = armv7pmu_reset,
.max_period = (1LLU << 32) - 1,
+ .save_pm_registers = armv7pmu_save_pm_registers,
+ .restore_pm_registers = armv7pmu_restore_pm_registers,
};
static u32 __init armv7_read_num_pmnc_events(void)
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 4b8d443..f2d65fe 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -261,6 +261,8 @@
select MSM_GPIOMUX
select MULTI_IRQ_HANDLER
select MSM_MULTIMEDIA_USE_ION
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select MSM_PIL
select MSM_SPM_V2
select MSM_L2_SPM
@@ -309,11 +311,15 @@
select MSM_SPM_V2
select MSM_L2_SPM
select MSM_RPM_SMD
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select ENABLE_VMALLOC_SAVINGS
config ARCH_MPQ8092
bool "MPQ8092"
select ARCH_MSM_KRAITMP
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select GPIO_MSM_V3
select ARM_GIC
select MULTI_IRQ_HANDLER
@@ -332,6 +338,8 @@
select MSM_SCM
select MSM_GPIOMUX
select MULTI_IRQ_HANDLER
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select MSM_PIL
select MSM_NATIVE_RESTART
select MSM_RESTART_V2
@@ -435,6 +443,8 @@
select MEMORY_HOLE_CARVEOUT
select QMI_ENCDEC
select MSM_CORTEX_A7
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
config ARCH_MSM8610
bool "MSM8610"
@@ -464,6 +474,8 @@
select MSM_CORTEX_A7
select CPU_FREQ_MSM
select CPU_FREQ
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select MSM_PIL
select MSM_RUN_QUEUE_STATS
select ARM_HAS_SG_CHAIN
@@ -475,7 +487,6 @@
select MSM_RPM_LOG
select MSM_IOMMU_SYNC
select MSM_RPM_STATS_LOG
- select ENABLE_VMALLOC_SAVINGS
config ARCH_MSM8226
bool "MSM8226"
@@ -505,6 +516,8 @@
select MSM_CORTEX_A7
select CPU_FREQ_MSM
select CPU_FREQ
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select MSM_PIL
select MSM_RUN_QUEUE_STATS
select ARM_HAS_SG_CHAIN
@@ -525,6 +538,8 @@
select ARM_GIC
select CPU_V7
select MSM_SCM
+ select PM_DEVFREQ
+ select MSM_DEVFREQ_CPUBW
select MSM_PIL
select MSM_GPIOMUX
select MULTI_IRQ_HANDLER
@@ -574,6 +589,7 @@
config ARCH_MSM_KRAIT
bool
select ARM_L1_CACHE_SHIFT_6
+ select DEVFREQ_GOV_MSM_CPUBW_HWMON
config MSM_CORTEX_A7
bool
@@ -1563,20 +1579,6 @@
Enables the PCIe functionality by configures PCIe core on
MSM chipset and by enabling the ARM PCI framework extension.
-config MSM_RPC_SDIO_XPRT
- depends on MSM_SDIO_AL
- default y
- bool "MSM SDIO XPRT Layer"
- help
- SDIO Transport Layer for RPC Rouer
-
-config MSM_RPC_SDIO_DEBUG
- depends on MSM_RPC_SDIO_XPRT
- default y
- bool "MSM SDIO XPRT debug support"
- help
- Support for debugging SDIO XPRT
-
config MSM_SMD_DEBUG
depends on MSM_SMD
default y
@@ -1585,21 +1587,6 @@
Support for debugging the SMD for communication
between the ARM9 and ARM11
-config MSM_SDIO_AL
- depends on ((ARCH_MSM7X30 || MACH_MSM8X60_FUSN_FFA || MACH_TYPE_MSM8X60_FUSION) && HAS_WAKELOCK)
- default y
- tristate "SDIO-Abstraction-Layer"
- help
- Support MSM<->MDM Communication over SDIO bus.
- MDM SDIO-Client should have pipes support.
-
-config MSM_SDIO_DMUX
- bool "SDIO Data Mux Driver"
- depends on MSM_SDIO_AL
- default n
- help
- Support Muxed Data Channels over SDIO interface.
-
config MSM_BAM_DMUX
bool "BAM Data Mux Driver"
depends on SPS
@@ -1680,16 +1667,6 @@
If in doubt, say yes.
-config MSM_SDIO_TTY
- bool "SDIO TTY Driver"
- depends on MSM_SDIO_AL
- default n
- help
- Provides a TTY driver SDIO TTY
- This driver can be used by user space
- applications for passing data through the
- SDIO interface.
-
config MSM_SMD_TTY
bool "SMD TTY Driver"
depends on MSM_SMD
@@ -1717,13 +1694,6 @@
If in doubt, say yes.
-config MSM_SDIO_CMUX
- bool "SDIO CMUX Driver"
- depends on MSM_SDIO_AL
- default n
- help
- Provides a Muxed port interface over SDIO QMI
-
config MSM_DSPS
bool "Sensors DSPS driver"
depends on (MSM_PIL && (ARCH_MSM8X60 || ARCH_MSM8960))
@@ -1736,13 +1706,6 @@
The number of clocks and their name may vary between targets.
It also triggers the PIL to load the DSPS firmware.
-config MSM_SDIO_CTL
- bool "SDIO CTL Driver"
- depends on MSM_SDIO_CMUX
- default n
- help
- Provides a binary SDIO control port interface.
-
config MSM_ONCRPCROUTER
depends on MSM_SMD
default n
@@ -1891,15 +1854,6 @@
Collects performance statistics and shows this information
through a debugfs file rmt_storage_stats.
-config MSM_SDIO_SMEM
- depends on MSM_SDIO_AL
- default n
- bool "SDIO SMEM for remote storage"
- help
- Copies data from remote MDM9K memory to local MSM8x60
- memory. Used by remote storage client to shadow
- MDM9K filesystem.
-
config MSM_DALRPC
bool "DAL RPC support"
default n
@@ -1934,6 +1888,20 @@
endif # CPU_FREQ_MSM
+config MSM_DEVFREQ_CPUBW
+ bool "Devfreq device for CPU<->DDR IB/AB BW voting"
+ depends on PM_DEVFREQ
+ select DEVFREQ_GOV_PERFORMANCE
+ select DEVFREQ_GOV_POWERSAVE
+ select DEVFREQ_GOV_USERSPACE
+ select DEVFREQ_GOV_MSM_CPUFREQ
+ default n
+ help
+ Different devfreq governors use this devfreq device to make CPU to
+ DDR IB/AB bandwidth votes. This driver provides a SoC topology
+ agnostic interface to so that some of the devfreq governors can be
+ shared across SoCs.
+
config MSM_AVS_HW
bool "Enable Adaptive Voltage Scaling (AVS)"
default n
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 4e60414..9c9fffc 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -98,10 +98,6 @@
obj-$(CONFIG_ARCH_FSM9XXX) += sirc-fsm9xxx.o
obj-$(CONFIG_MSM_FIQ_SUPPORT) += fiq_glue.o
obj-$(CONFIG_MACH_TROUT) += board-trout-rfkill.o
-obj-$(CONFIG_MSM_SDIO_AL) += sdio_al.o
-obj-$(CONFIG_MSM_SDIO_AL) += sdio_al_test.o
-obj-$(CONFIG_MSM_SDIO_AL) += sdio_al_dloader.o
-obj-$(CONFIG_MSM_SDIO_DMUX) += sdio_dmux.o
obj-$(CONFIG_MSM_BAM_DMUX) += bam_dmux.o
obj-$(CONFIG_MSM_SMD_LOGGING) += smem_log.o
obj-$(CONFIG_MSM_IPC_LOGGING) += ipc_logging.o
@@ -118,13 +114,10 @@
obj-$(CONFIG_ARCH_MSM9615) += nand_partitions.o
obj-$(CONFIG_ARCH_MSM8625) += nand_partitions.o
obj-$(CONFIG_ARCH_MSM7X27A) += nand_partitions.o
-obj-$(CONFIG_MSM_SDIO_TTY) += sdio_tty.o
obj-$(CONFIG_MSM_SMD_TTY) += smd_tty.o
obj-$(CONFIG_MSM_SMD_QMI) += smd_qmi.o
obj-$(CONFIG_MSM_SMD_PKT) += smd_pkt.o
-obj-$(CONFIG_MSM_SDIO_CMUX) += sdio_cmux.o
obj-$(CONFIG_MSM_DSPS) += msm_dsps.o
-obj-$(CONFIG_MSM_SDIO_CTL) += sdio_ctl.o
obj-$(CONFIG_MSM_SMD_NMEA) += smd_nmea.o
obj-$(CONFIG_MSM_RESET_MODEM) += reset_modem.o
obj-$(CONFIG_MSM_IPC_ROUTER_SMD_XPRT) += ipc_router_smd_xprt.o
@@ -141,7 +134,6 @@
obj-$(CONFIG_MSM_ONCRPCROUTER) += smd_rpcrouter_clients.o
obj-$(CONFIG_MSM_ONCRPCROUTER) += smd_rpcrouter_xdr.o
obj-$(CONFIG_MSM_ONCRPCROUTER) += rpcrouter_smd_xprt.o
-obj-$(CONFIG_MSM_RPC_SDIO_XPRT) += rpcrouter_sdio_xprt.o
obj-$(CONFIG_MSM_RPC_PING) += ping_mdm_rpc_client.o
obj-$(CONFIG_MSM_RPC_PROC_COMM_TEST) += proc_comm_test.o
obj-$(CONFIG_MSM_RPC_PING) += ping_mdm_rpc_client.o ping_apps_server.o
@@ -322,7 +314,6 @@
obj-$(CONFIG_HTC_PWRSINK) += htc_pwrsink.o
obj-$(CONFIG_HTC_HEADSET) += htc_headset.o
obj-$(CONFIG_MSM_RMT_STORAGE_CLIENT) += rmt_storage_client.o
-obj-$(CONFIG_MSM_SDIO_SMEM) += sdio_smem.o
obj-$(CONFIG_MSM_RPM) += rpm.o rpm_resources.o
obj-$(CONFIG_MSM_LPM_TEST) += test-lpm.o
obj-$(CONFIG_MSM_RPM_SMD) += rpm-smd.o lpm_levels.o
@@ -422,9 +413,9 @@
obj-$(CONFIG_ARCH_MSM8974) += msm_mpmctr.o
obj-$(CONFIG_MSM_CPR_REGULATOR) += cpr-regulator.o
obj-$(CONFIG_CPU_FREQ_MSM) += cpufreq.o
+obj-$(CONFIG_MSM_DEVFREQ_CPUBW) += devfreq_cpubw.o
obj-$(CONFIG_WALL_CLK) += wallclk.o
obj-$(CONFIG_WALL_CLK_SYSFS) += wallclk_sysfs.o
obj-$(CONFIG_ARCH_RANDOM) += early_random.o
obj-$(CONFIG_PERFMAP) += perfmap.o
-obj-$(CONFIG_ARCH_MSM8974) += cpubw-krait.o
diff --git a/arch/arm/mach-msm/Makefile.boot b/arch/arm/mach-msm/Makefile.boot
index 83c1d4c..78df289 100644
--- a/arch/arm/mach-msm/Makefile.boot
+++ b/arch/arm/mach-msm/Makefile.boot
@@ -117,6 +117,7 @@
dtb-$(CONFIG_ARCH_MSM8226) += msm8926-1080p-mtp.dtb
dtb-$(CONFIG_ARCH_MSM8226) += msm8926-qrd.dtb
dtb-$(CONFIG_ARCH_MSM8226) += msm8926-qrd-skug.dtb
+ dtb-$(CONFIG_ARCH_MSM8226) += msm8926-qrd-skug-pvt.dtb
dtb-$(CONFIG_ARCH_MSM8226) += msm8226-v1-qrd-skuf.dtb
dtb-$(CONFIG_ARCH_MSM8226) += msm8226-v2-qrd-skuf.dtb
dtb-$(CONFIG_ARCH_MSM8226) += apq8026-v1-xpm.dtb
diff --git a/arch/arm/mach-msm/acpuclock-8226.c b/arch/arm/mach-msm/acpuclock-8226.c
index da3cfba..d42e798 100644
--- a/arch/arm/mach-msm/acpuclock-8226.c
+++ b/arch/arm/mach-msm/acpuclock-8226.c
@@ -60,64 +60,64 @@
};
static struct clkctl_acpu_speed acpu_freq_tbl_8226_1p1[] = {
- { 1, 300000, PLL0, 4, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 600000, PLL0, 4, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 0, 1190400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
+ { 1, 300000, PLL0, 4, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 600000, PLL0, 4, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 0, 1190400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
{ 0 }
};
static struct clkctl_acpu_speed acpu_freq_tbl_8226_1p2[] = {
- { 1, 300000, PLL0, 4, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 600000, PLL0, 4, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
+ { 1, 300000, PLL0, 4, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 600000, PLL0, 4, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
{ 0 }
};
static struct clkctl_acpu_speed acpu_freq_tbl_8226_1p4[] = {
- { 1, 300000, PLL0, 4, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 600000, PLL0, 4, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1305600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1344000, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1401600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
+ { 1, 300000, PLL0, 4, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 600000, PLL0, 4, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1305600, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1344000, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
+ { 1, 1401600, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
{ 0 }
};
static struct clkctl_acpu_speed acpu_freq_tbl_8226_1p6[] = {
- { 1, 300000, PLL0, 4, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_SVS, 0, 4 },
- { 1, 600000, PLL0, 4, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_NORMAL, 0, 6 },
- { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1305600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1344000, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1401600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1497600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
- { 1, 1593600, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 7 },
+ { 1, 300000, PLL0, 4, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_2, 0, 4 },
+ { 1, 600000, PLL0, 4, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_4, 0, 6 },
+ { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_5, 0, 7 },
+ { 1, 1094400, ACPUPLL, 5, 0, CPR_CORNER_6, 0, 7 },
+ { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_7, 0, 7 },
+ { 1, 1305600, ACPUPLL, 5, 0, CPR_CORNER_8, 0, 7 },
+ { 1, 1344000, ACPUPLL, 5, 0, CPR_CORNER_9, 0, 7 },
+ { 1, 1401600, ACPUPLL, 5, 0, CPR_CORNER_10, 0, 7 },
+ { 1, 1497600, ACPUPLL, 5, 0, CPR_CORNER_11, 0, 7 },
+ { 1, 1593600, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 7 },
{ 0 }
};
static struct clkctl_acpu_speed acpu_freq_tbl_8610[] = {
- { 1, 300000, PLL0, 4, 2, CPR_CORNER_SVS, 0, 3 },
- { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_SVS, 0, 3 },
- { 1, 600000, PLL0, 4, 0, CPR_CORNER_NORMAL, 0, 4 },
- { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_NORMAL, 0, 4 },
- { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 5 },
- { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_TURBO, 0, 5 },
+ { 1, 300000, PLL0, 4, 2, CPR_CORNER_2, 0, 3 },
+ { 1, 384000, ACPUPLL, 5, 2, CPR_CORNER_2, 0, 3 },
+ { 1, 600000, PLL0, 4, 0, CPR_CORNER_4, 0, 4 },
+ { 1, 787200, ACPUPLL, 5, 0, CPR_CORNER_4, 0, 4 },
+ { 1, 998400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 5 },
+ { 1, 1190400, ACPUPLL, 5, 0, CPR_CORNER_12, 0, 5 },
{ 0 }
};
@@ -135,7 +135,7 @@
.freq_tbl = acpu_freq_tbl_8226_1p1,
.pvs_tables = pvs_tables_8226,
.bus_scale = &bus_client_pdata,
- .vdd_max_cpu = CPR_CORNER_TURBO,
+ .vdd_max_cpu = CPR_CORNER_12,
.src_clocks = {
[PLL0].name = "gpll0",
[ACPUPLL].name = "a7sspll",
diff --git a/arch/arm/mach-msm/bam_dmux.c b/arch/arm/mach-msm/bam_dmux.c
index 6281395..b618cd4 100644
--- a/arch/arm/mach-msm/bam_dmux.c
+++ b/arch/arm/mach-msm/bam_dmux.c
@@ -28,6 +28,7 @@
#include <linux/wakelock.h>
#include <linux/kfifo.h>
#include <linux/of.h>
+#include <linux/srcu.h>
#include <mach/msm_ipc_logging.h>
#include <mach/sps.h>
#include <mach/bam_dmux.h>
@@ -36,19 +37,12 @@
#include <mach/socinfo.h>
#include <mach/subsystem_restart.h>
+#include "bam_dmux_private.h"
+
#define BAM_CH_LOCAL_OPEN 0x1
#define BAM_CH_REMOTE_OPEN 0x2
#define BAM_CH_IN_RESET 0x4
-#define BAM_MUX_HDR_MAGIC_NO 0x33fc
-
-#define BAM_MUX_HDR_CMD_DATA 0
-#define BAM_MUX_HDR_CMD_OPEN 1
-#define BAM_MUX_HDR_CMD_CLOSE 2
-#define BAM_MUX_HDR_CMD_STATUS 3 /* unused */
-#define BAM_MUX_HDR_CMD_OPEN_NO_A2_PC 4
-
-
#define LOW_WATERMARK 2
#define HIGH_WATERMARK 4
#define DEFAULT_POLLING_MIN_SLEEP (950)
@@ -58,20 +52,47 @@
static int msm_bam_dmux_debug_enable;
module_param_named(debug_enable, msm_bam_dmux_debug_enable,
int, S_IRUGO | S_IWUSR | S_IWGRP);
-static int POLLING_MIN_SLEEP = 950;
+static int POLLING_MIN_SLEEP = 2950;
module_param_named(min_sleep, POLLING_MIN_SLEEP,
int, S_IRUGO | S_IWUSR | S_IWGRP);
-static int POLLING_MAX_SLEEP = 1050;
+static int POLLING_MAX_SLEEP = 3050;
module_param_named(max_sleep, POLLING_MAX_SLEEP,
int, S_IRUGO | S_IWUSR | S_IWGRP);
-static int POLLING_INACTIVITY = 40;
+static int POLLING_INACTIVITY = 1;
module_param_named(inactivity, POLLING_INACTIVITY,
int, S_IRUGO | S_IWUSR | S_IWGRP);
-static int bam_adaptive_timer_enabled = 1;
+static int bam_adaptive_timer_enabled;
module_param_named(adaptive_timer_enabled,
bam_adaptive_timer_enabled,
int, S_IRUGO | S_IWUSR | S_IWGRP);
+static struct bam_ops_if bam_default_ops = {
+ /* smsm */
+ .smsm_change_state_ptr = &smsm_change_state,
+ .smsm_get_state_ptr = &smsm_get_state,
+ .smsm_state_cb_register_ptr = &smsm_state_cb_register,
+ .smsm_state_cb_deregister_ptr = &smsm_state_cb_deregister,
+
+ /* sps */
+ .sps_connect_ptr = &sps_connect,
+ .sps_disconnect_ptr = &sps_disconnect,
+ .sps_register_bam_device_ptr = &sps_register_bam_device,
+ .sps_deregister_bam_device_ptr = &sps_deregister_bam_device,
+ .sps_alloc_endpoint_ptr = &sps_alloc_endpoint,
+ .sps_free_endpoint_ptr = &sps_free_endpoint,
+ .sps_set_config_ptr = &sps_set_config,
+ .sps_get_config_ptr = &sps_get_config,
+ .sps_device_reset_ptr = &sps_device_reset,
+ .sps_register_event_ptr = &sps_register_event,
+ .sps_transfer_one_ptr = &sps_transfer_one,
+ .sps_get_iovec_ptr = &sps_get_iovec,
+ .sps_get_unused_desc_num_ptr = &sps_get_unused_desc_num,
+
+ .dma_to = DMA_TO_DEVICE,
+ .dma_from = DMA_FROM_DEVICE,
+};
+static struct bam_ops_if *bam_ops = &bam_default_ops;
+
#if defined(DEBUG)
static uint32_t bam_dmux_read_cnt;
static uint32_t bam_dmux_write_cnt;
@@ -151,29 +172,10 @@
int use_wm;
};
-struct tx_pkt_info {
- struct sk_buff *skb;
- dma_addr_t dma_address;
- char is_cmd;
- uint32_t len;
- struct work_struct work;
- struct list_head list_node;
- unsigned ts_sec;
- unsigned long ts_nsec;
-};
-
-struct rx_pkt_info {
- struct sk_buff *skb;
- dma_addr_t dma_address;
- struct work_struct work;
- struct list_head list_node;
-};
-
#define A2_NUM_PIPES 6
#define A2_SUMMING_THRESHOLD 4096
#define A2_PHYS_BASE 0x124C2000
#define A2_PHYS_SIZE 0x2000
-#define BUFFER_SIZE 2048
#define DEFAULT_NUM_BUFFERS 32
#ifndef A2_BAM_IRQ
@@ -210,26 +212,20 @@
static DEFINE_SPINLOCK(bam_tx_pool_spinlock);
static DEFINE_MUTEX(bam_pdev_mutexlock);
-struct bam_mux_hdr {
- uint16_t magic_num;
- uint8_t reserved;
- uint8_t cmd;
- uint8_t pad_len;
- uint8_t ch_id;
- uint16_t pkt_len;
-};
-
static void notify_all(int event, unsigned long data);
static void bam_mux_write_done(struct work_struct *work);
static void handle_bam_mux_cmd(struct work_struct *work);
static void rx_timer_work_func(struct work_struct *work);
+static void queue_rx_work_func(struct work_struct *work);
static DECLARE_WORK(rx_timer_work, rx_timer_work_func);
-static struct delayed_work queue_rx_work;
+static DECLARE_WORK(queue_rx_work, queue_rx_work_func);
static struct workqueue_struct *bam_mux_rx_workqueue;
static struct workqueue_struct *bam_mux_tx_workqueue;
+static struct srcu_struct bam_dmux_srcu;
+
/* A2 power collaspe */
#define UL_TIMEOUT_DELAY 1000 /* in ms */
#define ENABLE_DISCONNECT_ACK 0x1
@@ -390,7 +386,7 @@
spin_unlock_irqrestore(&bam_tx_pool_spinlock, flags);
}
-static void queue_rx(void)
+static void __queue_rx(gfp_t alloc_flags)
{
void *ptr;
struct rx_pkt_info *info;
@@ -405,29 +401,29 @@
if (in_global_reset)
goto fail;
- info = kmalloc(sizeof(struct rx_pkt_info),
- GFP_NOWAIT | __GFP_NOWARN);
+ info = kmalloc(sizeof(struct rx_pkt_info), alloc_flags);
if (!info) {
DMUX_LOG_KERR(
- "%s: unable to alloc rx_pkt_info, will retry later\n",
- __func__);
+ "%s: unable to alloc rx_pkt_info w/ flags %x, will retry later\n",
+ __func__,
+ alloc_flags);
goto fail;
}
INIT_WORK(&info->work, handle_bam_mux_cmd);
- info->skb = __dev_alloc_skb(BUFFER_SIZE,
- GFP_NOWAIT | __GFP_NOWARN);
+ info->skb = __dev_alloc_skb(BUFFER_SIZE, alloc_flags);
if (info->skb == NULL) {
DMUX_LOG_KERR(
- "%s: unable to alloc skb, will retry later\n",
- __func__);
+ "%s: unable to alloc skb w/ flags %x, will retry later\n",
+ __func__,
+ alloc_flags);
goto fail_info;
}
ptr = skb_put(info->skb, BUFFER_SIZE);
info->dma_address = dma_map_single(NULL, ptr, BUFFER_SIZE,
- DMA_FROM_DEVICE);
+ bam_ops->dma_from);
if (info->dma_address == 0 || info->dma_address == ~0) {
DMUX_LOG_KERR("%s: dma_map_single failure %p for %p\n",
__func__, (void *)info->dma_address, ptr);
@@ -437,8 +433,8 @@
mutex_lock(&bam_rx_pool_mutexlock);
list_add_tail(&info->list_node, &bam_rx_pool);
rx_len_cached = ++bam_rx_pool_len;
- ret = sps_transfer_one(bam_rx_pipe, info->dma_address,
- BUFFER_SIZE, info, 0);
+ ret = bam_ops->sps_transfer_one_ptr(bam_rx_pipe,
+ info->dma_address, BUFFER_SIZE, info, 0);
if (ret) {
list_del(&info->list_node);
rx_len_cached = --bam_rx_pool_len;
@@ -447,7 +443,7 @@
__func__, ret);
dma_unmap_single(NULL, info->dma_address, BUFFER_SIZE,
- DMA_FROM_DEVICE);
+ bam_ops->dma_from);
goto fail_skb;
}
@@ -463,15 +459,30 @@
kfree(info);
fail:
- if (rx_len_cached == 0 && !in_global_reset) {
+ if (!in_global_reset) {
DMUX_LOG_KERR("%s: rescheduling\n", __func__);
- schedule_delayed_work(&queue_rx_work, msecs_to_jiffies(100));
+ schedule_work(&queue_rx_work);
}
}
+static void queue_rx(void)
+{
+ /*
+ * Hot path. Delays waiting for the allocation to find memory if its
+ * not immediately available, and delays from logging allocation
+ * failures which cannot be tolerated at this time.
+ */
+ __queue_rx(GFP_NOWAIT | __GFP_NOWARN);
+}
+
static void queue_rx_work_func(struct work_struct *work)
{
- queue_rx();
+ /*
+ * Cold path. Delays can be tolerated. Use of GFP_KERNEL should
+ * guarentee the requested memory will be found, after some ammount of
+ * delay.
+ */
+ __queue_rx(GFP_KERNEL);
}
static void bam_mux_process_data(struct sk_buff *rx_skb)
@@ -535,7 +546,8 @@
info = container_of(work, struct rx_pkt_info, work);
rx_skb = info->skb;
- dma_unmap_single(NULL, info->dma_address, BUFFER_SIZE, DMA_FROM_DEVICE);
+ dma_unmap_single(NULL, info->dma_address, BUFFER_SIZE,
+ bam_ops->dma_from);
kfree(info);
rx_hdr = (struct bam_mux_hdr *)rx_skb->data;
@@ -644,7 +656,7 @@
}
dma_address = dma_map_single(NULL, data, len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
if (!dma_address) {
pr_err("%s: dma_map_single() failed\n", __func__);
kfree(pkt);
@@ -659,7 +671,7 @@
INIT_WORK(&pkt->work, bam_mux_write_done);
spin_lock_irqsave(&bam_tx_pool_spinlock, flags);
list_add_tail(&pkt->list_node, &bam_tx_pool);
- rc = sps_transfer_one(bam_tx_pipe, dma_address, len,
+ rc = bam_ops->sps_transfer_one_ptr(bam_tx_pipe, dma_address, len,
pkt, SPS_IOVEC_FLAG_EOT);
if (rc) {
DMUX_LOG_KERR("%s sps_transfer_one failed rc=%d\n",
@@ -669,7 +681,7 @@
spin_unlock_irqrestore(&bam_tx_pool_spinlock, flags);
dma_unmap_single(NULL, pkt->dma_address,
pkt->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
kfree(pkt);
} else {
spin_unlock_irqrestore(&bam_tx_pool_spinlock, flags);
@@ -746,6 +758,7 @@
struct sk_buff *new_skb = NULL;
dma_addr_t dma_address;
struct tx_pkt_info *pkt;
+ int rcu_id;
if (id >= BAM_DMUX_NUM_CHANNELS)
return -EINVAL;
@@ -754,11 +767,19 @@
if (!bam_mux_initialized)
return -ENODEV;
+ rcu_id = srcu_read_lock(&bam_dmux_srcu);
+ if (in_global_reset) {
+ BAM_DMUX_LOG("%s: In SSR... ch_id[%d]\n", __func__, id);
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
+ return -EFAULT;
+ }
+
DBG("%s: writing to ch %d len %d\n", __func__, id, skb->len);
spin_lock_irqsave(&bam_ch[id].lock, flags);
if (!bam_ch_is_open(id)) {
spin_unlock_irqrestore(&bam_ch[id].lock, flags);
pr_err("%s: port not open: %d\n", __func__, bam_ch[id].status);
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
return -ENODEV;
}
@@ -766,6 +787,7 @@
(bam_ch[id].num_tx_pkts >= HIGH_WATERMARK)) {
spin_unlock_irqrestore(&bam_ch[id].lock, flags);
pr_err("%s: watermark exceeded: %d\n", __func__, id);
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
return -EAGAIN;
}
spin_unlock_irqrestore(&bam_ch[id].lock, flags);
@@ -774,8 +796,10 @@
if (!bam_is_connected) {
read_unlock(&ul_wakeup_lock);
ul_wakeup();
- if (unlikely(in_global_reset == 1))
+ if (unlikely(in_global_reset == 1)) {
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
return -EFAULT;
+ }
read_lock(&ul_wakeup_lock);
notify_all(BAM_DMUX_UL_CONNECTED, (unsigned long)(NULL));
}
@@ -820,7 +844,7 @@
}
dma_address = dma_map_single(NULL, skb->data, skb->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
if (!dma_address) {
pr_err("%s: dma_map_single() failed\n", __func__);
goto write_fail3;
@@ -832,7 +856,7 @@
INIT_WORK(&pkt->work, bam_mux_write_done);
spin_lock_irqsave(&bam_tx_pool_spinlock, flags);
list_add_tail(&pkt->list_node, &bam_tx_pool);
- rc = sps_transfer_one(bam_tx_pipe, dma_address, skb->len,
+ rc = bam_ops->sps_transfer_one_ptr(bam_tx_pipe, dma_address, skb->len,
pkt, SPS_IOVEC_FLAG_EOT);
if (rc) {
DMUX_LOG_KERR("%s sps_transfer_one failed rc=%d\n",
@@ -841,7 +865,7 @@
DBG_INC_TX_SPS_FAILURE_CNT();
spin_unlock_irqrestore(&bam_tx_pool_spinlock, flags);
dma_unmap_single(NULL, pkt->dma_address,
- pkt->skb->len, DMA_TO_DEVICE);
+ pkt->skb->len, bam_ops->dma_to);
kfree(pkt);
if (new_skb)
dev_kfree_skb_any(new_skb);
@@ -853,6 +877,7 @@
}
ul_packet_written = 1;
read_unlock(&ul_wakeup_lock);
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
return rc;
write_fail3:
@@ -863,6 +888,7 @@
dev_kfree_skb_any(new_skb);
write_fail:
read_unlock(&ul_wakeup_lock);
+ srcu_read_unlock(&bam_dmux_srcu, rcu_id);
return -ENOMEM;
}
@@ -1049,14 +1075,14 @@
* Attempt to enable interrupts - if this fails,
* continue polling and we will retry later.
*/
- ret = sps_get_config(bam_rx_pipe, &cur_rx_conn);
+ ret = bam_ops->sps_get_config_ptr(bam_rx_pipe, &cur_rx_conn);
if (ret) {
pr_err("%s: sps_get_config() failed %d\n", __func__, ret);
goto fail;
}
rx_register_event.options = SPS_O_EOT;
- ret = sps_register_event(bam_rx_pipe, &rx_register_event);
+ ret = bam_ops->sps_register_event_ptr(bam_rx_pipe, &rx_register_event);
if (ret) {
pr_err("%s: sps_register_event() failed %d\n", __func__, ret);
goto fail;
@@ -1064,7 +1090,7 @@
cur_rx_conn.options = SPS_O_AUTO_ENABLE |
SPS_O_EOT | SPS_O_ACK_TRANSFERS;
- ret = sps_set_config(bam_rx_pipe, &cur_rx_conn);
+ ret = bam_ops->sps_set_config_ptr(bam_rx_pipe, &cur_rx_conn);
if (ret) {
pr_err("%s: sps_set_config() failed %d\n", __func__, ret);
goto fail;
@@ -1075,7 +1101,7 @@
/* handle any rx packets before interrupt was enabled */
while (bam_connection_is_active && !polling_mode) {
- ret = sps_get_iovec(bam_rx_pipe, &iov);
+ ret = bam_ops->sps_get_iovec_ptr(bam_rx_pipe, &iov);
if (ret) {
pr_err("%s: sps_get_iovec failed %d\n",
__func__, ret);
@@ -1160,7 +1186,7 @@
return;
}
- ret = sps_get_iovec(bam_rx_pipe, &iov);
+ ret = bam_ops->sps_get_iovec_ptr(bam_rx_pipe, &iov);
if (ret) {
DMUX_LOG_KERR("%s: sps_get_iovec failed %d\n",
__func__, ret);
@@ -1209,7 +1235,7 @@
if (bam_adaptive_timer_enabled) {
usleep_range(rx_timer_interval, rx_timer_interval + 50);
- ret = sps_get_unused_desc_num(bam_rx_pipe,
+ ret = bam_ops->sps_get_unused_desc_num_ptr(bam_rx_pipe,
&buffs_unused);
if (ret) {
@@ -1261,11 +1287,11 @@
if (!pkt->is_cmd)
dma_unmap_single(NULL, pkt->dma_address,
pkt->skb->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
else
dma_unmap_single(NULL, pkt->dma_address,
pkt->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
queue_work(bam_mux_tx_workqueue, &pkt->work);
break;
default:
@@ -1288,7 +1314,8 @@
case SPS_EVENT_EOT:
/* attempt to disable interrupts in this pipe */
if (!polling_mode) {
- ret = sps_get_config(bam_rx_pipe, &cur_rx_conn);
+ ret = bam_ops->sps_get_config_ptr(bam_rx_pipe,
+ &cur_rx_conn);
if (ret) {
pr_err("%s: sps_get_config() failed %d, interrupts"
" not disabled\n", __func__, ret);
@@ -1296,7 +1323,8 @@
}
cur_rx_conn.options = SPS_O_AUTO_ENABLE |
SPS_O_ACK_TRANSFERS | SPS_O_POLL;
- ret = sps_set_config(bam_rx_pipe, &cur_rx_conn);
+ ret = bam_ops->sps_set_config_ptr(bam_rx_pipe,
+ &cur_rx_conn);
if (ret) {
pr_err("%s: sps_set_config() failed %d, interrupts"
" not disabled\n", __func__, ret);
@@ -1476,9 +1504,11 @@
bam_dmux_uplink_vote = vote;
if (vote)
- smsm_change_state(SMSM_APPS_STATE, 0, SMSM_A2_POWER_CONTROL);
+ bam_ops->smsm_change_state_ptr(SMSM_APPS_STATE,
+ 0, SMSM_A2_POWER_CONTROL);
else
- smsm_change_state(SMSM_APPS_STATE, SMSM_A2_POWER_CONTROL, 0);
+ bam_ops->smsm_change_state_ptr(SMSM_APPS_STATE,
+ SMSM_A2_POWER_CONTROL, 0);
}
/*
@@ -1747,29 +1777,31 @@
if (!power_management_only_mode) {
if (ssr_skipped_disconnect) {
/* delayed to here to prevent bus stall */
- sps_disconnect(bam_tx_pipe);
- sps_disconnect(bam_rx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_tx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_rx_pipe);
__memzero(rx_desc_mem_buf.base, rx_desc_mem_buf.size);
__memzero(tx_desc_mem_buf.base, tx_desc_mem_buf.size);
}
ssr_skipped_disconnect = 0;
- i = sps_device_reset(a2_device_handle);
+ i = bam_ops->sps_device_reset_ptr(a2_device_handle);
if (i)
pr_err("%s: device reset failed rc = %d\n", __func__,
i);
- i = sps_connect(bam_tx_pipe, &tx_connection);
+ i = bam_ops->sps_connect_ptr(bam_tx_pipe, &tx_connection);
if (i)
pr_err("%s: tx connection failed rc = %d\n", __func__,
i);
- i = sps_connect(bam_rx_pipe, &rx_connection);
+ i = bam_ops->sps_connect_ptr(bam_rx_pipe, &rx_connection);
if (i)
pr_err("%s: rx connection failed rc = %d\n", __func__,
i);
- i = sps_register_event(bam_tx_pipe, &tx_register_event);
+ i = bam_ops->sps_register_event_ptr(bam_tx_pipe,
+ &tx_register_event);
if (i)
pr_err("%s: tx event reg failed rc = %d\n", __func__,
i);
- i = sps_register_event(bam_rx_pipe, &rx_register_event);
+ i = bam_ops->sps_register_event_ptr(bam_rx_pipe,
+ &rx_register_event);
if (i)
pr_err("%s: rx event reg failed rc = %d\n", __func__,
i);
@@ -1823,9 +1855,9 @@
if (!power_management_only_mode) {
if (likely(!in_ssr)) {
BAM_DMUX_LOG("%s: disconnect tx\n", __func__);
- sps_disconnect(bam_tx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_tx_pipe);
BAM_DMUX_LOG("%s: disconnect rx\n", __func__);
- sps_disconnect(bam_rx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_rx_pipe);
__memzero(rx_desc_mem_buf.base, rx_desc_mem_buf.size);
__memzero(tx_desc_mem_buf.base, tx_desc_mem_buf.size);
BAM_DMUX_LOG("%s: device reset\n", __func__);
@@ -1842,7 +1874,7 @@
list_del(node);
info = container_of(node, struct rx_pkt_info, list_node);
dma_unmap_single(NULL, info->dma_address, BUFFER_SIZE,
- DMA_FROM_DEVICE);
+ bam_ops->dma_from);
dev_kfree_skb_any(info->skb);
kfree(info);
}
@@ -1957,9 +1989,12 @@
* because a watchdog crash from a bus stall would likely occur.
*/
if (code == SUBSYS_BEFORE_SHUTDOWN) {
+ BAM_DMUX_LOG("%s: begin\n", __func__);
in_global_reset = 1;
in_ssr = 1;
- BAM_DMUX_LOG("%s: begin\n", __func__);
+ /* wait till all bam_dmux writes completes */
+ synchronize_srcu(&bam_dmux_srcu);
+ BAM_DMUX_LOG("%s: ssr signaling complete\n", __func__);
flush_workqueue(bam_mux_rx_workqueue);
}
if (code != SUBSYS_AFTER_SHUTDOWN)
@@ -2008,12 +2043,12 @@
if (!info->is_cmd) {
dma_unmap_single(NULL, info->dma_address,
info->skb->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
dev_kfree_skb_any(info->skb);
} else {
dma_unmap_single(NULL, info->dma_address,
info->len,
- DMA_TO_DEVICE);
+ bam_ops->dma_to);
kfree(info->skb);
}
kfree(info);
@@ -2053,20 +2088,20 @@
if (cpu_is_msm9615() || satellite_mode)
a2_props.manage = SPS_BAM_MGR_DEVICE_REMOTE;
/* need to free on tear down */
- ret = sps_register_bam_device(&a2_props, &h);
+ ret = bam_ops->sps_register_bam_device_ptr(&a2_props, &h);
if (ret < 0) {
pr_err("%s: register bam error %d\n", __func__, ret);
goto register_bam_failed;
}
a2_device_handle = h;
- bam_tx_pipe = sps_alloc_endpoint();
+ bam_tx_pipe = bam_ops->sps_alloc_endpoint_ptr();
if (bam_tx_pipe == NULL) {
pr_err("%s: tx alloc endpoint failed\n", __func__);
ret = -ENOMEM;
goto tx_alloc_endpoint_failed;
}
- ret = sps_get_config(bam_tx_pipe, &tx_connection);
+ ret = bam_ops->sps_get_config_ptr(bam_tx_pipe, &tx_connection);
if (ret) {
pr_err("%s: tx get config failed %d\n", __func__, ret);
goto tx_get_config_failed;
@@ -2091,19 +2126,19 @@
tx_connection.desc = tx_desc_mem_buf;
tx_connection.event_thresh = 0x10;
- ret = sps_connect(bam_tx_pipe, &tx_connection);
+ ret = bam_ops->sps_connect_ptr(bam_tx_pipe, &tx_connection);
if (ret < 0) {
pr_err("%s: tx connect error %d\n", __func__, ret);
goto tx_connect_failed;
}
- bam_rx_pipe = sps_alloc_endpoint();
+ bam_rx_pipe = bam_ops->sps_alloc_endpoint_ptr();
if (bam_rx_pipe == NULL) {
pr_err("%s: rx alloc endpoint failed\n", __func__);
ret = -ENOMEM;
goto rx_alloc_endpoint_failed;
}
- ret = sps_get_config(bam_rx_pipe, &rx_connection);
+ ret = bam_ops->sps_get_config_ptr(bam_rx_pipe, &rx_connection);
if (ret) {
pr_err("%s: rx get config failed %d\n", __func__, ret);
goto rx_get_config_failed;
@@ -2129,7 +2164,7 @@
rx_connection.desc = rx_desc_mem_buf;
rx_connection.event_thresh = 0x10;
- ret = sps_connect(bam_rx_pipe, &rx_connection);
+ ret = bam_ops->sps_connect_ptr(bam_rx_pipe, &rx_connection);
if (ret < 0) {
pr_err("%s: rx connect error %d\n", __func__, ret);
goto rx_connect_failed;
@@ -2140,7 +2175,7 @@
tx_register_event.xfer_done = NULL;
tx_register_event.callback = bam_mux_tx_notify;
tx_register_event.user = NULL;
- ret = sps_register_event(bam_tx_pipe, &tx_register_event);
+ ret = bam_ops->sps_register_event_ptr(bam_tx_pipe, &tx_register_event);
if (ret < 0) {
pr_err("%s: tx register event error %d\n", __func__, ret);
goto rx_event_reg_failed;
@@ -2151,7 +2186,7 @@
rx_register_event.xfer_done = NULL;
rx_register_event.callback = bam_mux_rx_notify;
rx_register_event.user = NULL;
- ret = sps_register_event(bam_rx_pipe, &rx_register_event);
+ ret = bam_ops->sps_register_event_ptr(bam_rx_pipe, &rx_register_event);
if (ret < 0) {
pr_err("%s: tx register event error %d\n", __func__, ret);
goto rx_event_reg_failed;
@@ -2171,22 +2206,22 @@
return 0;
rx_event_reg_failed:
- sps_disconnect(bam_rx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_rx_pipe);
rx_connect_failed:
dma_free_coherent(NULL, rx_desc_mem_buf.size, rx_desc_mem_buf.base,
rx_desc_mem_buf.phys_base);
rx_mem_failed:
rx_get_config_failed:
- sps_free_endpoint(bam_rx_pipe);
+ bam_ops->sps_free_endpoint_ptr(bam_rx_pipe);
rx_alloc_endpoint_failed:
- sps_disconnect(bam_tx_pipe);
+ bam_ops->sps_disconnect_ptr(bam_tx_pipe);
tx_connect_failed:
dma_free_coherent(NULL, tx_desc_mem_buf.size, tx_desc_mem_buf.base,
tx_desc_mem_buf.phys_base);
tx_get_config_failed:
- sps_free_endpoint(bam_tx_pipe);
+ bam_ops->sps_free_endpoint_ptr(bam_tx_pipe);
tx_alloc_endpoint_failed:
- sps_deregister_bam_device(h);
+ bam_ops->sps_deregister_bam_device_ptr(h);
/*
* sps_deregister_bam_device() calls iounmap. calling iounmap on the
* same handle below will cause a crash, so skip it if we've freed
@@ -2224,7 +2259,7 @@
a2_props.summing_threshold = A2_SUMMING_THRESHOLD;
if (cpu_is_msm9615() || satellite_mode)
a2_props.manage = SPS_BAM_MGR_DEVICE_REMOTE;
- ret = sps_register_bam_device(&a2_props, &h);
+ ret = bam_ops->sps_register_bam_device_ptr(&a2_props, &h);
if (ret < 0) {
pr_err("%s: register bam error %d\n", __func__, ret);
goto register_bam_failed;
@@ -2276,7 +2311,7 @@
BAM_DMUX_LOG("%s: apps ack %d->%d\n", __func__,
clear_bit & 0x1, ~clear_bit & 0x1);
- smsm_change_state(SMSM_APPS_STATE,
+ bam_ops->smsm_change_state_ptr(SMSM_APPS_STATE,
clear_bit & SMSM_A2_POWER_CONTROL_ACK,
~clear_bit & SMSM_A2_POWER_CONTROL_ACK);
clear_bit = ~clear_bit;
@@ -2333,6 +2368,51 @@
complete_all(&ul_wakeup_ack_completion);
}
+/**
+ * msm_bam_dmux_set_bam_ops() - sets the bam_ops
+ * @ops: bam_ops_if to set
+ *
+ * Sets bam_ops to allow switching of runtime behavior. Preconditon, bam dmux
+ * must be in an idle state. If input ops is NULL, then bam_ops will be
+ * restored to their default state.
+ */
+void msm_bam_dmux_set_bam_ops(struct bam_ops_if *ops)
+{
+ if (ops != NULL)
+ bam_ops = ops;
+ else
+ bam_ops = &bam_default_ops;
+}
+EXPORT_SYMBOL(msm_bam_dmux_set_bam_ops);
+
+/**
+ * msm_bam_dmux_deinit() - puts bam dmux into a deinited state
+ *
+ * Puts bam dmux into a deinitialized state by simulating an ssr.
+ */
+void msm_bam_dmux_deinit(void)
+{
+ restart_notifier_cb(NULL, SUBSYS_BEFORE_SHUTDOWN, NULL);
+ restart_notifier_cb(NULL, SUBSYS_AFTER_SHUTDOWN, NULL);
+}
+EXPORT_SYMBOL(msm_bam_dmux_deinit);
+
+/**
+ * msm_bam_dmux_reinit() - reinitializes bam dmux
+ */
+void msm_bam_dmux_reinit(void)
+{
+ bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
+ SMSM_A2_POWER_CONTROL,
+ bam_dmux_smsm_cb, NULL);
+ bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
+ SMSM_A2_POWER_CONTROL_ACK,
+ bam_dmux_smsm_ack_cb, NULL);
+ bam_mux_initialized = 0;
+ bam_init();
+}
+EXPORT_SYMBOL(msm_bam_dmux_reinit);
+
static int bam_dmux_probe(struct platform_device *pdev)
{
int rc;
@@ -2432,11 +2512,12 @@
init_completion(&shutdown_completion);
complete_all(&shutdown_completion);
INIT_DELAYED_WORK(&ul_timeout_work, ul_timeout);
- INIT_DELAYED_WORK(&queue_rx_work, queue_rx_work_func);
wake_lock_init(&bam_wakelock, WAKE_LOCK_SUSPEND, "bam_dmux_wakelock");
+ init_srcu_struct(&bam_dmux_srcu);
- rc = smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_A2_POWER_CONTROL,
- bam_dmux_smsm_cb, NULL);
+ rc = bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
+ SMSM_A2_POWER_CONTROL,
+ bam_dmux_smsm_cb, NULL);
if (rc) {
destroy_workqueue(bam_mux_rx_workqueue);
@@ -2445,13 +2526,14 @@
return -ENOMEM;
}
- rc = smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_A2_POWER_CONTROL_ACK,
- bam_dmux_smsm_ack_cb, NULL);
+ rc = bam_ops->smsm_state_cb_register_ptr(SMSM_MODEM_STATE,
+ SMSM_A2_POWER_CONTROL_ACK,
+ bam_dmux_smsm_ack_cb, NULL);
if (rc) {
destroy_workqueue(bam_mux_rx_workqueue);
destroy_workqueue(bam_mux_tx_workqueue);
- smsm_state_cb_deregister(SMSM_MODEM_STATE,
+ bam_ops->smsm_state_cb_deregister_ptr(SMSM_MODEM_STATE,
SMSM_A2_POWER_CONTROL,
bam_dmux_smsm_cb, NULL);
pr_err("%s: smsm ack cb register failed, rc: %d\n", __func__,
@@ -2461,8 +2543,10 @@
return -ENOMEM;
}
- if (smsm_get_state(SMSM_MODEM_STATE) & SMSM_A2_POWER_CONTROL)
- bam_dmux_smsm_cb(NULL, 0, smsm_get_state(SMSM_MODEM_STATE));
+ if (bam_ops->smsm_get_state_ptr(SMSM_MODEM_STATE) &
+ SMSM_A2_POWER_CONTROL)
+ bam_dmux_smsm_cb(NULL, 0,
+ bam_ops->smsm_get_state_ptr(SMSM_MODEM_STATE));
return 0;
}
diff --git a/arch/arm/mach-msm/bam_dmux_private.h b/arch/arm/mach-msm/bam_dmux_private.h
new file mode 100644
index 0000000..871dd64
--- /dev/null
+++ b/arch/arm/mach-msm/bam_dmux_private.h
@@ -0,0 +1,173 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _BAM_DMUX_PRIVATE_H
+#define _BAM_DMUX_PRIVATE_H
+
+#include <linux/types.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/sps.h>
+
+#define BAM_MUX_HDR_MAGIC_NO 0x33fc
+#define BAM_MUX_HDR_CMD_DATA 0
+#define BAM_MUX_HDR_CMD_OPEN 1
+#define BAM_MUX_HDR_CMD_CLOSE 2
+#define BAM_MUX_HDR_CMD_STATUS 3 /* unused */
+#define BAM_MUX_HDR_CMD_OPEN_NO_A2_PC 4
+#define BUFFER_SIZE 2048
+
+/**
+ * struct bam_ops_if - collection of function pointers to allow swappable
+ * runtime functionality
+ * @smsm_change_state_ptr: pointer to smsm_change_state function
+ * @smsm_get_state_ptr: pointer to smsm_get_state function
+ * @smsm_state_cb_register_ptr: pointer to smsm_state_cb_register function
+ * @smsm_state_cb_deregister_ptr: pointer to smsm_state_cb_deregister function
+ * @sps_connect_ptr: pointer to sps_connect function
+ * @sps_disconnect_ptr: pointer to sps_disconnect function
+ * @sps_register_bam_device_ptr: pointer to sps_register_bam_device
+ * @sps_deregister_bam_device_ptr: pointer to sps_deregister_bam_device
+ * function
+ * @sps_alloc_endpoint_ptr: pointer to sps_alloc_endpoint function
+ * @sps_free_endpoint_ptr: pointer to sps_free_endpoint function
+ * @sps_set_config_ptr: pointer to sps_set_config function
+ * @sps_get_config_ptr: pointer to sps_get_config function
+ * @sps_device_reset_ptr: pointer to sps_device_reset function
+ * @sps_register_event_ptr: pointer to sps_register_event function
+ * @sps_transfer_one_ptr: pointer to sps_transfer_one function
+ * @sps_get_iovec_ptr: pointer to sps_get_iovec function
+ * @sps_get_unused_desc_num_ptr: pointer to sps_get_unused_desc_num function
+ * @dma_to: enum for the direction of dma operations to device
+ * @dma_from: enum for the direction of dma operations from device
+ *
+ * This struct contains the interface from bam_dmux to smsm and sps. The
+ * pointers can be swapped out at run time to provide different functionality.
+ */
+struct bam_ops_if {
+ /* smsm */
+ int (*smsm_change_state_ptr)(uint32_t smsm_entry,
+ uint32_t clear_mask, uint32_t set_mask);
+
+ uint32_t (*smsm_get_state_ptr)(uint32_t smsm_entry);
+
+ int (*smsm_state_cb_register_ptr)(uint32_t smsm_entry, uint32_t mask,
+ void (*notify)(void *, uint32_t old_state, uint32_t new_state),
+ void *data);
+
+ int (*smsm_state_cb_deregister_ptr)(uint32_t smsm_entry, uint32_t mask,
+ void (*notify)(void *, uint32_t, uint32_t), void *data);
+
+ /* sps */
+ int (*sps_connect_ptr)(struct sps_pipe *h, struct sps_connect *connect);
+
+ int (*sps_disconnect_ptr)(struct sps_pipe *h);
+
+ int (*sps_register_bam_device_ptr)(
+ const struct sps_bam_props *bam_props,
+ u32 *dev_handle);
+
+ int (*sps_deregister_bam_device_ptr)(u32 dev_handle);
+
+ struct sps_pipe *(*sps_alloc_endpoint_ptr)(void);
+
+ int (*sps_free_endpoint_ptr)(struct sps_pipe *h);
+
+ int (*sps_set_config_ptr)(struct sps_pipe *h,
+ struct sps_connect *config);
+
+ int (*sps_get_config_ptr)(struct sps_pipe *h,
+ struct sps_connect *config);
+
+ int (*sps_device_reset_ptr)(u32 dev);
+
+ int (*sps_register_event_ptr)(struct sps_pipe *h,
+ struct sps_register_event *reg);
+
+ int (*sps_transfer_one_ptr)(struct sps_pipe *h,
+ u32 addr, u32 size,
+ void *user, u32 flags);
+
+ int (*sps_get_iovec_ptr)(struct sps_pipe *h,
+ struct sps_iovec *iovec);
+
+ int (*sps_get_unused_desc_num_ptr)(struct sps_pipe *h,
+ u32 *desc_num);
+
+ enum dma_data_direction dma_to;
+
+ enum dma_data_direction dma_from;
+};
+
+/**
+ * struct bam_mux_hdr - struct which contains bam dmux header info
+ * @magic_num: magic number placed at start to ensure that it is actually a
+ * valid bam dmux header
+ * @reserved: for later use
+ * @cmd: the command
+ * @pad_len: the length of padding
+ * @ch_id: the id of the bam dmux channel that this is sent on
+ * @pkt_len: the length of the packet that this is the header of
+ */
+struct bam_mux_hdr {
+ uint16_t magic_num;
+ uint8_t reserved;
+ uint8_t cmd;
+ uint8_t pad_len;
+ uint8_t ch_id;
+ uint16_t pkt_len;
+};
+
+/**
+ * struct rx_pkt_info - struct describing an rx packet
+ * @skb: socket buffer containing the packet
+ * @dma_address: dma mapped address of the packet
+ * @work: work_struct for processing the packet
+ * @list_node: list_head for placing this on a list
+ */
+struct rx_pkt_info {
+ struct sk_buff *skb;
+ dma_addr_t dma_address;
+ struct work_struct work;
+ struct list_head list_node;
+};
+
+/**
+ * struct tx_pkt_info - struct describing a tx packet
+ * @skb: socket buffer containing the packet
+ * @dma_address: dma mapped address of the packet
+ * @is_cmd: signifies whether this is a command or data packet
+ * @len: length og the packet
+ * @work: work_struct for processing this packet
+ * @list_node: list_head for placing this on a list
+ * @ts_sec: seconds portion of the timestamp
+ * @ts_nsec: nanoseconds portion of the timestamp
+ *
+ */
+struct tx_pkt_info {
+ struct sk_buff *skb;
+ dma_addr_t dma_address;
+ char is_cmd;
+ uint32_t len;
+ struct work_struct work;
+ struct list_head list_node;
+ unsigned ts_sec;
+ unsigned long ts_nsec;
+};
+
+void msm_bam_dmux_set_bam_ops(struct bam_ops_if *ops);
+
+void msm_bam_dmux_deinit(void);
+
+void msm_bam_dmux_reinit(void);
+
+#endif /* _BAM_DMUX_PRIVATE_H */
diff --git a/arch/arm/mach-msm/clock-8226.c b/arch/arm/mach-msm/clock-8226.c
index 3a0c152..3c5ddc5 100644
--- a/arch/arm/mach-msm/clock-8226.c
+++ b/arch/arm/mach-msm/clock-8226.c
@@ -3150,7 +3150,7 @@
CLK_LOOKUP("iface_clk", gcc_mss_cfg_ahb_clk.c, "fc880000.qcom,mss"),
CLK_LOOKUP("mem_clk", gcc_boot_rom_ahb_clk.c, "fc880000.qcom,mss"),
/* NFC */
- CLK_LOOKUP("ref_clk", cxo_d1_pin.c, "2-000e"),
+ CLK_LOOKUP("ref_clk", cxo_d1_a_pin.c, "2-000e"),
/* PIL-PRONTO */
CLK_LOOKUP("xo", cxo_pil_pronto_clk.c, "fb21b000.qcom,pronto"),
diff --git a/arch/arm/mach-msm/clock-8974.c b/arch/arm/mach-msm/clock-8974.c
index 0051578..6ae909b 100755
--- a/arch/arm/mach-msm/clock-8974.c
+++ b/arch/arm/mach-msm/clock-8974.c
@@ -579,17 +579,6 @@
| BVAL(10, 8, s##_mm_source_val), \
}
-#define F_HDMI(f, s, div, m, n) \
- { \
- .freq_hz = (f), \
- .src_clk = &s##_clk_src, \
- .m_val = (m), \
- .n_val = ~((n)-(m)) * !!(n), \
- .d_val = ~(n),\
- .div_src_val = BVAL(4, 0, (int)(2*(div) - 1)) \
- | BVAL(10, 8, s##_mm_source_val), \
- }
-
#define F_EDP(f, s, div, m, n) \
{ \
.freq_hz = (f), \
@@ -3267,60 +3256,19 @@
},
};
-static int hdmi_pll_clk_enable(struct clk *c)
-{
- return hdmi_pll_enable();
-}
-
-static void hdmi_pll_clk_disable(struct clk *c)
-{
- hdmi_pll_disable();
-}
-
-static int hdmi_pll_clk_set_rate(struct clk *c, unsigned long rate)
-{
- return hdmi_pll_set_rate(rate);
-}
-
-static struct clk_ops clk_ops_hdmi_pll = {
- .enable = hdmi_pll_clk_enable,
- .disable = hdmi_pll_clk_disable,
- .set_rate = hdmi_pll_clk_set_rate,
-};
-
-static struct clk hdmipll_clk_src = {
- .parent = &cxo_clk_src.c,
- .dbg_name = "hdmipll_clk_src",
- .ops = &clk_ops_hdmi_pll,
- CLK_INIT(hdmipll_clk_src),
-};
-
static struct clk_freq_tbl ftbl_mdss_extpclk_clk[] = {
- /*
- * The zero rate is required since suspend/resume wipes out the HDMI PHY
- * registers. This entry allows the HDMI driver to switch the cached
- * rate to zero before suspend and back to the real rate after resume.
- */
- F_HDMI( 0, hdmipll, 1, 0, 0),
- F_HDMI( 25200000, hdmipll, 1, 0, 0),
- F_HDMI( 27000000, hdmipll, 1, 0, 0),
- F_HDMI( 27030000, hdmipll, 1, 0, 0),
- F_HDMI( 65000000, hdmipll, 1, 0, 0),
- F_HDMI( 74250000, hdmipll, 1, 0, 0),
- F_HDMI(108000000, hdmipll, 1, 0, 0),
- F_HDMI(148500000, hdmipll, 1, 0, 0),
- F_HDMI(268500000, hdmipll, 1, 0, 0),
- F_HDMI(297000000, hdmipll, 1, 0, 0),
+ F_MM(148500000, hdmipll, 1, 0, 0),
F_END
};
static struct rcg_clk extpclk_clk_src = {
.cmd_rcgr_reg = EXTPCLK_CMD_RCGR,
.freq_tbl = ftbl_mdss_extpclk_clk,
- .current_freq = &rcg_dummy_freq,
+ .current_freq = ftbl_mdss_extpclk_clk,
.base = &virt_bases[MMSS_BASE],
.c = {
.dbg_name = "extpclk_clk_src",
+ .parent = &hdmipll_clk_src.c,
.ops = &clk_ops_rcg_hdmi,
VDD_DIG_FMAX_MAP2(LOW, 148500000, NOMINAL, 297000000),
CLK_INIT(extpclk_clk_src.c),
diff --git a/arch/arm/mach-msm/clock-a7.c b/arch/arm/mach-msm/clock-a7.c
index 5b8dc4e..d09e4b6 100644
--- a/arch/arm/mach-msm/clock-a7.c
+++ b/arch/arm/mach-msm/clock-a7.c
@@ -193,7 +193,8 @@
if (!c->fmax)
return -ENOMEM;
- array = devm_kzalloc(&pdev->dev, prop_len * sizeof(u32), GFP_KERNEL);
+ array = devm_kzalloc(&pdev->dev,
+ prop_len * sizeof(u32) * 2, GFP_KERNEL);
if (!array)
return -ENOMEM;
diff --git a/arch/arm/mach-msm/clock-krait-8974.c b/arch/arm/mach-msm/clock-krait-8974.c
index 24fe303..4f133fc 100644
--- a/arch/arm/mach-msm/clock-krait-8974.c
+++ b/arch/arm/mach-msm/clock-krait-8974.c
@@ -414,7 +414,7 @@
};
static void get_krait_bin_format_b(struct platform_device *pdev,
- int *speed, int *pvs, int *ver)
+ int *speed, int *pvs, int *pvs_ver)
{
u32 pte_efuse, redundant_sel;
struct resource *res;
@@ -422,7 +422,7 @@
*speed = 0;
*pvs = 0;
- *ver = 0;
+ *pvs_ver = 0;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse");
if (!res) {
@@ -443,7 +443,7 @@
*speed = pte_efuse & 0x7;
/* 4 bits of PVS are in efuse register bits 31, 8-6. */
*pvs = ((pte_efuse >> 28) & 0x8) | ((pte_efuse >> 6) & 0x7);
- *ver = (pte_efuse >> 4) & 0x3;
+ *pvs_ver = (pte_efuse >> 4) & 0x3;
switch (redundant_sel) {
case 1:
@@ -471,7 +471,7 @@
*pvs = 0;
}
- dev_info(&pdev->dev, "PVS version: %d\n", *ver);
+ dev_info(&pdev->dev, "PVS version: %d\n", *pvs_ver);
devm_iounmap(&pdev->dev, base);
}
@@ -585,12 +585,16 @@
}
}
+static char table_name[] = "qcom,speedXX-pvsXX-bin-vXX";
+module_param_string(table_name, table_name, sizeof(table_name), S_IRUGO);
+static unsigned int pvs_config_ver;
+module_param(pvs_config_ver, uint, S_IRUGO);
+
static int clock_krait_8974_driver_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct clk *c;
- int speed, pvs, ver, rows, cpu;
- char prop_name[] = "qcom,speedXX-pvsXX-bin-vXX";
+ int speed, pvs, pvs_ver, config_ver, rows, cpu;
unsigned long *freq, cur_rate, aux_rate;
int *uv, *ua;
u32 *dscr, vco_mask, config_val;
@@ -673,15 +677,22 @@
if (!ret)
hdata.user_vco_mask = vco_mask;
- get_krait_bin_format_b(pdev, &speed, &pvs, &ver);
- snprintf(prop_name, ARRAY_SIZE(prop_name),
- "qcom,speed%d-pvs%d-bin-v%d", speed, pvs, ver);
+ ret = of_property_read_u32(dev->of_node, "qcom,pvs-config-ver",
+ &config_ver);
+ if (!ret) {
+ pvs_config_ver = config_ver;
+ dev_info(&pdev->dev, "PVS config version: %d\n", config_ver);
+ }
- rows = parse_tbl(dev, prop_name, 3,
+ get_krait_bin_format_b(pdev, &speed, &pvs, &pvs_ver);
+ snprintf(table_name, ARRAY_SIZE(table_name),
+ "qcom,speed%d-pvs%d-bin-v%d", speed, pvs, pvs_ver);
+
+ rows = parse_tbl(dev, table_name, 3,
(u32 **) &freq, (u32 **) &uv, (u32 **) &ua);
if (rows < 0) {
/* Fall back to most conservative PVS table */
- dev_err(dev, "Unable to load voltage plan %s!\n", prop_name);
+ dev_err(dev, "Unable to load voltage plan %s!\n", table_name);
ret = parse_tbl(dev, "qcom,speed0-pvs0-bin-v0", 3,
(u32 **) &freq, (u32 **) &uv, (u32 **) &ua);
if (ret < 0) {
diff --git a/arch/arm/mach-msm/clock-local2.c b/arch/arm/mach-msm/clock-local2.c
index cc6f290..e3693ee 100644
--- a/arch/arm/mach-msm/clock-local2.c
+++ b/arch/arm/mach-msm/clock-local2.c
@@ -843,23 +843,16 @@
*/
static int rcg_clk_set_rate_hdmi(struct clk *c, unsigned long rate)
{
- struct clk_freq_tbl *nf;
struct rcg_clk *rcg = to_rcg_clk(c);
+ struct clk_freq_tbl *nf = rcg->freq_tbl;
int rc;
- for (nf = rcg->freq_tbl; nf->freq_hz != rate; nf++)
- if (nf->freq_hz == FREQ_END) {
- rc = -EINVAL;
- goto out;
- }
-
rc = clk_set_rate(nf->src_clk, rate);
if (rc < 0)
goto out;
set_rate_hid(rcg, nf);
rcg->current_freq = nf;
- c->parent = nf->src_clk;
out:
return rc;
}
@@ -870,12 +863,6 @@
struct clk *clk;
struct clk_freq_tbl *freq;
uint32_t rate;
- u32 cmd_rcgr_regval;
-
- /* Is there a pending configuration? */
- cmd_rcgr_regval = readl_relaxed(CMD_RCGR_REG(rcg));
- if (cmd_rcgr_regval & CMD_RCGR_CONFIG_DIRTY_MASK)
- return NULL;
/* Figure out what rate the rcg is running at */
for (freq = rcg->freq_tbl; freq->freq_hz != FREQ_END; freq++) {
@@ -895,6 +882,21 @@
return freq->src_clk;
}
+static struct clk *rcg_hdmi_clk_get_parent(struct clk *c)
+{
+ struct rcg_clk *rcg = to_rcg_clk(c);
+ struct clk_freq_tbl *freq = rcg->freq_tbl;
+ u32 cmd_rcgr_regval;
+
+ /* Is there a pending configuration? */
+ cmd_rcgr_regval = readl_relaxed(CMD_RCGR_REG(rcg));
+ if (cmd_rcgr_regval & CMD_RCGR_CONFIG_DIRTY_MASK)
+ return NULL;
+
+ rcg->current_freq->freq_hz = clk_get_rate(c->parent);
+
+ return freq->src_clk;
+}
static DEFINE_SPINLOCK(mux_reg_lock);
@@ -1007,7 +1009,7 @@
.list_rate = rcg_clk_list_rate,
.round_rate = rcg_clk_round_rate,
.handoff = rcg_clk_handoff,
- .get_parent = rcg_clk_get_parent,
+ .get_parent = rcg_hdmi_clk_get_parent,
};
struct clk_ops clk_ops_rcg_edp = {
diff --git a/arch/arm/mach-msm/clock-mdss-8974.c b/arch/arm/mach-msm/clock-mdss-8974.c
index b500e1d..3ea719f 100644
--- a/arch/arm/mach-msm/clock-mdss-8974.c
+++ b/arch/arm/mach-msm/clock-mdss-8974.c
@@ -151,6 +151,7 @@
#define PLL_POLL_MAX_READS 10
#define PLL_POLL_TIMEOUT_US 50
+#define SEQ_M_MAX_COUNTER 7
static long vco_cached_rate;
static unsigned char *mdss_dsi_base;
@@ -171,23 +172,71 @@
(!(readl_relaxed(gdsc_base) & BIT(0)));
}
-void hdmi_pll_disable(void)
+/* Auto PLL calibaration */
+static int mdss_ahb_clk_enable(int enable)
{
- clk_enable(mdss_ahb_clk);
+ int rc = 0;
+
+ /* todo: Ideally, we should enable/disable GDSC whenever we are
+ * attempting to enable/disable MDSS AHB clock.
+ * For now, just return error if GDSC is not enabled.
+ */
+ if (!mdss_gdsc_enabled()) {
+ pr_err("%s: mdss GDSC is not enabled\n", __func__);
+ return -EPERM;
+ }
+
+ if (enable)
+ rc = clk_prepare_enable(mdss_ahb_clk);
+ else
+ clk_disable_unprepare(mdss_ahb_clk);
+
+ return rc;
+}
+
+static void hdmi_vco_disable(struct clk *c)
+{
+ u32 rc;
+
+ if (!mdss_gdsc_enabled()) {
+ pr_err("%s: mdss GDSC is not enabled\n", __func__);
+ return;
+ }
+
+ rc = clk_enable(mdss_ahb_clk);
+ if (rc) {
+ pr_err("%s: failed to enable mdss ahb clock. rc=%d\n",
+ __func__, rc);
+ return;
+ }
+
REG_W(0x0, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
udelay(5);
REG_W(0x0, hdmi_phy_base + HDMI_PHY_GLB_CFG);
+
clk_disable(mdss_ahb_clk);
hdmi_pll_on = 0;
-} /* hdmi_pll_disable */
+} /* hdmi_vco_disable */
-int hdmi_pll_enable(void)
+static int hdmi_vco_enable(struct clk *c)
{
u32 status;
+ u32 rc;
u32 max_reads, timeout_us;
- clk_enable(mdss_ahb_clk);
+ if (!mdss_gdsc_enabled()) {
+ pr_err("%s: mdss GDSC is not enabled\n", __func__);
+ return -EPERM;
+ }
+
+ rc = clk_enable(mdss_ahb_clk);
+ if (rc) {
+ pr_err("%s: failed to enable mdss ahb clock. rc=%d\n",
+ __func__, rc);
+ return rc;
+ }
+
/* Global Enable */
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
/* Power up power gen */
@@ -212,7 +261,7 @@
status, ((status & BIT(0)) == 1), max_reads, timeout_us)) {
pr_err("%s: hdmi phy pll status=%x failed to Lock\n",
__func__, status);
- hdmi_pll_disable();
+ hdmi_vco_disable(c);
clk_disable(mdss_ahb_clk);
return -EINVAL;
}
@@ -226,7 +275,7 @@
status, ((status & BIT(0)) == 1), max_reads, timeout_us)) {
pr_err("%s: hdmi phy status=%x failed to Lock\n",
__func__, status);
- hdmi_pll_disable();
+ hdmi_vco_disable(c);
clk_disable(mdss_ahb_clk);
return -EINVAL;
}
@@ -236,25 +285,173 @@
hdmi_pll_on = 1;
return 0;
-} /* hdmi_pll_enable */
+} /* hdmi_vco_enable */
-int hdmi_pll_set_rate(unsigned long rate)
+static inline struct hdmi_pll_vco_clk *to_hdmi_vco_clk(struct clk *clk)
+{
+ return container_of(clk, struct hdmi_pll_vco_clk, c);
+}
+
+static void hdmi_phy_pll_calculator(u32 vco_freq)
+{
+ u32 ref_clk = 19200000;
+ u32 sdm_mode = 1;
+ u32 ref_clk_multiplier = sdm_mode == 1 ? 2 : 1;
+ u32 int_ref_clk_freq = ref_clk * ref_clk_multiplier;
+ u32 fbclk_pre_div = 1;
+ u32 ssc_mode = 0;
+ u32 kvco = 270;
+ u32 vdd = 95;
+ u32 ten_power_six = 1000000;
+ u32 ssc_ds_ppm = ssc_mode ? 5000 : 0;
+ u32 sdm_res = 16;
+ u32 ssc_tri_step = 32;
+ u32 ssc_freq = 2;
+ u64 ssc_ds = vco_freq * ssc_ds_ppm;
+ u32 div_in_freq = vco_freq / fbclk_pre_div;
+ u64 dc_offset = (div_in_freq / int_ref_clk_freq - 1) *
+ ten_power_six * 10;
+ u32 ssc_kdiv = (int_ref_clk_freq / ssc_freq) -
+ ten_power_six;
+ u64 sdm_freq_seed;
+ u32 ssc_tri_inc;
+ u64 fb_div_n;
+
+ u32 val;
+
+ pr_debug("%s: vco_freq = %u\n", __func__, vco_freq);
+
+ do_div(ssc_ds, (u64)ten_power_six);
+
+ fb_div_n = (u64)div_in_freq * (u64)ten_power_six * 10;
+ do_div(fb_div_n, int_ref_clk_freq);
+
+ sdm_freq_seed = ((fb_div_n - dc_offset - ten_power_six * 10) *
+ (1 << sdm_res) * 10) + 5;
+ do_div(sdm_freq_seed, ((u64)ten_power_six * 100));
+
+ ssc_tri_inc = (u32)ssc_ds;
+ ssc_tri_inc = (ssc_tri_inc / int_ref_clk_freq) * (1 << 16) /
+ ssc_tri_step;
+
+ val = (ref_clk_multiplier == 2 ? 1 : 0) +
+ ((fbclk_pre_div == 2 ? 1 : 0) * 16);
+ pr_debug("%s: HDMI_UNI_PLL_REFCLK_CFG = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
+
+ REG_W(0x02, hdmi_phy_pll_base + HDMI_UNI_PLL_CHFPUMP_CFG);
+ REG_W(0x19, hdmi_phy_pll_base + HDMI_UNI_PLL_VCOLPF_CFG);
+ REG_W(0x04, hdmi_phy_pll_base + HDMI_UNI_PLL_VREG_CFG);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_PWRGEN_CFG);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
+ REG_W(0x0E, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFR_CFG);
+ REG_W(0x20, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFC1_CFG);
+ REG_W(0x0D, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFC2_CFG);
+
+ do_div(dc_offset, (u64)ten_power_six * 10);
+ val = sdm_mode == 0 ? 64 + dc_offset : 0;
+ pr_debug("%s: HDMI_UNI_PLL_SDM_CFG0 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG0);
+
+ val = 64 + dc_offset;
+ pr_debug("%s: HDMI_UNI_PLL_SDM_CFG1 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG1);
+
+ val = sdm_freq_seed & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_SDM_CFG2 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG2);
+
+ val = (sdm_freq_seed >> 8) & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_SDM_CFG3 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG3);
+
+ val = (sdm_freq_seed >> 16) & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_SDM_CFG4 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG4);
+
+ val = (ssc_mode == 0 ? 128 : 0) + (ssc_kdiv / ten_power_six);
+ pr_debug("%s: HDMI_UNI_PLL_SSC_CFG0 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SSC_CFG0);
+
+ val = ssc_tri_inc & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_SSC_CFG1 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SSC_CFG1);
+
+ val = (ssc_tri_inc >> 8) & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_SSC_CFG2 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_SSC_CFG2);
+
+ pr_debug("%s: HDMI_UNI_PLL_SSC_CFG3 = 0x%x\n", __func__, ssc_tri_step);
+ REG_W(ssc_tri_step, hdmi_phy_pll_base + HDMI_UNI_PLL_SSC_CFG3);
+
+ REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
+ REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
+ REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
+ REG_W(0x0A, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG0);
+ REG_W(0x04, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG1);
+ REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG3);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG4);
+ REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG5);
+
+ val = (kvco * vdd * 10000) / 6;
+ val += 500000;
+ val /= ten_power_six;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG6 = 0x%x\n", __func__, val);
+ REG_W(val & 0xFF, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG6);
+
+ val = (kvco * vdd * 10000) / 6;
+ val -= ten_power_six;
+ val /= ten_power_six;
+ val = (val >> 8) & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG7 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG7);
+
+ val = (ref_clk * 5) / ten_power_six;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG8 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG8);
+
+ val = ((ref_clk * 5) / ten_power_six) >> 8;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG9 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG9);
+
+ vco_freq /= ten_power_six;
+ val = vco_freq & 0xFF;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG10 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG10);
+
+ val = vco_freq >> 8;
+ pr_debug("%s: HDMI_UNI_PLL_CAL_CFG11 = 0x%x\n", __func__, val);
+ REG_W(val, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG11);
+} /* hdmi_phy_pll_calculator */
+
+static int hdmi_vco_set_rate(struct clk *c, unsigned long rate)
{
unsigned int set_power_dwn = 0;
+ int rc = 0;
+
+ struct hdmi_pll_vco_clk *vco = to_hdmi_vco_clk(c);
if (hdmi_pll_on) {
- hdmi_pll_disable();
+ hdmi_vco_disable(c);
set_power_dwn = 1;
}
- clk_enable(mdss_ahb_clk);
+ rc = mdss_ahb_clk_enable(1);
+ if (rc) {
+ pr_err("%s: failed to enable mdss ahb clock. rc=%d\n",
+ __func__, rc);
+ return rc;
+ }
+
pr_debug("%s: rate=%ld\n", __func__, rate);
+
switch (rate) {
case 0:
- /* This case is needed for suspend/resume. */
- break;
+ break;
- case 25200000:
+ case 756000000:
/* 640x480p60 */
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
@@ -271,7 +468,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x03, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -299,7 +495,7 @@
udelay(200);
break;
- case 27000000:
+ case 810000000:
/* 576p50/576i50 case */
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
@@ -316,7 +512,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0X1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x03, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -344,7 +539,7 @@
udelay(200);
break;
- case 27030000:
+ case 810900000:
/* 480p60/480i60 case */
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
@@ -361,7 +556,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x03, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -388,7 +582,7 @@
REG_W(0x05, hdmi_phy_base + HDMI_PHY_TXCAL_CFG3);
udelay(200);
break;
- case 65000000:
+ case 650000000:
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
@@ -404,7 +598,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -431,7 +624,7 @@
REG_W(0x05, hdmi_phy_base + HDMI_PHY_TXCAL_CFG3);
udelay(200);
break;
- case 74250000:
+ case 742500000:
/*
* 720p60/720p50/1080i60/1080i50
* 1080p24/1080p30/1080p25 case
@@ -451,7 +644,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -479,7 +671,7 @@
udelay(200);
break;
- case 108000000:
+ case 1080000000:
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
@@ -495,7 +687,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -523,51 +714,7 @@
udelay(200);
break;
- case 148500000:
- REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
- REG_W(0x19, hdmi_phy_pll_base + HDMI_UNI_PLL_VCOLPF_CFG);
- REG_W(0x0E, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFR_CFG);
- REG_W(0x20, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFC1_CFG);
- REG_W(0x0D, hdmi_phy_pll_base + HDMI_UNI_PLL_LPFC2_CFG);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG0);
- REG_W(0x52, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG1);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG2);
- REG_W(0x56, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG3);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_SDM_CFG4);
- REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
- REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
- REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
- REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
- REG_W(0x60, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG8);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG9);
- REG_W(0xE6, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG10);
- REG_W(0x02, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG11);
- REG_W(0x1F, hdmi_phy_base + HDMI_PHY_PD_CTRL0);
- udelay(50);
-
- REG_W(0x0F, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
- REG_W(0x00, hdmi_phy_base + HDMI_PHY_PD_CTRL1);
- REG_W(0x10, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
- REG_W(0xDB, hdmi_phy_base + HDMI_PHY_ANA_CFG0);
- REG_W(0x43, hdmi_phy_base + HDMI_PHY_ANA_CFG1);
- REG_W(0x02, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
- REG_W(0x00, hdmi_phy_base + HDMI_PHY_ANA_CFG3);
- REG_W(0x04, hdmi_phy_pll_base + HDMI_UNI_PLL_VREG_CFG);
- REG_W(0xD0, hdmi_phy_base + HDMI_PHY_DCC_CFG0);
- REG_W(0x1A, hdmi_phy_base + HDMI_PHY_DCC_CFG1);
- REG_W(0x00, hdmi_phy_base + HDMI_PHY_TXCAL_CFG0);
- REG_W(0x00, hdmi_phy_base + HDMI_PHY_TXCAL_CFG1);
- REG_W(0x02, hdmi_phy_base + HDMI_PHY_TXCAL_CFG2);
- REG_W(0x05, hdmi_phy_base + HDMI_PHY_TXCAL_CFG3);
- udelay(200);
- break;
-
- case 268500000:
+ case 1342500000:
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
@@ -583,7 +730,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -611,7 +757,7 @@
udelay(200);
break;
- case 297000000:
+ case 1485000000:
REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_REFCLK_CFG);
@@ -627,7 +773,6 @@
REG_W(0x10, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG0);
REG_W(0x1A, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG1);
REG_W(0x05, hdmi_phy_pll_base + HDMI_UNI_PLL_LKDET_CFG2);
- REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV1_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV2_CFG);
REG_W(0x00, hdmi_phy_pll_base + HDMI_UNI_PLL_POSTDIV3_CFG);
REG_W(0x01, hdmi_phy_pll_base + HDMI_UNI_PLL_CAL_CFG2);
@@ -656,40 +801,68 @@
break;
default:
- pr_err("%s: not supported rate=%ld\n", __func__, rate);
+ pr_debug("%s: Use pll settings calculator for rate=%ld\n",
+ __func__, rate);
+
+ REG_W(0x81, hdmi_phy_base + HDMI_PHY_GLB_CFG);
+ hdmi_phy_pll_calculator(rate);
+ REG_W(0x1F, hdmi_phy_base + HDMI_PHY_PD_CTRL0);
+ udelay(50);
+
+ REG_W(0x0F, hdmi_phy_pll_base + HDMI_UNI_PLL_GLB_CFG);
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_PD_CTRL1);
+ REG_W(0x10, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
+ REG_W(0xDB, hdmi_phy_base + HDMI_PHY_ANA_CFG0);
+ REG_W(0x43, hdmi_phy_base + HDMI_PHY_ANA_CFG1);
+
+ if (rate < 825000000) {
+ REG_W(0x01, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_ANA_CFG3);
+ } else if (rate >= 825000000 && rate < 1342500000) {
+ REG_W(0x05, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
+ REG_W(0x03, hdmi_phy_base + HDMI_PHY_ANA_CFG3);
+ } else {
+ REG_W(0x06, hdmi_phy_base + HDMI_PHY_ANA_CFG2);
+ REG_W(0x03, hdmi_phy_base + HDMI_PHY_ANA_CFG3);
+ }
+
+ REG_W(0x04, hdmi_phy_pll_base + HDMI_UNI_PLL_VREG_CFG);
+ REG_W(0xD0, hdmi_phy_base + HDMI_PHY_DCC_CFG0);
+ REG_W(0x1A, hdmi_phy_base + HDMI_PHY_DCC_CFG1);
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_TXCAL_CFG0);
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_TXCAL_CFG1);
+
+ if (rate < 825000000)
+ REG_W(0x01, hdmi_phy_base + HDMI_PHY_TXCAL_CFG2);
+ else
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_TXCAL_CFG2);
+
+ REG_W(0x05, hdmi_phy_base + HDMI_PHY_TXCAL_CFG3);
+ REG_W(0x62, hdmi_phy_base + HDMI_PHY_BIST_PATN0);
+ REG_W(0x03, hdmi_phy_base + HDMI_PHY_BIST_PATN1);
+ REG_W(0x69, hdmi_phy_base + HDMI_PHY_BIST_PATN2);
+ REG_W(0x02, hdmi_phy_base + HDMI_PHY_BIST_PATN3);
+
+ udelay(200);
+
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_BIST_CFG1);
+ REG_W(0x00, hdmi_phy_base + HDMI_PHY_BIST_CFG0);
}
/* Make sure writes complete before disabling iface clock */
mb();
- clk_disable(mdss_ahb_clk);
+ mdss_ahb_clk_enable(0);
if (set_power_dwn)
- hdmi_pll_enable();
+ hdmi_vco_enable(c);
+
+ vco->rate = rate;
+ vco->rate_set = true;
return 0;
} /* hdmi_pll_set_rate */
-/* Auto PLL calibaration */
-int mdss_ahb_clk_enable(int enable)
-{
- int rc = 0;
-
- /* todo: Ideally, we should enable/disable GDSC whenever we are
- * attempting to enable/disable MDSS AHB clock.
- * For now, just return error if GDSC is not enabled.
- */
- if (!mdss_gdsc_enabled())
- return -EPERM;
-
- if (enable)
- rc = clk_prepare_enable(mdss_ahb_clk);
- else
- clk_disable_unprepare(mdss_ahb_clk);
-
- return rc;
-}
-
int set_byte_mux_sel(struct mux_clk *clk, int sel)
{
pr_debug("%s: byte mux set to %s mode\n", __func__,
@@ -862,12 +1035,12 @@
static void dsi_pll_toggle_lock_detect(void)
{
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2,
- 0x05);
+ 0x0d);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2,
- 0x04);
+ 0x0c);
udelay(1);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2,
- 0x05);
+ 0x0d);
}
static int dsi_pll_lock_status(void)
@@ -921,24 +1094,25 @@
* the updates to take effect. These delays are necessary for the
* PLL to successfully lock
*/
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG1, 0x34);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x01);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
- for (i = 0; (i < 4) && !pll_locked; i++) {
+ for (i = 0; (i < SEQ_M_MAX_COUNTER) && !pll_locked; i++) {
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_PWRGEN_CFG,
+ 0x00);
+ udelay(50);
DSS_REG_W(mdss_dsi_base,
- DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x07);
- if (i != 0)
- DSS_REG_W(mdss_dsi_base,
- DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG1, 0x34);
- udelay(1);
+ DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
+ udelay(100);
DSS_REG_W(mdss_dsi_base,
DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
}
@@ -962,6 +1136,8 @@
* the updates to take effect. These delays are necessary for the
* PLL to successfully lock
*/
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_PWRGEN_CFG, 0x00);
+ udelay(50);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x01);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
@@ -973,7 +1149,7 @@
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x07);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
pr_debug("%s: PLL status = %s\n", __func__,
@@ -993,6 +1169,8 @@
* the updates to take effect. These delays are necessary for the
* PLL to successfully lock
*/
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_PWRGEN_CFG, 0x00);
+ udelay(50);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x01);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
@@ -1002,7 +1180,7 @@
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0d);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
pr_debug("%s: PLL status = %s\n", __func__,
@@ -1022,12 +1200,14 @@
* the updates to take effect. These delays are necessary for the
* PLL to successfully lock
*/
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_PWRGEN_CFG, 0x00);
+ udelay(50);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x01);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
pr_debug("%s: PLL status = %s\n", __func__,
@@ -1047,6 +1227,8 @@
* the updates to take effect. These delays are necessary for the
* PLL to successfully lock
*/
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_PWRGEN_CFG, 0x00);
+ udelay(50);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x01);
udelay(200);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x05);
@@ -1054,7 +1236,7 @@
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0d);
udelay(1);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_GLB_CFG, 0x0f);
- udelay(1000);
+ udelay(600);
pll_locked = dsi_pll_toggle_lock_detect_and_check_status();
pr_debug("%s: PLL status = %s\n", __func__,
@@ -1086,10 +1268,10 @@
for (i = 0; i < 3; i++) {
/* DSI Uniphy lock detect setting */
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2,
- 0x04);
+ 0x0c);
udelay(100);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2,
- 0x05);
+ 0x0d);
udelay(500);
/* poll for PLL ready status */
max_reads = 5;
@@ -1287,7 +1469,7 @@
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CHGPUMP_CFG, 0x02);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG3, 0x2b);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG4, 0x66);
- DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2, 0x05);
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_LKDET_CFG2, 0x0d);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_SDM_CFG1,
(u32)(sdm_cfg1 & 0xff));
@@ -1306,7 +1488,7 @@
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_VCOLPF_CFG, 0x71);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_SDM_CFG0,
(u32)sdm_cfg0);
- DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG0, 0x0a);
+ DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG0, 0x12);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG6, 0x30);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG7, 0x00);
DSS_REG_W(mdss_dsi_base, DSI_0_PHY_PLL_UNIPHY_PLL_CAL_CFG8, 0x60);
@@ -1468,13 +1650,14 @@
.ref_clk_rate = 19200000,
.min_rate = 350000000,
.max_rate = 750000000,
- .pll_en_seq_cnt = 6,
+ .pll_en_seq_cnt = 7,
.pll_enable_seqs[0] = dsi_pll_enable_seq_m,
- .pll_enable_seqs[1] = dsi_pll_enable_seq_d,
+ .pll_enable_seqs[1] = dsi_pll_enable_seq_m,
.pll_enable_seqs[2] = dsi_pll_enable_seq_d,
- .pll_enable_seqs[3] = dsi_pll_enable_seq_f1,
- .pll_enable_seqs[4] = dsi_pll_enable_seq_c,
- .pll_enable_seqs[5] = dsi_pll_enable_seq_e,
+ .pll_enable_seqs[3] = dsi_pll_enable_seq_d,
+ .pll_enable_seqs[4] = dsi_pll_enable_seq_f1,
+ .pll_enable_seqs[5] = dsi_pll_enable_seq_c,
+ .pll_enable_seqs[6] = dsi_pll_enable_seq_e,
.lpfr_lut_size = 10,
.lpfr_lut = (struct lpfr_cfg[]){
{479500000, 8},
@@ -2126,6 +2309,291 @@
},
};
+/* HDMI PLL DIV CLK */
+
+static unsigned long hdmi_vco_get_rate(struct clk *c)
+{
+ unsigned long freq = 0;
+
+ if (mdss_ahb_clk_enable(1)) {
+ pr_err("%s: Failed to enable mdss ahb clock\n", __func__);
+ return freq;
+ }
+
+ freq = DSS_REG_R(hdmi_phy_pll_base, HDMI_UNI_PLL_CAL_CFG11) << 8 |
+ DSS_REG_R(hdmi_phy_pll_base, HDMI_UNI_PLL_CAL_CFG10);
+
+ switch (freq) {
+ case 742:
+ freq = 742500000;
+ break;
+ case 810:
+ if (DSS_REG_R(hdmi_phy_pll_base, HDMI_UNI_PLL_SDM_CFG3) == 0x18)
+ freq = 810000000;
+ else
+ freq = 810900000;
+ break;
+ case 1342:
+ freq = 1342500000;
+ break;
+ default:
+ freq *= 1000000;
+ }
+
+ mdss_ahb_clk_enable(0);
+
+ return freq;
+}
+
+static long hdmi_vco_round_rate(struct clk *c, unsigned long rate)
+{
+ unsigned long rrate = rate;
+ struct hdmi_pll_vco_clk *vco = to_hdmi_vco_clk(c);
+
+ if (rate < vco->min_rate)
+ rrate = vco->min_rate;
+ if (rate > vco->max_rate)
+ rrate = vco->max_rate;
+
+ pr_debug("%s: rrate=%ld\n", __func__, rrate);
+
+ return rrate;
+}
+
+static int hdmi_vco_prepare(struct clk *c)
+{
+ struct hdmi_pll_vco_clk *vco = to_hdmi_vco_clk(c);
+ int ret = 0;
+
+ pr_debug("%s: rate=%ld\n", __func__, vco->rate);
+
+ if (!vco->rate_set && vco->rate)
+ ret = hdmi_vco_set_rate(c, vco->rate);
+
+ if (!ret)
+ ret = clk_prepare(mdss_ahb_clk);
+
+ return ret;
+}
+
+static void hdmi_vco_unprepare(struct clk *c)
+{
+ struct hdmi_pll_vco_clk *vco = to_hdmi_vco_clk(c);
+
+ vco->rate_set = false;
+
+ clk_unprepare(mdss_ahb_clk);
+}
+
+static int hdmi_pll_lock_status(void)
+{
+ u32 status;
+ int pll_locked = 0;
+ int rc;
+
+ rc = mdss_ahb_clk_enable(1);
+ if (rc) {
+ pr_err("%s: failed to enable mdss ahb clock. rc=%d\n",
+ __func__, rc);
+ return 0;
+ }
+ /* poll for PLL ready status */
+ if (readl_poll_timeout_noirq((hdmi_phy_base + HDMI_PHY_STATUS),
+ status, ((status & BIT(0)) == 1),
+ PLL_POLL_MAX_READS, PLL_POLL_TIMEOUT_US)) {
+ pr_debug("%s: HDMI PLL status=%x failed to Lock\n",
+ __func__, status);
+ pll_locked = 0;
+ } else {
+ pll_locked = 1;
+ }
+ mdss_ahb_clk_enable(0);
+
+ return pll_locked;
+}
+
+static enum handoff hdmi_vco_handoff(struct clk *c)
+{
+ enum handoff ret = HANDOFF_DISABLED_CLK;
+
+ if (hdmi_pll_lock_status()) {
+ c->rate = hdmi_vco_get_rate(c);
+ ret = HANDOFF_ENABLED_CLK;
+ }
+
+ pr_debug("%s: done, ret=%d\n", __func__, ret);
+ return ret;
+}
+
+static struct clk_ops hdmi_vco_clk_ops = {
+ .enable = hdmi_vco_enable,
+ .set_rate = hdmi_vco_set_rate,
+ .get_rate = hdmi_vco_get_rate,
+ .round_rate = hdmi_vco_round_rate,
+ .prepare = hdmi_vco_prepare,
+ .unprepare = hdmi_vco_unprepare,
+ .disable = hdmi_vco_disable,
+ .handoff = hdmi_vco_handoff,
+};
+
+static struct hdmi_pll_vco_clk hdmi_vco_clk = {
+ .min_rate = 600000000,
+ .max_rate = 1800000000,
+ .c = {
+ .dbg_name = "hdmi_vco_clk",
+ .ops = &hdmi_vco_clk_ops,
+ CLK_INIT(hdmi_vco_clk.c),
+ },
+};
+
+struct div_clk hdmipll_div1_clk = {
+ .data = {
+ .div = 1,
+ .min_div = 1,
+ .max_div = 1,
+ },
+ .c = {
+ .parent = &hdmi_vco_clk.c,
+ .dbg_name = "hdmipll_div1_clk",
+ .ops = &clk_ops_div,
+ .flags = CLKFLAG_NO_RATE_CACHE,
+ CLK_INIT(hdmipll_div1_clk.c),
+ },
+};
+
+struct div_clk hdmipll_div2_clk = {
+ .data = {
+ .div = 2,
+ .min_div = 2,
+ .max_div = 2,
+ },
+ .c = {
+ .parent = &hdmi_vco_clk.c,
+ .dbg_name = "hdmipll_div2_clk",
+ .ops = &clk_ops_div,
+ .flags = CLKFLAG_NO_RATE_CACHE,
+ CLK_INIT(hdmipll_div2_clk.c),
+ },
+};
+
+struct div_clk hdmipll_div4_clk = {
+ .data = {
+ .div = 4,
+ .min_div = 4,
+ .max_div = 4,
+ },
+ .c = {
+ .parent = &hdmi_vco_clk.c,
+ .dbg_name = "hdmipll_div4_clk",
+ .ops = &clk_ops_div,
+ .flags = CLKFLAG_NO_RATE_CACHE,
+ CLK_INIT(hdmipll_div4_clk.c),
+ },
+};
+
+struct div_clk hdmipll_div6_clk = {
+ .data = {
+ .div = 6,
+ .min_div = 6,
+ .max_div = 6,
+ },
+ .c = {
+ .parent = &hdmi_vco_clk.c,
+ .dbg_name = "hdmipll_div6_clk",
+ .ops = &clk_ops_div,
+ .flags = CLKFLAG_NO_RATE_CACHE,
+ CLK_INIT(hdmipll_div6_clk.c),
+ },
+};
+
+static int hdmipll_set_mux_sel(struct mux_clk *clk, int mux_sel)
+{
+ int rc;
+
+ if (!mdss_gdsc_enabled()) {
+ pr_err("%s: mdss GDSC is not enabled\n", __func__);
+ return -EPERM;
+ }
+
+ rc = clk_enable(mdss_ahb_clk);
+ if (rc) {
+ pr_err("%s: Failed to enable mdss ahb clock\n", __func__);
+ return rc;
+ }
+
+ pr_debug("%s: mux_sel=%d\n", __func__, mux_sel);
+ DSS_REG_W(hdmi_phy_pll_base, HDMI_UNI_PLL_POSTDIV1_CFG, mux_sel);
+
+ clk_disable(mdss_ahb_clk);
+
+ return 0;
+}
+
+static int hdmipll_get_mux_sel(struct mux_clk *clk)
+{
+ int mux_sel = 0;
+
+ if (mdss_ahb_clk_enable(1)) {
+ pr_err("%s: Failed to enable mdss ahb clock\n", __func__);
+ return mux_sel;
+ }
+
+ mux_sel = DSS_REG_R(hdmi_phy_pll_base, HDMI_UNI_PLL_POSTDIV1_CFG);
+ mux_sel &= 0x03;
+ pr_debug("%s: mux_sel=%d\n", __func__, mux_sel);
+
+ mdss_ahb_clk_enable(0);
+
+ return mux_sel;
+}
+
+static struct clk_mux_ops hdmipll_mux_ops = {
+ .set_mux_sel = hdmipll_set_mux_sel,
+ .get_mux_sel = hdmipll_get_mux_sel,
+};
+
+static struct clk_ops hdmi_mux_ops;
+
+static int hdmi_mux_prepare(struct clk *c)
+{
+ int ret = 0;
+
+ if (c && c->ops && c->ops->set_rate)
+ ret = c->ops->set_rate(c, c->rate);
+
+ return ret;
+}
+
+static struct mux_clk hdmipll_mux_clk = {
+ MUX_SRC_LIST(
+ { &hdmipll_div1_clk.c, 0 },
+ { &hdmipll_div2_clk.c, 1 },
+ { &hdmipll_div4_clk.c, 2 },
+ { &hdmipll_div6_clk.c, 3 },
+ ),
+ .ops = &hdmipll_mux_ops,
+ .c = {
+ .parent = &hdmipll_div1_clk.c,
+ .dbg_name = "hdmipll_mux_clk",
+ .ops = &hdmi_mux_ops,
+ CLK_INIT(hdmipll_mux_clk.c),
+ },
+};
+
+struct div_clk hdmipll_clk_src = {
+ .data = {
+ .div = 5,
+ .min_div = 5,
+ .max_div = 5,
+ },
+ .c = {
+ .parent = &hdmipll_mux_clk.c,
+ .dbg_name = "hdmipll_clk_src",
+ .ops = &clk_ops_div,
+ CLK_INIT(hdmipll_clk_src.c),
+ },
+};
+
void __init mdss_clk_ctrl_pre_init(struct clk *ahb_clk)
{
BUG_ON(ahb_clk == NULL);
@@ -2170,4 +2638,7 @@
edp_pixel_clk_ops = clk_ops_slave_div;
edp_pixel_clk_ops.prepare = div_prepare;
+
+ hdmi_mux_ops = clk_ops_gen_mux;
+ hdmi_mux_ops.prepare = hdmi_mux_prepare;
}
diff --git a/arch/arm/mach-msm/clock-mdss-8974.h b/arch/arm/mach-msm/clock-mdss-8974.h
index da24b0d..f9286f1 100644
--- a/arch/arm/mach-msm/clock-mdss-8974.h
+++ b/arch/arm/mach-msm/clock-mdss-8974.h
@@ -22,9 +22,15 @@
void mdss_clk_ctrl_pre_init(struct clk *ahb_clk);
void mdss_clk_ctrl_post_init(void);
-int hdmi_pll_enable(void);
-void hdmi_pll_disable(void);
-int hdmi_pll_set_rate(unsigned long rate);
+
+struct hdmi_pll_vco_clk {
+ unsigned long rate; /* current vco rate */
+ unsigned long min_rate; /* min vco rate */
+ unsigned long max_rate; /* max vco rate */
+ bool rate_set;
+
+ struct clk c;
+};
struct edp_pll_vco_clk {
unsigned long ref_clk_rate;
@@ -67,5 +73,6 @@
extern struct div_clk edp_mainlink_clk_src;
extern struct div_clk edp_pixel_clk_src;
+extern struct div_clk hdmipll_clk_src;
#endif
diff --git a/arch/arm/mach-msm/cpr-regulator.c b/arch/arm/mach-msm/cpr-regulator.c
index 1cf2e41..28afc91 100644
--- a/arch/arm/mach-msm/cpr-regulator.c
+++ b/arch/arm/mach-msm/cpr-regulator.c
@@ -25,7 +25,6 @@
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
-#include <linux/cpufreq.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/cpr-regulator.h>
@@ -33,6 +32,10 @@
/* Register Offsets for RB-CPR and Bit Definitions */
+/* RBCPR Version Register */
+#define REG_RBCPR_VERSION 0
+#define RBCPR_VER_2 0x02
+
/* RBCPR Gate Count and Target Registers */
#define REG_RBCPR_GCNT_TARGET(n) (0x60 + 4 * n)
@@ -131,14 +134,14 @@
#define BYTES_PER_FUSE_ROW 8
+#define FLAGS_IGNORE_1ST_IRQ_STATUS BIT(0)
#define FLAGS_SET_MIN_VOLTAGE BIT(1)
#define FLAGS_UPLIFT_QUOT_VOLT BIT(2)
-#define FLAGS_QUOT_ADJUST_WITH_FREQ BIT(3)
-struct cpufreq_mapping_info {
- int freq;
+struct quot_adjust_info {
+ int speed_bin;
+ int virtual_corner;
int quot_adjust;
- int corner;
};
enum voltage_change_dir {
@@ -160,7 +163,7 @@
/* Process voltage parameters */
u32 pvs_init_v[CPR_PVS_EFUSE_BINS_MAX];
- u32 pvs_corner_v[NUM_APC_PVS][CPR_CORNER_MAX];
+ u32 pvs_corner_v[NUM_APC_PVS][CPR_FUSE_CORNER_MAX];
/* Process voltage variables */
u32 pvs_bin;
u32 process;
@@ -178,9 +181,8 @@
u64 cpr_fuse_bits;
bool cpr_fuse_disable;
bool cpr_fuse_local;
- int cpr_fuse_target_quot[CPR_CORNER_MAX];
- int cpr_fuse_original_quot[CPR_CORNER_MAX];
- int cpr_fuse_ro_sel[CPR_CORNER_MAX];
+ int cpr_fuse_target_quot[CPR_FUSE_CORNER_MAX];
+ int cpr_fuse_ro_sel[CPR_FUSE_CORNER_MAX];
int gcnt;
unsigned int cpr_irq;
@@ -188,13 +190,13 @@
phys_addr_t rbcpr_clk_addr;
struct mutex cpr_mutex;
- int ceiling_volt[CPR_CORNER_MAX];
- int floor_volt[CPR_CORNER_MAX];
- int last_volt[CPR_CORNER_MAX];
+ int ceiling_volt[CPR_FUSE_CORNER_MAX];
+ int floor_volt[CPR_FUSE_CORNER_MAX];
+ int *last_volt;
int step_volt;
- int save_ctl[CPR_CORNER_MAX];
- int save_irq[CPR_CORNER_MAX];
+ int *save_ctl;
+ int *save_irq;
u32 save_regs[CPR_NUM_SAVE_REGS];
u32 save_reg_val[CPR_NUM_SAVE_REGS];
@@ -214,10 +216,10 @@
u32 vdd_apc_step_up_limit;
u32 vdd_apc_step_down_limit;
u32 flags;
- struct notifier_block freq_transition;
- unsigned int freq;
- struct cpufreq_mapping_info *cpufreq_mapping;
- u32 cpufreq_mapping_size;
+ int *corner_map;
+ u32 num_corners;
+ int *quot_adjust;
+ u32 quotient_adjustment;
};
#define CPR_DEBUG_MASK_IRQ BIT(0)
@@ -280,28 +282,6 @@
return efuse_bits;
}
-static int cpr_get_freq_corner(struct cpr_regulator *cpr_vreg, int freq)
-{
- int i;
-
- for (i = 0; i < cpr_vreg->cpufreq_mapping_size; i++) {
- if (freq == cpr_vreg->cpufreq_mapping[i].freq)
- return cpr_vreg->cpufreq_mapping[i].corner;
- }
-
- return -EINVAL;
-}
-
-static int cpr_get_freq_quot_adjust(struct cpr_regulator *cpr_vreg, int freq)
-{
- int i;
-
- for (i = 0; i < cpr_vreg->cpufreq_mapping_size; i++) {
- if (freq == cpr_vreg->cpufreq_mapping[i].freq)
- return cpr_vreg->cpufreq_mapping[i].quot_adjust;
- }
- return 0;
-}
static bool cpr_is_allowed(struct cpr_regulator *cpr_vreg)
{
@@ -362,9 +342,11 @@
static void cpr_ctl_enable(struct cpr_regulator *cpr_vreg, int corner)
{
u32 val;
+ int fuse_corner = cpr_vreg->corner_map[corner];
if (cpr_is_allowed(cpr_vreg) &&
- (cpr_vreg->ceiling_volt[corner] > cpr_vreg->floor_volt[corner]))
+ (cpr_vreg->ceiling_volt[fuse_corner] >
+ cpr_vreg->floor_volt[fuse_corner]))
val = RBCPR_CTL_LOOP_EN;
else
val = 0;
@@ -376,13 +358,6 @@
cpr_ctl_modify(cpr_vreg, RBCPR_CTL_LOOP_EN, 0);
}
-static bool cpr_ctl_is_enabled(struct cpr_regulator *cpr_vreg)
-{
- u32 val;
- val = cpr_read(cpr_vreg, REG_RBCPR_CTL);
- return ((val & RBCPR_CTL_LOOP_EN) == RBCPR_CTL_LOOP_EN);
-}
-
static void cpr_regs_save(struct cpr_regulator *cpr_vreg)
{
int i, offset;
@@ -415,16 +390,12 @@
static void cpr_corner_restore(struct cpr_regulator *cpr_vreg, int corner)
{
u32 gcnt, ctl, irq, ro_sel;
- int adjust;
+ int fuse_corner = cpr_vreg->corner_map[corner];
- if (cpr_vreg->flags & FLAGS_QUOT_ADJUST_WITH_FREQ) {
- adjust = cpr_get_freq_quot_adjust(cpr_vreg, cpr_vreg->freq);
- cpr_vreg->cpr_fuse_target_quot[corner] =
- cpr_vreg->cpr_fuse_original_quot[corner] - adjust;
- }
+ ro_sel = cpr_vreg->cpr_fuse_ro_sel[fuse_corner];
+ gcnt = cpr_vreg->gcnt | (cpr_vreg->cpr_fuse_target_quot[fuse_corner] -
+ cpr_vreg->quot_adjust[corner]);
- ro_sel = cpr_vreg->cpr_fuse_ro_sel[corner];
- gcnt = cpr_vreg->gcnt | cpr_vreg->cpr_fuse_target_quot[corner];
cpr_write(cpr_vreg, REG_RBCPR_GCNT_TARGET(ro_sel), gcnt);
ctl = cpr_vreg->save_ctl[corner];
cpr_write(cpr_vreg, REG_RBCPR_CTL, ctl);
@@ -462,8 +433,9 @@
goto _exit;
}
- cpr_debug("%d -> %d [corner=%d]\n",
- old_cpr_enable, cpr_enable, the_cpr->corner);
+ cpr_debug("%d -> %d [corner=%d, fuse_corner=%d]\n",
+ old_cpr_enable, cpr_enable, the_cpr->corner,
+ the_cpr->corner_map[the_cpr->corner]);
if (the_cpr->cpr_fuse_disable) {
/* Already disabled */
@@ -509,17 +481,18 @@
static int cpr_mx_get(struct cpr_regulator *cpr_vreg, int corner, int apc_volt)
{
int vdd_mx;
+ int fuse_corner = cpr_vreg->corner_map[corner];
switch (cpr_vreg->vdd_mx_vmin_method) {
case VDD_MX_VMIN_APC:
vdd_mx = apc_volt;
break;
case VDD_MX_VMIN_APC_CORNER_CEILING:
- vdd_mx = cpr_vreg->ceiling_volt[corner];
+ vdd_mx = cpr_vreg->ceiling_volt[fuse_corner];
break;
case VDD_MX_VMIN_APC_SLOW_CORNER_CEILING:
vdd_mx = cpr_vreg->pvs_corner_v[APC_PVS_SLOW]
- [CPR_CORNER_TURBO];
+ [CPR_FUSE_CORNER_TURBO];
break;
case VDD_MX_VMIN_MX_VMAX:
vdd_mx = cpr_vreg->vdd_mx_vmax;
@@ -536,15 +509,19 @@
int vdd_mx_vmin)
{
int rc;
+ int fuse_corner = cpr_vreg->corner_map[corner];
rc = regulator_set_voltage(cpr_vreg->vdd_mx, vdd_mx_vmin,
cpr_vreg->vdd_mx_vmax);
- cpr_debug("[corner:%d] %d uV\n", corner, vdd_mx_vmin);
- if (!rc)
+ cpr_debug("[corner:%d, fuse_corner:%d] %d uV\n", corner,
+ fuse_corner, vdd_mx_vmin);
+
+ if (!rc) {
cpr_vreg->vdd_mx_vmin = vdd_mx_vmin;
- else
- pr_err("set: vdd_mx [%d] = %d uV: rc=%d\n",
- corner, vdd_mx_vmin, rc);
+ } else {
+ pr_err("set: vdd_mx [corner:%d, fuse_corner:%d] = %d uV failed: rc=%d\n",
+ corner, fuse_corner, vdd_mx_vmin, rc);
+ }
return rc;
}
@@ -582,9 +559,11 @@
enum voltage_change_dir dir)
{
u32 reg_val, error_steps, reg_mask;
- int last_volt, new_volt, corner;
+ int last_volt, new_volt, corner, fuse_corner;
+ u32 gcnt, quot;
corner = cpr_vreg->corner;
+ fuse_corner = cpr_vreg->corner_map[corner];
reg_val = cpr_read(cpr_vreg, REG_RBCPR_RESULT_0);
@@ -592,18 +571,27 @@
& RBCPR_RESULT0_ERROR_STEPS_MASK;
last_volt = cpr_vreg->last_volt[corner];
- cpr_debug_irq("last_volt[corner:%d] = %d uV\n", corner, last_volt);
+ cpr_debug_irq("last_volt[corner:%d, fuse_corner:%d] = %d uV\n", corner,
+ fuse_corner, last_volt);
+
+ gcnt = cpr_read(cpr_vreg, REG_RBCPR_GCNT_TARGET
+ (cpr_vreg->cpr_fuse_ro_sel[fuse_corner]));
+ quot = gcnt & ((1 << RBCPR_GCNT_TARGET_GCNT_SHIFT) - 1);
if (dir == UP) {
cpr_debug_irq("Up: cpr status = 0x%08x (error_steps=%d)\n",
reg_val, error_steps);
- if (last_volt >= cpr_vreg->ceiling_volt[corner]) {
- cpr_debug_irq("[corn:%d] @ ceiling: %d >= %d: NACK\n",
- corner, last_volt,
- cpr_vreg->ceiling_volt[corner]);
+ if (last_volt >= cpr_vreg->ceiling_volt[fuse_corner]) {
+ cpr_debug_irq(
+ "[corn:%d, fuse_corn:%d] @ ceiling: %d >= %d: NACK\n",
+ corner, fuse_corner, last_volt,
+ cpr_vreg->ceiling_volt[fuse_corner]);
cpr_irq_clr_nack(cpr_vreg);
+ cpr_debug_irq("gcnt = 0x%08x (quot = %d)\n", gcnt,
+ quot);
+
/* Maximize the UP threshold */
reg_mask = RBCPR_CTL_UP_THRESHOLD_MASK <<
RBCPR_CTL_UP_THRESHOLD_SHIFT;
@@ -621,11 +609,12 @@
/* Calculate new voltage */
new_volt = last_volt + (error_steps * cpr_vreg->step_volt);
- if (new_volt > cpr_vreg->ceiling_volt[corner]) {
+ if (new_volt > cpr_vreg->ceiling_volt[fuse_corner]) {
cpr_debug_irq("new_volt(%d) >= ceiling(%d): Clamp\n",
new_volt,
- cpr_vreg->ceiling_volt[corner]);
- new_volt = cpr_vreg->ceiling_volt[corner];
+ cpr_vreg->ceiling_volt[fuse_corner]);
+
+ new_volt = cpr_vreg->ceiling_volt[fuse_corner];
}
if (cpr_scale_voltage(cpr_vreg, corner, new_volt, dir)) {
@@ -634,13 +623,9 @@
}
cpr_vreg->last_volt[corner] = new_volt;
- /* Restore default threshold for DOWN */
- reg_mask = RBCPR_CTL_DN_THRESHOLD_MASK <<
- RBCPR_CTL_DN_THRESHOLD_SHIFT;
- reg_val = cpr_vreg->down_threshold <<
- RBCPR_CTL_DN_THRESHOLD_SHIFT;
- /* and disable auto nack down */
- reg_mask |= RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
+ /* Disable auto nack down */
+ reg_mask = RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
+ reg_val = 0;
cpr_ctl_modify(cpr_vreg, reg_mask, reg_val);
@@ -650,26 +635,26 @@
/* Ack */
cpr_irq_clr_ack(cpr_vreg);
- cpr_debug_irq("UP: -> new_volt[corner:%d] = %d uV\n",
- corner, new_volt);
+ cpr_debug_irq(
+ "UP: -> new_volt[corner:%d, fuse_corner:%d] = %d uV\n",
+ corner, fuse_corner, new_volt);
} else if (dir == DOWN) {
cpr_debug_irq("Down: cpr status = 0x%08x (error_steps=%d)\n",
reg_val, error_steps);
- if (last_volt <= cpr_vreg->floor_volt[corner]) {
- cpr_debug_irq("[corn:%d] @ floor: %d <= %d: NACK\n",
- corner, last_volt,
- cpr_vreg->floor_volt[corner]);
+ if (last_volt <= cpr_vreg->floor_volt[fuse_corner]) {
+ cpr_debug_irq(
+ "[corn:%d, fuse_corner:%d] @ floor: %d <= %d: NACK\n",
+ corner, fuse_corner, last_volt,
+ cpr_vreg->floor_volt[fuse_corner]);
cpr_irq_clr_nack(cpr_vreg);
- /* Maximize the DOWN threshold */
- reg_mask = RBCPR_CTL_DN_THRESHOLD_MASK <<
- RBCPR_CTL_DN_THRESHOLD_SHIFT;
- reg_val = reg_mask;
+ cpr_debug_irq("gcnt = 0x%08x (quot = %d)\n", gcnt,
+ quot);
/* Enable auto nack down */
- reg_mask |= RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
- reg_val |= RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
+ reg_mask = RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
+ reg_val = RBCPR_CTL_SW_AUTO_CONT_NACK_DN_EN;
cpr_ctl_modify(cpr_vreg, reg_mask, reg_val);
@@ -688,11 +673,11 @@
/* Calculte new voltage */
new_volt = last_volt - (error_steps * cpr_vreg->step_volt);
- if (new_volt < cpr_vreg->floor_volt[corner]) {
+ if (new_volt < cpr_vreg->floor_volt[fuse_corner]) {
cpr_debug_irq("new_volt(%d) < floor(%d): Clamp\n",
new_volt,
- cpr_vreg->floor_volt[corner]);
- new_volt = cpr_vreg->floor_volt[corner];
+ cpr_vreg->floor_volt[fuse_corner]);
+ new_volt = cpr_vreg->floor_volt[fuse_corner];
}
if (cpr_scale_voltage(cpr_vreg, corner, new_volt, dir)) {
@@ -711,8 +696,9 @@
/* Ack */
cpr_irq_clr_ack(cpr_vreg);
- cpr_debug_irq("DOWN: -> new_volt[corner:%d] = %d uV\n",
- corner, new_volt);
+ cpr_debug_irq(
+ "DOWN: -> new_volt[corner:%d, fuse_corner:%d] = %d uV\n",
+ corner, fuse_corner, new_volt);
}
}
@@ -724,6 +710,9 @@
mutex_lock(&cpr_vreg->cpr_mutex);
reg_val = cpr_read(cpr_vreg, REG_RBIF_IRQ_STATUS);
+ if (cpr_vreg->flags & FLAGS_IGNORE_1ST_IRQ_STATUS)
+ reg_val = cpr_read(cpr_vreg, REG_RBIF_IRQ_STATUS);
+
cpr_debug_irq("IRQ_STATUS = 0x%02X\n", reg_val);
if (!cpr_is_allowed(cpr_vreg)) {
@@ -831,6 +820,7 @@
int rc;
int new_volt;
enum voltage_change_dir change_dir = NO_CHANGE;
+ int fuse_corner = cpr_vreg->corner_map[corner];
mutex_lock(&cpr_vreg->cpr_mutex);
@@ -838,10 +828,12 @@
cpr_ctl_disable(cpr_vreg);
new_volt = cpr_vreg->last_volt[corner];
} else {
- new_volt = cpr_vreg->pvs_corner_v[cpr_vreg->process][corner];
+ new_volt = cpr_vreg->pvs_corner_v
+ [cpr_vreg->process][fuse_corner];
}
- cpr_debug("[corner:%d] = %d uV\n", corner, new_volt);
+ cpr_debug("[corner:%d, fuse_corner:%d] = %d uV\n", corner, fuse_corner,
+ new_volt);
if (corner > cpr_vreg->corner)
change_dir = UP;
@@ -934,11 +926,13 @@
#define cpr_regulator_resume NULL
#endif
-static int __devinit cpr_config(struct cpr_regulator *cpr_vreg)
+static int __devinit cpr_config(struct cpr_regulator *cpr_vreg,
+ struct device *dev)
{
int i;
u32 val, gcnt, reg;
void __iomem *rbcpr_clk;
+ int size;
/* Use 19.2 MHz clock for CPR. */
rbcpr_clk = ioremap(cpr_vreg->rbcpr_clk_addr, 4);
@@ -1009,17 +1003,26 @@
cpr_vreg->save_regs[5] = REG_RBIF_IRQ_EN(cpr_vreg->irq_line);
cpr_vreg->save_regs[6] = REG_RBCPR_CTL;
cpr_vreg->save_regs[7] = REG_RBCPR_GCNT_TARGET
- (cpr_vreg->cpr_fuse_ro_sel[CPR_CORNER_SVS]);
+ (cpr_vreg->cpr_fuse_ro_sel[CPR_FUSE_CORNER_SVS]);
cpr_vreg->save_regs[8] = REG_RBCPR_GCNT_TARGET
- (cpr_vreg->cpr_fuse_ro_sel[CPR_CORNER_NORMAL]);
+ (cpr_vreg->cpr_fuse_ro_sel[CPR_FUSE_CORNER_NORMAL]);
cpr_vreg->save_regs[9] = REG_RBCPR_GCNT_TARGET
- (cpr_vreg->cpr_fuse_ro_sel[CPR_CORNER_TURBO]);
+ (cpr_vreg->cpr_fuse_ro_sel[CPR_FUSE_CORNER_TURBO]);
cpr_irq_set(cpr_vreg, CPR_INT_DEFAULT);
- cpr_corner_save(cpr_vreg, CPR_CORNER_SVS);
- cpr_corner_save(cpr_vreg, CPR_CORNER_NORMAL);
- cpr_corner_save(cpr_vreg, CPR_CORNER_TURBO);
+ val = cpr_read(cpr_vreg, REG_RBCPR_VERSION);
+ if (val <= RBCPR_VER_2)
+ cpr_vreg->flags |= FLAGS_IGNORE_1ST_IRQ_STATUS;
+
+ size = cpr_vreg->num_corners + 1;
+ cpr_vreg->save_ctl = devm_kzalloc(dev, sizeof(int) * size, GFP_KERNEL);
+ cpr_vreg->save_irq = devm_kzalloc(dev, sizeof(int) * size, GFP_KERNEL);
+ if (!cpr_vreg->save_ctl || !cpr_vreg->save_irq)
+ return -ENOMEM;
+
+ for (i = 1; i < size; i++)
+ cpr_corner_save(cpr_vreg, i);
return 0;
}
@@ -1053,13 +1056,13 @@
int rc, i;
rc = of_property_read_u32(of_node,
- "qti,cpr-uplift-voltage", &uplift_voltage);
+ "qcom,cpr-uplift-voltage", &uplift_voltage);
if (rc < 0) {
pr_err("cpr-uplift-voltage is missing, rc = %d", rc);
return rc;
}
rc = of_property_read_u32(of_node,
- "qti,cpr-uplift-max-volt", &uplift_max_volt);
+ "qcom,cpr-uplift-max-volt", &uplift_max_volt);
if (rc < 0) {
pr_err("cpr-uplift-max-volt is missing, rc = %d", rc);
return rc;
@@ -1081,11 +1084,11 @@
u64 efuse_bits;
int rc, process;
u32 pvs_fuse[4], pvs_fuse_redun_sel[5];
- u32 init_v;
+ u32 init_v, quot_adjust;
bool redundant;
size_t pvs_bins;
- rc = of_property_read_u32_array(of_node, "qti,pvs-fuse-redun-sel",
+ rc = of_property_read_u32_array(of_node, "qcom,pvs-fuse-redun-sel",
pvs_fuse_redun_sel, 5);
if (rc < 0) {
pr_err("pvs-fuse-redun-sel missing: rc=%d\n", rc);
@@ -1095,14 +1098,14 @@
redundant = cpr_fuse_is_setting_expected(cpr_vreg, pvs_fuse_redun_sel);
if (redundant) {
- rc = of_property_read_u32_array(of_node, "qti,pvs-fuse-redun",
+ rc = of_property_read_u32_array(of_node, "qcom,pvs-fuse-redun",
pvs_fuse, 4);
if (rc < 0) {
pr_err("pvs-fuse-redun missing: rc=%d\n", rc);
return rc;
}
} else {
- rc = of_property_read_u32_array(of_node, "qti,pvs-fuse",
+ rc = of_property_read_u32_array(of_node, "qcom,pvs-fuse",
pvs_fuse, 4);
if (rc < 0) {
pr_err("pvs-fuse missing: rc=%d\n", rc);
@@ -1118,7 +1121,7 @@
pvs_bins = 1 << pvs_fuse[2];
- rc = of_property_read_u32_array(of_node, "qti,pvs-init-voltage",
+ rc = of_property_read_u32_array(of_node, "qcom,pvs-init-voltage",
cpr_vreg->pvs_init_v, pvs_bins);
if (rc < 0) {
pr_err("pvs-init-voltage missing: rc=%d\n", rc);
@@ -1135,16 +1138,18 @@
init_v = cpr_vreg->pvs_init_v[cpr_vreg->pvs_bin];
for (process = NUM_APC_PVS - 1; process > APC_PVS_NO; process--) {
- if (init_v <= cpr_vreg->pvs_corner_v[process][CPR_CORNER_TURBO])
+ if (init_v <= cpr_vreg->pvs_corner_v
+ [process][CPR_FUSE_CORNER_TURBO])
break;
}
if (process == APC_PVS_NO) {
process = APC_PVS_SLOW;
- cpr_vreg->pvs_corner_v[process][CPR_CORNER_TURBO] = init_v;
+ cpr_vreg->pvs_corner_v[process][CPR_FUSE_CORNER_TURBO] = init_v;
cpr_vreg->ceiling_max = init_v;
} else if (process == APC_PVS_FAST &&
- init_v < cpr_vreg->pvs_corner_v[APC_PVS_FAST][CPR_CORNER_SVS]) {
+ init_v < cpr_vreg->pvs_corner_v
+ [APC_PVS_FAST][CPR_FUSE_CORNER_SVS]) {
process = APC_PVS_SLOW;
}
@@ -1152,10 +1157,15 @@
pvs_fuse[0], efuse_bits, pvs_fuse[2],
cpr_vreg->pvs_bin, process);
pr_info("pvs initial turbo voltage_= from %u to %u\n",
- init_v, cpr_vreg->pvs_corner_v[process][CPR_CORNER_TURBO]);
+ init_v, cpr_vreg->pvs_corner_v[process][CPR_FUSE_CORNER_TURBO]);
cpr_vreg->process = process;
+ rc = of_property_read_u32(of_node,
+ "qcom,cpr-quotient-adjustment", "_adjust);
+ if (!rc)
+ cpr_vreg->quotient_adjustment = quot_adjust;
+
return 0;
}
@@ -1163,7 +1173,7 @@
do { \
if (!rc) { \
rc = of_property_read_u32(of_node, \
- "qti," cpr_property, \
+ "qcom," cpr_property, \
cpr_config); \
if (rc) { \
pr_err("Missing " #cpr_property \
@@ -1200,14 +1210,14 @@
/* Parse dependency parameters */
if (cpr_vreg->vdd_mx) {
- rc = of_property_read_u32(of_node, "qti,vdd-mx-vmax",
+ rc = of_property_read_u32(of_node, "qcom,vdd-mx-vmax",
&cpr_vreg->vdd_mx_vmax);
if (rc < 0) {
pr_err("vdd-mx-vmax missing: rc=%d\n", rc);
return rc;
}
- rc = of_property_read_u32(of_node, "qti,vdd-mx-vmin-method",
+ rc = of_property_read_u32(of_node, "qcom,vdd-mx-vmin-method",
&cpr_vreg->vdd_mx_vmin_method);
if (rc < 0) {
pr_err("vdd-mx-vmin-method missing: rc=%d\n", rc);
@@ -1240,86 +1250,114 @@
int rc, i;
rc = of_property_read_u32_array(of_node,
- "qti,cpr-uplift-quotient", delta_quot, 3);
+ "qcom,cpr-uplift-quotient", delta_quot, 3);
if (rc < 0) {
pr_err("cpr-uplift-quotient is missing: %d", rc);
return rc;
}
- for (i = CPR_CORNER_SVS; i < CPR_CORNER_MAX; i++)
+ for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++)
cpr_vreg->cpr_fuse_target_quot[i] += delta_quot[i-1];
return rc;
}
-static int cpr_get_of_cprfreq_mappings(struct cpr_regulator *cpr_vreg,
+static int cpr_get_of_corner_mappings(struct cpr_regulator *cpr_vreg,
struct device *dev)
{
int rc = 0;
- int i, j, size, stripe_size, length;
+ int i, size, stripe_size;
struct property *prop;
u32 *tmp;
+ bool corners_mapped;
- prop = of_find_property(dev->of_node, "qti,cpr-quot-adjust-table",
- NULL);
+ prop = of_find_property(dev->of_node, "qcom,cpr-corner-map", NULL);
+
if (prop) {
size = prop->length / sizeof(u32);
+ corners_mapped = true;
+ } else {
+ size = CPR_FUSE_CORNER_MAX - 1;
+ corners_mapped = false;
+ }
+
+ cpr_vreg->corner_map = devm_kzalloc(dev, sizeof(int) * (size + 1),
+ GFP_KERNEL);
+ if (!cpr_vreg->corner_map) {
+ pr_err("Can't allocate cpr_vreg->corner_map memory\n");
+ return -ENOMEM;
+ }
+ cpr_vreg->num_corners = size;
+
+ if (!corners_mapped) {
+ for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++)
+ cpr_vreg->corner_map[i] = i;
+ } else {
+ rc = of_property_read_u32_array(dev->of_node,
+ "qcom,cpr-corner-map", &cpr_vreg->corner_map[1], size);
+
+ if (rc) {
+ pr_err("qcom,cpr-corner-map missing, rc = %d", rc);
+ return rc;
+ }
+ }
+
+ cpr_vreg->quot_adjust = devm_kzalloc(dev,
+ sizeof(int) * (cpr_vreg->num_corners + 1),
+ GFP_KERNEL);
+ if (!cpr_vreg->quot_adjust) {
+ pr_err("Can't allocate cpr_vreg->quot_adjust memory\n");
+ return -ENOMEM;
+ }
+
+ prop = of_find_property(dev->of_node, "qcom,cpr-quot-adjust-table",
+ NULL);
+
+ if (prop) {
+ if (!corners_mapped) {
+ pr_err("qcom,cpr-corner-map missing\n");
+ return -EINVAL;
+ }
+
+ size = prop->length / sizeof(u32);
tmp = kzalloc(sizeof(u32) * size, GFP_KERNEL);
if (!tmp)
return -ENOMEM;
rc = of_property_read_u32_array(dev->of_node,
- "qti,cpr-quot-adjust-table", tmp, size);
+ "qcom,cpr-quot-adjust-table", tmp, size);
if (rc) {
- pr_err("qti,cpr-quot-adjust-table missing, rc = %d",
+ pr_err("qcom,cpr-quot-adjust-table missing, rc = %d",
rc);
kfree(tmp);
return rc;
}
- length = 0;
- stripe_size = 1 + sizeof(struct cpufreq_mapping_info) /
- sizeof(int);
- for (i = 0; i < size; i += stripe_size) {
- if (tmp[i] == cpr_vreg->speed_bin)
- length++;
- }
- if (i != size) {
- pr_err("qti,cpr-quot-adjust-table data is not correct\n");
+ stripe_size = sizeof(struct quot_adjust_info) / sizeof(int);
+
+ if ((size % stripe_size) != 0) {
+ pr_err("qcom,cpr-quot-adjust-table data is not correct");
kfree(tmp);
return -EINVAL;
}
- cpr_vreg->cpufreq_mapping_size = length;
- if (length) {
- cpr_vreg->cpufreq_mapping = devm_kzalloc(dev,
- sizeof(struct cpufreq_mapping_info) * length,
- GFP_KERNEL);
-
- if (!cpr_vreg->cpufreq_mapping) {
- kfree(tmp);
- return -ENOMEM;
- }
-
- cpr_vreg->flags |= FLAGS_QUOT_ADJUST_WITH_FREQ;
-
- for (i = 0, j = 0; i < size; i += stripe_size) {
- if (tmp[i] == cpr_vreg->speed_bin) {
- cpr_vreg->cpufreq_mapping[j].freq =
- tmp[i+1];
- cpr_vreg->cpufreq_mapping[j].quot_adjust
- = tmp[i+2];
- cpr_vreg->cpufreq_mapping[j].corner =
- tmp[i+3];
- ++j;
+ for (i = 0; i < size; i += stripe_size) {
+ if (tmp[i] == cpr_vreg->speed_bin) {
+ if (tmp[i + 1] >= 1 &&
+ tmp[i + 1] <=
+ cpr_vreg->num_corners) {
+ cpr_vreg->quot_adjust[tmp[i + 1]] =
+ tmp[i + 2];
+ } else {
+ pr_err("qcom,cpr-quot-adjust-table data is not correct");
+ kfree(tmp);
+ return -EINVAL;
}
-
}
-
}
kfree(tmp);
}
- return rc;
+ return 0;
}
static int __devinit cpr_init_cpr_efuse(struct platform_device *pdev,
@@ -1332,12 +1370,12 @@
char *targ_quot_str, *ro_sel_str;
u32 cpr_fuse_row[2];
u32 bp_cpr_disable, bp_scheme;
- int bp_target_quot[CPR_CORNER_MAX];
- int bp_ro_sel[CPR_CORNER_MAX];
+ int bp_target_quot[CPR_FUSE_CORNER_MAX];
+ int bp_ro_sel[CPR_FUSE_CORNER_MAX];
u32 ro_sel, val;
u64 fuse_bits, fuse_bits_2;
- rc = of_property_read_u32_array(of_node, "qti,cpr-fuse-redun-sel",
+ rc = of_property_read_u32_array(of_node, "qcom,cpr-fuse-redun-sel",
cpr_fuse_redun_sel, 5);
if (rc < 0) {
pr_err("cpr-fuse-redun-sel missing: rc=%d\n", rc);
@@ -1348,24 +1386,24 @@
if (redundant) {
rc = of_property_read_u32_array(of_node,
- "qti,cpr-fuse-redun-row",
+ "qcom,cpr-fuse-redun-row",
cpr_fuse_row, 2);
- targ_quot_str = "qti,cpr-fuse-redun-target-quot";
- ro_sel_str = "qti,cpr-fuse-redun-ro-sel";
+ targ_quot_str = "qcom,cpr-fuse-redun-target-quot";
+ ro_sel_str = "qcom,cpr-fuse-redun-ro-sel";
} else {
rc = of_property_read_u32_array(of_node,
- "qti,cpr-fuse-row",
+ "qcom,cpr-fuse-row",
cpr_fuse_row, 2);
- targ_quot_str = "qti,cpr-fuse-target-quot";
- ro_sel_str = "qti,cpr-fuse-ro-sel";
+ targ_quot_str = "qcom,cpr-fuse-target-quot";
+ ro_sel_str = "qcom,cpr-fuse-ro-sel";
}
if (rc)
return rc;
rc = of_property_read_u32_array(of_node,
targ_quot_str,
- &bp_target_quot[CPR_CORNER_SVS],
- CPR_CORNER_MAX - CPR_CORNER_SVS);
+ &bp_target_quot[CPR_FUSE_CORNER_SVS],
+ CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
if (rc < 0) {
pr_err("missing %s: rc=%d\n", targ_quot_str, rc);
return rc;
@@ -1373,8 +1411,8 @@
rc = of_property_read_u32_array(of_node,
ro_sel_str,
- &bp_ro_sel[CPR_CORNER_SVS],
- CPR_CORNER_MAX - CPR_CORNER_SVS);
+ &bp_ro_sel[CPR_FUSE_CORNER_SVS],
+ CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
if (rc < 0) {
pr_err("missing %s: rc=%d\n", ro_sel_str, rc);
return rc;
@@ -1387,7 +1425,7 @@
if (redundant) {
if (of_property_read_bool(of_node,
- "qti,cpr-fuse-redun-bp-cpr-disable")) {
+ "qcom,cpr-fuse-redun-bp-cpr-disable")) {
CPR_PROP_READ_U32(of_node,
"cpr-fuse-redun-bp-cpr-disable",
&bp_cpr_disable, rc);
@@ -1406,7 +1444,7 @@
CPR_PROP_READ_U32(of_node, "cpr-fuse-bp-scheme",
&bp_scheme, rc);
rc = of_property_read_u32_array(of_node,
- "qti,cpr-fuse-row",
+ "qcom,cpr-fuse-row",
temp_row, 2);
if (rc)
return rc;
@@ -1432,11 +1470,12 @@
pr_info("disable = %d, local = %d\n",
cpr_vreg->cpr_fuse_disable, cpr_vreg->cpr_fuse_local);
- for (i = CPR_CORNER_SVS; i < CPR_CORNER_MAX; i++) {
+ for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++) {
ro_sel = (fuse_bits >> bp_ro_sel[i])
& CPR_FUSE_RO_SEL_BITS_MASK;
val = (fuse_bits >> bp_target_quot[i])
& CPR_FUSE_TARGET_QUOT_BITS_MASK;
+ val += cpr_vreg->quotient_adjustment;
cpr_vreg->cpr_fuse_target_quot[i] = val;
cpr_vreg->cpr_fuse_ro_sel[i] = ro_sel;
pr_info("Corner[%d]: ro_sel = %d, target quot = %d\n",
@@ -1445,18 +1484,13 @@
if (cpr_vreg->flags & FLAGS_UPLIFT_QUOT_VOLT) {
cpr_voltage_uplift_wa_inc_quot(cpr_vreg, of_node);
- for (i = CPR_CORNER_SVS; i < CPR_CORNER_MAX; i++) {
+ for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++) {
pr_info("Corner[%d]: uplifted target quot = %d\n",
i, cpr_vreg->cpr_fuse_target_quot[i]);
}
}
- for (i = CPR_CORNER_SVS; i < CPR_CORNER_MAX; i++) {
- cpr_vreg->cpr_fuse_original_quot[i] =
- cpr_vreg->cpr_fuse_target_quot[i];
- }
-
- rc = cpr_get_of_cprfreq_mappings(cpr_vreg, &pdev->dev);
+ rc = cpr_get_of_corner_mappings(cpr_vreg, &pdev->dev);
if (rc)
return rc;
@@ -1469,10 +1503,12 @@
int *quot = cpr_vreg->cpr_fuse_target_quot;
bool valid_fuse = true;
- if ((quot[CPR_CORNER_TURBO] > quot[CPR_CORNER_NORMAL]) &&
- (quot[CPR_CORNER_NORMAL] > quot[CPR_CORNER_SVS])) {
- if ((quot[CPR_CORNER_TURBO] -
- quot[CPR_CORNER_NORMAL])
+ if ((quot[CPR_FUSE_CORNER_TURBO] >
+ quot[CPR_FUSE_CORNER_NORMAL]) &&
+ (quot[CPR_FUSE_CORNER_NORMAL] >
+ quot[CPR_FUSE_CORNER_SVS])) {
+ if ((quot[CPR_FUSE_CORNER_TURBO] -
+ quot[CPR_FUSE_CORNER_NORMAL])
<= CPR_FUSE_MIN_QUOT_DIFF)
valid_fuse = false;
} else {
@@ -1488,18 +1524,27 @@
return 0;
}
-static int __devinit cpr_init_cpr_voltages(struct cpr_regulator *cpr_vreg)
+static int __devinit cpr_init_cpr_voltages(struct cpr_regulator *cpr_vreg,
+ struct device *dev)
{
int i;
+ int size = cpr_vreg->num_corners + 1;
+
+ cpr_vreg->last_volt = devm_kzalloc(dev, sizeof(int) * size, GFP_KERNEL);
+ if (!cpr_vreg->last_volt)
+ return -EINVAL;
/* Construct CPR voltage limits */
- for (i = CPR_CORNER_SVS; i < CPR_CORNER_MAX; i++) {
+ for (i = CPR_FUSE_CORNER_SVS; i < CPR_FUSE_CORNER_MAX; i++) {
cpr_vreg->floor_volt[i] =
cpr_vreg->pvs_corner_v[APC_PVS_FAST][i];
cpr_vreg->ceiling_volt[i] =
cpr_vreg->pvs_corner_v[APC_PVS_SLOW][i];
- cpr_vreg->last_volt[i] =
- cpr_vreg->pvs_corner_v[cpr_vreg->process][i];
+ }
+
+ for (i = 1; i < size; i++) {
+ cpr_vreg->last_volt[i] = cpr_vreg->pvs_corner_v
+ [cpr_vreg->process][cpr_vreg->corner_map[i]];
}
return 0;
@@ -1565,7 +1610,7 @@
return rc;
/* Init module parameter with the DT value */
- cpr_vreg->enable = of_property_read_bool(of_node, "qti,cpr-enable");
+ cpr_vreg->enable = of_property_read_bool(of_node, "qcom,cpr-enable");
cpr_enable = (int) cpr_vreg->enable;
pr_info("CPR is %s by default.\n",
cpr_vreg->enable ? "enabled" : "disabled");
@@ -1599,7 +1644,9 @@
resource_size(res));
/* Init all voltage set points of APC regulator for CPR */
- cpr_init_cpr_voltages(cpr_vreg);
+ rc = cpr_init_cpr_voltages(cpr_vreg, &pdev->dev);
+ if (rc)
+ return rc;
/* Init CPR configuration parameters */
rc = cpr_init_cpr_parameters(pdev, cpr_vreg);
@@ -1614,7 +1661,7 @@
}
/* Configure CPR HW but keep it disabled */
- rc = cpr_config(cpr_vreg);
+ rc = cpr_config(cpr_vreg, &pdev->dev);
if (rc)
return rc;
@@ -1668,12 +1715,12 @@
u32 fuse_sel[5];
/*
* Restrict all pvs corner voltages to a minimum value of
- * qti,cpr-cond-min-voltage if the fuse defined in
- * qti,cpr-fuse-cond-min-volt-sel does not read back with
+ * qcom,cpr-cond-min-voltage if the fuse defined in
+ * qcom,cpr-fuse-cond-min-volt-sel does not read back with
* the expected value.
*/
rc = of_property_read_u32_array(of_node,
- "qti,cpr-fuse-cond-min-volt-sel", fuse_sel, 5);
+ "qcom,cpr-fuse-cond-min-volt-sel", fuse_sel, 5);
if (!rc) {
if (!cpr_fuse_is_setting_expected(cpr_vreg, fuse_sel))
cpr_vreg->flags |= FLAGS_SET_MIN_VOLTAGE;
@@ -1689,7 +1736,7 @@
u32 speed_bits;
rc = of_property_read_u32_array(of_node,
- "qti,speed-bin-fuse-sel", fuse_sel, 4);
+ "qcom,speed-bin-fuse-sel", fuse_sel, 4);
if (!rc) {
fuse_bits = cpr_read_efuse_row(cpr_vreg,
@@ -1712,13 +1759,13 @@
u32 uplift_speed_bin;
rc = of_property_read_u32_array(of_node,
- "qti,cpr-fuse-uplift-sel", fuse_sel, 5);
+ "qcom,cpr-fuse-uplift-sel", fuse_sel, 5);
if (!rc) {
rc = of_property_read_u32(of_node,
- "qti,cpr-uplift-speed-bin",
+ "qcom,cpr-uplift-speed-bin",
&uplift_speed_bin);
if (rc < 0) {
- pr_err("qti,cpr-uplift-speed-bin missing\n");
+ pr_err("qcom,cpr-uplift-speed-bin missing\n");
return rc;
}
if (cpr_fuse_is_setting_expected(cpr_vreg, fuse_sel)
@@ -1738,27 +1785,27 @@
u32 min_uv = 0;
rc = of_property_read_u32_array(of_node,
- "qti,pvs-corner-ceiling-slow",
- &cpr_vreg->pvs_corner_v[APC_PVS_SLOW][CPR_CORNER_SVS],
- CPR_CORNER_MAX - CPR_CORNER_SVS);
+ "qcom,pvs-corner-ceiling-slow",
+ &cpr_vreg->pvs_corner_v[APC_PVS_SLOW][CPR_FUSE_CORNER_SVS],
+ CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
if (rc < 0) {
pr_err("pvs-corner-ceiling-slow missing: rc=%d\n", rc);
return rc;
}
rc = of_property_read_u32_array(of_node,
- "qti,pvs-corner-ceiling-nom",
- &cpr_vreg->pvs_corner_v[APC_PVS_NOM][CPR_CORNER_SVS],
- CPR_CORNER_MAX - CPR_CORNER_SVS);
+ "qcom,pvs-corner-ceiling-nom",
+ &cpr_vreg->pvs_corner_v[APC_PVS_NOM][CPR_FUSE_CORNER_SVS],
+ CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
if (rc < 0) {
pr_err("pvs-corner-ceiling-norm missing: rc=%d\n", rc);
return rc;
}
rc = of_property_read_u32_array(of_node,
- "qti,pvs-corner-ceiling-fast",
- &cpr_vreg->pvs_corner_v[APC_PVS_FAST][CPR_CORNER_SVS],
- CPR_CORNER_MAX - CPR_CORNER_SVS);
+ "qcom,pvs-corner-ceiling-fast",
+ &cpr_vreg->pvs_corner_v[APC_PVS_FAST][CPR_FUSE_CORNER_SVS],
+ CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS);
if (rc < 0) {
pr_err("pvs-corner-ceiling-fast missing: rc=%d\n", rc);
return rc;
@@ -1772,73 +1819,29 @@
return rc;
}
if (cpr_vreg->flags & FLAGS_SET_MIN_VOLTAGE) {
- of_property_read_u32(of_node, "qti,cpr-cond-min-voltage",
+ of_property_read_u32(of_node, "qcom,cpr-cond-min-voltage",
&min_uv);
for (i = APC_PVS_SLOW; i < NUM_APC_PVS; i++)
- for (j = CPR_CORNER_SVS; j < CPR_CORNER_MAX; j++)
+ for (j = CPR_FUSE_CORNER_SVS; j < CPR_FUSE_CORNER_MAX;
+ j++)
if (cpr_vreg->pvs_corner_v[i][j] < min_uv)
cpr_vreg->pvs_corner_v[i][j] = min_uv;
}
/* Set ceiling max and use it for APC_PVS_NO */
cpr_vreg->ceiling_max =
- cpr_vreg->pvs_corner_v[APC_PVS_SLOW][CPR_CORNER_TURBO];
+ cpr_vreg->pvs_corner_v[APC_PVS_SLOW][CPR_FUSE_CORNER_TURBO];
for (i = APC_PVS_SLOW; i < NUM_APC_PVS; i++) {
pr_info("[%d] [%d %d %d] uV\n", i,
- cpr_vreg->pvs_corner_v[i][CPR_CORNER_SVS],
- cpr_vreg->pvs_corner_v[i][CPR_CORNER_NORMAL],
- cpr_vreg->pvs_corner_v[i][CPR_CORNER_TURBO]);
+ cpr_vreg->pvs_corner_v[i][CPR_FUSE_CORNER_SVS],
+ cpr_vreg->pvs_corner_v[i][CPR_FUSE_CORNER_NORMAL],
+ cpr_vreg->pvs_corner_v[i][CPR_FUSE_CORNER_TURBO]);
}
return 0;
}
-static int cpr_freq_transition(struct notifier_block *nb, unsigned long val,
- void *data)
-{
- int old_corner, new_corner;
- struct cpr_regulator *cpr_vreg = container_of(nb, struct cpr_regulator,
- freq_transition);
- struct cpufreq_freqs *freqs = data;
-
- mutex_lock(&cpr_vreg->cpr_mutex);
- switch (val) {
- case CPUFREQ_PRECHANGE:
- cpr_vreg->freq = freqs->new;
- if (freqs->new > freqs->old) {
- old_corner = cpr_get_freq_corner(cpr_vreg, freqs->old);
- new_corner = cpr_get_freq_corner(cpr_vreg, freqs->new);
- if (new_corner > 0 && old_corner == new_corner &&
- cpr_ctl_is_enabled(cpr_vreg)) {
- cpr_ctl_disable(cpr_vreg);
- cpr_irq_clr(cpr_vreg);
- cpr_corner_restore(cpr_vreg, new_corner);
- cpr_ctl_enable(cpr_vreg, new_corner);
- }
- }
- break;
- case CPUFREQ_POSTCHANGE:
- if (freqs->new < freqs->old) {
- old_corner = cpr_get_freq_corner(cpr_vreg, freqs->old);
- new_corner = cpr_get_freq_corner(cpr_vreg, freqs->new);
- if (new_corner > 0 && old_corner == new_corner &&
- cpr_ctl_is_enabled(cpr_vreg)) {
- cpr_ctl_disable(cpr_vreg);
- cpr_irq_clr(cpr_vreg);
- cpr_corner_restore(cpr_vreg, new_corner);
- cpr_ctl_enable(cpr_vreg, new_corner);
- }
- }
- break;
- default:
- break;
- }
- mutex_unlock(&cpr_vreg->cpr_mutex);
-
- return NOTIFY_OK;
-}
-
static int __devinit cpr_regulator_probe(struct platform_device *pdev)
{
struct cpr_regulator *cpr_vreg;
@@ -1922,10 +1925,6 @@
platform_set_drvdata(pdev, cpr_vreg);
the_cpr = cpr_vreg;
- cpr_vreg->freq_transition.notifier_call = cpr_freq_transition;
- if (cpr_vreg->flags & FLAGS_QUOT_ADJUST_WITH_FREQ)
- cpufreq_register_notifier(&cpr_vreg->freq_transition,
- CPUFREQ_TRANSITION_NOTIFIER);
return 0;
@@ -1946,9 +1945,6 @@
cpr_irq_set(cpr_vreg, 0);
}
- if (cpr_vreg->flags & FLAGS_QUOT_ADJUST_WITH_FREQ)
- cpufreq_unregister_notifier(&cpr_vreg->freq_transition,
- CPUFREQ_TRANSITION_NOTIFIER);
cpr_apc_exit(cpr_vreg);
regulator_unregister(cpr_vreg->rdev);
}
diff --git a/arch/arm/mach-msm/cpubw-krait.c b/arch/arm/mach-msm/cpubw-krait.c
deleted file mode 100644
index 4108754..0000000
--- a/arch/arm/mach-msm/cpubw-krait.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt) "cpubw-krait: " fmt
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/delay.h>
-#include <linux/ktime.h>
-#include <linux/time.h>
-#include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/mutex.h>
-#include <linux/interrupt.h>
-#include <trace/events/power.h>
-#include <mach/msm_bus.h>
-#include <mach/msm_bus_board.h>
-
-#include <mach/msm-krait-l2-accessors.h>
-
-#define L2PMRESR2 0x412
-#define L2PMCR 0x400
-#define L2PMCNTENCLR 0x402
-#define L2PMCNTENSET 0x403
-#define L2PMINTENCLR 0x404
-#define L2PMINTENSET 0x405
-#define L2PMOVSR 0x406
-#define L2PMOVSSET 0x407
-#define L2PMnEVCNTCR(n) (0x420 + n * 0x10)
-#define L2PMnEVCNTR(n) (0x421 + n * 0x10)
-#define L2PMnEVCNTSR(n) (0x422 + n * 0x10)
-#define L2PMnEVFILTER(n) (0x423 + n * 0x10)
-#define L2PMnEVTYPER(n) (0x424 + n * 0x10)
-#define MON_INT 33
-
-#define MBYTE (1 << 20)
-
-#define BW(_bw) \
- { \
- .vectors = (struct msm_bus_vectors[]){ \
- {\
- .src = MSM_BUS_MASTER_AMPSS_M0, \
- .dst = MSM_BUS_SLAVE_EBI_CH0, \
- }, \
- { \
- .src = MSM_BUS_MASTER_AMPSS_M1, \
- .dst = MSM_BUS_SLAVE_EBI_CH0, \
- }, \
- }, \
- .num_paths = 2, \
- }
-
-/* Has to be a power of 2 to work correctly */
-static unsigned int bytes_per_beat = 8;
-module_param(bytes_per_beat, uint, 0644);
-
-static unsigned int sample_ms = 50;
-module_param(sample_ms, uint, 0644);
-
-static unsigned int tolerance_percent = 10;
-module_param(tolerance_percent, uint, 0644);
-
-static unsigned int guard_band_mbps = 100;
-module_param(guard_band_mbps, uint, 0644);
-
-static unsigned int decay_rate = 90;
-module_param(decay_rate, uint, 0644);
-
-static unsigned int io_percent = 15;
-module_param(io_percent, uint, 0644);
-
-static unsigned int bw_step = 200;
-module_param(bw_step, uint, 0644);
-
-static struct kernel_param_ops enable_ops;
-static bool enable;
-module_param_cb(enable, &enable_ops, &enable, S_IRUGO | S_IWUSR);
-
-static void mon_init(void)
-{
- /* Set up counters 0/1 to count write/read beats */
- set_l2_indirect_reg(L2PMRESR2, 0x8B0B0000);
- set_l2_indirect_reg(L2PMnEVCNTCR(0), 0x0);
- set_l2_indirect_reg(L2PMnEVCNTCR(1), 0x0);
- set_l2_indirect_reg(L2PMnEVCNTR(0), 0xFFFFFFFF);
- set_l2_indirect_reg(L2PMnEVCNTR(1), 0xFFFFFFFF);
- set_l2_indirect_reg(L2PMnEVFILTER(0), 0xF003F);
- set_l2_indirect_reg(L2PMnEVFILTER(1), 0xF003F);
- set_l2_indirect_reg(L2PMnEVTYPER(0), 0xA);
- set_l2_indirect_reg(L2PMnEVTYPER(1), 0xB);
-}
-
-static void global_mon_enable(bool en)
-{
- u32 regval;
-
- /* Global counter enable */
- regval = get_l2_indirect_reg(L2PMCR);
- if (en)
- regval |= BIT(0);
- else
- regval &= ~BIT(0);
- set_l2_indirect_reg(L2PMCR, regval);
-}
-
-static void mon_enable(int n)
-{
- /* Clear previous overflow state for event counter n */
- set_l2_indirect_reg(L2PMOVSR, BIT(n));
-
- /* Enable event counter n */
- set_l2_indirect_reg(L2PMCNTENSET, BIT(n));
-}
-
-static void mon_disable(int n)
-{
- /* Disable event counter n */
- set_l2_indirect_reg(L2PMCNTENCLR, BIT(n));
-}
-
-/* Returns start counter value to be used with mon_get_mbps() */
-static u32 mon_set_limit_mbyte(int n, unsigned int mbytes)
-{
- u32 regval, beats;
-
- beats = mult_frac(mbytes, MBYTE, bytes_per_beat);
- regval = 0xFFFFFFFF - beats;
- set_l2_indirect_reg(L2PMnEVCNTR(n), regval);
- pr_debug("EV%d MB: %d, start val: %x\n", n, mbytes, regval);
-
- return regval;
-}
-
-/* Returns MBps of read/writes for the sampling window. */
-static int mon_get_mbps(int n, u32 start_val, unsigned int us)
-{
- u32 overflow, count;
- long long beats;
-
- count = get_l2_indirect_reg(L2PMnEVCNTR(n));
- overflow = get_l2_indirect_reg(L2PMOVSR);
-
- if (overflow & BIT(n))
- beats = 0xFFFFFFFF - start_val + count;
- else
- beats = count - start_val;
-
- beats *= USEC_PER_SEC;
- beats *= bytes_per_beat;
- do_div(beats, us);
- beats = DIV_ROUND_UP_ULL(beats, MBYTE);
-
- pr_debug("EV%d ov: %x, cnt: %x\n", n, overflow, count);
-
- return beats;
-}
-
-static void do_bw_sample(struct work_struct *work);
-static DECLARE_DEFERRED_WORK(bw_sample, do_bw_sample);
-static struct workqueue_struct *bw_sample_wq;
-
-static DEFINE_MUTEX(bw_lock);
-static ktime_t prev_ts;
-static u32 prev_r_start_val;
-static u32 prev_w_start_val;
-
-static struct msm_bus_paths bw_levels[] = {
- BW(0), BW(200),
-};
-static struct msm_bus_scale_pdata bw_data = {
- .usecase = bw_levels,
- .num_usecases = ARRAY_SIZE(bw_levels),
- .name = "cpubw-krait",
- .active_only = 1,
-};
-static u32 bus_client;
-static void compute_bw(int mbps);
-static irqreturn_t mon_intr_handler(int irq, void *dev_id);
-
-#define START_LIMIT 100 /* MBps */
-static int start_monitoring(void)
-{
- int mb_limit;
- int ret;
-
- ret = request_threaded_irq(MON_INT, NULL, mon_intr_handler,
- IRQF_ONESHOT | IRQF_SHARED | IRQF_TRIGGER_RISING,
- "cpubw_krait", mon_intr_handler);
- if (ret) {
- pr_err("Unable to register interrupt handler\n");
- return ret;
- }
-
- bw_sample_wq = alloc_workqueue("cpubw-krait", WQ_HIGHPRI, 0);
- if (!bw_sample_wq) {
- pr_err("Unable to alloc workqueue\n");
- ret = -ENOMEM;
- goto alloc_wq_fail;
- }
-
- bus_client = msm_bus_scale_register_client(&bw_data);
- if (!bus_client) {
- pr_err("Unable to register bus client\n");
- ret = -ENODEV;
- goto bus_reg_fail;
- }
-
- compute_bw(START_LIMIT);
-
- mon_init();
- mon_disable(0);
- mon_disable(1);
-
- mb_limit = mult_frac(START_LIMIT, sample_ms, MSEC_PER_SEC);
- mb_limit /= 2;
-
- prev_r_start_val = mon_set_limit_mbyte(0, mb_limit);
- prev_w_start_val = mon_set_limit_mbyte(1, mb_limit);
-
- prev_ts = ktime_get();
-
- set_l2_indirect_reg(L2PMINTENSET, BIT(0));
- set_l2_indirect_reg(L2PMINTENSET, BIT(1));
- mon_enable(0);
- mon_enable(1);
- global_mon_enable(true);
-
- queue_delayed_work(bw_sample_wq, &bw_sample,
- msecs_to_jiffies(sample_ms));
-
- return 0;
-
-bus_reg_fail:
- destroy_workqueue(bw_sample_wq);
-alloc_wq_fail:
- disable_irq(MON_INT);
- free_irq(MON_INT, mon_intr_handler);
- return ret;
-}
-
-static void stop_monitoring(void)
-{
- global_mon_enable(false);
- mon_disable(0);
- mon_disable(1);
- set_l2_indirect_reg(L2PMINTENCLR, BIT(0));
- set_l2_indirect_reg(L2PMINTENCLR, BIT(1));
-
- disable_irq(MON_INT);
- free_irq(MON_INT, mon_intr_handler);
-
- cancel_delayed_work_sync(&bw_sample);
- destroy_workqueue(bw_sample_wq);
-
- bw_levels[0].vectors[0].ib = 0;
- bw_levels[0].vectors[0].ab = 0;
- bw_levels[0].vectors[1].ib = 0;
- bw_levels[0].vectors[1].ab = 0;
-
- bw_levels[1].vectors[0].ib = 0;
- bw_levels[1].vectors[0].ab = 0;
- bw_levels[1].vectors[1].ib = 0;
- bw_levels[1].vectors[1].ab = 0;
- msm_bus_scale_unregister_client(bus_client);
-}
-
-static void set_bw(int mbps)
-{
- static int cur_idx, cur_ab, cur_ib;
- int new_ab, new_ib;
- int i, ret;
-
- if (!io_percent)
- io_percent = 1;
- new_ab = roundup(mbps, bw_step);
- new_ib = mbps * 100 / io_percent;
- new_ib = roundup(new_ib, bw_step);
-
- if (cur_ib == new_ib && cur_ab == new_ab)
- return;
-
- i = (cur_idx + 1) % ARRAY_SIZE(bw_levels);
-
- bw_levels[i].vectors[0].ib = new_ib * 1000000ULL;
- bw_levels[i].vectors[0].ab = new_ab * 1000000ULL;
- bw_levels[i].vectors[1].ib = new_ib * 1000000ULL;
- bw_levels[i].vectors[1].ab = new_ab * 1000000ULL;
-
- pr_debug("BW MBps: Req: %d AB: %d IB: %d\n", mbps, new_ab, new_ib);
-
- ret = msm_bus_scale_client_update_request(bus_client, i);
- if (ret)
- pr_err("bandwidth request failed (%d)\n", ret);
- else {
- cur_idx = i;
- cur_ib = new_ib;
- cur_ab = new_ab;
- }
-}
-
-static void compute_bw(int mbps)
-{
- static int cur_bw;
- int new_bw;
-
- mbps += guard_band_mbps;
-
- if (mbps > cur_bw) {
- new_bw = mbps;
- } else {
- new_bw = mbps * decay_rate + cur_bw * (100 - decay_rate);
- new_bw /= 100;
- }
-
- if (new_bw == cur_bw)
- return;
-
- set_bw(new_bw);
- cur_bw = new_bw;
-}
-
-static int to_limit(int mbps)
-{
- mbps *= (100 + tolerance_percent) * sample_ms;
- mbps /= 100;
- mbps = DIV_ROUND_UP(mbps, MSEC_PER_SEC);
- return mbps;
-}
-
-static void measure_bw(void)
-{
- int r_mbps, w_mbps, mbps;
- ktime_t ts;
- unsigned int us;
-
- mutex_lock(&bw_lock);
-
- /*
- * Since we are stopping the counters, we don't want this short work
- * to be interrupted by other tasks and cause the measurements to be
- * wrong. Not blocking interrupts to avoid affecting interrupt
- * latency and since they should be short anyway because they run in
- * atomic context.
- */
- preempt_disable();
-
- ts = ktime_get();
- us = ktime_to_us(ktime_sub(ts, prev_ts));
- if (!us)
- us = 1;
-
- mon_disable(0);
- mon_disable(1);
-
- r_mbps = mon_get_mbps(0, prev_r_start_val, us);
- w_mbps = mon_get_mbps(1, prev_w_start_val, us);
-
- prev_r_start_val = mon_set_limit_mbyte(0, to_limit(r_mbps));
- prev_w_start_val = mon_set_limit_mbyte(1, to_limit(w_mbps));
-
- mon_enable(0);
- mon_enable(1);
-
- preempt_enable();
-
- mbps = r_mbps + w_mbps;
- pr_debug("R/W/BW/us = %d/%d/%d/%d\n", r_mbps, w_mbps, mbps, us);
- compute_bw(mbps);
-
- prev_ts = ts;
- mutex_unlock(&bw_lock);
-}
-
-static void do_bw_sample(struct work_struct *work)
-{
- measure_bw();
- queue_delayed_work(bw_sample_wq, &bw_sample,
- msecs_to_jiffies(sample_ms));
-}
-
-static irqreturn_t mon_intr_handler(int irq, void *dev_id)
-{
- bool pending;
- u32 regval;
-
- regval = get_l2_indirect_reg(L2PMOVSR);
- pr_debug("Got interrupt: %x\n", regval);
-
- pending = cancel_delayed_work_sync(&bw_sample);
-
- /*
- * Don't recalc bandwidth if the interrupt came just after the end
- * of the sample period (!pending). This is done for two reasons:
- *
- * 1. Sampling the BW during a very short duration can result in a
- * very inaccurate measurement due to very short bursts.
- * 2. If the limit was hit very close to the sample period, then the
- * current BW estimate is not very off and can stay as such.
- */
- if (pending)
- measure_bw();
-
- queue_delayed_work(bw_sample_wq, &bw_sample,
- msecs_to_jiffies(sample_ms));
-
- return IRQ_HANDLED;
-}
-
-static int set_enable(const char *arg, const struct kernel_param *kp)
-{
- int ret;
- bool old_val = *((bool *) kp->arg);
- bool new_val;
-
- if (!arg)
- arg = "1";
- ret = strtobool(arg, &new_val);
- if (ret)
- return ret;
-
- if (!old_val && new_val) {
- if (start_monitoring()) {
- pr_err("L2PM counters already in use.\n");
- return ret;
- } else {
- pr_info("Enabling CPU BW monitoring\n");
- }
- } else if (old_val && !new_val) {
- pr_info("Disabling CPU BW monitoring\n");
- stop_monitoring();
- }
-
- *(bool *) kp->arg = new_val;
- return 0;
-}
-
-static struct kernel_param_ops enable_ops = {
- .set = set_enable,
- .get = param_get_bool,
-};
-
-static int cpubw_krait_init(void)
-{
- bw_sample_wq = alloc_workqueue("cpubw-krait", WQ_HIGHPRI, 0);
- if (!bw_sample_wq)
- return -ENOMEM;
-
- bus_client = msm_bus_scale_register_client(&bw_data);
- if (!bus_client) {
- pr_err("Unable to register bus client\n");
- destroy_workqueue(bw_sample_wq);
- return -ENODEV;
- }
-
- return 0;
-}
-late_initcall(cpubw_krait_init);
-
-MODULE_DESCRIPTION("CPU DDR bandwidth voting driver for Krait CPUs");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/cpufreq.c b/arch/arm/mach-msm/cpufreq.c
index 60856c2..0978a2d 100644
--- a/arch/arm/mach-msm/cpufreq.c
+++ b/arch/arm/mach-msm/cpufreq.c
@@ -32,7 +32,7 @@
#include <linux/platform_device.h>
#include <trace/events/power.h>
#include <mach/socinfo.h>
-#include <mach/msm_bus.h>
+#include <mach/cpufreq.h>
#include "acpuclock.h"
@@ -47,16 +47,12 @@
static struct clk *cpu_clk[NR_CPUS];
static struct clk *l2_clk;
static unsigned int freq_index[NR_CPUS];
+static unsigned int max_freq_index;
static struct cpufreq_frequency_table *freq_table;
static unsigned int *l2_khz;
static bool is_clk;
static bool is_sync;
-static struct msm_bus_vectors *bus_vec_lst;
-static struct msm_bus_scale_pdata bus_bw = {
- .name = "msm-cpufreq",
- .active_only = 1,
-};
-static u32 bus_client;
+static unsigned long *mem_bw;
struct cpufreq_work_struct {
struct work_struct work;
@@ -77,6 +73,11 @@
static DEFINE_PER_CPU(struct cpufreq_suspend_t, cpufreq_suspend);
+unsigned long msm_cpufreq_get_bw(void)
+{
+ return mem_bw[max_freq_index];
+}
+
static void update_l2_bw(int *also_cpu)
{
int rc = 0, cpu;
@@ -98,10 +99,10 @@
goto out;
}
- if (bus_client)
- rc = msm_bus_scale_client_update_request(bus_client, index);
+ max_freq_index = index;
+ rc = devfreq_msm_cpufreq_update_bw();
if (rc)
- pr_err("Bandwidth req failed (%d)\n", rc);
+ pr_err("Unable to update BW (%d)\n", rc);
out:
mutex_unlock(&l2bw_lock);
@@ -397,33 +398,14 @@
};
#define PROP_TBL "qcom,cpufreq-table"
-#define PROP_PORTS "qcom,cpu-mem-ports"
static int cpufreq_parse_dt(struct device *dev)
{
- int ret, len, nf, num_cols = 1, num_paths = 0, i, j, k;
- u32 *data, *ports = NULL;
- struct msm_bus_vectors *v = NULL;
+ int ret, len, nf, num_cols = 2, i, j;
+ u32 *data;
if (l2_clk)
num_cols++;
- /* Parse optional bus ports parameter */
- if (of_find_property(dev->of_node, PROP_PORTS, &len)) {
- len /= sizeof(*ports);
- if (len % 2)
- return -EINVAL;
-
- ports = devm_kzalloc(dev, len * sizeof(*ports), GFP_KERNEL);
- if (!ports)
- return -ENOMEM;
- ret = of_property_read_u32_array(dev->of_node, PROP_PORTS,
- ports, len);
- if (ret)
- return ret;
- num_paths = len / 2;
- num_cols++;
- }
-
/* Parse CPU freq -> L2/Mem BW map table. */
if (!of_find_property(dev->of_node, PROP_TBL, &len))
return -EINVAL;
@@ -444,7 +426,9 @@
/* Allocate all data structures. */
freq_table = devm_kzalloc(dev, (nf + 1) * sizeof(*freq_table),
GFP_KERNEL);
- if (!freq_table)
+ mem_bw = devm_kzalloc(dev, nf * sizeof(*mem_bw), GFP_KERNEL);
+
+ if (!freq_table || !mem_bw)
return -ENOMEM;
if (l2_clk) {
@@ -453,15 +437,6 @@
return -ENOMEM;
}
- if (num_paths) {
- int sz_u = nf * sizeof(*bus_bw.usecase);
- int sz_v = nf * num_paths * sizeof(*bus_vec_lst);
- bus_bw.usecase = devm_kzalloc(dev, sz_u, GFP_KERNEL);
- v = bus_vec_lst = devm_kzalloc(dev, sz_v, GFP_KERNEL);
- if (!bus_bw.usecase || !bus_vec_lst)
- return -ENOMEM;
- }
-
j = 0;
for (i = 0; i < nf; i++) {
unsigned long f;
@@ -504,25 +479,12 @@
}
}
- if (num_paths) {
- unsigned int bw_mbps = data[j++];
- bus_bw.usecase[i].num_paths = num_paths;
- bus_bw.usecase[i].vectors = v;
- for (k = 0; k < num_paths; k++) {
- v->src = ports[k * 2];
- v->dst = ports[k * 2 + 1];
- v->ib = bw_mbps * 1000000ULL;
- v++;
- }
- }
+ mem_bw[i] = data[j++];
}
- bus_bw.num_usecases = i;
freq_table[i].index = i;
freq_table[i].frequency = CPUFREQ_TABLE_END;
- if (ports)
- devm_kfree(dev, ports);
devm_kfree(dev, data);
return 0;
@@ -532,15 +494,12 @@
static int msm_cpufreq_show(struct seq_file *m, void *unused)
{
unsigned int i, cpu_freq;
- uint64_t ib;
if (!freq_table)
return 0;
seq_printf(m, "%10s%10s", "CPU (KHz)", "L2 (KHz)");
- if (bus_bw.usecase)
- seq_printf(m, "%12s", "Mem (MBps)");
- seq_printf(m, "\n");
+ seq_printf(m, "%12s\n", "Mem (MBps)");
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
cpu_freq = freq_table[i].frequency;
@@ -548,11 +507,7 @@
continue;
seq_printf(m, "%10d", cpu_freq);
seq_printf(m, "%10d", l2_khz ? l2_khz[i] : cpu_freq);
- if (bus_bw.usecase) {
- ib = bus_bw.usecase[i].vectors[0].ib;
- do_div(ib, 1000000);
- seq_printf(m, "%12llu", ib);
- }
+ seq_printf(m, "%12lu", mem_bw[i]);
seq_printf(m, "\n");
}
return 0;
@@ -602,10 +557,10 @@
cpufreq_frequency_table_get_attr(freq_table, cpu);
}
- if (bus_bw.usecase) {
- bus_client = msm_bus_scale_register_client(&bus_bw);
- if (!bus_client)
- dev_warn(dev, "Unable to register bus client\n");
+ ret = register_devfreq_msm_cpufreq();
+ if (ret) {
+ pr_err("devfreq governor registration failed\n");
+ return ret;
}
is_clk = true;
diff --git a/arch/arm/mach-msm/devfreq_cpubw.c b/arch/arm/mach-msm/devfreq_cpubw.c
new file mode 100644
index 0000000..20cabc2
--- /dev/null
+++ b/arch/arm/mach-msm/devfreq_cpubw.c
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt) "cpubw: " fmt
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/ktime.h>
+#include <linux/time.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/mutex.h>
+#include <linux/interrupt.h>
+#include <linux/devfreq.h>
+#include <linux/of.h>
+#include <trace/events/power.h>
+#include <mach/msm_bus.h>
+#include <mach/msm_bus_board.h>
+
+/* Has to be ULL to prevent overflow where this macro is used. */
+#define MBYTE (1ULL << 20)
+#define MAX_PATHS 2
+
+static struct msm_bus_vectors vectors[MAX_PATHS * 2];
+static struct msm_bus_paths bw_levels[] = {
+ { .vectors = &vectors[0] },
+ { .vectors = &vectors[MAX_PATHS] },
+};
+static struct msm_bus_scale_pdata bw_data = {
+ .usecase = bw_levels,
+ .num_usecases = ARRAY_SIZE(bw_levels),
+ .name = "devfreq_cpubw",
+ .active_only = 1,
+};
+static int num_paths;
+static u32 bus_client;
+
+static int set_bw(int new_ib, int new_ab)
+{
+ static int cur_idx, cur_ab, cur_ib;
+ int i, ret;
+
+ if (cur_ib == new_ib && cur_ab == new_ab)
+ return 0;
+
+ i = (cur_idx + 1) % ARRAY_SIZE(bw_levels);
+
+ bw_levels[i].vectors[0].ib = new_ib * MBYTE;
+ bw_levels[i].vectors[0].ab = new_ab / num_paths * MBYTE;
+ bw_levels[i].vectors[1].ib = new_ib * MBYTE;
+ bw_levels[i].vectors[1].ab = new_ab / num_paths * MBYTE;
+
+ pr_debug("BW MBps: AB: %d IB: %d\n", new_ab, new_ib);
+
+ ret = msm_bus_scale_client_update_request(bus_client, i);
+ if (ret) {
+ pr_err("bandwidth request failed (%d)\n", ret);
+ } else {
+ cur_idx = i;
+ cur_ib = new_ib;
+ cur_ab = new_ab;
+ }
+
+ return ret;
+}
+
+static void find_freq(struct devfreq_dev_profile *p, unsigned long *freq,
+ u32 flags)
+{
+ int i;
+ unsigned long atmost, atleast, f;
+
+ atmost = p->freq_table[0];
+ atleast = p->freq_table[p->max_state-1];
+ for (i = 0; i < p->max_state; i++) {
+ f = p->freq_table[i];
+ if (f <= *freq)
+ atmost = max(f, atmost);
+ if (f >= *freq)
+ atleast = min(f, atleast);
+ }
+
+ if (flags & DEVFREQ_FLAG_LEAST_UPPER_BOUND)
+ *freq = atmost;
+ else
+ *freq = atleast;
+}
+
+struct devfreq_dev_profile cpubw_profile;
+static long gov_ab;
+
+int cpubw_target(struct device *dev, unsigned long *freq, u32 flags)
+{
+ find_freq(&cpubw_profile, freq, flags);
+ return set_bw(*freq, gov_ab);
+}
+
+static struct devfreq_governor_data gov_data[] = {
+ { .name = "performance" },
+ { .name = "powersave" },
+ { .name = "userspace" },
+ { .name = "msm_cpufreq" },
+ { .name = "cpubw_hwmon", .data = &gov_ab },
+};
+
+struct devfreq_dev_profile cpubw_profile = {
+ .polling_ms = 50,
+ .target = cpubw_target,
+ .governor_data = gov_data,
+ .num_governor_data = ARRAY_SIZE(gov_data),
+};
+
+#define PROP_PORTS "qcom,cpu-mem-ports"
+#define PROP_TBL "qcom,bw-tbl"
+
+static int __init cpubw_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct devfreq_dev_profile *p = &cpubw_profile;
+ struct devfreq *df;
+ u32 *data, ports[MAX_PATHS * 2];
+ int ret, len, i;
+
+ if (of_find_property(dev->of_node, PROP_PORTS, &len)) {
+ len /= sizeof(ports[0]);
+ if (len % 2 || len > ARRAY_SIZE(ports)) {
+ dev_err(dev, "Unexpected number of ports\n");
+ return -EINVAL;
+ }
+
+ ret = of_property_read_u32_array(dev->of_node, PROP_PORTS,
+ ports, len);
+ if (ret)
+ return ret;
+
+ num_paths = len / 2;
+ } else {
+ return -EINVAL;
+ }
+
+ for (i = 0; i < num_paths; i++) {
+ bw_levels[0].vectors[i].src = ports[2 * i];
+ bw_levels[0].vectors[i].dst = ports[2 * i + 1];
+ bw_levels[1].vectors[i].src = ports[2 * i];
+ bw_levels[1].vectors[i].dst = ports[2 * i + 1];
+ }
+ bw_levels[0].num_paths = num_paths;
+ bw_levels[1].num_paths = num_paths;
+
+ if (of_find_property(dev->of_node, PROP_TBL, &len)) {
+ len /= sizeof(*data);
+ data = devm_kzalloc(dev, len * sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ p->freq_table = devm_kzalloc(dev,
+ len * sizeof(*p->freq_table),
+ GFP_KERNEL);
+ if (!p->freq_table)
+ return -ENOMEM;
+
+ ret = of_property_read_u32_array(dev->of_node, PROP_TBL,
+ data, len);
+ if (ret)
+ return ret;
+
+ for (i = 0; i < len; i++)
+ p->freq_table[i] = data[i];
+ p->max_state = len;
+ }
+
+ bus_client = msm_bus_scale_register_client(&bw_data);
+ if (!bus_client) {
+ dev_err(dev, "Unable to register bus client\n");
+ return -ENODEV;
+ }
+
+ df = devfreq_add_device(dev, &cpubw_profile, "msm_cpufreq", NULL);
+ if (IS_ERR(df)) {
+ msm_bus_scale_unregister_client(bus_client);
+ return PTR_ERR(df);
+ }
+
+ return 0;
+}
+
+static struct of_device_id match_table[] = {
+ { .compatible = "qcom,cpubw" },
+ {}
+};
+
+static struct platform_driver cpubw_driver = {
+ .driver = {
+ .name = "cpubw",
+ .of_match_table = match_table,
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init cpubw_init(void)
+{
+ platform_driver_probe(&cpubw_driver, cpubw_probe);
+ return 0;
+}
+device_initcall(cpubw_init);
+
+MODULE_DESCRIPTION("CPU DDR bandwidth voting driver MSM CPUs");
+MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/include/mach/cpufreq.h b/arch/arm/mach-msm/include/mach/cpufreq.h
new file mode 100644
index 0000000..46872d7
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/cpufreq.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#ifndef __MACH_CPUFREQ_H
+#define __MACH_CPUFREQ_H
+
+#if defined(CONFIG_DEVFREQ_GOV_MSM_CPUFREQ)
+extern int devfreq_msm_cpufreq_update_bw(void);
+extern int register_devfreq_msm_cpufreq(void);
+#else
+static int devfreq_msm_cpufreq_update_bw(void)
+{
+ return 0;
+}
+static int register_devfreq_msm_cpufreq(void)
+{
+ return 0;
+}
+#endif
+
+#if defined(CONFIG_CPU_FREQ_MSM)
+extern unsigned long msm_cpufreq_get_bw(void);
+#else
+extern unsigned long msm_cpufreq_get_bw(void)
+{
+ return ULONG_MAX;
+}
+#endif
+
+#endif
diff --git a/arch/arm/mach-msm/include/mach/msm-krait-l2-accessors.h b/arch/arm/mach-msm/include/mach/msm-krait-l2-accessors.h
index a35ff4d..45d000b 100644
--- a/arch/arm/mach-msm/include/mach/msm-krait-l2-accessors.h
+++ b/arch/arm/mach-msm/include/mach/msm-krait-l2-accessors.h
@@ -2,7 +2,7 @@
#define __ASM_ARCH_MSM_MSM_KRAIT_L2_ACCESSORS_H
/*
- * Copyright (c) 2011,2012, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -14,6 +14,55 @@
* GNU General Public License for more details.
*/
+#define MAX_L2_PERIOD ((1ULL << 32) - 1)
+#define MAX_KRAIT_L2_CTRS 10
+
+#define PMCR_NUM_EV_SHIFT 11
+#define PMCR_NUM_EV_MASK 0x1f
+
+#define L2_EVT_MASK 0xfffff
+
+#define L2_SLAVE_EV_PREFIX 4
+#define L2_TRACECTR_PREFIX 5
+
+#define L2PMCCNTR 0x409
+#define L2PMCCNTCR 0x408
+#define L2PMCCNTSR 0x40A
+#define L2CYCLE_CTR_BIT 31
+#define L2CYCLE_CTR_RAW_CODE 0xfe
+
+#define L2PMOVSR 0x406
+
+#define L2PMCR 0x400
+#define L2PMCR_RESET_ALL 0x6
+#define L2PMCR_GLOBAL_ENABLE 0x1
+#define L2PMCR_GLOBAL_DISABLE 0x0
+
+#define L2PMCNTENSET 0x403
+#define L2PMCNTENCLR 0x402
+
+#define L2PMINTENSET 0x405
+#define L2PMINTENCLR 0x404
+
+#define IA_L2PMXEVCNTCR_BASE 0x420
+#define IA_L2PMXEVTYPER_BASE 0x424
+#define IA_L2PMRESX_BASE 0x410
+#define IA_L2PMXEVFILTER_BASE 0x423
+#define IA_L2PMXEVCNTR_BASE 0x421
+
+/* event format is -e rsRCCG See get_event_desc() */
+
+#define EVENT_PREFIX_MASK 0xf0000
+#define EVENT_REG_MASK 0x0f000
+#define EVENT_GROUPSEL_MASK 0x0000f
+#define EVENT_GROUPCODE_MASK 0x00ff0
+
+#define EVENT_PREFIX_SHIFT 16
+#define EVENT_REG_SHIFT 12
+#define EVENT_GROUPCODE_SHIFT 4
+
+#define RESRX_VALUE_EN 0x80000000
+
#ifdef CONFIG_ARCH_MSM_KRAIT
extern void set_l2_indirect_reg(u32 reg_addr, u32 val);
extern u32 get_l2_indirect_reg(u32 reg_addr);
diff --git a/arch/arm/mach-msm/lpm_levels.c b/arch/arm/mach-msm/lpm_levels.c
index b9dcf88..06160f7 100644
--- a/arch/arm/mach-msm/lpm_levels.c
+++ b/arch/arm/mach-msm/lpm_levels.c
@@ -212,7 +212,6 @@
switch (sleep_mode) {
case MSM_SPM_L2_MODE_POWER_COLLAPSE:
- pr_info("Configuring for L2 power collapse\n");
msm_pm_set_l2_flush_flag(MSM_SCM_L2_OFF);
break;
case MSM_SPM_L2_MODE_GDHS:
diff --git a/arch/arm/mach-msm/perf_debug.c b/arch/arm/mach-msm/perf_debug.c
index 28d8e42..d493e8b 100644
--- a/arch/arm/mach-msm/perf_debug.c
+++ b/arch/arm/mach-msm/perf_debug.c
@@ -35,6 +35,16 @@
"10 Perf: Fix counts across power collapse\n"
"11 ARM: dts: msm: add perf-events support for msm8x10, msm8x12\n"
"12 Perf: Make per-process counters configurable\n"
+ "13 msm: perf: Add L2 support for tracecounters\n"
+ "14 Perf: keep events across hotplug\n"
+ "15 Perf: bring CPU online if needed when disabling irq\n"
+ "16 Perf: Support sw events across hotplug\n"
+ "17 msm: perf: initialise krait perf L2 counter enables\n"
+ "18 msm: perf: clean up duplicate constraint events\n"
+ "19 Perf: Make per-process counters cumulative\n"
+ "20 Perf: Fix PID for tracepoints\n"
+ "21 Perf: preserve registers across hotplug\n"
+ "22 msm: perf: fix formatting of trace entry\n"
;
static ssize_t desc_read(struct file *fp, char __user *buf,
diff --git a/arch/arm/mach-msm/perf_event_msm_krait_l2.c b/arch/arm/mach-msm/perf_event_msm_krait_l2.c
index ad34457..c9e2b8f 100644
--- a/arch/arm/mach-msm/perf_event_msm_krait_l2.c
+++ b/arch/arm/mach-msm/perf_event_msm_krait_l2.c
@@ -18,54 +18,6 @@
#include <mach/msm-krait-l2-accessors.h>
-#define MAX_L2_PERIOD ((1ULL << 32) - 1)
-#define MAX_KRAIT_L2_CTRS 10
-
-#define PMCR_NUM_EV_SHIFT 11
-#define PMCR_NUM_EV_MASK 0x1f
-
-#define L2_EVT_MASK 0xfffff
-
-#define L2_SLAVE_EV_PREFIX 4
-
-#define L2PMCCNTR 0x409
-#define L2PMCCNTCR 0x408
-#define L2PMCCNTSR 0x40A
-#define L2CYCLE_CTR_BIT 31
-#define L2CYCLE_CTR_RAW_CODE 0xfe
-
-#define L2PMOVSR 0x406
-
-#define L2PMCR 0x400
-#define L2PMCR_RESET_ALL 0x6
-#define L2PMCR_GLOBAL_ENABLE 0x1
-#define L2PMCR_GLOBAL_DISABLE 0x0
-
-#define L2PMCNTENSET 0x403
-#define L2PMCNTENCLR 0x402
-
-#define L2PMINTENSET 0x405
-#define L2PMINTENCLR 0x404
-
-#define IA_L2PMXEVCNTCR_BASE 0x420
-#define IA_L2PMXEVTYPER_BASE 0x424
-#define IA_L2PMRESX_BASE 0x410
-#define IA_L2PMXEVFILTER_BASE 0x423
-#define IA_L2PMXEVCNTR_BASE 0x421
-
-/* event format is -e rsRCCG See get_event_desc() */
-
-#define EVENT_PREFIX_MASK 0xf0000
-#define EVENT_REG_MASK 0x0f000
-#define EVENT_GROUPSEL_MASK 0x0000f
-#define EVENT_GROUPCODE_MASK 0x00ff0
-
-#define EVENT_PREFIX_SHIFT 16
-#define EVENT_REG_SHIFT 12
-#define EVENT_GROUPCODE_SHIFT 4
-
-#define RESRX_VALUE_EN 0x80000000
-
/*
* The L2 PMU is shared between all CPU's, so protect
* its bitmap access.
@@ -197,13 +149,16 @@
set_l2_indirect_reg(filter_reg, filter_val);
}
-static void set_evfilter_sys_mode(int ctr, unsigned int is_slv)
+static void set_evfilter_sys_mode(int ctr, unsigned int is_slv, int cpu,
+ unsigned int is_tracectr)
{
u32 filter_reg = (ctr * 16) + IA_L2PMXEVFILTER_BASE;
u32 filter_val = l2_orig_filter_prefix | 0xf;
- if (is_slv)
+ if (is_slv == 1)
filter_val = l2_slv_filter_prefix;
+ if (is_tracectr == 1)
+ filter_val = l2_orig_filter_prefix | 1 << cpu;
set_l2_indirect_reg(filter_reg, filter_val);
}
@@ -277,6 +232,7 @@
struct event_desc evdesc;
unsigned long iflags;
unsigned int is_slv = 0;
+ unsigned int is_tracectr = 0;
unsigned int evt_prefix;
raw_spin_lock_irqsave(&krait_l2_pmu_hw_events.pmu_lock, iflags);
@@ -290,6 +246,8 @@
if (evt_prefix == L2_SLAVE_EV_PREFIX)
is_slv = 1;
+ else if (evt_prefix == L2_TRACECTR_PREFIX)
+ is_tracectr = 1;
set_evcntcr(idx);
@@ -305,7 +263,7 @@
if (cpu < 0)
set_evfilter_task_mode(idx, is_slv);
else
- set_evfilter_sys_mode(idx, is_slv);
+ set_evfilter_sys_mode(idx, is_slv, cpu, is_tracectr);
out:
enable_intenset(idx);
@@ -456,6 +414,7 @@
static int msm_l2_test_set_ev_constraint(struct perf_event *event)
{
u32 evt_type = event->attr.config & L2_EVT_MASK;
+ u8 evt_prefix = (evt_type & EVENT_PREFIX_MASK) >> EVENT_PREFIX_SHIFT;
u8 reg = (evt_type & 0x0F000) >> 12;
u8 group = evt_type & 0x0000F;
u8 code = (evt_type & 0x00FF0) >> 4;
@@ -464,6 +423,8 @@
u64 bitmap_t;
u32 shift_idx;
+ if (evt_prefix == L2_TRACECTR_PREFIX)
+ return err;
/*
* Cycle counter collision is detected in
* get_event_idx().
@@ -496,8 +457,10 @@
* This sets the event OFF on all but one
* CPU.
*/
- if (!(event->cpu < 0))
+ if (!(event->cpu < 0)) {
event->state = PERF_EVENT_STATE_OFF;
+ event->attr.constraint_duplicate = 1;
+ }
}
out:
raw_spin_unlock_irqrestore(&l2_pmu_constraints.lock, flags);
@@ -507,12 +470,15 @@
static int msm_l2_clear_ev_constraint(struct perf_event *event)
{
u32 evt_type = event->attr.config & L2_EVT_MASK;
+ u8 evt_prefix = (evt_type & EVENT_PREFIX_MASK) >> EVENT_PREFIX_SHIFT;
u8 reg = (evt_type & 0x0F000) >> 12;
u8 group = evt_type & 0x0000F;
unsigned long flags;
u64 bitmap_t;
u32 shift_idx;
+ if (evt_prefix == L2_TRACECTR_PREFIX)
+ return 1;
raw_spin_lock_irqsave(&l2_pmu_constraints.lock, flags);
shift_idx = ((reg * 4) + group);
@@ -592,6 +558,8 @@
static int __init register_krait_l2_pmu_driver(void)
{
+ int i;
+
/* Reset all ctrs */
set_l2_indirect_reg(L2PMCR, L2PMCR_RESET_ALL);
@@ -613,6 +581,11 @@
/* Avoid spurious interrupt if any */
get_reset_pmovsr();
+ /* Clear counter enables */
+ disable_counter(l2_cycle_ctr_idx);
+ for (i = 0; i < total_l2_ctrs; i++)
+ disable_counter(i);
+
return platform_driver_register(&krait_l2_pmu_driver);
}
device_initcall(register_krait_l2_pmu_driver);
diff --git a/arch/arm/mach-msm/perf_trace_counters.c b/arch/arm/mach-msm/perf_trace_counters.c
index 8fa73ae..f847b5d 100644
--- a/arch/arm/mach-msm/perf_trace_counters.c
+++ b/arch/arm/mach-msm/perf_trace_counters.c
@@ -17,21 +17,48 @@
static unsigned int tp_pid_state;
+DEFINE_PER_CPU(u32, previous_ccnt);
+DEFINE_PER_CPU(u32[NUM_L1_CTRS], previous_l1_cnts);
+DEFINE_PER_CPU(u32[NUM_L2_PERCPU], previous_l2_cnts);
+DEFINE_PER_CPU(u32, old_pid);
+/* Reset per_cpu variables that store counter values uppn CPU hotplug */
+static int tracectr_cpu_hotplug_notifier(struct notifier_block *self,
+ unsigned long action, void *hcpu)
+{
+ int ret = NOTIFY_OK;
+ int cpu = (int)hcpu;
+ int i;
+
+ if ((action & (~CPU_TASKS_FROZEN)) == CPU_UP_PREPARE) {
+ per_cpu(previous_ccnt, cpu) = 0;
+ for (i = 0; i < NUM_L1_CTRS; i++)
+ per_cpu(previous_l1_cnts[i], cpu) = 0;
+ for (i = 0; i < NUM_L2_PERCPU; i++)
+ per_cpu(previous_l2_cnts[i], cpu) = 0;
+ }
+ return ret;
+}
+
+static struct notifier_block tracectr_cpu_hotplug_notifier_block = {
+ .notifier_call = tracectr_cpu_hotplug_notifier,
+};
+
static int tracectr_notifier(struct notifier_block *self, unsigned long cmd,
void *v)
{
- static int old_pid = -1;
struct thread_info *thread = v;
int current_pid;
+ u32 cpu = smp_processor_id();
if (cmd != THREAD_NOTIFY_SWITCH)
- return old_pid;
+ return -EFAULT;
current_pid = thread->task->pid;
- if (old_pid != -1)
- trace_sched_switch_with_ctrs(old_pid, current_pid);
- old_pid = current_pid;
- return old_pid;
+ if (per_cpu(old_pid, cpu) != -1)
+ trace_sched_switch_with_ctrs(per_cpu(old_pid, cpu),
+ current_pid);
+ per_cpu(old_pid, cpu) = current_pid;
+ return NOTIFY_OK;
}
static struct notifier_block tracectr_notifier_block = {
@@ -102,6 +129,7 @@
struct dentry *dir;
struct dentry *file;
unsigned int value = 1;
+ int cpu;
dir = debugfs_create_dir("perf_debug_tp", NULL);
if (!dir)
@@ -112,6 +140,15 @@
debugfs_remove(dir);
return -ENOMEM;
}
+ register_cpu_notifier(&tracectr_cpu_hotplug_notifier_block);
+ for_each_possible_cpu(cpu)
+ per_cpu(old_pid, cpu) = -1;
+ return 0;
+}
+
+int __exit exit_tracecounters(void)
+{
+ unregister_cpu_notifier(&tracectr_cpu_hotplug_notifier_block);
return 0;
}
late_initcall(init_tracecounters);
diff --git a/arch/arm/mach-msm/perf_trace_counters.h b/arch/arm/mach-msm/perf_trace_counters.h
index 8f77bad..fce176e 100644
--- a/arch/arm/mach-msm/perf_trace_counters.h
+++ b/arch/arm/mach-msm/perf_trace_counters.h
@@ -19,14 +19,21 @@
/* Ctr index for PMCNTENSET/CLR */
#define CC 0x80000000
#define C0 0x1
-#define C1 0x10
-#define C2 0x100
-#define C3 0x1000
-
+#define C1 0x2
+#define C2 0x4
+#define C3 0x8
+#define C_ALL (CC | C0 | C1 | C2 | C3)
+#define NUM_L1_CTRS 4
+#define NUM_L2_PERCPU 2
#include <linux/sched.h>
+#include <linux/cpumask.h>
#include <linux/tracepoint.h>
+#include <mach/msm-krait-l2-accessors.h>
+DECLARE_PER_CPU(u32, previous_ccnt);
+DECLARE_PER_CPU(u32[NUM_L1_CTRS], previous_l1_cnts);
+DECLARE_PER_CPU(u32[NUM_L2_PERCPU], previous_l2_cnts);
TRACE_EVENT(sched_switch_with_ctrs,
TP_PROTO(pid_t prev, pid_t next),
@@ -41,82 +48,112 @@
__field(u32, ctr1)
__field(u32, ctr2)
__field(u32, ctr3)
+ __field(u32, lctr0)
+ __field(u32, lctr1)
),
TP_fast_assign(
+ u32 cpu = smp_processor_id();
+ u32 idx;
+ u32 i;
+ u32 counter_reg;
+ u32 val;
+ u32 cnten_val;
+ u32 num_l2ctrs;
+ u32 num_cores = nr_cpu_ids;
+ u32 total_ccnt = 0;
+ u32 total_cnt = 0;
+ u32 delta_l1_cnts[NUM_L1_CTRS];
+ u32 delta_l2_cnts[NUM_L2_PERCPU];
__entry->old_pid = prev;
__entry->new_pid = next;
- /* cycle counter */
- /* Disable */
- asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r"(CC));
- /* Read value */
- asm volatile("mrc p15, 0, %0, c9, c13, 0"
- : "=r"(__entry->cctr));
- /* Reset */
- asm volatile("mcr p15, 0, %0, c9, c13, 0" : : "r"(0));
- /* Enable */
- asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(CC));
+ val = get_l2_indirect_reg(L2PMCR);
+ num_l2ctrs = ((val >> 11) & 0x1f) + 1;
- /* ctr 0 */
- /* Disable */
- asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r"(C0));
- /* Select */
- asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r"(0));
- /* Read value */
- asm volatile("mrc p15, 0, %0, c9, c13, 2"
- : "=r"(__entry->ctr0));
- /* Reset */
- asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r"(0));
- /* Enable */
- asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(C0));
+ /* Read PMCNTENSET */
+ asm volatile("mrc p15, 0, %0, c9, c12, 1"
+ : "=r"(cnten_val));
+ /* Disable all the counters that were enabled */
+ asm volatile("mcr p15, 0, %0, c9, c12, 2"
+ : : "r"(cnten_val));
+ if (cnten_val & CC) {
+ /* Read value */
+ asm volatile("mrc p15, 0, %0, c9, c13, 0"
+ : "=r"(total_ccnt));
+ __entry->cctr = total_ccnt -
+ per_cpu(previous_ccnt, cpu);
+ per_cpu(previous_ccnt, cpu) = total_ccnt;
+ }
+ for (i = 0; i < NUM_L1_CTRS; i++) {
+ if (cnten_val & (1 << i)) {
+ /* Select */
+ asm volatile(
+ "mcr p15, 0, %0, c9, c12, 5"
+ : : "r"(i));
+ /* Read value */
+ asm volatile(
+ "mrc p15, 0, %0, c9, c13, 2"
+ : "=r"(total_cnt));
- /* ctr 1 */
- /* Disable */
- asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r"(C1));
- /* Select */
- asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r"(1));
- /* Read value */
- asm volatile("mrc p15, 0, %0, c9, c13, 2"
- : "=r"(__entry->ctr1));
- /* Reset */
- asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r"(0));
- /* Enable */
- asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(C1));
+ delta_l1_cnts[i] = total_cnt -
+ per_cpu(previous_l1_cnts[i], cpu);
+ per_cpu(previous_l1_cnts[i], cpu) =
+ total_cnt;
+ } else
+ delta_l1_cnts[i] = 0;
+ }
+ /* Enable all the counters that were disabled */
+ asm volatile("mcr p15, 0, %0, c9, c12, 1"
+ : : "r"(cnten_val));
- /* ctr 2 */
- /* Disable */
- asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r"(C2));
- /* Select */
- asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r"(2));
- /* Read value */
- asm volatile("mrc p15, 0, %0, c9, c13, 2"
- : "=r"(__entry->ctr2));
- /* Reset */
- asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r"(0));
- /* Enable */
- asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(C2));
-
- /* ctr 3 */
- /* Disable */
- asm volatile("mcr p15, 0, %0, c9, c12, 2" : : "r"(C3));
- /* Select */
- asm volatile("mcr p15, 0, %0, c9, c12, 5" : : "r"(3));
- /* Read value */
- asm volatile("mrc p15, 0, %0, c9, c13, 2"
- : "=r"(__entry->ctr3));
- /* Reset */
- asm volatile("mcr p15, 0, %0, c9, c13, 2" : : "r"(0));
- /* Enable */
- asm volatile("mcr p15, 0, %0, c9, c12, 1" : : "r"(C3));
-
+ /* L2 counters */
+ /* Assign L2 counters to cores sequentially starting
+ * from zero. A core could have multiple L2 counters
+ * allocated if # L2 counters is more than the # cores
+ */
+ cnten_val = get_l2_indirect_reg(L2PMCNTENSET);
+ for (i = 0; i < NUM_L2_PERCPU; i++) {
+ idx = cpu + (num_cores * i);
+ if (idx < num_l2ctrs &&
+ (cnten_val & (1 << idx))) {
+ /* Disable */
+ set_l2_indirect_reg(L2PMCNTENCLR,
+ (1 << idx));
+ /* L2PMEVCNTR values go from 0x421,
+ * 0x431..
+ * So we multiply idx by 16 to get the
+ * counter reg value
+ */
+ counter_reg = (idx * 16) +
+ IA_L2PMXEVCNTR_BASE;
+ total_cnt =
+ get_l2_indirect_reg(counter_reg);
+ /* Enable */
+ set_l2_indirect_reg(L2PMCNTENSET,
+ (1 << idx));
+ delta_l2_cnts[i] = total_cnt -
+ per_cpu(previous_l2_cnts[i], cpu);
+ per_cpu(previous_l2_cnts[i], cpu) =
+ total_cnt;
+ } else
+ delta_l2_cnts[i] = 0;
+ }
+ __entry->ctr0 = delta_l1_cnts[0];
+ __entry->ctr1 = delta_l1_cnts[1];
+ __entry->ctr2 = delta_l1_cnts[2];
+ __entry->ctr3 = delta_l1_cnts[3];
+ __entry->lctr0 = delta_l2_cnts[0];
+ __entry->lctr1 = delta_l2_cnts[1];
),
TP_printk("prev_pid=%d, next_pid=%d, CCNTR: %u, CTR0: %u," \
- " CTR1: %u, CTR2: %u, CTR3: %u",
+ " CTR1: %u, CTR2: %u, CTR3: %u," \
+ " L2CTR0: %u, L2CTR1: %u",
__entry->old_pid, __entry->new_pid,
__entry->cctr, __entry->ctr0, __entry->ctr1,
- __entry->ctr2, __entry->ctr3)
+ __entry->ctr2, __entry->ctr3,
+ __entry->lctr0, __entry->lctr1)
);
#endif
diff --git a/arch/arm/mach-msm/restart.c b/arch/arm/mach-msm/restart.c
index 37fd650..a96b02f 100644
--- a/arch/arm/mach-msm/restart.c
+++ b/arch/arm/mach-msm/restart.c
@@ -115,6 +115,10 @@
__raw_writel(EMERGENCY_DLOAD_MAGIC3,
emergency_dload_mode_addr +
(2 * sizeof(unsigned int)));
+
+ /* Need disable the pmic wdt, then the emergency dload mode
+ * will not auto reset. */
+ qpnp_pon_wd_config(0);
mb();
}
}
@@ -276,6 +280,8 @@
__raw_writel(0x77665500, restart_reason);
} else if (!strncmp(cmd, "recovery", 8)) {
__raw_writel(0x77665502, restart_reason);
+ } else if (!strcmp(cmd, "rtc")) {
+ __raw_writel(0x77665503, restart_reason);
} else if (!strncmp(cmd, "oem-", 4)) {
unsigned long code;
code = simple_strtoul(cmd + 4, NULL, 16) & 0xff;
diff --git a/arch/arm/mach-msm/rpcrouter_sdio_xprt.c b/arch/arm/mach-msm/rpcrouter_sdio_xprt.c
deleted file mode 100644
index e9818e5..0000000
--- a/arch/arm/mach-msm/rpcrouter_sdio_xprt.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * RPCROUTER SDIO XPRT module.
- */
-
-#include <linux/platform_device.h>
-#include <linux/types.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/fs.h>
-#include <linux/err.h>
-#include <linux/sched.h>
-#include <linux/poll.h>
-#include <linux/wakelock.h>
-#include <asm/uaccess.h>
-#include <linux/slab.h>
-
-#include <mach/sdio_al.h>
-#include "smd_rpcrouter.h"
-
-enum {
- MSM_SDIO_XPRT_DEBUG = 1U << 0,
- MSM_SDIO_XPRT_INFO = 1U << 1,
-};
-
-static int msm_sdio_xprt_debug_mask;
-module_param_named(debug_mask, msm_sdio_xprt_debug_mask,
- int, S_IRUGO | S_IWUSR | S_IWGRP);
-
-#if defined(CONFIG_MSM_RPC_SDIO_DEBUG)
-#define SDIO_XPRT_DBG(x...) do { \
- if (msm_sdio_xprt_debug_mask & MSM_SDIO_XPRT_DEBUG) \
- printk(KERN_DEBUG x); \
- } while (0)
-
-#define SDIO_XPRT_INFO(x...) do { \
- if (msm_sdio_xprt_debug_mask & MSM_SDIO_XPRT_INFO) \
- printk(KERN_INFO x); \
- } while (0)
-#else
-#define SDIO_XPRT_DBG(x...) do { } while (0)
-#define SDIO_XPRT_INFO(x...) do { } while (0)
-#endif
-
-#define MAX_SDIO_WRITE_RETRY 5
-#define SDIO_BUF_SIZE (RPCROUTER_MSGSIZE_MAX + sizeof(struct rr_header) - 8)
-#define NUM_SDIO_BUFS 20
-#define MAX_TX_BUFS 10
-#define MAX_RX_BUFS 10
-
-struct sdio_xprt {
- struct sdio_channel *handle;
-
- struct list_head write_list;
- spinlock_t write_list_lock;
-
- struct list_head read_list;
- spinlock_t read_list_lock;
-
- struct list_head free_list;
- spinlock_t free_list_lock;
-
- struct wake_lock read_wakelock;
-};
-
-struct rpcrouter_sdio_xprt {
- struct rpcrouter_xprt xprt;
- struct sdio_xprt *channel;
-};
-
-static struct rpcrouter_sdio_xprt sdio_remote_xprt;
-
-static void sdio_xprt_read_data(struct work_struct *work);
-static DECLARE_DELAYED_WORK(work_read_data, sdio_xprt_read_data);
-static struct workqueue_struct *sdio_xprt_read_workqueue;
-
-struct sdio_buf_struct {
- struct list_head list;
- uint32_t size;
- uint32_t read_index;
- uint32_t write_index;
- unsigned char data[SDIO_BUF_SIZE];
-};
-
-static void sdio_xprt_write_data(struct work_struct *work);
-static DECLARE_WORK(work_write_data, sdio_xprt_write_data);
-static wait_queue_head_t write_avail_wait_q;
-static uint32_t num_free_bufs;
-static uint32_t num_tx_bufs;
-static uint32_t num_rx_bufs;
-
-static DEFINE_MUTEX(modem_reset_lock);
-static uint32_t modem_reset;
-
-static void free_sdio_xprt(struct sdio_xprt *chnl)
-{
- struct sdio_buf_struct *buf;
- unsigned long flags;
-
- if (!chnl) {
- printk(KERN_ERR "Invalid chnl to free\n");
- return;
- }
-
- spin_lock_irqsave(&chnl->free_list_lock, flags);
- while (!list_empty(&chnl->free_list)) {
- buf = list_first_entry(&chnl->free_list,
- struct sdio_buf_struct, list);
- list_del(&buf->list);
- kfree(buf);
- }
- num_free_bufs = 0;
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
-
- spin_lock_irqsave(&chnl->write_list_lock, flags);
- while (!list_empty(&chnl->write_list)) {
- buf = list_first_entry(&chnl->write_list,
- struct sdio_buf_struct, list);
- list_del(&buf->list);
- kfree(buf);
- }
- num_tx_bufs = 0;
- spin_unlock_irqrestore(&chnl->write_list_lock, flags);
-
- spin_lock_irqsave(&chnl->read_list_lock, flags);
- while (!list_empty(&chnl->read_list)) {
- buf = list_first_entry(&chnl->read_list,
- struct sdio_buf_struct, list);
- list_del(&buf->list);
- kfree(buf);
- }
- num_rx_bufs = 0;
- spin_unlock_irqrestore(&chnl->read_list_lock, flags);
- wake_unlock(&chnl->read_wakelock);
-}
-
-static struct sdio_buf_struct *alloc_from_free_list(struct sdio_xprt *chnl)
-{
- struct sdio_buf_struct *buf;
- unsigned long flags;
-
- spin_lock_irqsave(&chnl->free_list_lock, flags);
- if (list_empty(&chnl->free_list)) {
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
- SDIO_XPRT_DBG("%s: Free list empty\n", __func__);
- return NULL;
- }
- buf = list_first_entry(&chnl->free_list, struct sdio_buf_struct, list);
- list_del(&buf->list);
- num_free_bufs--;
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
-
- buf->size = 0;
- buf->read_index = 0;
- buf->write_index = 0;
-
- return buf;
-}
-
-static void return_to_free_list(struct sdio_xprt *chnl,
- struct sdio_buf_struct *buf)
-{
- unsigned long flags;
-
- if (!chnl || !buf) {
- pr_err("%s: Invalid chnl or buf\n", __func__);
- return;
- }
-
- buf->size = 0;
- buf->read_index = 0;
- buf->write_index = 0;
-
- spin_lock_irqsave(&chnl->free_list_lock, flags);
- list_add_tail(&buf->list, &chnl->free_list);
- num_free_bufs++;
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
-
-}
-
-static int rpcrouter_sdio_remote_read_avail(void)
-{
- int read_avail = 0;
- unsigned long flags;
- struct sdio_buf_struct *buf;
-
- spin_lock_irqsave(&sdio_remote_xprt.channel->read_list_lock, flags);
- list_for_each_entry(buf, &sdio_remote_xprt.channel->read_list, list) {
- read_avail += buf->size;
- }
- spin_unlock_irqrestore(&sdio_remote_xprt.channel->read_list_lock,
- flags);
- return read_avail;
-}
-
-static int rpcrouter_sdio_remote_read(void *data, uint32_t len)
-{
- struct sdio_buf_struct *buf;
- unsigned char *buf_data;
- unsigned long flags;
-
- SDIO_XPRT_DBG("sdio_xprt Called %s\n", __func__);
- if (len < 0 || !data)
- return -EINVAL;
- else if (len == 0)
- return 0;
-
- spin_lock_irqsave(&sdio_remote_xprt.channel->read_list_lock, flags);
- if (list_empty(&sdio_remote_xprt.channel->read_list)) {
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->read_list_lock, flags);
- return -EINVAL;
- }
-
- buf = list_first_entry(&sdio_remote_xprt.channel->read_list,
- struct sdio_buf_struct, list);
- if (buf->size < len) {
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->read_list_lock, flags);
- return -EINVAL;
- }
-
- buf_data = buf->data + buf->read_index;
- memcpy(data, buf_data, len);
- buf->read_index += len;
- buf->size -= len;
- if (buf->size == 0) {
- list_del(&buf->list);
- num_rx_bufs--;
- return_to_free_list(sdio_remote_xprt.channel, buf);
- }
-
- if (list_empty(&sdio_remote_xprt.channel->read_list))
- wake_unlock(&sdio_remote_xprt.channel->read_wakelock);
- spin_unlock_irqrestore(&sdio_remote_xprt.channel->read_list_lock,
- flags);
- return len;
-}
-
-static int rpcrouter_sdio_remote_write_avail(void)
-{
- uint32_t write_avail = 0;
- unsigned long flags;
-
- SDIO_XPRT_DBG("sdio_xprt Called %s\n", __func__);
- spin_lock_irqsave(&sdio_remote_xprt.channel->write_list_lock, flags);
- write_avail = (MAX_TX_BUFS - num_tx_bufs) * SDIO_BUF_SIZE;
- spin_unlock_irqrestore(&sdio_remote_xprt.channel->write_list_lock,
- flags);
- return write_avail;
-}
-
-static int rpcrouter_sdio_remote_write(void *data, uint32_t len,
- enum write_data_type type)
-{
- unsigned long flags;
- static struct sdio_buf_struct *buf;
- unsigned char *buf_data;
-
- switch (type) {
- case HEADER:
- spin_lock_irqsave(&sdio_remote_xprt.channel->write_list_lock,
- flags);
- if (num_tx_bufs == MAX_TX_BUFS) {
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->write_list_lock,
- flags);
- return -ENOMEM;
- }
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->write_list_lock, flags);
-
- SDIO_XPRT_DBG("sdio_xprt WRITE HEADER %s\n", __func__);
- buf = alloc_from_free_list(sdio_remote_xprt.channel);
- if (!buf) {
- pr_err("%s: alloc_from_free_list failed\n", __func__);
- return -ENOMEM;
- }
- buf_data = buf->data + buf->write_index;
- memcpy(buf_data, data, len);
- buf->write_index += len;
- buf->size += len;
- return len;
- case PACKMARK:
- SDIO_XPRT_DBG("sdio_xprt WRITE PACKMARK %s\n", __func__);
- if (!buf) {
- pr_err("%s: HEADER not written or alloc failed\n",
- __func__);
- return -ENOMEM;
- }
- buf_data = buf->data + buf->write_index;
- memcpy(buf_data, data, len);
- buf->write_index += len;
- buf->size += len;
- return len;
- case PAYLOAD:
- SDIO_XPRT_DBG("sdio_xprt WRITE PAYLOAD %s\n", __func__);
- if (!buf) {
- pr_err("%s: HEADER not written or alloc failed\n",
- __func__);
- return -ENOMEM;
- }
- buf_data = buf->data + buf->write_index;
- memcpy(buf_data, data, len);
- buf->write_index += len;
- buf->size += len;
-
- SDIO_XPRT_DBG("sdio_xprt flush %d bytes\n", buf->size);
- spin_lock_irqsave(&sdio_remote_xprt.channel->write_list_lock,
- flags);
- list_add_tail(&buf->list,
- &sdio_remote_xprt.channel->write_list);
- num_tx_bufs++;
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->write_list_lock, flags);
- queue_work(sdio_xprt_read_workqueue, &work_write_data);
- buf = NULL;
- return len;
- default:
- return -EINVAL;
- }
-}
-
-static void sdio_xprt_write_data(struct work_struct *work)
-{
- int rc = 0, sdio_write_retry = 0;
- unsigned long flags;
- struct sdio_buf_struct *buf;
-
- mutex_lock(&modem_reset_lock);
- if (modem_reset) {
- mutex_unlock(&modem_reset_lock);
- return;
- }
-
- spin_lock_irqsave(&sdio_remote_xprt.channel->write_list_lock, flags);
- while (!list_empty(&sdio_remote_xprt.channel->write_list)) {
- buf = list_first_entry(&sdio_remote_xprt.channel->write_list,
- struct sdio_buf_struct, list);
- list_del(&buf->list);
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->write_list_lock, flags);
- mutex_unlock(&modem_reset_lock);
-
- wait_event(write_avail_wait_q,
- (!(modem_reset) && (sdio_write_avail(
- sdio_remote_xprt.channel->handle) >=
- buf->size)));
-
- mutex_lock(&modem_reset_lock);
- while (!(modem_reset) &&
- ((rc = sdio_write(sdio_remote_xprt.channel->handle,
- buf->data, buf->size)) < 0) &&
- (sdio_write_retry++ < MAX_SDIO_WRITE_RETRY)) {
- printk(KERN_ERR "sdio_write failed with RC %d\n", rc);
- mutex_unlock(&modem_reset_lock);
- msleep(250);
- mutex_lock(&modem_reset_lock);
- }
- if (modem_reset) {
- mutex_unlock(&modem_reset_lock);
- kfree(buf);
- return;
- } else {
- return_to_free_list(sdio_remote_xprt.channel, buf);
- }
-
- if (!rc)
- SDIO_XPRT_DBG("sdio_write %d bytes completed\n",
- buf->size);
-
- spin_lock_irqsave(&sdio_remote_xprt.channel->write_list_lock,
- flags);
- num_tx_bufs--;
- }
- spin_unlock_irqrestore(&sdio_remote_xprt.channel->write_list_lock,
- flags);
- mutex_unlock(&modem_reset_lock);
-}
-
-static int rpcrouter_sdio_remote_close(void)
-{
- SDIO_XPRT_DBG("sdio_xprt Called %s\n", __func__);
- flush_workqueue(sdio_xprt_read_workqueue);
- sdio_close(sdio_remote_xprt.channel->handle);
- free_sdio_xprt(sdio_remote_xprt.channel);
- return 0;
-}
-
-static void sdio_xprt_read_data(struct work_struct *work)
-{
- int size = 0, read_avail;
- unsigned long flags;
- struct sdio_buf_struct *buf;
- SDIO_XPRT_DBG("sdio_xprt Called %s\n", __func__);
-
- mutex_lock(&modem_reset_lock);
- while (!(modem_reset) &&
- ((read_avail =
- sdio_read_avail(sdio_remote_xprt.channel->handle)) > 0)) {
- spin_lock_irqsave(&sdio_remote_xprt.channel->read_list_lock,
- flags);
- if (num_rx_bufs == MAX_RX_BUFS) {
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->read_list_lock,
- flags);
- queue_delayed_work(sdio_xprt_read_workqueue,
- &work_read_data,
- msecs_to_jiffies(100));
- break;
- }
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->read_list_lock, flags);
-
- buf = alloc_from_free_list(sdio_remote_xprt.channel);
- if (!buf) {
- SDIO_XPRT_DBG("%s: Failed to alloc_from_free_list"
- " Try again later\n", __func__);
- queue_delayed_work(sdio_xprt_read_workqueue,
- &work_read_data,
- msecs_to_jiffies(100));
- break;
- }
-
- size = sdio_read(sdio_remote_xprt.channel->handle,
- buf->data, read_avail);
- if (size < 0) {
- printk(KERN_ERR "sdio_read failed,"
- " read %d bytes, expected %d\n",
- size, read_avail);
- return_to_free_list(sdio_remote_xprt.channel, buf);
- queue_delayed_work(sdio_xprt_read_workqueue,
- &work_read_data,
- msecs_to_jiffies(100));
- break;
- }
-
- if (size == 0)
- size = read_avail;
-
- buf->size = size;
- buf->write_index = size;
- spin_lock_irqsave(&sdio_remote_xprt.channel->read_list_lock,
- flags);
- list_add_tail(&buf->list,
- &sdio_remote_xprt.channel->read_list);
- num_rx_bufs++;
- spin_unlock_irqrestore(
- &sdio_remote_xprt.channel->read_list_lock, flags);
- wake_lock(&sdio_remote_xprt.channel->read_wakelock);
- }
-
- if (!modem_reset && !list_empty(&sdio_remote_xprt.channel->read_list))
- msm_rpcrouter_xprt_notify(&sdio_remote_xprt.xprt,
- RPCROUTER_XPRT_EVENT_DATA);
- mutex_unlock(&modem_reset_lock);
-}
-
-static void rpcrouter_sdio_remote_notify(void *_dev, unsigned event)
-{
- if (event == SDIO_EVENT_DATA_READ_AVAIL) {
- SDIO_XPRT_DBG("%s Received Notify"
- "SDIO_EVENT_DATA_READ_AVAIL\n", __func__);
- queue_delayed_work(sdio_xprt_read_workqueue,
- &work_read_data, 0);
- }
- if (event == SDIO_EVENT_DATA_WRITE_AVAIL) {
- SDIO_XPRT_DBG("%s Received Notify"
- "SDIO_EVENT_DATA_WRITE_AVAIL\n", __func__);
- wake_up(&write_avail_wait_q);
- }
-}
-
-static int allocate_sdio_xprt(struct sdio_xprt **sdio_xprt_chnl)
-{
- struct sdio_buf_struct *buf;
- struct sdio_xprt *chnl;
- int i;
- unsigned long flags;
- int rc = -ENOMEM;
-
- if (!(*sdio_xprt_chnl)) {
- chnl = kmalloc(sizeof(struct sdio_xprt), GFP_KERNEL);
- if (!chnl) {
- printk(KERN_ERR "sdio_xprt channel"
- " allocation failed\n");
- return rc;
- }
-
- spin_lock_init(&chnl->write_list_lock);
- spin_lock_init(&chnl->read_list_lock);
- spin_lock_init(&chnl->free_list_lock);
-
- INIT_LIST_HEAD(&chnl->write_list);
- INIT_LIST_HEAD(&chnl->read_list);
- INIT_LIST_HEAD(&chnl->free_list);
- wake_lock_init(&chnl->read_wakelock,
- WAKE_LOCK_SUSPEND, "rpc_sdio_xprt_read");
- } else {
- chnl = *sdio_xprt_chnl;
- }
-
- for (i = 0; i < NUM_SDIO_BUFS; i++) {
- buf = kzalloc(sizeof(struct sdio_buf_struct), GFP_KERNEL);
- if (!buf) {
- printk(KERN_ERR "sdio_buf_struct alloc failed\n");
- goto alloc_failure;
- }
- spin_lock_irqsave(&chnl->free_list_lock, flags);
- list_add_tail(&buf->list, &chnl->free_list);
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
- }
- num_free_bufs = NUM_SDIO_BUFS;
-
- *sdio_xprt_chnl = chnl;
- return 0;
-
-alloc_failure:
- spin_lock_irqsave(&chnl->free_list_lock, flags);
- while (!list_empty(&chnl->free_list)) {
- buf = list_first_entry(&chnl->free_list,
- struct sdio_buf_struct,
- list);
- list_del(&buf->list);
- kfree(buf);
- }
- spin_unlock_irqrestore(&chnl->free_list_lock, flags);
- wake_lock_destroy(&chnl->read_wakelock);
-
- kfree(chnl);
- *sdio_xprt_chnl = NULL;
- return rc;
-}
-
-static int rpcrouter_sdio_remote_probe(struct platform_device *pdev)
-{
- int rc;
-
- SDIO_XPRT_INFO("%s Called\n", __func__);
-
- mutex_lock(&modem_reset_lock);
- if (!modem_reset) {
- sdio_xprt_read_workqueue =
- create_singlethread_workqueue("sdio_xprt");
- if (!sdio_xprt_read_workqueue) {
- mutex_unlock(&modem_reset_lock);
- return -ENOMEM;
- }
-
- sdio_remote_xprt.xprt.name = "rpcrotuer_sdio_xprt";
- sdio_remote_xprt.xprt.read_avail =
- rpcrouter_sdio_remote_read_avail;
- sdio_remote_xprt.xprt.read = rpcrouter_sdio_remote_read;
- sdio_remote_xprt.xprt.write_avail =
- rpcrouter_sdio_remote_write_avail;
- sdio_remote_xprt.xprt.write = rpcrouter_sdio_remote_write;
- sdio_remote_xprt.xprt.close = rpcrouter_sdio_remote_close;
- sdio_remote_xprt.xprt.priv = NULL;
-
- init_waitqueue_head(&write_avail_wait_q);
- }
- modem_reset = 0;
-
- rc = allocate_sdio_xprt(&sdio_remote_xprt.channel);
- if (rc) {
- destroy_workqueue(sdio_xprt_read_workqueue);
- mutex_unlock(&modem_reset_lock);
- return rc;
- }
-
- /* Open up SDIO channel */
- rc = sdio_open("SDIO_RPC", &sdio_remote_xprt.channel->handle, NULL,
- rpcrouter_sdio_remote_notify);
-
- if (rc < 0) {
- free_sdio_xprt(sdio_remote_xprt.channel);
- destroy_workqueue(sdio_xprt_read_workqueue);
- mutex_unlock(&modem_reset_lock);
- return rc;
- }
- mutex_unlock(&modem_reset_lock);
-
- msm_rpcrouter_xprt_notify(&sdio_remote_xprt.xprt,
- RPCROUTER_XPRT_EVENT_OPEN);
-
- SDIO_XPRT_INFO("%s Completed\n", __func__);
-
- return 0;
-}
-
-static int rpcrouter_sdio_remote_remove(struct platform_device *pdev)
-{
- SDIO_XPRT_INFO("%s Called\n", __func__);
-
- mutex_lock(&modem_reset_lock);
- modem_reset = 1;
- wake_up(&write_avail_wait_q);
- free_sdio_xprt(sdio_remote_xprt.channel);
- mutex_unlock(&modem_reset_lock);
-
- msm_rpcrouter_xprt_notify(&sdio_remote_xprt.xprt,
- RPCROUTER_XPRT_EVENT_CLOSE);
-
- SDIO_XPRT_INFO("%s Completed\n", __func__);
-
- return 0;
-}
-
-/*Remove this platform driver after mainline of SDIO_AL update*/
-static struct platform_driver rpcrouter_sdio_remote_driver = {
- .probe = rpcrouter_sdio_remote_probe,
- .driver = {
- .name = "SDIO_AL",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver rpcrouter_sdio_driver = {
- .probe = rpcrouter_sdio_remote_probe,
- .remove = rpcrouter_sdio_remote_remove,
- .driver = {
- .name = "SDIO_RPC",
- .owner = THIS_MODULE,
- },
-};
-
-static int __init rpcrouter_sdio_init(void)
-{
- int rc;
- msm_sdio_xprt_debug_mask = 0x2;
- rc = platform_driver_register(&rpcrouter_sdio_remote_driver);
- if (rc < 0)
- return rc;
- return platform_driver_register(&rpcrouter_sdio_driver);
-}
-
-module_init(rpcrouter_sdio_init);
-MODULE_DESCRIPTION("RPC Router SDIO XPRT");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/rpm-smd.c b/arch/arm/mach-msm/rpm-smd.c
index 54576a9..2a01a36 100644
--- a/arch/arm/mach-msm/rpm-smd.c
+++ b/arch/arm/mach-msm/rpm-smd.c
@@ -130,8 +130,7 @@
bool valid;
};
static struct rb_root tr_root = RB_ROOT;
-
-static int msm_rpm_send_smd_buffer(char *buf, int size, bool noirq);
+static int msm_rpm_send_smd_buffer(char *buf, uint32_t size, bool noirq);
static uint32_t msm_rpm_get_next_msg_id(void);
static inline unsigned int get_rsc_type(char *buf)
@@ -187,7 +186,8 @@
static void delete_kvp(char *msg, struct kvp *d)
{
struct kvp *n;
- int dec, size;
+ int dec;
+ uint32_t size;
n = get_next_kvp(d);
dec = (void *)n - (void *)d;
@@ -206,7 +206,7 @@
static void add_kvp(char *buf, struct kvp *n)
{
- int inc = sizeof(*n) + n->s;
+ uint32_t inc = sizeof(*n) + n->s;
BUG_ON((get_req_len(buf) + inc) > MAX_SLEEP_BUFFER);
memcpy(buf + get_buf_len(buf), n, inc);
@@ -311,7 +311,7 @@
}
}
-int msm_rpm_smd_buffer_request(char *buf, int size, gfp_t flag)
+int msm_rpm_smd_buffer_request(char *buf, uint32_t size, gfp_t flag)
{
struct slp_buf *slp;
static DEFINE_SPINLOCK(slp_buffer_lock);
@@ -367,7 +367,7 @@
pos += scnprintf(buf + pos, buflen - pos, " id = 0%x",
get_rsc_id(s->buf));
for_each_kvp(s->buf, e) {
- int i;
+ uint32_t i;
char *data = get_data(e);
memcpy(ch, &e->k, sizeof(u32));
@@ -482,14 +482,17 @@
static int msm_rpm_add_kvp_data_common(struct msm_rpm_request *handle,
uint32_t key, const uint8_t *data, int size, bool noirq)
{
- int i;
- int data_size, msg_size;
+ uint32_t i;
+ uint32_t data_size, msg_size;
if (!handle) {
pr_err("%s(): Invalid handle\n", __func__);
return -EINVAL;
}
+ if (size < 0)
+ return -EINVAL;
+
data_size = ALIGN(size, SZ_4);
msg_size = data_size + sizeof(struct rpm_request_header);
@@ -813,7 +816,7 @@
static int msm_rpm_read_smd_data(char *buf)
{
- int pkt_sz;
+ uint32_t pkt_sz;
int bytes_read = 0;
pkt_sz = smd_cur_packet_size(msm_rpm_data.ch_info);
@@ -867,7 +870,8 @@
size_t buflen = DEBUG_PRINT_BUFFER_SIZE;
char name[5];
u32 value;
- int i, j, prev_valid;
+ uint32_t i;
+ int j, prev_valid;
int valid_count = 0;
int pos = 0;
@@ -992,7 +996,7 @@
pos += scnprintf(buf + pos, buflen - pos, "\n");
printk(buf);
}
-static int msm_rpm_send_smd_buffer(char *buf, int size, bool noirq)
+static int msm_rpm_send_smd_buffer(char *buf, uint32_t size, bool noirq)
{
unsigned long flags;
int ret;
@@ -1027,8 +1031,9 @@
int msg_type, bool noirq)
{
uint8_t *tmpbuff;
- int i, ret, msg_size;
-
+ int ret;
+ uint32_t i;
+ uint32_t msg_size;
int req_hdr_sz, msg_hdr_sz;
if (!cdata->msg_hdr.data_len)
diff --git a/arch/arm/mach-msm/sdio_al.c b/arch/arm/mach-msm/sdio_al.c
deleted file mode 100644
index bcfc556..0000000
--- a/arch/arm/mach-msm/sdio_al.c
+++ /dev/null
@@ -1,4365 +0,0 @@
-/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * SDIO-Abstraction-Layer Module.
- *
- * To be used with Qualcomm's SDIO-Client connected to this host.
- */
-#include "sdio_al_private.h"
-
-#include <linux/module.h>
-#include <linux/scatterlist.h>
-#include <linux/workqueue.h>
-#include <linux/wait.h>
-#include <linux/delay.h>
-#include <linux/fs.h>
-#include <linux/slab.h>
-#include <linux/wakelock.h>
-#include <linux/mmc/core.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/mmc.h>
-#include <linux/mmc/sdio.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/sdio_ids.h>
-#include <linux/gpio.h>
-#include <linux/dma-mapping.h>
-#include <linux/earlysuspend.h>
-#include <linux/debugfs.h>
-#include <linux/uaccess.h>
-#include <linux/syscalls.h>
-#include <linux/time.h>
-#include <linux/spinlock.h>
-
-#include <mach/dma.h>
-#include <mach/gpio.h>
-#include <mach/subsystem_notif.h>
-
-#include "../../../drivers/mmc/host/msm_sdcc.h"
-
-/**
- * Func#0 has SDIO standard registers
- * Func#1 is for Mailbox.
- * Functions 2..7 are for channels.
- * Currently only functions 2..5 are active due to SDIO-Client
- * number of pipes.
- *
- */
-#define SDIO_AL_MAX_CHANNELS 6
-
-/** Func 1..5 */
-#define SDIO_AL_MAX_FUNCS (SDIO_AL_MAX_CHANNELS+1)
-#define SDIO_AL_WAKEUP_FUNC 6
-
-/** Number of SDIO-Client pipes */
-#define SDIO_AL_MAX_PIPES 16
-#define SDIO_AL_ACTIVE_PIPES 8
-
-/** CMD53/CMD54 Block size */
-#define SDIO_AL_BLOCK_SIZE 256
-
-/** Func#1 hardware Mailbox base address */
-#define HW_MAILBOX_ADDR 0x1000
-
-/** Func#1 peer sdioc software version.
- * The header is duplicated also to the mailbox of the other
- * functions. It can be used before other functions are enabled. */
-#define SDIOC_SW_HEADER_ADDR 0x0400
-
-/** Func#2..7 software Mailbox base address at 16K */
-#define SDIOC_SW_MAILBOX_ADDR 0x4000
-
-/** Some Mailbox registers address, written by host for
- control */
-#define PIPES_THRESHOLD_ADDR 0x01000
-
-#define PIPES_0_7_IRQ_MASK_ADDR 0x01048
-
-#define PIPES_8_15_IRQ_MASK_ADDR 0x0104C
-
-#define FUNC_1_4_MASK_IRQ_ADDR 0x01040
-#define FUNC_5_7_MASK_IRQ_ADDR 0x01044
-#define FUNC_1_4_USER_IRQ_ADDR 0x01050
-#define FUNC_5_7_USER_IRQ_ADDR 0x01054
-
-#define EOT_PIPES_ENABLE 0x00
-
-/** Maximum read/write data available is SDIO-Client limitation */
-#define MAX_DATA_AVAILABLE (16*1024)
-#define INVALID_DATA_AVAILABLE (0x8000)
-
-/** SDIO-Client HW threshold to generate interrupt to the
- * SDIO-Host on write available bytes.
- */
-#define DEFAULT_WRITE_THRESHOLD (1024)
-
-/** SDIO-Client HW threshold to generate interrupt to the
- * SDIO-Host on read available bytes, for streaming (non
- * packet) rx data.
- */
-#define DEFAULT_READ_THRESHOLD (1024)
-#define LOW_LATENCY_THRESHOLD (1)
-
-/* Extra bytes to ensure getting the rx threshold interrupt on stream channels
- when restoring the threshold after sleep */
-#define THRESHOLD_CHANGE_EXTRA_BYTES (100)
-
-/** SW threshold to trigger reading the mailbox. */
-#define DEFAULT_MIN_WRITE_THRESHOLD (1024)
-#define DEFAULT_MIN_WRITE_THRESHOLD_STREAMING (1600)
-
-#define THRESHOLD_DISABLE_VAL (0xFFFFFFFF)
-
-/** Mailbox polling time for packet channels */
-#define DEFAULT_POLL_DELAY_MSEC 10
-/** Mailbox polling time for streaming channels */
-#define DEFAULT_POLL_DELAY_NOPACKET_MSEC 30
-
-/** The SDIO-Client prepares N buffers of size X per Tx pipe.
- * Even when the transfer fills a partial buffer,
- * that buffer becomes unusable for the next transfer. */
-#define DEFAULT_PEER_TX_BUF_SIZE (128)
-
-#define ROUND_UP(x, n) (((x + n - 1) / n) * n)
-
-/** Func#2..7 FIFOs are r/w via
- sdio_readsb() & sdio_writesb(),when inc_addr=0 */
-#define PIPE_RX_FIFO_ADDR 0x00
-#define PIPE_TX_FIFO_ADDR 0x00
-
-/** Inactivity time to go to sleep in mseconds */
-#define INACTIVITY_TIME_MSEC 30
-#define INITIAL_INACTIVITY_TIME_MSEC 5000
-
-/** Context validity check */
-#define SDIO_AL_SIGNATURE 0xAABBCCDD
-
-/* Vendor Specific Command */
-#define SD_IO_RW_EXTENDED_QCOM 54
-
-#define TIME_TO_WAIT_US 500
-#define SDIO_CLOSE_FLUSH_TIMEOUT_MSEC (10000)
-#define RX_FLUSH_BUFFER_SIZE (16*1024)
-
-#define SDIO_TEST_POSTFIX "_TEST"
-
-#define DATA_DEBUG(x, y...) \
- do { \
- if (sdio_al->debug.debug_data_on) \
- pr_info(y); \
- sdio_al_log(x, y); \
- } while (0)
-
-#define LPM_DEBUG(x, y...) \
- do { \
- if (sdio_al->debug.debug_lpm_on) \
- pr_info(y); \
- sdio_al_log(x, y); \
- } while (0)
-
-#define sdio_al_loge(x, y...) \
- do { \
- pr_err(y); \
- sdio_al_log(x, y); \
- } while (0)
-
-#define sdio_al_logi(x, y...) \
- do { \
- pr_info(y); \
- sdio_al_log(x, y); \
- } while (0)
-
-#define CLOSE_DEBUG(x, y...) \
- do { \
- if (sdio_al->debug.debug_close_on) \
- pr_info(y); \
- sdio_al_log(x, y); \
- } while (0)
-
-/* The index of the SDIO card used for the sdio_al_dloader */
-#define SDIO_BOOTLOADER_CARD_INDEX 1
-
-
-/* SDIO card state machine */
-enum sdio_al_device_state {
- CARD_INSERTED,
- CARD_REMOVED,
- MODEM_RESTART
-};
-
-struct sdio_al_debug {
- u8 debug_lpm_on;
- u8 debug_data_on;
- u8 debug_close_on;
- struct dentry *sdio_al_debug_root;
- struct dentry *sdio_al_debug_lpm_on;
- struct dentry *sdio_al_debug_data_on;
- struct dentry *sdio_al_debug_close_on;
- struct dentry *sdio_al_debug_info;
- struct dentry *sdio_al_debug_log_buffers[MAX_NUM_OF_SDIO_DEVICES + 1];
-};
-
-/* Polling time for the inactivity timer for devices that doesn't have
- * a streaming channel
- */
-#define SDIO_AL_POLL_TIME_NO_STREAMING 30
-
-#define CHAN_TO_FUNC(x) ((x) + 2 - 1)
-
-/**
- * Mailbox structure.
- * The Mailbox is located on the SDIO-Client Function#1.
- * The mailbox size is 128 bytes, which is one block.
- * The mailbox allows the host ton:
- * 1. Get the number of available bytes on the pipes.
- * 2. Enable/Disable SDIO-Client interrupt, related to pipes.
- * 3. Set the Threshold for generating interrupt.
- *
- */
-struct sdio_mailbox {
- u32 pipe_bytes_threshold[SDIO_AL_MAX_PIPES]; /* Addr 0x1000 */
-
- /* Mask USER interrupts generated towards host - Addr 0x1040 */
- u32 mask_irq_func_1:8; /* LSB */
- u32 mask_irq_func_2:8;
- u32 mask_irq_func_3:8;
- u32 mask_irq_func_4:8;
-
- u32 mask_irq_func_5:8;
- u32 mask_irq_func_6:8;
- u32 mask_irq_func_7:8;
- u32 mask_mutex_irq:8;
-
- /* Mask PIPE interrupts generated towards host - Addr 0x1048 */
- u32 mask_eot_pipe_0_7:8;
- u32 mask_thresh_above_limit_pipe_0_7:8;
- u32 mask_overflow_pipe_0_7:8;
- u32 mask_underflow_pipe_0_7:8;
-
- u32 mask_eot_pipe_8_15:8;
- u32 mask_thresh_above_limit_pipe_8_15:8;
- u32 mask_overflow_pipe_8_15:8;
- u32 mask_underflow_pipe_8_15:8;
-
- /* Status of User interrupts generated towards host - Addr 0x1050 */
- u32 user_irq_func_1:8;
- u32 user_irq_func_2:8;
- u32 user_irq_func_3:8;
- u32 user_irq_func_4:8;
-
- u32 user_irq_func_5:8;
- u32 user_irq_func_6:8;
- u32 user_irq_func_7:8;
- u32 user_mutex_irq:8;
-
- /* Status of PIPE interrupts generated towards host */
- /* Note: All sources are cleared once they read. - Addr 0x1058 */
- u32 eot_pipe_0_7:8;
- u32 thresh_above_limit_pipe_0_7:8;
- u32 overflow_pipe_0_7:8;
- u32 underflow_pipe_0_7:8;
-
- u32 eot_pipe_8_15:8;
- u32 thresh_above_limit_pipe_8_15:8;
- u32 overflow_pipe_8_15:8;
- u32 underflow_pipe_8_15:8;
-
- u16 pipe_bytes_avail[SDIO_AL_MAX_PIPES];
-};
-
-/** Track pending Rx Packet size */
-struct rx_packet_size {
- u32 size; /* in bytes */
- struct list_head list;
-};
-
-#define PEER_SDIOC_SW_MAILBOX_SIGNATURE 0xFACECAFE
-#define PEER_SDIOC_SW_MAILBOX_UT_SIGNATURE 0x5D107E57
-#define PEER_SDIOC_SW_MAILBOX_BOOT_SIGNATURE 0xDEADBEEF
-
-/* Allow support in old sdio version */
-#define PEER_SDIOC_OLD_VERSION_MAJOR 0x0002
-#define INVALID_SDIO_CHAN 0xFF
-
-/**
- * Peer SDIO-Client software header.
- */
-struct peer_sdioc_sw_header {
- u32 signature;
- u32 version;
- u32 max_channels;
- char channel_names[SDIO_AL_MAX_CHANNELS][PEER_CHANNEL_NAME_SIZE];
- u32 reserved[23];
-};
-
-struct peer_sdioc_boot_sw_header {
- u32 signature;
- u32 version;
- u32 boot_ch_num;
- u32 reserved[29]; /* 32 - previous fields */
-};
-
-/**
- * Peer SDIO-Client software mailbox.
- */
-struct peer_sdioc_sw_mailbox {
- struct peer_sdioc_sw_header sw_header;
- struct peer_sdioc_channel_config ch_config[SDIO_AL_MAX_CHANNELS];
-};
-
-#define SDIO_AL_DEBUG_LOG_SIZE 3000
-struct sdio_al_local_log {
- char buffer[SDIO_AL_DEBUG_LOG_SIZE];
- unsigned int buf_cur_pos;
- spinlock_t log_lock;
-};
-
-#define SDIO_AL_DEBUG_TMP_LOG_SIZE 250
-static int sdio_al_log(struct sdio_al_local_log *, const char *fmt, ...);
-
-/**
- * SDIO Abstraction Layer driver context.
- *
- * @pdata -
- * @debug -
- * @devices - an array of the the devices claimed by sdio_al
- * @unittest_mode - a flag to indicate if sdio_al is in
- * unittest mode
- * @bootloader_dev - the device which is used for the
- * bootloader
- * @subsys_notif_handle - handle for modem restart
- * notifications
- *
- */
-struct sdio_al {
- struct sdio_al_local_log gen_log;
- struct sdio_al_local_log device_log[MAX_NUM_OF_SDIO_DEVICES];
- struct sdio_al_platform_data *pdata;
- struct sdio_al_debug debug;
- struct sdio_al_device *devices[MAX_NUM_OF_SDIO_DEVICES];
- int unittest_mode;
- struct sdio_al_device *bootloader_dev;
- void *subsys_notif_handle;
- int sdioc_major;
- int skip_print_info;
-};
-
-struct sdio_al_work {
- struct work_struct work;
- struct sdio_al_device *sdio_al_dev;
-};
-
-
-/**
- * SDIO Abstraction Layer device context.
- *
- * @card - card claimed.
- *
- * @mailbox - A shadow of the SDIO-Client mailbox.
- *
- * @channel - Channels context.
- *
- * @workqueue - workqueue to read the mailbox and handle
- * pending requests. Reading the mailbox should not happen
- * in interrupt context.
- *
- * @work - work to submit to workqueue.
- *
- * @is_ready - driver is ready.
- *
- * @ask_mbox - Flag to request reading the mailbox,
- * for different reasons.
- *
- * @wake_lock - Lock when can't sleep.
- *
- * @lpm_chan - Channel to use for LPM (low power mode)
- * communication.
- *
- * @is_ok_to_sleep - Mark if driver is OK with going to sleep
- * (no pending transactions).
- *
- * @inactivity_time - time allowed to be in inactivity before
- * going to sleep
- *
- * @timer - timer to use for polling the mailbox.
- *
- * @poll_delay_msec - timer delay for polling the mailbox.
- *
- * @is_err - error detected.
- *
- * @signature - Context Validity Check.
- *
- * @flashless_boot_on - flag to indicate if sdio_al is in
- * flshless boot mode
- *
- */
-struct sdio_al_device {
- struct sdio_al_local_log *dev_log;
- struct mmc_card *card;
- struct mmc_host *host;
- struct sdio_mailbox *mailbox;
- struct sdio_channel channel[SDIO_AL_MAX_CHANNELS];
-
- struct peer_sdioc_sw_header *sdioc_sw_header;
- struct peer_sdioc_boot_sw_header *sdioc_boot_sw_header;
-
- struct workqueue_struct *workqueue;
- struct sdio_al_work sdio_al_work;
- struct sdio_al_work boot_work;
-
- int is_ready;
-
- wait_queue_head_t wait_mbox;
- int ask_mbox;
- int bootloader_done;
-
- struct wake_lock wake_lock;
- int lpm_chan;
- int is_ok_to_sleep;
- unsigned long inactivity_time;
-
- struct timer_list timer;
- u32 poll_delay_msec;
- int is_timer_initialized;
-
- int is_err;
-
- u32 signature;
-
- unsigned int is_suspended;
-
- int flashless_boot_on;
- int ch_close_supported;
- int state;
- int (*lpm_callback)(void *, int);
-
- int print_after_interrupt;
-
- u8 *rx_flush_buf;
-};
-
-/*
- * Host operation:
- * lower 16bits are operation code
- * upper 16bits are operation state
- */
-#define PEER_OPERATION(op_code , op_state) ((op_code) | ((op_state) << 16))
-#define GET_PEER_OPERATION_CODE(op) ((op) & 0xffff)
-#define GET_PEER_OPERATION_STATE(op) ((op) >> 16)
-
-enum peer_op_code {
- PEER_OP_CODE_CLOSE = 1
-};
-
-enum peer_op_state {
- PEER_OP_STATE_INIT = 0,
- PEER_OP_STATE_START = 1
-};
-
-
-/*
- * On the kernel command line specify
- * sdio_al.debug_lpm_on=1 to enable the LPM debug messages
- * By default the LPM debug messages are turned off
- */
-static int debug_lpm_on;
-module_param(debug_lpm_on, int, 0);
-
-/*
- * On the kernel command line specify
- * sdio_al.debug_data_on=1 to enable the DATA debug messages
- * By default the DATA debug messages are turned off
- */
-static int debug_data_on;
-module_param(debug_data_on, int, 0);
-
-/*
- * Enables / disables open close debug messages
- */
-static int debug_close_on = 1;
-module_param(debug_close_on, int, 0);
-
-/** The driver context */
-static struct sdio_al *sdio_al;
-
-/* Static functions declaration */
-static int enable_eot_interrupt(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int enable);
-static int enable_threshold_interrupt(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int enable);
-static void sdio_func_irq(struct sdio_func *func);
-static void sdio_al_timer_handler(unsigned long data);
-static int get_min_poll_time_msec(struct sdio_al_device *sdio_al_dev);
-static u32 check_pending_rx_packet(struct sdio_channel *ch, u32 eot);
-static u32 remove_handled_rx_packet(struct sdio_channel *ch);
-static int set_pipe_threshold(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int threshold);
-static int sdio_al_wake_up(struct sdio_al_device *sdio_al_dev,
- u32 not_from_int, struct sdio_channel *ch);
-static int sdio_al_client_setup(struct sdio_al_device *sdio_al_dev);
-static int enable_mask_irq(struct sdio_al_device *sdio_al_dev,
- int func_num, int enable, u8 bit_offset);
-static int sdio_al_enable_func_retry(struct sdio_func *func, const char *name);
-static void sdio_al_print_info(void);
-static int sdio_read_internal(struct sdio_channel *ch, void *data, int len);
-static int sdio_read_from_closed_ch(struct sdio_channel *ch, int len);
-static void stop_and_del_timer(struct sdio_al_device *sdio_al_dev);
-
-#define SDIO_AL_ERR(func) \
- do { \
- printk_once(KERN_ERR MODULE_NAME \
- ":In Error state, ignore %s\n", \
- func); \
- sdio_al_print_info(); \
- } while (0)
-
-#ifdef CONFIG_DEBUG_FS
-static int debug_info_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- return 0;
-}
-
-static ssize_t debug_info_write(struct file *file,
- const char __user *buf, size_t count, loff_t *ppos)
-{
- sdio_al_print_info();
- return 1;
-}
-
-const struct file_operations debug_info_ops = {
- .open = debug_info_open,
- .write = debug_info_write,
-};
-
-struct debugfs_blob_wrapper sdio_al_dbgfs_log[MAX_NUM_OF_SDIO_DEVICES + 1];
-
-/*
-*
-* Trigger on/off for debug messages
-* for trigger off the data messages debug level use:
-* echo 0 > /sys/kernel/debugfs/sdio_al/debug_data_on
-* for trigger on the data messages debug level use:
-* echo 1 > /sys/kernel/debugfs/sdio_al/debug_data_on
-* for trigger off the lpm messages debug level use:
-* echo 0 > /sys/kernel/debugfs/sdio_al/debug_lpm_on
-* for trigger on the lpm messages debug level use:
-* echo 1 > /sys/kernel/debugfs/sdio_al/debug_lpm_on
-*/
-static int sdio_al_debugfs_init(void)
-{
- int i, blob_errs = 0;
-
- sdio_al->debug.sdio_al_debug_root = debugfs_create_dir("sdio_al", NULL);
- if (!sdio_al->debug.sdio_al_debug_root)
- return -ENOENT;
-
- sdio_al->debug.sdio_al_debug_lpm_on = debugfs_create_u8("debug_lpm_on",
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- &sdio_al->debug.debug_lpm_on);
-
- sdio_al->debug.sdio_al_debug_data_on = debugfs_create_u8(
- "debug_data_on",
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- &sdio_al->debug.debug_data_on);
-
- sdio_al->debug.sdio_al_debug_close_on = debugfs_create_u8(
- "debug_close_on",
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- &sdio_al->debug.debug_close_on);
-
- sdio_al->debug.sdio_al_debug_info = debugfs_create_file(
- "sdio_debug_info",
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- NULL,
- &debug_info_ops);
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; ++i) {
- char temp[18];
-
- scnprintf(temp, 18, "sdio_al_log_dev_%d", i + 1);
- sdio_al->debug.sdio_al_debug_log_buffers[i] =
- debugfs_create_blob(temp,
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- &sdio_al_dbgfs_log[i]);
- }
-
- sdio_al->debug.sdio_al_debug_log_buffers[MAX_NUM_OF_SDIO_DEVICES] =
- debugfs_create_blob("sdio_al_gen_log",
- S_IRUGO | S_IWUGO,
- sdio_al->debug.sdio_al_debug_root,
- &sdio_al_dbgfs_log[MAX_NUM_OF_SDIO_DEVICES]);
-
- for (i = 0; i < (MAX_NUM_OF_SDIO_DEVICES + 1); ++i) {
- if (!sdio_al->debug.sdio_al_debug_log_buffers[i]) {
- pr_err(MODULE_NAME ": Failed to create debugfs buffer"
- " entry for "
- "sdio_al->debug.sdio_al_debug_log_buffers[%d]",
- i);
- blob_errs = 1;
- }
- }
-
- if (blob_errs) {
- for (i = 0; i < (MAX_NUM_OF_SDIO_DEVICES + 1); ++i)
- if (sdio_al->debug.sdio_al_debug_log_buffers[i])
- debugfs_remove(
- sdio_al->
- debug.sdio_al_debug_log_buffers[i]);
- }
-
-
- if ((!sdio_al->debug.sdio_al_debug_data_on) &&
- (!sdio_al->debug.sdio_al_debug_lpm_on) &&
- (!sdio_al->debug.sdio_al_debug_close_on) &&
- (!sdio_al->debug.sdio_al_debug_info) &&
- blob_errs) {
- debugfs_remove(sdio_al->debug.sdio_al_debug_root);
- sdio_al->debug.sdio_al_debug_root = NULL;
- return -ENOENT;
- }
-
- sdio_al_dbgfs_log[MAX_NUM_OF_SDIO_DEVICES].data =
- sdio_al->gen_log.buffer;
- sdio_al_dbgfs_log[MAX_NUM_OF_SDIO_DEVICES].size =
- SDIO_AL_DEBUG_LOG_SIZE;
-
- return 0;
-}
-
-static void sdio_al_debugfs_cleanup(void)
-{
- int i;
-
- debugfs_remove(sdio_al->debug.sdio_al_debug_lpm_on);
- debugfs_remove(sdio_al->debug.sdio_al_debug_data_on);
- debugfs_remove(sdio_al->debug.sdio_al_debug_close_on);
- debugfs_remove(sdio_al->debug.sdio_al_debug_info);
-
- for (i = 0; i < (MAX_NUM_OF_SDIO_DEVICES + 1); ++i)
- debugfs_remove(sdio_al->debug.sdio_al_debug_log_buffers[i]);
-
- debugfs_remove(sdio_al->debug.sdio_al_debug_root);
-}
-#endif
-
-static int sdio_al_log(struct sdio_al_local_log *log, const char *fmt, ...)
-{
- va_list args;
- int r;
- char *tp, *log_buf;
- unsigned int *log_cur_pos;
- struct timeval kt;
- unsigned long flags;
- static char sdio_al_log_tmp[SDIO_AL_DEBUG_TMP_LOG_SIZE];
-
- spin_lock_irqsave(&log->log_lock, flags);
-
- kt = ktime_to_timeval(ktime_get());
- r = scnprintf(sdio_al_log_tmp, SDIO_AL_DEBUG_TMP_LOG_SIZE,
- "[%8ld.%6ld] ", kt.tv_sec, kt.tv_usec);
-
- va_start(args, fmt);
- r += vscnprintf(&sdio_al_log_tmp[r], (SDIO_AL_DEBUG_TMP_LOG_SIZE - r),
- fmt, args);
- va_end(args);
-
- log_buf = log->buffer;
- log_cur_pos = &(log->buf_cur_pos);
-
- for (tp = sdio_al_log_tmp; tp < (sdio_al_log_tmp + r); tp++) {
- log_buf[(*log_cur_pos)++] = *tp;
- if ((*log_cur_pos) == SDIO_AL_DEBUG_LOG_SIZE)
- *log_cur_pos = 0;
- }
-
- spin_unlock_irqrestore(&log->log_lock, flags);
-
- return r;
-}
-
-static int sdio_al_verify_func1(struct sdio_al_device *sdio_al_dev,
- char const *func)
-{
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "sdio_al_dev\n", func);
- return -ENODEV;
- }
-
- if (sdio_al_dev->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: Invalid "
- "signature\n", func);
- return -ENODEV;
- }
-
- if (!sdio_al_dev->card) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: NULL "
- "card\n", func);
- return -ENODEV;
- }
- if (!sdio_al_dev->card->sdio_func[0]) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: NULL "
- "func1\n", func);
- return -ENODEV;
- }
- return 0;
-}
-
-static int sdio_al_claim_mutex(struct sdio_al_device *sdio_al_dev,
- char const *func)
-{
- if (!sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "device\n", func);
- return -ENODEV;
- }
-
- if (sdio_al_dev->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: Invalid "
- "device signature\n", func);
- return -ENODEV;
- }
-
- if (!sdio_al_dev->host) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: NULL "
- "host\n", func);
- return -ENODEV;
- }
-
- mmc_claim_host(sdio_al_dev->host);
-
- return 0;
-}
-
-static int sdio_al_release_mutex(struct sdio_al_device *sdio_al_dev,
- char const *func)
-{
- if (!sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "device\n", func);
- return -ENODEV;
- }
-
- if (sdio_al_dev->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: Invalid "
- "device signature\n", func);
- return -ENODEV;
- }
-
- if (!sdio_al_dev->host) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: NULL "
- "host\n", func);
- return -ENODEV;
- }
-
- mmc_release_host(sdio_al_dev->host);
-
- return 0;
-}
-
-static int sdio_al_claim_mutex_and_verify_dev(
- struct sdio_al_device *sdio_al_dev,
- char const *func)
-{
- if (sdio_al_claim_mutex(sdio_al_dev, __func__))
- return -ENODEV;
-
- if (sdio_al_dev->state != CARD_INSERTED) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": %s: Invalid "
- "device state %d\n", func, sdio_al_dev->state);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return -ENODEV;
- }
-
- return 0;
-}
-
-static void sdio_al_get_into_err_state(struct sdio_al_device *sdio_al_dev)
-{
- if ((!sdio_al) || (!sdio_al_dev))
- return;
-
- sdio_al_dev->is_err = true;
- sdio_al->debug.debug_data_on = 0;
- sdio_al->debug.debug_lpm_on = 0;
- sdio_al_print_info();
-}
-
-void sdio_al_register_lpm_cb(void *device_handle,
- int(*lpm_callback)(void *, int))
-{
- struct sdio_al_device *sdio_al_dev =
- (struct sdio_al_device *) device_handle;
-
- if (!sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s - "
- "device_handle is NULL\n", __func__);
- return;
- }
-
- if (lpm_callback) {
- sdio_al_dev->lpm_callback = lpm_callback;
- lpm_callback((void *)sdio_al_dev,
- sdio_al_dev->is_ok_to_sleep);
- }
-
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": %s - device %d "
- "registered for wakeup callback\n", __func__,
- sdio_al_dev->host->index);
-}
-
-void sdio_al_unregister_lpm_cb(void *device_handle)
-{
- struct sdio_al_device *sdio_al_dev =
- (struct sdio_al_device *) device_handle;
-
- if (!sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s - "
- "device_handle is NULL\n", __func__);
- return;
- }
-
- sdio_al_dev->lpm_callback = NULL;
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": %s - device %d "
- "unregister for wakeup callback\n", __func__,
- sdio_al_dev->host->index);
-}
-
-static void sdio_al_vote_for_sleep(struct sdio_al_device *sdio_al_dev,
- int is_vote_for_sleep)
-{
- pr_debug(MODULE_NAME ": %s()", __func__);
-
- if (!sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s - sdio_al_dev"
- " is NULL\n", __func__);
- return;
- }
-
- if (is_vote_for_sleep) {
- pr_debug(MODULE_NAME ": %s - sdio vote for Sleep", __func__);
- wake_unlock(&sdio_al_dev->wake_lock);
- } else {
- pr_debug(MODULE_NAME ": %s - sdio vote against sleep",
- __func__);
- wake_lock(&sdio_al_dev->wake_lock);
- }
-
- if (sdio_al_dev->lpm_callback != NULL) {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": %s - "
- "is_vote_for_sleep=%d for card#%d, "
- "calling callback...", __func__,
- is_vote_for_sleep,
- sdio_al_dev->host->index);
- sdio_al_dev->lpm_callback((void *)sdio_al_dev,
- is_vote_for_sleep);
- }
-}
-
-/**
- * Write SDIO-Client lpm information
- * Should only be called with host claimed.
- */
-static int write_lpm_info(struct sdio_al_device *sdio_al_dev)
-{
- struct sdio_func *lpm_func = NULL;
- int offset = offsetof(struct peer_sdioc_sw_mailbox, ch_config)+
- sizeof(struct peer_sdioc_channel_config) *
- sdio_al_dev->lpm_chan+
- offsetof(struct peer_sdioc_channel_config, is_host_ok_to_sleep);
- int ret;
-
- if (sdio_al_dev->lpm_chan == INVALID_SDIO_CHAN) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Invalid "
- "lpm_chan for card %d\n",
- sdio_al_dev->host->index);
- return -EINVAL;
- }
-
- if (!sdio_al_dev->card ||
- !sdio_al_dev->card->sdio_func[sdio_al_dev->lpm_chan+1]) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": NULL card or lpm_func\n");
- return -ENODEV;
- }
- lpm_func = sdio_al_dev->card->sdio_func[sdio_al_dev->lpm_chan+1];
-
- pr_debug(MODULE_NAME ":write_lpm_info is_ok_to_sleep=%d, device %d\n",
- sdio_al_dev->is_ok_to_sleep,
- sdio_al_dev->host->index);
-
- ret = sdio_memcpy_toio(lpm_func, SDIOC_SW_MAILBOX_ADDR+offset,
- &sdio_al_dev->is_ok_to_sleep, sizeof(u32));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":failed to "
- "write lpm info for card %d\n",
- sdio_al_dev->host->index);
- return ret;
- }
-
- return 0;
-}
-
-/* Set inactivity counter to intial value to allow clients come up */
-static inline void start_inactive_time(struct sdio_al_device *sdio_al_dev)
-{
- sdio_al_dev->inactivity_time = jiffies +
- msecs_to_jiffies(INITIAL_INACTIVITY_TIME_MSEC);
-}
-
-static inline void restart_inactive_time(struct sdio_al_device *sdio_al_dev)
-{
- sdio_al_dev->inactivity_time = jiffies +
- msecs_to_jiffies(INACTIVITY_TIME_MSEC);
-}
-
-static inline int is_inactive_time_expired(struct sdio_al_device *sdio_al_dev)
-{
- return time_after(jiffies, sdio_al_dev->inactivity_time);
-}
-
-
-static int is_user_irq_enabled(struct sdio_al_device *sdio_al_dev,
- int func_num)
-{
- int ret = 0;
- struct sdio_func *func1;
- u32 user_irq = 0;
- u32 addr = 0;
- u32 offset = 0;
- u32 masked_user_irq = 0;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return 0;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- if (func_num < 4) {
- addr = FUNC_1_4_USER_IRQ_ADDR;
- offset = func_num * 8;
- } else {
- addr = FUNC_5_7_USER_IRQ_ADDR;
- offset = (func_num - 4) * 8;
- }
-
- user_irq = sdio_readl(func1, addr, &ret);
- if (ret) {
- pr_debug(MODULE_NAME ":read_user_irq fail\n");
- return 0;
- }
-
- masked_user_irq = (user_irq >> offset) && 0xFF;
- if (masked_user_irq == 0x1) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":user_irq "
- "enabled\n");
- return 1;
- }
-
- return 0;
-}
-
-static void sdio_al_sleep(struct sdio_al_device *sdio_al_dev,
- struct mmc_host *host)
-{
- int i;
-
- /* Go to sleep */
- pr_debug(MODULE_NAME ":Inactivity timer expired."
- " Going to sleep\n");
- /* Stop mailbox timer */
- stop_and_del_timer(sdio_al_dev);
- /* Make sure we get interrupt for non-packet-mode right away */
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
- if ((ch->state != SDIO_CHANNEL_STATE_OPEN) &&
- (ch->state != SDIO_CHANNEL_STATE_CLOSED)) {
- pr_debug(MODULE_NAME ":continue for channel %s in"
- " state %d\n", ch->name, ch->state);
- continue;
- }
- if (ch->is_packet_mode == false) {
- ch->read_threshold = LOW_LATENCY_THRESHOLD;
- set_pipe_threshold(sdio_al_dev,
- ch->rx_pipe_index,
- ch->read_threshold);
- }
- }
- /* Prevent modem to go to sleep until we get the PROG_DONE on
- the dummy CMD52 */
- msmsdcc_set_pwrsave(sdio_al_dev->host, 0);
- /* Mark HOST_OK_TOSLEEP */
- sdio_al_dev->is_ok_to_sleep = 1;
- write_lpm_info(sdio_al_dev);
-
- msmsdcc_lpm_enable(host);
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":Finished sleep sequence"
- " for card %d. Sleep now.\n",
- sdio_al_dev->host->index);
- /* Release wakelock */
- sdio_al_vote_for_sleep(sdio_al_dev, 1);
-}
-
-
-/**
- * Read SDIO-Client Mailbox from Function#1.thresh_pipe
- *
- * The mailbox contain the bytes available per pipe,
- * and the End-Of-Transfer indication per pipe (if available).
- *
- * WARNING: Each time the Mailbox is read from the client, the
- * read_bytes_avail is incremented with another pending
- * transfer. Therefore, a pending rx-packet should be added to a
- * list before the next read of the mailbox.
- *
- * This function should run from a workqueue context since it
- * notifies the clients.
- *
- * This function assumes that sdio_al_claim_mutex was called before
- * calling it.
- *
- */
-static int read_mailbox(struct sdio_al_device *sdio_al_dev, int from_isr)
-{
- int ret;
- struct sdio_func *func1 = NULL;
- struct sdio_mailbox *mailbox = sdio_al_dev->mailbox;
- struct mmc_host *host = sdio_al_dev->host;
- u32 new_write_avail = 0;
- u32 old_write_avail = 0;
- u32 any_read_avail = 0;
- u32 any_write_pending = 0;
- int i;
- u32 rx_notify_bitmask = 0;
- u32 tx_notify_bitmask = 0;
- u32 eot_pipe = 0;
- u32 thresh_pipe = 0;
- u32 overflow_pipe = 0;
- u32 underflow_pipe = 0;
- u32 thresh_intr_mask = 0;
- int is_closing = 0;
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- return 0;
- }
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- pr_debug(MODULE_NAME ":start %s from_isr = %d for card %d.\n"
- , __func__, from_isr, sdio_al_dev->host->index);
-
- pr_debug(MODULE_NAME ":before sdio_memcpy_fromio.\n");
- memset(mailbox, 0, sizeof(struct sdio_mailbox));
- ret = sdio_memcpy_fromio(func1, mailbox,
- HW_MAILBOX_ADDR, sizeof(*mailbox));
- pr_debug(MODULE_NAME ":after sdio_memcpy_fromio.\n");
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to read "
- "Mailbox for card %d, goto error state\n",
- sdio_al_dev->host->index);
- sdio_al_get_into_err_state(sdio_al_dev);
- goto exit_err;
- }
-
- eot_pipe = (mailbox->eot_pipe_0_7) |
- (mailbox->eot_pipe_8_15<<8);
- thresh_pipe = (mailbox->thresh_above_limit_pipe_0_7) |
- (mailbox->thresh_above_limit_pipe_8_15<<8);
-
- overflow_pipe = (mailbox->overflow_pipe_0_7) |
- (mailbox->overflow_pipe_8_15<<8);
- underflow_pipe = mailbox->underflow_pipe_0_7 |
- (mailbox->underflow_pipe_8_15<<8);
- thresh_intr_mask =
- (mailbox->mask_thresh_above_limit_pipe_0_7) |
- (mailbox->mask_thresh_above_limit_pipe_8_15<<8);
-
- if (overflow_pipe || underflow_pipe)
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Mailbox ERROR "
- "overflow=0x%x, underflow=0x%x\n",
- overflow_pipe, underflow_pipe);
-
- /* In case of modem reset we would like to read the daya from the modem
- to clear the interrupts but do not process it */
- if (sdio_al_dev->state != CARD_INSERTED) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":sdio_al_device"
- " (card %d) is in invalid state %d\n",
- sdio_al_dev->host->index,
- sdio_al_dev->state);
- return -ENODEV;
- }
-
- pr_debug(MODULE_NAME ":card %d: eot=0x%x, thresh=0x%x\n",
- sdio_al_dev->host->index,
- eot_pipe, thresh_pipe);
-
- /* Scan for Rx Packets available and update read available bytes */
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
- u32 old_read_avail;
- u32 read_avail;
- u32 new_packet_size = 0;
-
- if (ch->state == SDIO_CHANNEL_STATE_CLOSING)
- is_closing = true; /* used to prevent sleep */
-
- old_read_avail = ch->read_avail;
- read_avail = mailbox->pipe_bytes_avail[ch->rx_pipe_index];
-
- if ((ch->state == SDIO_CHANNEL_STATE_CLOSED) &&
- (read_avail > 0)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":%s: Invalid read_avail 0x%x, for CLOSED ch %s\n",
- __func__, read_avail, ch->name);
- sdio_read_from_closed_ch(ch, read_avail);
- }
- if ((ch->state != SDIO_CHANNEL_STATE_OPEN) &&
- (ch->state != SDIO_CHANNEL_STATE_CLOSING))
- continue;
-
- if (read_avail > INVALID_DATA_AVAILABLE) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":Invalid read_avail 0x%x for pipe %d\n",
- read_avail, ch->rx_pipe_index);
- continue;
- }
- any_read_avail |= read_avail | old_read_avail;
- ch->statistics.last_any_read_avail = any_read_avail;
- ch->statistics.last_read_avail = read_avail;
- ch->statistics.last_old_read_avail = old_read_avail;
-
- if (ch->is_packet_mode) {
- if ((eot_pipe & (1<<ch->rx_pipe_index)) &&
- sdio_al_dev->print_after_interrupt) {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME
- ":Interrupt on ch %s, "
- "card %d", ch->name,
- sdio_al_dev->host->index);
- }
- new_packet_size = check_pending_rx_packet(ch, eot_pipe);
- } else {
- if ((thresh_pipe & (1<<ch->rx_pipe_index)) &&
- sdio_al_dev->print_after_interrupt) {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME
- ":Interrupt on ch %s, "
- "card %d", ch->name,
- sdio_al_dev->host->index);
- }
- ch->read_avail = read_avail;
-
- /*
- * Restore default thresh for non packet channels.
- * in case it IS low latency channel then read_threshold
- * and def_read_threshold are both
- * LOW_LATENCY_THRESHOLD
- */
- if ((ch->read_threshold != ch->def_read_threshold) &&
- (read_avail >= ch->threshold_change_cnt)) {
- if (!ch->is_low_latency_ch) {
- ch->read_threshold =
- ch->def_read_threshold;
- set_pipe_threshold(sdio_al_dev,
- ch->rx_pipe_index,
- ch->read_threshold);
- }
- }
- }
-
- if ((ch->is_packet_mode) && (new_packet_size > 0)) {
- rx_notify_bitmask |= (1<<ch->num);
- ch->statistics.total_notifs++;
- }
-
- if ((!ch->is_packet_mode) && (ch->read_avail > 0) &&
- (old_read_avail == 0)) {
- rx_notify_bitmask |= (1<<ch->num);
- ch->statistics.total_notifs++;
- }
- }
- sdio_al_dev->print_after_interrupt = 0;
-
- /* Update Write available */
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
-
- if ((ch->state != SDIO_CHANNEL_STATE_OPEN) &&
- (ch->state != SDIO_CHANNEL_STATE_CLOSING))
- continue;
-
- new_write_avail = mailbox->pipe_bytes_avail[ch->tx_pipe_index];
-
- if (new_write_avail > INVALID_DATA_AVAILABLE) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":Invalid write_avail 0x%x for pipe %d\n",
- new_write_avail, ch->tx_pipe_index);
- continue;
- }
-
- old_write_avail = ch->write_avail;
- ch->write_avail = new_write_avail;
-
- if ((old_write_avail <= ch->min_write_avail) &&
- (new_write_avail >= ch->min_write_avail))
- tx_notify_bitmask |= (1<<ch->num);
-
- /* There is not enough write avail for this channel.
- We need to keep reading mailbox to wait for the appropriate
- write avail and cannot sleep. Ignore SMEM channel that has
- only one direction. */
- if (strncmp(ch->name, "SDIO_SMEM", CHANNEL_NAME_SIZE))
- any_write_pending |=
- (new_write_avail < ch->ch_config.max_tx_threshold);
- }
- /* notify clients */
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
-
- if ((ch->state != SDIO_CHANNEL_STATE_OPEN) ||
- (ch->notify == NULL))
- continue;
-
- if (rx_notify_bitmask & (1<<ch->num))
- ch->notify(ch->priv,
- SDIO_EVENT_DATA_READ_AVAIL);
-
- if (tx_notify_bitmask & (1<<ch->num))
- ch->notify(ch->priv,
- SDIO_EVENT_DATA_WRITE_AVAIL);
- }
-
-
- if ((rx_notify_bitmask == 0) && (tx_notify_bitmask == 0) &&
- !any_read_avail && !any_write_pending) {
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":Nothing to "
- "Notify for card %d, is_closing=%d\n",
- sdio_al_dev->host->index, is_closing);
- if (is_closing)
- restart_inactive_time(sdio_al_dev);
- else if (is_inactive_time_expired(sdio_al_dev))
- sdio_al_sleep(sdio_al_dev, host);
- } else {
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":Notify bitmask"
- " for card %d rx=0x%x, tx=0x%x.\n",
- sdio_al_dev->host->index,
- rx_notify_bitmask, tx_notify_bitmask);
- /* Restart inactivity timer if any activity on the channel */
- restart_inactive_time(sdio_al_dev);
- }
-
- pr_debug(MODULE_NAME ":end %s.\n", __func__);
-
-exit_err:
- return ret;
-}
-
-/**
- * Check pending rx packet when reading the mailbox.
- */
-static u32 check_pending_rx_packet(struct sdio_channel *ch, u32 eot)
-{
- u32 rx_pending;
- u32 rx_avail;
- u32 new_packet_size = 0;
- struct sdio_al_device *sdio_al_dev = ch->sdio_al_dev;
-
-
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": NULL sdio_al_dev"
- " for channel %s\n", ch->name);
- return -EINVAL;
- }
-
- mutex_lock(&ch->ch_lock);
-
- rx_pending = ch->rx_pending_bytes;
- rx_avail = sdio_al_dev->mailbox->pipe_bytes_avail[ch->rx_pipe_index];
-
- pr_debug(MODULE_NAME ":pipe %d of card %d rx_avail=0x%x, "
- "rx_pending=0x%x\n",
- ch->rx_pipe_index, sdio_al_dev->host->index, rx_avail,
- rx_pending);
-
-
- /* new packet detected */
- if (eot & (1<<ch->rx_pipe_index)) {
- struct rx_packet_size *p = NULL;
- new_packet_size = rx_avail - rx_pending;
-
- if ((rx_avail <= rx_pending)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": Invalid new packet size."
- " rx_avail=%d.\n", rx_avail);
- new_packet_size = 0;
- goto exit_err;
- }
-
- p = kzalloc(sizeof(*p), GFP_KERNEL);
- if (p == NULL) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": failed to allocate item for "
- "rx_pending list. rx_avail=%d, "
- "rx_pending=%d.\n",
- rx_avail, rx_pending);
- new_packet_size = 0;
- goto exit_err;
- }
- p->size = new_packet_size;
- /* Add new packet as last */
- list_add_tail(&p->list, &ch->rx_size_list_head);
- ch->rx_pending_bytes += new_packet_size;
-
- if (ch->read_avail == 0)
- ch->read_avail = new_packet_size;
- }
-
-exit_err:
- mutex_unlock(&ch->ch_lock);
-
- return new_packet_size;
-}
-
-
-
-/**
- * Remove first pending packet from the list.
- */
-static u32 remove_handled_rx_packet(struct sdio_channel *ch)
-{
- struct rx_packet_size *p = NULL;
-
- mutex_lock(&ch->ch_lock);
-
- ch->rx_pending_bytes -= ch->read_avail;
-
- if (!list_empty(&ch->rx_size_list_head)) {
- p = list_first_entry(&ch->rx_size_list_head,
- struct rx_packet_size, list);
- list_del(&p->list);
- kfree(p);
- } else {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME ":%s: ch "
- "%s: unexpected empty list!!\n",
- __func__, ch->name);
- }
-
- if (list_empty(&ch->rx_size_list_head)) {
- ch->read_avail = 0;
- } else {
- p = list_first_entry(&ch->rx_size_list_head,
- struct rx_packet_size, list);
- ch->read_avail = p->size;
- }
-
- mutex_unlock(&ch->ch_lock);
-
- return ch->read_avail;
-}
-
-
-/**
- * Bootloader worker function.
- *
- * @note: clear the bootloader_done flag only after reading the
- * mailbox, to ignore more requests while reading the mailbox.
- */
-static void boot_worker(struct work_struct *work)
-{
- int ret = 0;
- int func_num = 0;
- int i;
- struct sdio_al_device *sdio_al_dev = NULL;
- struct sdio_al_work *sdio_al_work = container_of(work,
- struct sdio_al_work,
- work);
-
- if (sdio_al_work == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "sdio_al_work\n", __func__);
- return;
- }
-
- sdio_al_dev = sdio_al_work->sdio_al_dev;
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "sdio_al_dev\n", __func__);
- return;
- }
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":Bootloader Worker Started"
- ", wait for bootloader_done event..\n");
- wait_event(sdio_al_dev->wait_mbox,
- sdio_al_dev->bootloader_done);
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":Got bootloader_done "
- "event..\n");
- /* Do polling until MDM is up */
- for (i = 0; i < 5000; ++i) {
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return;
- if (is_user_irq_enabled(sdio_al_dev, func_num)) {
- sdio_al_release_mutex(sdio_al_dev, __func__);
- sdio_al_dev->bootloader_done = 0;
- ret = sdio_al_client_setup(sdio_al_dev);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": sdio_al_client_setup failed, "
- "for card %d ret=%d\n",
- sdio_al_dev->host->index, ret);
- sdio_al_get_into_err_state(sdio_al_dev);
- }
- goto done;
- }
- sdio_al_release_mutex(sdio_al_dev, __func__);
- msleep(100);
- }
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Timeout waiting for "
- "user_irq for card %d\n",
- sdio_al_dev->host->index);
- sdio_al_get_into_err_state(sdio_al_dev);
-
-done:
- pr_debug(MODULE_NAME ":Boot Worker for card %d Exit!\n",
- sdio_al_dev->host->index);
-}
-
-/**
- * Worker function.
- *
- * @note: clear the ask_mbox flag only after
- * reading the mailbox, to ignore more requests while
- * reading the mailbox.
- */
-static void worker(struct work_struct *work)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = NULL;
- struct sdio_al_work *sdio_al_work = container_of(work,
- struct sdio_al_work,
- work);
- if (sdio_al_work == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": worker: NULL "
- "sdio_al_work\n");
- return;
- }
-
- sdio_al_dev = sdio_al_work->sdio_al_dev;
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": worker: NULL "
- "sdio_al_dev\n");
- return;
- }
- pr_debug(MODULE_NAME ":Worker Started..\n");
- while ((sdio_al_dev->is_ready) && (ret == 0)) {
- pr_debug(MODULE_NAME ":Wait for read mailbox request..\n");
- wait_event(sdio_al_dev->wait_mbox, sdio_al_dev->ask_mbox);
- if (!sdio_al_dev->is_ready)
- break;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- break;
- if (sdio_al_dev->is_ok_to_sleep) {
- ret = sdio_al_wake_up(sdio_al_dev, 1, NULL);
- if (ret) {
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return;
- }
- }
- ret = read_mailbox(sdio_al_dev, false);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- sdio_al_dev->ask_mbox = false;
- }
-
- pr_debug(MODULE_NAME ":Worker Exit!\n");
-}
-
-/**
- * Write command using CMD54 rather than CMD53.
- * Writing with CMD54 generate EOT interrupt at the
- * SDIO-Client.
- * Based on mmc_io_rw_extended()
- */
-static int sdio_write_cmd54(struct mmc_card *card, unsigned fn,
- unsigned addr, const u8 *buf,
- unsigned blocks, unsigned blksz)
-{
- struct mmc_request mrq;
- struct mmc_command cmd;
- struct mmc_data data;
- struct scatterlist sg;
- int incr_addr = 1; /* MUST */
- int write = 1;
-
- BUG_ON(!card);
- BUG_ON(fn > 7);
- BUG_ON(blocks == 1 && blksz > 512);
- WARN_ON(blocks == 0);
- WARN_ON(blksz == 0);
-
- write = true;
- pr_debug(MODULE_NAME ":sdio_write_cmd54()"
- "fn=%d,buf=0x%x,blocks=%d,blksz=%d\n",
- fn, (u32) buf, blocks, blksz);
-
- memset(&mrq, 0, sizeof(struct mmc_request));
- memset(&cmd, 0, sizeof(struct mmc_command));
- memset(&data, 0, sizeof(struct mmc_data));
-
- mrq.cmd = &cmd;
- mrq.data = &data;
-
- cmd.opcode = SD_IO_RW_EXTENDED_QCOM;
-
- cmd.arg = write ? 0x80000000 : 0x00000000;
- cmd.arg |= fn << 28;
- cmd.arg |= incr_addr ? 0x04000000 : 0x00000000;
- cmd.arg |= addr << 9;
- if (blocks == 1 && blksz <= 512)
- cmd.arg |= (blksz == 512) ? 0 : blksz; /* byte mode */
- else
- cmd.arg |= 0x08000000 | blocks; /* block mode */
- cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC;
-
- data.blksz = blksz;
- data.blocks = blocks;
- data.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ;
- data.sg = &sg;
- data.sg_len = 1;
-
- sg_init_one(&sg, buf, blksz * blocks);
-
- mmc_set_data_timeout(&data, card);
-
- mmc_wait_for_req(card->host, &mrq);
-
- if (cmd.error)
- return cmd.error;
- if (data.error)
- return data.error;
-
- if (mmc_host_is_spi(card->host)) {
- /* host driver already reported errors */
- } else {
- if (cmd.resp[0] & R5_ERROR) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME
- ":%s: R5_ERROR for card %d",
- __func__, card->host->index);
- return -EIO;
- }
- if (cmd.resp[0] & R5_FUNCTION_NUMBER) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME
- ":%s: R5_FUNCTION_NUMBER for card %d",
- __func__, card->host->index);
- return -EINVAL;
- }
- if (cmd.resp[0] & R5_OUT_OF_RANGE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME
- ":%s: R5_OUT_OF_RANGE for card %d",
- __func__, card->host->index);
- return -ERANGE;
- }
- }
-
- return 0;
-}
-
-
-/**
- * Write data to channel.
- * Handle different data size types.
- *
- */
-static int sdio_ch_write(struct sdio_channel *ch, const u8 *buf, u32 len)
-{
- int ret = 0;
- unsigned blksz = ch->func->cur_blksize;
- int blocks = len / blksz;
- int remain_bytes = len % blksz;
- struct mmc_card *card = NULL;
- u32 fn = ch->func->num;
-
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
-
- if (!ch->sdio_al_dev) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "sdio_al_dev\n", __func__);
- return -ENODEV;
- }
-
- if (len == 0) {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME ":channel "
- "%s trying to write 0 bytes\n", ch->name);
- return -EINVAL;
- }
-
- card = ch->func->card;
-
- if (remain_bytes) {
- /* CMD53 */
- if (blocks) {
- ret = sdio_memcpy_toio(ch->func, PIPE_TX_FIFO_ADDR,
- (void *) buf, blocks*blksz);
- if (ret != 0) {
- sdio_al_loge(ch->sdio_al_dev->dev_log,
- MODULE_NAME ":%s: sdio_memcpy_toio "
- "failed for channel %s\n",
- __func__, ch->name);
- sdio_al_get_into_err_state(ch->sdio_al_dev);
- return ret;
- }
- }
-
- buf += (blocks*blksz);
-
- ret = sdio_write_cmd54(card, fn, PIPE_TX_FIFO_ADDR,
- buf, 1, remain_bytes);
- } else {
- ret = sdio_write_cmd54(card, fn, PIPE_TX_FIFO_ADDR,
- buf, blocks, blksz);
- }
-
- if (ret != 0) {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME ":%s: "
- "sdio_write_cmd54 failed for channel %s\n",
- __func__, ch->name);
- ch->sdio_al_dev->is_err = true;
- return ret;
- }
-
- return ret;
-}
-
-static int sdio_al_bootloader_completed(void)
-{
- int i;
-
- pr_debug(MODULE_NAME ":sdio_al_bootloader_completed was called\n");
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; ++i) {
- struct sdio_al_device *dev = NULL;
- if (sdio_al->devices[i] == NULL)
- continue;
- dev = sdio_al->devices[i];
- dev->bootloader_done = 1;
- wake_up(&dev->wait_mbox);
- }
-
- return 0;
-}
-
-static int sdio_al_wait_for_bootloader_comp(struct sdio_al_device *sdio_al_dev)
-{
- int ret = 0;
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- /*
- * Enable function 0 interrupt mask to allow 9k to raise this interrupt
- * in power-up. When sdio_downloader will notify its completion
- * we will poll on this interrupt to wait for 9k power-up
- */
- ret = enable_mask_irq(sdio_al_dev, 0, 1, 0);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": Enable_mask_irq for card %d failed, "
- "ret=%d\n",
- sdio_al_dev->host->index, ret);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return ret;
- }
-
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- /*
- * Start bootloader worker that will wait for the bootloader
- * completion
- */
- sdio_al_dev->boot_work.sdio_al_dev = sdio_al_dev;
- INIT_WORK(&sdio_al_dev->boot_work.work, boot_worker);
- sdio_al_dev->bootloader_done = 0;
- queue_work(sdio_al_dev->workqueue, &sdio_al_dev->boot_work.work);
-
- return 0;
-}
-
-static int sdio_al_bootloader_setup(void)
-{
- int ret = 0;
- struct sdio_al_device *bootloader_dev = sdio_al->bootloader_dev;
- struct sdio_func *func1 = NULL;
-
- if (sdio_al_claim_mutex_and_verify_dev(bootloader_dev, __func__))
- return -ENODEV;
-
- if (bootloader_dev->flashless_boot_on) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME ":Already "
- "in boot process.\n");
- sdio_al_release_mutex(bootloader_dev, __func__);
- return 0;
- }
-
- bootloader_dev->sdioc_boot_sw_header
- = kzalloc(sizeof(*bootloader_dev->sdioc_boot_sw_header),
- GFP_KERNEL);
- if (bootloader_dev->sdioc_boot_sw_header == NULL) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME ":fail to "
- "allocate sdioc boot sw header.\n");
- sdio_al_release_mutex(bootloader_dev, __func__);
- return -ENOMEM;
- }
-
- if (sdio_al_verify_func1(bootloader_dev, __func__)) {
- sdio_al_release_mutex(bootloader_dev, __func__);
- goto exit_err;
- }
- func1 = bootloader_dev->card->sdio_func[0];
-
- ret = sdio_memcpy_fromio(func1,
- bootloader_dev->sdioc_boot_sw_header,
- SDIOC_SW_HEADER_ADDR,
- sizeof(struct peer_sdioc_boot_sw_header));
- if (ret) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME ":fail to "
- "read sdioc boot sw header.\n");
- sdio_al_release_mutex(bootloader_dev, __func__);
- goto exit_err;
- }
-
- if (bootloader_dev->sdioc_boot_sw_header->signature !=
- (u32) PEER_SDIOC_SW_MAILBOX_BOOT_SIGNATURE) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME ":invalid "
- "mailbox signature 0x%x.\n",
- bootloader_dev->sdioc_boot_sw_header->signature);
- sdio_al_release_mutex(bootloader_dev, __func__);
- ret = -EINVAL;
- goto exit_err;
- }
-
- /* Upper byte has to be equal - no backward compatibility for unequal */
- if ((bootloader_dev->sdioc_boot_sw_header->version >> 16) !=
- (sdio_al->pdata->peer_sdioc_boot_version_major)) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME ": HOST(0x%x)"
- " and CLIENT(0x%x) SDIO_AL BOOT VERSION don't match\n",
- ((sdio_al->pdata->peer_sdioc_boot_version_major<<16)+
- sdio_al->pdata->peer_sdioc_boot_version_minor),
- bootloader_dev->sdioc_boot_sw_header->version);
- sdio_al_release_mutex(bootloader_dev, __func__);
- ret = -EIO;
- goto exit_err;
- }
-
- sdio_al_logi(bootloader_dev->dev_log, MODULE_NAME ": SDIOC BOOT SW "
- "version 0x%x\n",
- bootloader_dev->sdioc_boot_sw_header->version);
-
- bootloader_dev->flashless_boot_on = true;
-
- sdio_al_release_mutex(bootloader_dev, __func__);
-
- ret = sdio_al_wait_for_bootloader_comp(bootloader_dev);
- if (ret) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME
- ": sdio_al_wait_for_bootloader_comp failed, "
- "err=%d\n", ret);
- goto exit_err;
- }
-
- ret = sdio_downloader_setup(bootloader_dev->card, 1,
- bootloader_dev->sdioc_boot_sw_header->boot_ch_num,
- sdio_al_bootloader_completed);
-
- if (ret) {
- sdio_al_loge(bootloader_dev->dev_log, MODULE_NAME
- ": sdio_downloader_setup failed, err=%d\n", ret);
- goto exit_err;
- }
-
- sdio_al_logi(bootloader_dev->dev_log, MODULE_NAME ":In Flashless boot,"
- " waiting for its completion\n");
-
-
-exit_err:
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":free "
- "sdioc_boot_sw_header.\n");
- kfree(bootloader_dev->sdioc_boot_sw_header);
- bootloader_dev->sdioc_boot_sw_header = NULL;
- bootloader_dev = NULL;
-
- return ret;
-}
-
-
-/**
- * Read SDIO-Client software header
- *
- */
-static int read_sdioc_software_header(struct sdio_al_device *sdio_al_dev,
- struct peer_sdioc_sw_header *header)
-{
- int ret;
- int i;
- int test_version = 0;
- int sdioc_test_version = 0;
- struct sdio_func *func1 = NULL;
-
- pr_debug(MODULE_NAME ":reading sdioc sw header.\n");
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
-
- func1 = sdio_al_dev->card->sdio_func[0];
-
- ret = sdio_memcpy_fromio(func1, header,
- SDIOC_SW_HEADER_ADDR, sizeof(*header));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":fail to read "
- "sdioc sw header.\n");
- goto exit_err;
- }
-
- if (header->signature == (u32)PEER_SDIOC_SW_MAILBOX_UT_SIGNATURE) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":SDIOC SW "
- "unittest signature. 0x%x\n",
- header->signature);
- sdio_al->unittest_mode = true;
- /* Verify test code compatibility with the modem */
- sdioc_test_version = (header->version & 0xFF00) >> 8;
- test_version = sdio_al->pdata->peer_sdioc_version_minor >> 8;
- if (test_version != sdioc_test_version) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": HOST(0x%x) and CLIENT(0x%x) "
- "testing VERSION don't match\n",
- test_version,
- sdioc_test_version);
- msleep(500);
- BUG();
- }
- }
-
- if ((header->signature != (u32) PEER_SDIOC_SW_MAILBOX_SIGNATURE) &&
- (header->signature != (u32) PEER_SDIOC_SW_MAILBOX_UT_SIGNATURE)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":SDIOC SW "
- "invalid signature. 0x%x\n", header->signature);
- goto exit_err;
- }
- /* Upper byte has to be equal - no backward compatibility for unequal */
- sdio_al->sdioc_major = header->version >> 16;
- if (sdio_al->pdata->allow_sdioc_version_major_2) {
- if ((sdio_al->sdioc_major !=
- sdio_al->pdata->peer_sdioc_version_major) &&
- (sdio_al->sdioc_major != PEER_SDIOC_OLD_VERSION_MAJOR)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": HOST(0x%x) and CLIENT(0x%x) "
- "SDIO_AL VERSION don't match\n",
- ((sdio_al->pdata->peer_sdioc_version_major<<16)+
- sdio_al->pdata->peer_sdioc_version_minor),
- header->version);
- goto exit_err;
- }
- } else {
- if (sdio_al->sdioc_major !=
- sdio_al->pdata->peer_sdioc_version_major) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": HOST(0x%x) and CLIENT(0x%x) "
- "SDIO_AL VERSION don't match\n",
- ((sdio_al->pdata->peer_sdioc_version_major<<16)+
- sdio_al->pdata->peer_sdioc_version_minor),
- header->version);
- goto exit_err;
- }
- }
- sdio_al_dev->ch_close_supported = (header->version & 0x000F) >=
- (sdio_al->pdata->peer_sdioc_version_minor & 0xF);
-
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":SDIOC SW version 0x%x,"
- " sdio_al major 0x%x minor 0x%x\n", header->version,
- sdio_al->sdioc_major,
- sdio_al->pdata->peer_sdioc_version_minor);
-
- sdio_al_dev->flashless_boot_on = false;
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
-
- /* Set default values */
- ch->read_threshold = DEFAULT_READ_THRESHOLD;
- ch->write_threshold = DEFAULT_WRITE_THRESHOLD;
- ch->min_write_avail = DEFAULT_MIN_WRITE_THRESHOLD;
- ch->is_packet_mode = true;
- ch->peer_tx_buf_size = DEFAULT_PEER_TX_BUF_SIZE;
- ch->poll_delay_msec = 0;
-
- ch->num = i;
- ch->func = NULL;
- ch->rx_pipe_index = ch->num*2;
- ch->tx_pipe_index = ch->num*2+1;
-
- memset(ch->name, 0, sizeof(ch->name));
-
- if (header->channel_names[i][0]) {
- memcpy(ch->name, SDIO_PREFIX,
- strlen(SDIO_PREFIX));
- memcpy(ch->name + strlen(SDIO_PREFIX),
- header->channel_names[i],
- PEER_CHANNEL_NAME_SIZE);
-
- ch->state = SDIO_CHANNEL_STATE_IDLE;
- ch->sdio_al_dev = sdio_al_dev;
- if (sdio_al_dev->card->sdio_func[ch->num+1]) {
- ch->func =
- sdio_al_dev->card->sdio_func[ch->num+1];
- } else {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": NULL func for channel %s\n",
- ch->name);
- goto exit_err;
- }
- } else {
- ch->state = SDIO_CHANNEL_STATE_INVALID;
- }
-
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":Channel=%s, "
- "state=%d\n", ch->name, ch->state);
- }
-
- return 0;
-
-exit_err:
- sdio_al_get_into_err_state(sdio_al_dev);
- memset(header, 0, sizeof(*header));
-
- return -EIO;
-}
-
-/**
- * Read SDIO-Client channel configuration
- *
- */
-static int read_sdioc_channel_config(struct sdio_channel *ch)
-{
- int ret;
- struct peer_sdioc_sw_mailbox *sw_mailbox = NULL;
- struct peer_sdioc_channel_config *ch_config = NULL;
- struct sdio_al_device *sdio_al_dev = ch->sdio_al_dev;
-
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": NULL sdio_al_dev"
- " for channel %s\n", ch->name);
- return -EINVAL;
- }
-
- if (sdio_al_dev->sdioc_sw_header->version == 0)
- return -1;
-
- pr_debug(MODULE_NAME ":reading sw mailbox %s channel.\n", ch->name);
-
- sw_mailbox = kzalloc(sizeof(*sw_mailbox), GFP_KERNEL);
- if (sw_mailbox == NULL)
- return -ENOMEM;
-
- ret = sdio_memcpy_fromio(ch->func, sw_mailbox,
- SDIOC_SW_MAILBOX_ADDR, sizeof(*sw_mailbox));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":fail to read "
- "sw mailbox.\n");
- goto exit_err;
- }
-
- ch_config = &sw_mailbox->ch_config[ch->num];
- memcpy(&ch->ch_config, ch_config,
- sizeof(struct peer_sdioc_channel_config));
-
- if (!ch_config->is_ready) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":sw mailbox "
- "channel not ready.\n");
- goto exit_err;
- }
-
- ch->read_threshold = LOW_LATENCY_THRESHOLD;
- ch->is_low_latency_ch = ch_config->is_low_latency_ch;
- /* Threshold on 50% of the maximum size , sdioc uses double-buffer */
- ch->write_threshold = (ch_config->max_tx_threshold * 5) / 10;
- ch->threshold_change_cnt = ch->ch_config.max_rx_threshold -
- ch->read_threshold + THRESHOLD_CHANGE_EXTRA_BYTES;
-
- if (ch->is_low_latency_ch)
- ch->def_read_threshold = LOW_LATENCY_THRESHOLD;
- else /* Aggregation up to 90% of the maximum size */
- ch->def_read_threshold = (ch_config->max_rx_threshold * 9) / 10;
-
- ch->is_packet_mode = ch_config->is_packet_mode;
- if (!ch->is_packet_mode) {
- ch->poll_delay_msec = DEFAULT_POLL_DELAY_NOPACKET_MSEC;
- ch->min_write_avail = DEFAULT_MIN_WRITE_THRESHOLD_STREAMING;
- }
- /* The max_packet_size is set by the modem in version 3 and on */
- if (sdio_al->sdioc_major > PEER_SDIOC_OLD_VERSION_MAJOR)
- ch->min_write_avail = ch_config->max_packet_size;
-
- if (ch->min_write_avail > ch->write_threshold)
- ch->min_write_avail = ch->write_threshold;
-
- CLOSE_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":ch %s "
- "read_threshold=%d, write_threshold=%d,"
- " min_write_avail=%d, max_rx_threshold=%d,"
- " max_tx_threshold=%d\n", ch->name, ch->read_threshold,
- ch->write_threshold, ch->min_write_avail,
- ch_config->max_rx_threshold,
- ch_config->max_tx_threshold);
-
- ch->peer_tx_buf_size = ch_config->tx_buf_size;
-
- kfree(sw_mailbox);
-
- return 0;
-
-exit_err:
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":Reading SW Mailbox "
- "error.\n");
- kfree(sw_mailbox);
-
- return -1;
-}
-
-
-/**
- * Enable/Disable EOT interrupt of a pipe.
- *
- */
-static int enable_eot_interrupt(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int enable)
-{
- int ret = 0;
- struct sdio_func *func1;
- u32 mask;
- u32 pipe_mask;
- u32 addr;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- if (pipe_index < 8) {
- addr = PIPES_0_7_IRQ_MASK_ADDR;
- pipe_mask = (1<<pipe_index);
- } else {
- addr = PIPES_8_15_IRQ_MASK_ADDR;
- pipe_mask = (1<<(pipe_index-8));
- }
-
- mask = sdio_readl(func1, addr, &ret);
- if (ret) {
- pr_debug(MODULE_NAME ":enable_eot_interrupt fail\n");
- goto exit_err;
- }
-
- if (enable)
- mask &= (~pipe_mask); /* 0 = enable */
- else
- mask |= (pipe_mask); /* 1 = disable */
-
- sdio_writel(func1, mask, addr, &ret);
-
-exit_err:
- return ret;
-}
-
-
-/**
- * Enable/Disable mask interrupt of a function.
- *
- */
-static int enable_mask_irq(struct sdio_al_device *sdio_al_dev,
- int func_num, int enable, u8 bit_offset)
-{
- int ret = 0;
- struct sdio_func *func1 = NULL;
- u32 mask = 0;
- u32 func_mask = 0;
- u32 addr = 0;
- u32 offset = 0;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- if (func_num < 4) {
- addr = FUNC_1_4_MASK_IRQ_ADDR;
- offset = func_num * 8 + bit_offset;
- } else {
- addr = FUNC_5_7_MASK_IRQ_ADDR;
- offset = (func_num - 4) * 8 + bit_offset;
- }
-
- func_mask = 1<<offset;
-
- mask = sdio_readl(func1, addr, &ret);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "enable_mask_irq fail\n");
- goto exit_err;
- }
-
- if (enable)
- mask &= (~func_mask); /* 0 = enable */
- else
- mask |= (func_mask); /* 1 = disable */
-
- pr_debug(MODULE_NAME ":enable_mask_irq, writing mask = 0x%x\n", mask);
-
- sdio_writel(func1, mask, addr, &ret);
-
-exit_err:
- return ret;
-}
-
-/**
- * Enable/Disable Threshold interrupt of a pipe.
- *
- */
-static int enable_threshold_interrupt(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int enable)
-{
- int ret = 0;
- struct sdio_func *func1;
- u32 mask;
- u32 pipe_mask;
- u32 addr;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- if (pipe_index < 8) {
- addr = PIPES_0_7_IRQ_MASK_ADDR;
- pipe_mask = (1<<pipe_index);
- } else {
- addr = PIPES_8_15_IRQ_MASK_ADDR;
- pipe_mask = (1<<(pipe_index-8));
- }
-
- mask = sdio_readl(func1, addr, &ret);
- if (ret) {
- pr_debug(MODULE_NAME ":enable_threshold_interrupt fail\n");
- goto exit_err;
- }
-
- pipe_mask = pipe_mask<<8; /* Threshold bits 8..15 */
- if (enable)
- mask &= (~pipe_mask); /* 0 = enable */
- else
- mask |= (pipe_mask); /* 1 = disable */
-
- sdio_writel(func1, mask, addr, &ret);
-
-exit_err:
- return ret;
-}
-
-/**
- * Set the threshold to trigger interrupt from SDIO-Card on
- * pipe available bytes.
- *
- */
-static int set_pipe_threshold(struct sdio_al_device *sdio_al_dev,
- int pipe_index, int threshold)
-{
- int ret = 0;
- struct sdio_func *func1;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = sdio_al_dev->card->sdio_func[0];
-
- sdio_writel(func1, threshold,
- PIPES_THRESHOLD_ADDR+pipe_index*4, &ret);
- if (ret)
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "set_pipe_threshold err=%d\n", -ret);
-
- return ret;
-}
-
-/**
- * Enable func w/ retries
- *
- */
-static int sdio_al_enable_func_retry(struct sdio_func *func, const char *name)
-{
- int ret, i;
- for (i = 0; i < 200; i++) {
- ret = sdio_enable_func(func);
- if (ret) {
- pr_debug(MODULE_NAME ":retry enable %s func#%d "
- "ret=%d\n",
- name, func->num, ret);
- msleep(10);
- } else
- break;
- }
-
- return ret;
-}
-
-/**
- * Open Channel
- *
- * 1. Init Channel Context.
- * 2. Init the Channel SDIO-Function.
- * 3. Init the Channel Pipes on Mailbox.
- */
-static int open_channel(struct sdio_channel *ch)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = ch->sdio_al_dev;
-
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": NULL "
- "sdio_al_dev for channel %s\n", ch->name);
- return -EINVAL;
- }
-
- /* Init channel Context */
- /** Func#1 is reserved for mailbox */
- ch->func = sdio_al_dev->card->sdio_func[ch->num+1];
- ch->rx_pipe_index = ch->num*2;
- ch->tx_pipe_index = ch->num*2+1;
- ch->signature = SDIO_AL_SIGNATURE;
-
- ch->total_rx_bytes = 0;
- ch->total_tx_bytes = 0;
-
- ch->write_avail = 0;
- ch->read_avail = 0;
- ch->rx_pending_bytes = 0;
-
- mutex_init(&ch->ch_lock);
-
- pr_debug(MODULE_NAME ":open_channel %s func#%d\n",
- ch->name, ch->func->num);
-
- INIT_LIST_HEAD(&(ch->rx_size_list_head));
-
- /* Init SDIO Function */
- ret = sdio_al_enable_func_retry(ch->func, ch->name);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "sdio_enable_func() err=%d\n", -ret);
- goto exit_err;
- }
-
- /* Note: Patch Func CIS tuple issue */
- ret = sdio_set_block_size(ch->func, SDIO_AL_BLOCK_SIZE);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "sdio_set_block_size()failed, err=%d\n", -ret);
- goto exit_err;
- }
-
- ch->func->max_blksize = SDIO_AL_BLOCK_SIZE;
-
- sdio_set_drvdata(ch->func, ch);
-
- /* Get channel parameters from the peer SDIO-Client */
- read_sdioc_channel_config(ch);
-
- /* Set Pipes Threshold on Mailbox */
- ret = set_pipe_threshold(sdio_al_dev,
- ch->rx_pipe_index, ch->read_threshold);
- if (ret)
- goto exit_err;
- ret = set_pipe_threshold(sdio_al_dev,
- ch->tx_pipe_index, ch->write_threshold);
- if (ret)
- goto exit_err;
-
- /* Set flag before interrupts are enabled to allow notify */
- ch->state = SDIO_CHANNEL_STATE_OPEN;
- pr_debug(MODULE_NAME ":channel %s is in OPEN state now\n", ch->name);
-
- sdio_al_dev->poll_delay_msec = get_min_poll_time_msec(sdio_al_dev);
-
- /* lpm mechanism lives under the assumption there is always a timer */
- /* Check if need to start the timer */
- if ((sdio_al_dev->poll_delay_msec) &&
- (sdio_al_dev->is_timer_initialized == false)) {
-
- init_timer(&sdio_al_dev->timer);
- sdio_al_dev->timer.data = (unsigned long) sdio_al_dev;
- sdio_al_dev->timer.function = sdio_al_timer_handler;
- sdio_al_dev->timer.expires = jiffies +
- msecs_to_jiffies(sdio_al_dev->poll_delay_msec);
- add_timer(&sdio_al_dev->timer);
- sdio_al_dev->is_timer_initialized = true;
- }
-
- /* Enable Pipes Interrupts */
- enable_eot_interrupt(sdio_al_dev, ch->rx_pipe_index, true);
- enable_eot_interrupt(sdio_al_dev, ch->tx_pipe_index, true);
-
- enable_threshold_interrupt(sdio_al_dev, ch->rx_pipe_index, true);
- enable_threshold_interrupt(sdio_al_dev, ch->tx_pipe_index, true);
-
-exit_err:
-
- return ret;
-}
-
-/**
- * Ask the worker to read the mailbox.
- */
-static void ask_reading_mailbox(struct sdio_al_device *sdio_al_dev)
-{
- if (!sdio_al_dev->ask_mbox) {
- pr_debug(MODULE_NAME ":ask_reading_mailbox for card %d\n",
- sdio_al_dev->host->index);
- sdio_al_dev->ask_mbox = true;
- wake_up(&sdio_al_dev->wait_mbox);
- }
-}
-
-/**
- * Start the timer
- */
-static void start_timer(struct sdio_al_device *sdio_al_dev)
-{
- if ((sdio_al_dev->poll_delay_msec) &&
- (sdio_al_dev->state == CARD_INSERTED)) {
- sdio_al_dev->timer.expires = jiffies +
- msecs_to_jiffies(sdio_al_dev->poll_delay_msec);
- add_timer(&sdio_al_dev->timer);
- }
-}
-
-/**
- * Restart(postpone) the already working timer
- */
-static void restart_timer(struct sdio_al_device *sdio_al_dev)
-{
- if ((sdio_al_dev->poll_delay_msec) &&
- (sdio_al_dev->state == CARD_INSERTED)) {
- ulong expires = jiffies +
- msecs_to_jiffies(sdio_al_dev->poll_delay_msec);
- mod_timer(&sdio_al_dev->timer, expires);
- }
-}
-
-/**
- * Stop and delete the timer
- */
-static void stop_and_del_timer(struct sdio_al_device *sdio_al_dev)
-{
- if (sdio_al_dev->is_timer_initialized) {
- sdio_al_dev->poll_delay_msec = 0;
- del_timer_sync(&sdio_al_dev->timer);
- }
-}
-
-/**
- * Do the wakup sequence.
- * This function should be called after claiming the host!
- * The caller is responsible for releasing the host.
- *
- * Wake up sequence
- * 1. Get lock
- * 2. Enable wake up function if needed
- * 3. Mark NOT OK to sleep and write it
- * 4. Restore default thresholds
- * 5. Start the mailbox and inactivity timer again
- */
-static int sdio_al_wake_up(struct sdio_al_device *sdio_al_dev,
- u32 not_from_int, struct sdio_channel *ch)
-{
- int ret = 0;
- struct sdio_func *wk_func = NULL;
- unsigned long time_to_wait;
- struct mmc_host *host = sdio_al_dev->host;
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- return -ENODEV;
- }
-
- if (!sdio_al_dev->is_ok_to_sleep) {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":card %d "
- "already awake, no need to wake up\n",
- sdio_al_dev->host->index);
- return 0;
- }
-
- /* Wake up sequence */
- if (not_from_int) {
- if (ch) {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": Wake up"
- " card %d (not by interrupt), ch %s",
- sdio_al_dev->host->index,
- ch->name);
- } else {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": Wake up"
- " card %d (not by interrupt)",
- sdio_al_dev->host->index);
- }
- } else {
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": Wake up card "
- "%d by interrupt",
- sdio_al_dev->host->index);
- sdio_al_dev->print_after_interrupt = 1;
- }
-
- sdio_al_vote_for_sleep(sdio_al_dev, 0);
-
- msmsdcc_lpm_disable(host);
- msmsdcc_set_pwrsave(host, 0);
- /* Poll the GPIO */
- time_to_wait = jiffies + msecs_to_jiffies(1000);
- while (time_before(jiffies, time_to_wait)) {
- if (sdio_al->pdata->get_mdm2ap_status())
- break;
- udelay(TIME_TO_WAIT_US);
- }
-
- pr_debug(MODULE_NAME ":GPIO mdm2ap_status=%d\n",
- sdio_al->pdata->get_mdm2ap_status());
-
- /* Here get_mdm2ap_status() returning 0 is not an error condition */
- if (sdio_al->pdata->get_mdm2ap_status() == 0)
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ": "
- "get_mdm2ap_status() is 0\n");
-
- /* Enable Wake up Function */
- if (!sdio_al_dev->card ||
- !sdio_al_dev->card->sdio_func[SDIO_AL_WAKEUP_FUNC-1]) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": NULL card or wk_func\n");
- return -ENODEV;
- }
- wk_func = sdio_al_dev->card->sdio_func[SDIO_AL_WAKEUP_FUNC-1];
- ret = sdio_al_enable_func_retry(wk_func, "wakeup func");
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "sdio_enable_func() err=%d\n", -ret);
- goto error_exit;
- }
- /* Mark NOT OK_TOSLEEP */
- sdio_al_dev->is_ok_to_sleep = 0;
- ret = write_lpm_info(sdio_al_dev);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": "
- "write_lpm_info() failed, err=%d\n", -ret);
- sdio_al_dev->is_ok_to_sleep = 1;
- sdio_disable_func(wk_func);
- goto error_exit;
- }
- sdio_disable_func(wk_func);
-
- /* Start the timer again*/
- restart_inactive_time(sdio_al_dev);
- sdio_al_dev->poll_delay_msec = get_min_poll_time_msec(sdio_al_dev);
- start_timer(sdio_al_dev);
-
- LPM_DEBUG(sdio_al_dev->dev_log, MODULE_NAME "Finished Wake up sequence"
- " for card %d", sdio_al_dev->host->index);
-
- msmsdcc_set_pwrsave(host, 1);
- pr_debug(MODULE_NAME ":Turn clock off\n");
-
- return ret;
-error_exit:
- sdio_al_vote_for_sleep(sdio_al_dev, 1);
- msmsdcc_set_pwrsave(host, 1);
- WARN_ON(ret);
- sdio_al_get_into_err_state(sdio_al_dev);
- return ret;
-}
-
-
-/**
- * SDIO Function Interrupt handler.
- *
- * Interrupt shall be triggered by SDIO-Client when:
- * 1. End-Of-Transfer (EOT) detected in packet mode.
- * 2. Bytes-available reached the threshold.
- *
- * Reading the mailbox clears the EOT/Threshold interrupt
- * source.
- * The interrupt source should be cleared before this ISR
- * returns. This ISR is called from IRQ Thread and not
- * interrupt, so it may sleep.
- *
- */
-static void sdio_func_irq(struct sdio_func *func)
-{
- struct sdio_al_device *sdio_al_dev = sdio_get_drvdata(func);
-
- pr_debug(MODULE_NAME ":start %s.\n", __func__);
-
- if (sdio_al_dev == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": NULL device");
- return;
- }
-
- if (sdio_al_dev->is_ok_to_sleep)
- sdio_al_wake_up(sdio_al_dev, 0, NULL);
- else
- restart_timer(sdio_al_dev);
-
- read_mailbox(sdio_al_dev, true);
-
- pr_debug(MODULE_NAME ":end %s.\n", __func__);
-}
-
-/**
- * Timer Expire Handler
- *
- */
-static void sdio_al_timer_handler(unsigned long data)
-{
- struct sdio_al_device *sdio_al_dev = (struct sdio_al_device *)data;
- if (sdio_al_dev == NULL) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": NULL "
- "sdio_al_dev for data %lu\n", data);
- return;
- }
- if (sdio_al_dev->state != CARD_INSERTED) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": sdio_al_dev "
- "is in invalid state %d\n", sdio_al_dev->state);
- return;
- }
- pr_debug(MODULE_NAME " Timer Expired\n");
-
- ask_reading_mailbox(sdio_al_dev);
-
- restart_timer(sdio_al_dev);
-}
-
-/**
- * Driver Setup.
- *
- */
-static int sdio_al_setup(struct sdio_al_device *sdio_al_dev)
-{
- int ret = 0;
- struct mmc_card *card = sdio_al_dev->card;
- struct sdio_func *func1 = NULL;
- int i = 0;
- int fn = 0;
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- return -ENODEV;
- func1 = card->sdio_func[0];
-
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":sdio_al_setup for "
- "card %d\n", sdio_al_dev->host->index);
-
- ret = sdio_al->pdata->config_mdm2ap_status(1);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME "Could not "
- "request GPIO\n");
- return ret;
- }
-
- INIT_WORK(&sdio_al_dev->sdio_al_work.work, worker);
- /* disable all pipes interrupts before claim irq.
- since all are enabled by default. */
- for (i = 0 ; i < SDIO_AL_MAX_PIPES; i++) {
- enable_eot_interrupt(sdio_al_dev, i, false);
- enable_threshold_interrupt(sdio_al_dev, i, false);
- }
-
- /* Disable all SDIO Functions before claim irq. */
- for (fn = 1 ; fn <= card->sdio_funcs; fn++)
- sdio_disable_func(card->sdio_func[fn-1]);
-
- sdio_set_drvdata(func1, sdio_al_dev);
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":claim IRQ for card "
- "%d\n", sdio_al_dev->host->index);
-
- ret = sdio_claim_irq(func1, sdio_func_irq);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to claim"
- " IRQ for card %d\n",
- sdio_al_dev->host->index);
- return ret;
- }
-
- sdio_al_dev->is_ready = true;
-
- /* Start worker before interrupt might happen */
- queue_work(sdio_al_dev->workqueue, &sdio_al_dev->sdio_al_work.work);
-
- start_inactive_time(sdio_al_dev);
-
- pr_debug(MODULE_NAME ":Ready.\n");
-
- return 0;
-}
-
-/**
- * Driver Tear-Down.
- *
- */
-static void sdio_al_tear_down(void)
-{
- int i, j;
- struct sdio_al_device *sdio_al_dev = NULL;
- struct sdio_func *func1;
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; ++i) {
- if (sdio_al->devices[i] == NULL)
- continue;
- sdio_al_dev = sdio_al->devices[i];
-
- if (sdio_al_dev->is_ready) {
- sdio_al_dev->is_ready = false; /* Flag worker to exit */
- sdio_al_dev->ask_mbox = false;
- ask_reading_mailbox(sdio_al_dev); /* Wakeup worker */
- /* allow gracefully exit of the worker thread */
- msleep(100);
-
- flush_workqueue(sdio_al_dev->workqueue);
- destroy_workqueue(sdio_al_dev->workqueue);
-
- sdio_al_vote_for_sleep(sdio_al_dev, 1);
-
- if (!sdio_al_claim_mutex_and_verify_dev(sdio_al_dev,
- __func__)) {
- if (!sdio_al_dev->card ||
- !sdio_al_dev->card->sdio_func[0]) {
- sdio_al_loge(sdio_al_dev->dev_log,
- MODULE_NAME
- ": %s: Invalid func1",
- __func__);
- return;
- }
- func1 = sdio_al_dev->card->sdio_func[0];
- sdio_release_irq(func1);
- sdio_disable_func(func1);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- }
- }
-
- for (j = 0; j < SDIO_AL_MAX_CHANNELS; j++)
- sdio_al_dev->channel[j].signature = 0x0;
- sdio_al_dev->signature = 0;
-
- kfree(sdio_al_dev->sdioc_sw_header);
- kfree(sdio_al_dev->mailbox);
- kfree(sdio_al_dev->rx_flush_buf);
- kfree(sdio_al_dev);
- }
-
- sdio_al->pdata->config_mdm2ap_status(0);
-}
-
-/**
- * Find channel by name.
- *
- */
-static struct sdio_channel *find_channel_by_name(const char *name)
-{
- struct sdio_channel *ch = NULL;
- int i, j;
- struct sdio_al_device *sdio_al_dev = NULL;
-
- for (j = 0; j < MAX_NUM_OF_SDIO_DEVICES; ++j) {
- if (sdio_al->devices[j] == NULL)
- continue;
- sdio_al_dev = sdio_al->devices[j];
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- if (sdio_al_dev->channel[i].state ==
- SDIO_CHANNEL_STATE_INVALID)
- continue;
- if (strncmp(sdio_al_dev->channel[i].name, name,
- CHANNEL_NAME_SIZE) == 0) {
- ch = &sdio_al_dev->channel[i];
- break;
- }
- }
- if (ch != NULL)
- break;
- }
-
- return ch;
-}
-
-/**
- * Find the minimal poll time.
- *
- */
-static int get_min_poll_time_msec(struct sdio_al_device *sdio_sl_dev)
-{
- int i;
- int poll_delay_msec = 0x0FFFFFFF;
-
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++)
- if ((sdio_sl_dev->channel[i].state ==
- SDIO_CHANNEL_STATE_OPEN) &&
- (sdio_sl_dev->channel[i].poll_delay_msec > 0) &&
- (sdio_sl_dev->channel[i].poll_delay_msec < poll_delay_msec))
- poll_delay_msec =
- sdio_sl_dev->channel[i].poll_delay_msec;
-
- if (poll_delay_msec == 0x0FFFFFFF)
- poll_delay_msec = SDIO_AL_POLL_TIME_NO_STREAMING;
-
- pr_debug(MODULE_NAME ":poll delay time is %d msec\n", poll_delay_msec);
-
- return poll_delay_msec;
-}
-
-/**
- * Open SDIO Channel.
- *
- * Enable the channel.
- * Set the channel context.
- * Trigger reading the mailbox to check available bytes.
- *
- */
-int sdio_open(const char *name, struct sdio_channel **ret_ch, void *priv,
- void (*notify)(void *priv, unsigned ch_event))
-{
- int ret = 0;
- struct sdio_channel *ch = NULL;
- struct sdio_al_device *sdio_al_dev = NULL;
-
- *ret_ch = NULL; /* default */
-
- ch = find_channel_by_name(name);
- if (ch == NULL) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":Can't find "
- "channel name %s\n", name);
- return -EINVAL;
- }
-
- sdio_al_dev = ch->sdio_al_dev;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- if ((ch->state != SDIO_CHANNEL_STATE_IDLE) &&
- (ch->state != SDIO_CHANNEL_STATE_CLOSED)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Wrong ch %s "
- "state %d\n", name, ch->state);
- ret = -EPERM;
- goto exit_err;
- }
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- ret = -ENODEV;
- goto exit_err;
- }
-
- ret = sdio_al_wake_up(sdio_al_dev, 1, ch);
- if (ret)
- goto exit_err;
-
- ch->notify = notify;
- ch->priv = priv;
-
- /* Note: Set caller returned context before interrupts are enabled */
- *ret_ch = ch;
-
- ret = open_channel(ch);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":sdio_open %s "
- "err=%d\n", name, -ret);
- goto exit_err;
- }
-
- CLOSE_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":sdio_open %s "
- "completed OK\n", name);
- if (sdio_al_dev->lpm_chan == INVALID_SDIO_CHAN) {
- if (sdio_al->sdioc_major == PEER_SDIOC_OLD_VERSION_MAJOR) {
- if (!ch->is_packet_mode) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME
- ":setting channel %s as "
- "lpm_chan\n", name);
- sdio_al_dev->lpm_chan = ch->num;
- }
- } else {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ": "
- "setting channel %s as lpm_chan\n",
- name);
- sdio_al_dev->lpm_chan = ch->num;
- }
- }
-
-exit_err:
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return ret;
-}
-EXPORT_SYMBOL(sdio_open);
-
-/**
- * Request peer operation
- * note: sanity checks of parameters done by caller
- * called under bus locked
- */
-static int peer_set_operation(u32 opcode,
- struct sdio_al_device *sdio_al_dev,
- struct sdio_channel *ch)
-{
- int ret;
- int offset;
- struct sdio_func *wk_func = NULL;
- u32 peer_operation;
- int loop_count = 0;
-
- if (!sdio_al_dev->card ||
- !sdio_al_dev->card->sdio_func[SDIO_AL_WAKEUP_FUNC-1]) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": NULL card or wk_func\n");
- ret = -ENODEV;
- goto exit;
- }
- wk_func = sdio_al_dev->card->sdio_func[SDIO_AL_WAKEUP_FUNC-1];
-
- /* calculate offset of peer_operation field in sw mailbox struct */
- offset = offsetof(struct peer_sdioc_sw_mailbox, ch_config) +
- sizeof(struct peer_sdioc_channel_config) * ch->num +
- offsetof(struct peer_sdioc_channel_config, peer_operation);
-
- ret = sdio_al_wake_up(sdio_al_dev, 1, ch);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to "
- "wake up\n");
- goto exit;
- }
- /* request operation from MDM peer */
- peer_operation = PEER_OPERATION(opcode, PEER_OP_STATE_INIT);
- ret = sdio_memcpy_toio(ch->func, SDIOC_SW_MAILBOX_ADDR+offset,
- &peer_operation, sizeof(u32));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":failed to "
- "request close operation\n");
- goto exit;
- }
- ret = sdio_al_enable_func_retry(wk_func, "wk_func");
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to enable"
- " Func#%d\n", wk_func->num);
- goto exit;
- }
- pr_debug(MODULE_NAME ":%s: wk_func enabled on ch %s\n",
- __func__, ch->name);
- /* send "start" operation to MDM */
- peer_operation = PEER_OPERATION(opcode, PEER_OP_STATE_START);
- ret = sdio_memcpy_toio(ch->func, SDIOC_SW_MAILBOX_ADDR+offset,
- &peer_operation, sizeof(u32));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":failed to "
- "send start close operation\n");
- goto exit;
- }
- ret = sdio_disable_func(wk_func);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to "
- "disable Func#%d\n", wk_func->num);
- goto exit;
- }
- /* poll for peer operation ack */
- while (peer_operation != 0) {
- ret = sdio_memcpy_fromio(ch->func,
- &peer_operation,
- SDIOC_SW_MAILBOX_ADDR+offset,
- sizeof(u32));
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":failed to request ack on close"
- " operation, loop_count = %d\n",
- loop_count);
- goto exit;
- }
- loop_count++;
- if (loop_count > 10) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":%s: "
- "peer_operation=0x%x wait loop"
- " %d on ch %s\n", __func__,
- peer_operation, loop_count, ch->name);
- }
- }
-exit:
- return ret;
-}
-
-static int channel_close(struct sdio_channel *ch, int flush_flag)
-{
- int ret;
- struct sdio_al_device *sdio_al_dev = NULL;
- int flush_len;
- ulong flush_expires;
-
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
-
- if (!ch->func) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":%s: NULL func"
- " on channel:%d\n", __func__, ch->num);
- return -ENODEV;
- }
-
- sdio_al_dev = ch->sdio_al_dev;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- if (!sdio_al_dev->ch_close_supported) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":%s: Not "
- "supported by mdm, ch %s\n",
- __func__, ch->name);
- ret = -ENOTSUPP;
- goto error_exit;
- }
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- ret = -ENODEV;
- goto error_exit;
- }
- if (ch->state != SDIO_CHANNEL_STATE_OPEN) {
- sdio_al_loge(sdio_al_dev->dev_log,
- MODULE_NAME ":%s: ch %s is not in "
- "open state (%d)\n",
- __func__, ch->name, ch->state);
- ret = -ENODEV;
- goto error_exit;
- }
- ch->state = SDIO_CHANNEL_STATE_CLOSING;
- ret = peer_set_operation(PEER_OP_CODE_CLOSE, sdio_al_dev, ch);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":%s: "
- "peer_set_operation() failed: %d\n",
- __func__, ret);
- ret = -ENODEV;
- goto error_exit;
- }
- /* udate poll time for opened channels */
- if (ch->poll_delay_msec > 0) {
- sdio_al_dev->poll_delay_msec =
- get_min_poll_time_msec(sdio_al_dev);
- }
- sdio_al_release_mutex(ch->sdio_al_dev, __func__);
-
- flush_expires = jiffies +
- msecs_to_jiffies(SDIO_CLOSE_FLUSH_TIMEOUT_MSEC);
- /* flush rx packets of the channel */
- if (flush_flag) {
- do {
- while (ch->read_avail > 0) {
- flush_len = ch->read_avail;
- ret = sdio_read_internal(ch,
- sdio_al_dev->rx_flush_buf,
- flush_len);
- if (ret) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":%s sdio_read"
- " failed: %d, ch %s\n",
- __func__, ret,
- ch->name);
- return ret;
- }
-
- if (time_after(jiffies, flush_expires) != 0) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":%s flush rx "
- "packets timeout: ch %s\n",
- __func__, ch->name);
- sdio_al_get_into_err_state(sdio_al_dev);
- return -EBUSY;
- }
- }
- msleep(100);
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":%s: after sleep,"
- " invalid signature"
- " 0x%x\n", __func__,
- ch->signature);
- return -ENODEV;
- }
- if (sdio_al_claim_mutex_and_verify_dev(ch->sdio_al_dev,
- __func__))
- return -ENODEV;
-
- ret = read_mailbox(sdio_al_dev, false);
- if (ret) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":%s: failed to"
- " read mailbox", __func__);
- goto error_exit;
- }
- sdio_al_release_mutex(ch->sdio_al_dev, __func__);
- } while (ch->read_avail > 0);
- }
- if (sdio_al_claim_mutex_and_verify_dev(ch->sdio_al_dev,
- __func__))
- return -ENODEV;
- /* disable function to be able to open the channel again */
- ret = sdio_disable_func(ch->func);
- if (ret) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":Fail to disable Func#%d\n",
- ch->func->num);
- goto error_exit;
- }
- ch->state = SDIO_CHANNEL_STATE_CLOSED;
- CLOSE_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":%s: Ch %s closed "
- "successfully\n", __func__, ch->name);
-
-error_exit:
- sdio_al_release_mutex(ch->sdio_al_dev, __func__);
-
- return ret;
-}
-
-/**
- * Close SDIO Channel.
- *
- */
-int sdio_close(struct sdio_channel *ch)
-{
- return channel_close(ch, true);
-}
-EXPORT_SYMBOL(sdio_close);
-
-/**
- * Get the number of available bytes to write.
- *
- */
-int sdio_write_avail(struct sdio_channel *ch)
-{
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: "
- "Invalid signature 0x%x\n", __func__,
- ch->signature);
- return -ENODEV;
- }
- if (ch->state != SDIO_CHANNEL_STATE_OPEN) {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME ":%s: "
- "channel %s state is not open (%d)\n",
- __func__, ch->name, ch->state);
- return -ENODEV;
- }
- pr_debug(MODULE_NAME ":sdio_write_avail %s 0x%x\n",
- ch->name, ch->write_avail);
-
- return ch->write_avail;
-}
-EXPORT_SYMBOL(sdio_write_avail);
-
-/**
- * Get the number of available bytes to read.
- *
- */
-int sdio_read_avail(struct sdio_channel *ch)
-{
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: "
- "Invalid signature 0x%x\n", __func__,
- ch->signature);
- return -ENODEV;
- }
- if (ch->state != SDIO_CHANNEL_STATE_OPEN) {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME ":%s: "
- "channel %s state is not open (%d)\n",
- __func__, ch->name, ch->state);
- return -ENODEV;
- }
- pr_debug(MODULE_NAME ":sdio_read_avail %s 0x%x\n",
- ch->name, ch->read_avail);
-
- return ch->read_avail;
-}
-EXPORT_SYMBOL(sdio_read_avail);
-
-static int sdio_read_from_closed_ch(struct sdio_channel *ch, int len)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = NULL;
-
- if (!ch) {
- sdio_al_loge(ch->sdio_al_dev->dev_log,
- MODULE_NAME ":%s: NULL channel\n", __func__);
- return -ENODEV;
- }
-
- sdio_al_dev = ch->sdio_al_dev;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- ret = sdio_memcpy_fromio(ch->func, sdio_al_dev->rx_flush_buf,
- PIPE_RX_FIFO_ADDR, len);
-
- if (ret) {
- sdio_al_loge(ch->sdio_al_dev->dev_log,
- MODULE_NAME ":ch %s: %s err=%d, len=%d\n",
- ch->name, __func__, -ret, len);
- sdio_al_dev->is_err = true;
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return ret;
- }
-
- restart_inactive_time(sdio_al_dev);
-
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- return 0;
-}
-
-/**
- * Internal read from SDIO Channel.
- *
- * Reading from the pipe will trigger interrupt if there are
- * other pending packets on the SDIO-Client.
- *
- */
-static int sdio_read_internal(struct sdio_channel *ch, void *data, int len)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = NULL;
-
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
- if (!data) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL data\n",
- __func__);
- return -ENODEV;
- }
- if (len == 0) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":channel %s trying"
- " to read 0 bytes\n", ch->name);
- return -EINVAL;
- }
-
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: Invalid "
- "signature 0x%x\n", __func__, ch->signature);
- return -ENODEV;
- }
-
- sdio_al_dev = ch->sdio_al_dev;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- ret = -ENODEV;
- goto exit;
- }
-
- /* lpm policy says we can't go to sleep when we have pending rx data,
- so either we had rx interrupt and woken up, or we never went to
- sleep */
- if (sdio_al_dev->is_ok_to_sleep) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":%s: called "
- "when is_ok_to_sleep is set for ch %s, len=%d,"
- " last_any_read_avail=%d, last_read_avail=%d, "
- "last_old_read_avail=%d", __func__, ch->name,
- len, ch->statistics.last_any_read_avail,
- ch->statistics.last_read_avail,
- ch->statistics.last_old_read_avail);
- }
- BUG_ON(sdio_al_dev->is_ok_to_sleep);
-
- if ((ch->state != SDIO_CHANNEL_STATE_OPEN) &&
- (ch->state != SDIO_CHANNEL_STATE_CLOSING)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":%s wrong "
- "channel %s state %d\n",
- __func__, ch->name, ch->state);
- ret = -EINVAL;
- goto exit;
- }
-
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":start ch %s read %d "
- "avail %d.\n", ch->name, len, ch->read_avail);
-
- restart_inactive_time(sdio_al_dev);
-
- if ((ch->is_packet_mode) && (len != ch->read_avail)) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":sdio_read ch "
- "%s len != read_avail\n", ch->name);
- ret = -EINVAL;
- goto exit;
- }
-
- if (len > ch->read_avail) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":ERR ch %s: "
- "reading more bytes (%d) than the avail(%d).\n",
- ch->name, len, ch->read_avail);
- ret = -ENOMEM;
- goto exit;
- }
-
- ret = sdio_memcpy_fromio(ch->func, data, PIPE_RX_FIFO_ADDR, len);
-
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":ch %s: "
- "sdio_read err=%d, len=%d, read_avail=%d, "
- "last_read_avail=%d, last_old_read_avail=%d\n",
- ch->name, -ret, len, ch->read_avail,
- ch->statistics.last_read_avail,
- ch->statistics.last_old_read_avail);
- sdio_al_get_into_err_state(sdio_al_dev);
- goto exit;
- }
-
- ch->statistics.total_read_times++;
-
- /* Remove handled packet from the list regardless if ret is ok */
- if (ch->is_packet_mode)
- remove_handled_rx_packet(ch);
- else
- ch->read_avail -= len;
-
- ch->total_rx_bytes += len;
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":end ch %s read %d "
- "avail %d total %d.\n", ch->name, len,
- ch->read_avail, ch->total_rx_bytes);
-
- if ((ch->read_avail == 0) && !(ch->is_packet_mode))
- ask_reading_mailbox(sdio_al_dev);
-
-exit:
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- return ret;
-}
-
-/**
- * Read from SDIO Channel.
- *
- * Reading from the pipe will trigger interrupt if there are
- * other pending packets on the SDIO-Client.
- *
- */
-int sdio_read(struct sdio_channel *ch, void *data, int len)
-{
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: "
- "Invalid signature 0x%x\n", __func__, ch->signature);
- return -ENODEV;
- }
- if (ch->state == SDIO_CHANNEL_STATE_OPEN) {
- return sdio_read_internal(ch, data, len);
- } else {
- sdio_al_loge(ch->sdio_al_dev->dev_log, MODULE_NAME
- ":%s: Invalid channel %s state %d\n",
- __func__, ch->name, ch->state);
- }
- return -ENODEV;
-}
-EXPORT_SYMBOL(sdio_read);
-
-/**
- * Write to SDIO Channel.
- *
- */
-int sdio_write(struct sdio_channel *ch, const void *data, int len)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = NULL;
-
- if (!ch) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL "
- "channel\n", __func__);
- return -ENODEV;
- }
- if (!data) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: NULL data\n",
- __func__);
- return -ENODEV;
- }
- if (len == 0) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":channel %s trying"
- " to write 0 bytes\n", ch->name);
- return -EINVAL;
- }
-
- if (ch->signature != SDIO_AL_SIGNATURE) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":%s: Invalid "
- "signature 0x%x\n", __func__, ch->signature);
- return -ENODEV;
- }
-
- sdio_al_dev = ch->sdio_al_dev;
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- WARN_ON(len > ch->write_avail);
-
- if (sdio_al_dev->is_err) {
- SDIO_AL_ERR(__func__);
- ret = -ENODEV;
- goto exit;
- }
-
- if (ch->state != SDIO_CHANNEL_STATE_OPEN) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":writing to "
- "closed channel %s\n", ch->name);
- ret = -EINVAL;
- goto exit;
- }
-
- if (sdio_al_dev->is_ok_to_sleep) {
- ret = sdio_al_wake_up(sdio_al_dev, 1, ch);
- if (ret)
- goto exit;
- } else {
- restart_inactive_time(sdio_al_dev);
- }
-
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":start ch %s write %d "
- "avail %d.\n", ch->name, len, ch->write_avail);
-
- if (len > ch->write_avail) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":ERR ch %s: "
- "write more bytes (%d) than available %d.\n",
- ch->name, len, ch->write_avail);
- ret = -ENOMEM;
- goto exit;
- }
-
- ret = sdio_ch_write(ch, data, len);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":sdio_write "
- "on channel %s err=%d\n", ch->name, -ret);
- goto exit;
- }
-
- ch->total_tx_bytes += len;
- DATA_DEBUG(sdio_al_dev->dev_log, MODULE_NAME ":end ch %s write %d "
- "avail %d total %d.\n", ch->name, len,
- ch->write_avail, ch->total_tx_bytes);
-
- /* Round up to whole buffer size */
- len = ROUND_UP(len, ch->peer_tx_buf_size);
- /* Protect from wraparound */
- len = min(len, (int) ch->write_avail);
- ch->write_avail -= len;
-
- if (ch->write_avail < ch->min_write_avail)
- ask_reading_mailbox(sdio_al_dev);
-
-exit:
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- return ret;
-}
-EXPORT_SYMBOL(sdio_write);
-
-static int __devinit msm_sdio_al_probe(struct platform_device *pdev)
-{
- if (!sdio_al) {
- pr_err(MODULE_NAME ": %s: NULL sdio_al\n", __func__);
- return -ENODEV;
- }
-
- sdio_al->pdata = pdev->dev.platform_data;
- return 0;
-}
-
-static int __devexit msm_sdio_al_remove(struct platform_device *pdev)
-{
- return 0;
-}
-
-static void sdio_al_close_all_channels(struct sdio_al_device *sdio_al_dev)
-{
- int j;
- int ret;
- struct sdio_channel *ch = NULL;
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s", __func__);
-
- if (!sdio_al_dev) {
- sdio_al_loge(sdio_al_dev->dev_log,
- MODULE_NAME ": %s: NULL device", __func__);
- return;
- }
- for (j = 0; j < SDIO_AL_MAX_CHANNELS; j++) {
- ch = &sdio_al_dev->channel[j];
-
- if (ch->state == SDIO_CHANNEL_STATE_OPEN) {
- sdio_al_loge(sdio_al_dev->dev_log,
- MODULE_NAME ": %s: Call to sdio_close() for"
- " ch %s\n", __func__, ch->name);
- ret = channel_close(ch, false);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log,
- MODULE_NAME ": %s: failed sdio_close()"
- " for ch %s (%d)\n",
- __func__, ch->name, ret);
- }
- } else {
- pr_debug(MODULE_NAME ": %s: skip sdio_close() ch %s"
- " (state=%d)\n", __func__,
- ch->name, ch->state);
- }
- }
-}
-
-static void sdio_al_invalidate_sdio_clients(struct sdio_al_device *sdio_al_dev,
- struct platform_device **pdev_arr)
-{
- int j;
-
- pr_debug(MODULE_NAME ": %s: Notifying SDIO clients for card %d",
- __func__, sdio_al_dev->host->index);
- for (j = 0; j < SDIO_AL_MAX_CHANNELS; ++j) {
- if (sdio_al_dev->channel[j].state ==
- SDIO_CHANNEL_STATE_INVALID)
- continue;
- pdev_arr[j] = sdio_al_dev->channel[j].pdev;
- sdio_al_dev->channel[j].signature = 0x0;
- sdio_al_dev->channel[j].state =
- SDIO_CHANNEL_STATE_INVALID;
- }
-}
-
-static void sdio_al_modem_reset_operations(struct sdio_al_device
- *sdio_al_dev)
-{
- int ret = 0;
- struct platform_device *pdev_arr[SDIO_AL_MAX_CHANNELS];
- int j;
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s", __func__);
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return;
-
- if (sdio_al_dev->state == CARD_REMOVED) {
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: "
- "card %d is already removed", __func__,
- sdio_al_dev->host->index);
- goto exit_err;
- }
-
- if (sdio_al_dev->state == MODEM_RESTART) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ": %s: "
- "card %d was already notified for modem reset",
- __func__, sdio_al_dev->host->index);
- goto exit_err;
- }
-
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ": %s: Set the "
- "state to MODEM_RESTART for card %d",
- __func__, sdio_al_dev->host->index);
- sdio_al_dev->state = MODEM_RESTART;
- sdio_al_dev->is_ready = false;
-
- /* Stop mailbox timer */
- stop_and_del_timer(sdio_al_dev);
-
- if ((sdio_al_dev->is_ok_to_sleep) &&
- (!sdio_al_dev->is_err)) {
- pr_debug(MODULE_NAME ": %s: wakeup modem for "
- "card %d", __func__,
- sdio_al_dev->host->index);
- ret = sdio_al_wake_up(sdio_al_dev, 1, NULL);
- }
-
- if (!ret && (!sdio_al_dev->is_err) && sdio_al_dev->card &&
- sdio_al_dev->card->sdio_func[0]) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME
- ": %s: sdio_release_irq for card %d",
- __func__,
- sdio_al_dev->host->index);
- sdio_release_irq(sdio_al_dev->card->sdio_func[0]);
- }
-
- memset(pdev_arr, 0, sizeof(pdev_arr));
- sdio_al_invalidate_sdio_clients(sdio_al_dev, pdev_arr);
-
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: Notifying SDIO "
- "clients for card %d",
- __func__, sdio_al_dev->host->index);
- for (j = 0; j < SDIO_AL_MAX_CHANNELS; j++) {
- if (!pdev_arr[j])
- continue;
- platform_device_unregister(pdev_arr[j]);
- }
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: Finished Notifying "
- "SDIO clients for card %d",
- __func__, sdio_al_dev->host->index);
-
- return;
-
-exit_err:
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return;
-}
-
-#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
-static void sdio_al_reset(void)
-{
- int i;
- struct sdio_al_device *sdio_al_dev;
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s", __func__);
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; i++) {
- if (sdio_al->devices[i] == NULL) {
- pr_debug(MODULE_NAME ": %s: NULL device in index %d",
- __func__, i);
- continue;
- }
- sdio_al_dev = sdio_al->devices[i];
- sdio_al_modem_reset_operations(sdio_al->devices[i]);
- }
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s completed", __func__);
-}
-#endif
-
-static void msm_sdio_al_shutdown(struct platform_device *pdev)
-{
- int i;
- struct sdio_al_device *sdio_al_dev;
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME
- "Initiating msm_sdio_al_shutdown...");
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; i++) {
- if (sdio_al->devices[i] == NULL) {
- pr_debug(MODULE_NAME ": %s: NULL device in index %d",
- __func__, i);
- continue;
- }
- sdio_al_dev = sdio_al->devices[i];
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return;
-
- if (sdio_al_dev->ch_close_supported)
- sdio_al_close_all_channels(sdio_al_dev);
-
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- sdio_al_modem_reset_operations(sdio_al_dev);
- }
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: "
- "msm_sdio_al_shutdown complete.", __func__);
-}
-
-static struct platform_driver msm_sdio_al_driver = {
- .probe = msm_sdio_al_probe,
- .remove = __exit_p(msm_sdio_al_remove),
- .shutdown = msm_sdio_al_shutdown,
- .driver = {
- .name = "msm_sdio_al",
- },
-};
-
-/**
- * Initialize SDIO_AL channels.
- *
- */
-static int init_channels(struct sdio_al_device *sdio_al_dev)
-{
- int ret = 0;
- int i;
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- ret = read_sdioc_software_header(sdio_al_dev,
- sdio_al_dev->sdioc_sw_header);
- if (ret)
- goto exit;
-
- ret = sdio_al_setup(sdio_al_dev);
- if (ret)
- goto exit;
-
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- int ch_name_size;
- if (sdio_al_dev->channel[i].state == SDIO_CHANNEL_STATE_INVALID)
- continue;
- if (sdio_al->unittest_mode) {
- memset(sdio_al_dev->channel[i].ch_test_name, 0,
- sizeof(sdio_al_dev->channel[i].ch_test_name));
- ch_name_size = strnlen(sdio_al_dev->channel[i].name,
- CHANNEL_NAME_SIZE);
- strncpy(sdio_al_dev->channel[i].ch_test_name,
- sdio_al_dev->channel[i].name,
- ch_name_size);
- strncat(sdio_al_dev->channel[i].ch_test_name +
- ch_name_size,
- SDIO_TEST_POSTFIX,
- SDIO_TEST_POSTFIX_SIZE);
- pr_debug(MODULE_NAME ":pdev.name = %s\n",
- sdio_al_dev->channel[i].ch_test_name);
- sdio_al_dev->channel[i].pdev = platform_device_alloc(
- sdio_al_dev->channel[i].ch_test_name, -1);
- } else {
- pr_debug(MODULE_NAME ":pdev.name = %s\n",
- sdio_al_dev->channel[i].name);
- sdio_al_dev->channel[i].pdev = platform_device_alloc(
- sdio_al_dev->channel[i].name, -1);
- }
- if (!sdio_al_dev->channel[i].pdev) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":NULL platform device for ch %s",
- sdio_al_dev->channel[i].name);
- sdio_al_dev->channel[i].state =
- SDIO_CHANNEL_STATE_INVALID;
- continue;
- }
- ret = platform_device_add(sdio_al_dev->channel[i].pdev);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ":platform_device_add failed, "
- "ret=%d\n", ret);
- sdio_al_dev->channel[i].state =
- SDIO_CHANNEL_STATE_INVALID;
- }
- }
-
-exit:
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return ret;
-}
-
-/**
- * Initialize SDIO_AL channels according to the client setup.
- * This function also check if the client is in boot mode and
- * flashless boot is required to be activated or the client is
- * up and running.
- *
- */
-static int sdio_al_client_setup(struct sdio_al_device *sdio_al_dev)
-{
- int ret = 0;
- struct sdio_func *func1;
- int signature = 0;
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- if (!sdio_al_dev->card || !sdio_al_dev->card->sdio_func[0]) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":NULL card or "
- "func1\n");
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return -ENODEV;
- }
- func1 = sdio_al_dev->card->sdio_func[0];
-
- /* Read the header signature to determine the status of the MDM
- * SDIO Client
- */
- signature = sdio_readl(func1, SDIOC_SW_HEADER_ADDR, &ret);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":fail to read "
- "signature from sw header.\n");
- return ret;
- }
-
- switch (signature) {
- case PEER_SDIOC_SW_MAILBOX_BOOT_SIGNATURE:
- if (sdio_al_dev == sdio_al->bootloader_dev) {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":setup "
- "bootloader on card %d\n",
- sdio_al_dev->host->index);
- return sdio_al_bootloader_setup();
- } else {
- sdio_al_logi(sdio_al_dev->dev_log, MODULE_NAME ":wait "
- "for bootloader completion "
- "on card %d\n",
- sdio_al_dev->host->index);
- return sdio_al_wait_for_bootloader_comp(sdio_al_dev);
- }
- case PEER_SDIOC_SW_MAILBOX_SIGNATURE:
- case PEER_SDIOC_SW_MAILBOX_UT_SIGNATURE:
- return init_channels(sdio_al_dev);
- default:
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Invalid "
- "signature 0x%x\n", signature);
- return -EINVAL;
- }
-
- return 0;
-}
-
-static void clean_sdio_al_device_data(struct sdio_al_device *sdio_al_dev)
-{
- sdio_al_dev->is_ready = 0;
- sdio_al_dev->bootloader_done = 0;
- sdio_al_dev->lpm_chan = 0;
- sdio_al_dev->is_ok_to_sleep = 0;
- sdio_al_dev->inactivity_time = 0;
- sdio_al_dev->poll_delay_msec = 0;
- sdio_al_dev->is_timer_initialized = 0;
- sdio_al_dev->is_err = 0;
- sdio_al_dev->is_suspended = 0;
- sdio_al_dev->flashless_boot_on = 0;
- sdio_al_dev->ch_close_supported = 0;
- sdio_al_dev->print_after_interrupt = 0;
- memset(sdio_al_dev->sdioc_sw_header, 0,
- sizeof(*sdio_al_dev->sdioc_sw_header));
- memset(sdio_al_dev->mailbox, 0, sizeof(*sdio_al_dev->mailbox));
- memset(sdio_al_dev->rx_flush_buf, 0,
- sizeof(*sdio_al_dev->rx_flush_buf));
-}
-
-/*
- * SDIO driver functions
- */
-static int sdio_al_sdio_probe(struct sdio_func *func,
- const struct sdio_device_id *sdio_dev_id)
-{
- int ret = 0;
- struct sdio_al_device *sdio_al_dev = NULL;
- int i;
- struct mmc_card *card = NULL;
-
- if (!func) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL func\n",
- __func__);
- return -ENODEV;
- }
- card = func->card;
-
- if (!card) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL card\n",
- __func__);
- return -ENODEV;
- }
-
- if (!card->sdio_func[0]) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "func1\n",
- __func__);
- return -ENODEV;
- }
-
- if (card->sdio_funcs < SDIO_AL_MAX_FUNCS) {
- dev_info(&card->dev,
- "SDIO-functions# %d less than expected.\n",
- card->sdio_funcs);
- return -ENODEV;
- }
-
- /* Check if there is already a device for this card */
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; ++i) {
- if (sdio_al->devices[i] == NULL)
- continue;
- if (sdio_al->devices[i]->host == card->host) {
- sdio_al_dev = sdio_al->devices[i];
- if (sdio_al_dev->state == CARD_INSERTED)
- return 0;
- clean_sdio_al_device_data(sdio_al_dev);
- break;
- }
- }
-
- if (!sdio_al_dev) {
- sdio_al_dev = kzalloc(sizeof(struct sdio_al_device),
- GFP_KERNEL);
- if (sdio_al_dev == NULL)
- return -ENOMEM;
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES ; ++i)
- if (sdio_al->devices[i] == NULL) {
- sdio_al->devices[i] = sdio_al_dev;
- sdio_al_dev->dev_log = &sdio_al->device_log[i];
- spin_lock_init(&sdio_al_dev->dev_log->log_lock);
- #ifdef CONFIG_DEBUG_FS
- sdio_al_dbgfs_log[i].data =
- sdio_al_dev->dev_log->buffer;
- sdio_al_dbgfs_log[i].size =
- SDIO_AL_DEBUG_LOG_SIZE;
- #endif
- break;
- }
- if (i == MAX_NUM_OF_SDIO_DEVICES) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ":No space "
- "in devices array for the device\n");
- return -ENOMEM;
- }
- }
-
- dev_info(&card->dev, "SDIO Card claimed.\n");
- sdio_al->skip_print_info = 0;
-
- sdio_al_dev->state = CARD_INSERTED;
-
- if (card->host->index == SDIO_BOOTLOADER_CARD_INDEX)
- sdio_al->bootloader_dev = sdio_al_dev;
-
- sdio_al_dev->is_ready = false;
-
- sdio_al_dev->signature = SDIO_AL_SIGNATURE;
-
- sdio_al_dev->is_suspended = 0;
- sdio_al_dev->is_timer_initialized = false;
-
- sdio_al_dev->lpm_chan = INVALID_SDIO_CHAN;
-
- sdio_al_dev->card = card;
- sdio_al_dev->host = card->host;
-
- if (!sdio_al_dev->mailbox) {
- sdio_al_dev->mailbox = kzalloc(sizeof(struct sdio_mailbox),
- GFP_KERNEL);
- if (sdio_al_dev->mailbox == NULL)
- return -ENOMEM;
- }
-
- if (!sdio_al_dev->sdioc_sw_header) {
- sdio_al_dev->sdioc_sw_header
- = kzalloc(sizeof(*sdio_al_dev->sdioc_sw_header),
- GFP_KERNEL);
- if (sdio_al_dev->sdioc_sw_header == NULL)
- return -ENOMEM;
- }
-
- if (!sdio_al_dev->rx_flush_buf) {
- sdio_al_dev->rx_flush_buf = kzalloc(RX_FLUSH_BUFFER_SIZE,
- GFP_KERNEL);
- if (sdio_al_dev->rx_flush_buf == NULL) {
- sdio_al_loge(&sdio_al->gen_log,
- MODULE_NAME ":Fail to allocate "
- "rx_flush_buf for card %d\n",
- card->host->index);
- return -ENOMEM;
- }
- }
-
- sdio_al_dev->timer.data = (unsigned long)sdio_al_dev;
-
- wake_lock_init(&sdio_al_dev->wake_lock, WAKE_LOCK_SUSPEND, MODULE_NAME);
- /* Don't allow sleep until all required clients register */
- sdio_al_vote_for_sleep(sdio_al_dev, 0);
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return -ENODEV;
-
- /* Init Func#1 */
- ret = sdio_al_enable_func_retry(card->sdio_func[0], "Init Func#1");
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to "
- "enable Func#%d\n", card->sdio_func[0]->num);
- goto exit;
- }
-
- /* Patch Func CIS tuple issue */
- ret = sdio_set_block_size(card->sdio_func[0], SDIO_AL_BLOCK_SIZE);
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ":Fail to set "
- "block size, Func#%d\n", card->sdio_func[0]->num);
- goto exit;
- }
- sdio_al_dev->card->sdio_func[0]->max_blksize = SDIO_AL_BLOCK_SIZE;
-
- sdio_al_dev->workqueue = create_singlethread_workqueue("sdio_al_wq");
- sdio_al_dev->sdio_al_work.sdio_al_dev = sdio_al_dev;
- init_waitqueue_head(&sdio_al_dev->wait_mbox);
-
- ret = sdio_al_client_setup(sdio_al_dev);
-
-exit:
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return ret;
-}
-
-static void sdio_al_sdio_remove(struct sdio_func *func)
-{
- struct sdio_al_device *sdio_al_dev = NULL;
- int i;
- struct mmc_card *card = NULL;
- struct platform_device *pdev_arr[SDIO_AL_MAX_CHANNELS];
-
- if (!func) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL func\n",
- __func__);
- return;
- }
- card = func->card;
-
- if (!card) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL card\n",
- __func__);
- return;
- }
-
- /* Find the sdio_al_device of this card */
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES; ++i) {
- if (sdio_al->devices[i] == NULL)
- continue;
- if (sdio_al->devices[i]->card == card) {
- sdio_al_dev = sdio_al->devices[i];
- break;
- }
- }
- if (sdio_al_dev == NULL) {
- pr_debug(MODULE_NAME ":%s :NULL sdio_al_dev for card %d\n",
- __func__, card->host->index);
- return;
- }
-
- if (sdio_al_claim_mutex(sdio_al_dev, __func__))
- return;
-
- if (sdio_al_dev->state == CARD_REMOVED) {
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return;
- }
-
- if (!card->sdio_func[0]) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: NULL "
- "func1\n", __func__);
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return;
- }
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":%s for card %d\n",
- __func__, card->host->index);
-
- sdio_al_dev->state = CARD_REMOVED;
-
- memset(pdev_arr, 0, sizeof(pdev_arr));
- sdio_al_invalidate_sdio_clients(sdio_al_dev, pdev_arr);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":%s: ask_reading_mailbox "
- "for card %d\n", __func__, card->host->index);
- sdio_al_dev->is_ready = false; /* Flag worker to exit */
- sdio_al_dev->ask_mbox = false;
- ask_reading_mailbox(sdio_al_dev); /* Wakeup worker */
-
- stop_and_del_timer(sdio_al_dev);
-
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: Notifying SDIO "
- "clients for card %d",
- __func__, sdio_al_dev->host->index);
- for (i = 0; i < SDIO_AL_MAX_CHANNELS; i++) {
- if (!pdev_arr[i])
- continue;
- platform_device_unregister(pdev_arr[i]);
- }
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: Finished Notifying "
- "SDIO clients for card %d",
- __func__, sdio_al_dev->host->index);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":%s: vote for sleep for "
- "card %d\n", __func__, card->host->index);
- sdio_al_vote_for_sleep(sdio_al_dev, 1);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":%s: flush_workqueue for "
- "card %d\n", __func__, card->host->index);
- flush_workqueue(sdio_al_dev->workqueue);
- destroy_workqueue(sdio_al_dev->workqueue);
- wake_lock_destroy(&sdio_al_dev->wake_lock);
-
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ":%s: sdio card %d removed."
- "\n", __func__, card->host->index);
-}
-
-static void sdio_print_mailbox(char *prefix_str, struct sdio_mailbox *mailbox)
-{
- int k = 0;
- char buf[256];
- char buf1[10];
-
- if (!mailbox) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": mailbox is "
- "NULL\n");
- return;
- }
-
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s: pipes 0_7: eot=0x%x,"
- " thresh=0x%x, overflow=0x%x, "
- "underflow=0x%x, mask_thresh=0x%x\n",
- prefix_str, mailbox->eot_pipe_0_7,
- mailbox->thresh_above_limit_pipe_0_7,
- mailbox->overflow_pipe_0_7,
- mailbox->underflow_pipe_0_7,
- mailbox->mask_thresh_above_limit_pipe_0_7);
-
- memset(buf, 0, sizeof(buf));
- strncat(buf, ": bytes_avail:", sizeof(buf));
-
- for (k = 0 ; k < SDIO_AL_ACTIVE_PIPES ; ++k) {
- snprintf(buf1, sizeof(buf1), "%d, ",
- mailbox->pipe_bytes_avail[k]);
- strncat(buf, buf1, sizeof(buf));
- }
-
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME "%s", buf);
-}
-
-static void sdio_al_print_info(void)
-{
- int i = 0;
- int j = 0;
- int ret = 0;
- struct sdio_mailbox *mailbox = NULL;
- struct sdio_mailbox *hw_mailbox = NULL;
- struct peer_sdioc_channel_config *ch_config = NULL;
- struct sdio_func *func1 = NULL;
- struct sdio_func *lpm_func = NULL;
- int offset = 0;
- int is_ok_to_sleep = 0;
- char buf[50];
-
- if (sdio_al->skip_print_info == 1)
- return;
-
- sdio_al->skip_print_info = 1;
-
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s - SDIO DEBUG INFO\n",
- __func__);
-
- if (!sdio_al) {
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": %s - ERROR - "
- "sdio_al is NULL\n", __func__);
- return;
- }
-
- sdio_al_loge(&sdio_al->gen_log, MODULE_NAME ": GPIO mdm2ap_status=%d\n",
- sdio_al->pdata->get_mdm2ap_status());
-
- for (j = 0 ; j < MAX_NUM_OF_SDIO_DEVICES ; ++j) {
- struct sdio_al_device *sdio_al_dev = sdio_al->devices[j];
-
- if (sdio_al_dev == NULL) {
- continue;
- }
-
- if (!sdio_al_dev->host) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": Host"
- " is NULL\n);");
- continue;
- }
-
- snprintf(buf, sizeof(buf), "Card#%d: Shadow HW MB",
- sdio_al_dev->host->index);
-
- /* printing Shadowing HW Mailbox*/
- mailbox = sdio_al_dev->mailbox;
- sdio_print_mailbox(buf, mailbox);
-
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": Card#%d: "
- "is_ok_to_sleep=%d\n",
- sdio_al_dev->host->index,
- sdio_al_dev->is_ok_to_sleep);
-
-
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME ": Card#%d: "
- "Shadow channels SW MB:",
- sdio_al_dev->host->index);
-
- /* printing Shadowing SW Mailbox per channel*/
- for (i = 0 ; i < SDIO_AL_MAX_CHANNELS ; ++i) {
- struct sdio_channel *ch = &sdio_al_dev->channel[i];
-
- if (ch == NULL) {
- continue;
- }
-
- if (ch->state == SDIO_CHANNEL_STATE_INVALID)
- continue;
-
- ch_config = &sdio_al_dev->channel[i].ch_config;
-
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": Ch %s: max_rx_thres=0x%x, "
- "max_tx_thres=0x%x, tx_buf=0x%x, "
- "is_packet_mode=%d, "
- "max_packet=0x%x, min_write=0x%x",
- ch->name, ch_config->max_rx_threshold,
- ch_config->max_tx_threshold,
- ch_config->tx_buf_size,
- ch_config->is_packet_mode,
- ch_config->max_packet_size,
- ch->min_write_avail);
-
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": total_rx=0x%x, total_tx=0x%x, "
- "read_avail=0x%x, write_avail=0x%x, "
- "rx_pending=0x%x, num_reads=0x%x, "
- "num_notifs=0x%x", ch->total_rx_bytes,
- ch->total_tx_bytes, ch->read_avail,
- ch->write_avail, ch->rx_pending_bytes,
- ch->statistics.total_read_times,
- ch->statistics.total_notifs);
- } /* end loop over all channels */
-
- } /* end loop over all devices */
-
- /* reading from client and printing is_host_ok_to_sleep per device */
- for (j = 0 ; j < MAX_NUM_OF_SDIO_DEVICES ; ++j) {
- struct sdio_al_device *sdio_al_dev = sdio_al->devices[j];
-
- if (sdio_al_verify_func1(sdio_al_dev, __func__))
- continue;
-
- if (!sdio_al_dev->host) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": Host is NULL");
- continue;
- }
-
- if (sdio_al_dev->lpm_chan == INVALID_SDIO_CHAN) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": %s - for Card#%d, is lpm_chan=="
- "INVALID_SDIO_CHAN. continuing...",
- __func__, sdio_al_dev->host->index);
- continue;
- }
-
- offset = offsetof(struct peer_sdioc_sw_mailbox, ch_config)+
- sizeof(struct peer_sdioc_channel_config) *
- sdio_al_dev->lpm_chan+
- offsetof(struct peer_sdioc_channel_config, is_host_ok_to_sleep);
-
- lpm_func = sdio_al_dev->card->sdio_func[sdio_al_dev->
- lpm_chan+1];
- if (!lpm_func) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": %s - lpm_func is NULL for card#%d"
- " continuing...\n", __func__,
- sdio_al_dev->host->index);
- continue;
- }
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return;
- ret = sdio_memcpy_fromio(lpm_func,
- &is_ok_to_sleep,
- SDIOC_SW_MAILBOX_ADDR+offset,
- sizeof(int));
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- if (ret)
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": %s - fail to read "
- "is_HOST_ok_to_sleep from mailbox for card %d",
- __func__, sdio_al_dev->host->index);
- else
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": Card#%d: "
- "is_HOST_ok_to_sleep=%d\n",
- sdio_al_dev->host->index,
- is_ok_to_sleep);
- }
-
- for (j = 0 ; j < MAX_NUM_OF_SDIO_DEVICES ; ++j) {
- struct sdio_al_device *sdio_al_dev = sdio_al->devices[j];
-
- if (!sdio_al_dev)
- continue;
-
- /* Reading HW Mailbox */
- hw_mailbox = sdio_al_dev->mailbox;
-
- if (sdio_al_claim_mutex_and_verify_dev(sdio_al_dev, __func__))
- return;
-
- if (!sdio_al_dev->card || !sdio_al_dev->card->sdio_func[0]) {
- sdio_al_release_mutex(sdio_al_dev, __func__);
- return;
- }
- func1 = sdio_al_dev->card->sdio_func[0];
- ret = sdio_memcpy_fromio(func1, hw_mailbox,
- HW_MAILBOX_ADDR, sizeof(*hw_mailbox));
- sdio_al_release_mutex(sdio_al_dev, __func__);
-
- if (ret) {
- sdio_al_loge(sdio_al_dev->dev_log, MODULE_NAME
- ": fail to read "
- "mailbox for card#%d. "
- "continuing...\n",
- sdio_al_dev->host->index);
- continue;
- }
-
- snprintf(buf, sizeof(buf), "Card#%d: Current HW MB",
- sdio_al_dev->host->index);
-
- /* Printing HW Mailbox */
- sdio_print_mailbox(buf, hw_mailbox);
- }
-}
-
-static struct sdio_device_id sdio_al_sdioid[] = {
- {.class = 0, .vendor = 0x70, .device = 0x2460},
- {.class = 0, .vendor = 0x70, .device = 0x0460},
- {.class = 0, .vendor = 0x70, .device = 0x23F1},
- {.class = 0, .vendor = 0x70, .device = 0x23F0},
- {}
-};
-
-static struct sdio_driver sdio_al_sdiofn_driver = {
- .name = "sdio_al_sdiofn",
- .id_table = sdio_al_sdioid,
- .probe = sdio_al_sdio_probe,
- .remove = sdio_al_sdio_remove,
-};
-
-#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
-/*
- * Callback for notifications from restart mudule.
- * This function handles only the BEFORE_RESTART notification.
- * Stop all the activity on the card and notify our clients.
- */
-static int sdio_al_subsys_notifier_cb(struct notifier_block *this,
- unsigned long notif_type,
- void *data)
-{
- if (notif_type != SUBSYS_BEFORE_SHUTDOWN) {
- sdio_al_logi(&sdio_al->gen_log, MODULE_NAME ": %s: got "
- "notification %ld", __func__, notif_type);
- return NOTIFY_DONE;
- }
-
- sdio_al_reset();
- return NOTIFY_OK;
-}
-
-static struct notifier_block sdio_al_nb = {
- .notifier_call = sdio_al_subsys_notifier_cb,
-};
-#endif
-
-/**
- * Module Init.
- *
- * @warn: allocate sdio_al context before registering driver.
- *
- */
-static int __init sdio_al_init(void)
-{
- int ret = 0;
- int i;
-
- pr_debug(MODULE_NAME ":sdio_al_init\n");
-
- pr_info(MODULE_NAME ":SDIO-AL SW version %s\n",
- DRV_VERSION);
-
- sdio_al = kzalloc(sizeof(struct sdio_al), GFP_KERNEL);
- if (sdio_al == NULL)
- return -ENOMEM;
-
- for (i = 0; i < MAX_NUM_OF_SDIO_DEVICES ; ++i)
- sdio_al->devices[i] = NULL;
-
- sdio_al->unittest_mode = false;
-
- sdio_al->debug.debug_lpm_on = debug_lpm_on;
- sdio_al->debug.debug_data_on = debug_data_on;
- sdio_al->debug.debug_close_on = debug_close_on;
-
-#ifdef CONFIG_DEBUG_FS
- sdio_al_debugfs_init();
-#endif
-
-
-#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
- sdio_al->subsys_notif_handle = subsys_notif_register_notifier(
- "external_modem", &sdio_al_nb);
-#endif
-
- ret = platform_driver_register(&msm_sdio_al_driver);
- if (ret) {
- pr_err(MODULE_NAME ": platform_driver_register failed: %d\n",
- ret);
- goto exit;
- }
-
- sdio_register_driver(&sdio_al_sdiofn_driver);
-
- spin_lock_init(&sdio_al->gen_log.log_lock);
-
-exit:
- if (ret)
- kfree(sdio_al);
- return ret;
-}
-
-/**
- * Module Exit.
- *
- * Free allocated memory.
- * Disable SDIO-Card.
- * Unregister driver.
- *
- */
-static void __exit sdio_al_exit(void)
-{
- if (sdio_al == NULL)
- return;
-
- pr_debug(MODULE_NAME ":sdio_al_exit\n");
-
-#ifdef CONFIG_MSM_SUBSYSTEM_RESTART
- subsys_notif_unregister_notifier(
- sdio_al->subsys_notif_handle, &sdio_al_nb);
-#endif
-
- sdio_al_tear_down();
-
- sdio_unregister_driver(&sdio_al_sdiofn_driver);
-
- kfree(sdio_al);
-
-#ifdef CONFIG_DEBUG_FS
- sdio_al_debugfs_cleanup();
-#endif
-
- platform_driver_unregister(&msm_sdio_al_driver);
-
- pr_debug(MODULE_NAME ":sdio_al_exit complete\n");
-}
-
-module_init(sdio_al_init);
-module_exit(sdio_al_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SDIO Abstraction Layer");
-MODULE_AUTHOR("Amir Samuelov <amirs@codeaurora.org>");
-MODULE_VERSION(DRV_VERSION);
-
diff --git a/arch/arm/mach-msm/sdio_al_dloader.c b/arch/arm/mach-msm/sdio_al_dloader.c
deleted file mode 100644
index f3effa8..0000000
--- a/arch/arm/mach-msm/sdio_al_dloader.c
+++ /dev/null
@@ -1,2574 +0,0 @@
-/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * SDIO-Downloader
- *
- * To be used with Qualcomm's SDIO-Client connected to this host.
- */
-
-/* INCLUDES */
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/wakelock.h>
-#include <linux/workqueue.h>
-#include <linux/mmc/card.h>
-#include <linux/dma-mapping.h>
-#include <mach/dma.h>
-#include <linux/mmc/sdio_func.h>
-#include "sdio_al_private.h"
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/kthread.h>
-#include <linux/version.h>
-#include <linux/errno.h>
-#include <linux/debugfs.h>
-
-/* DEFINES AND MACROS */
-#define MAX_NUM_DEVICES 1
-#define TTY_SDIO_DEV "tty_sdio_0"
-#define TTY_SDIO_DEV_TEST "tty_sdio_test_0"
-#define SDIOC_MAILBOX_ADDRESS 0
-#define SDIO_DL_BLOCK_SIZE 512
-#define SDIO_DL_MAIN_THREAD_NAME "sdio_tty_main_thread"
-#define SDIOC_DL_BUFF_ADDRESS 0
-#define SDIOC_UP_BUFF_ADDRESS 0x4
-#define SDIOC_DL_BUFF_SIZE_OFFSET 0x8
-#define SDIOC_UP_BUFF_SIZE_OFFSET 0xC
-#define SDIOC_DL_WR_PTR 0x10
-#define SDIOC_DL_RD_PTR 0x14
-#define SDIOC_UL_WR_PTR 0x18
-#define SDIOC_UL_RD_PTR 0x1C
-#define SDIOC_EXIT_PTR 0x20
-#define SDIOC_OP_MODE_PTR 0x24
-#define SDIOC_PTRS_OFFSET 0x10
-#define SDIOC_PTR_REGS_SIZE 0x10
-#define SDIOC_CFG_REGS_SIZE 0x10
-#define WRITE_RETRIES 0xFFFFFFFF
-#define INPUT_SPEED 4800
-#define OUTPUT_SPEED 4800
-#define SDIOC_EXIT_CODE 0xDEADDEAD
-#define SLEEP_MS 10
-#define PRINTING_GAP 200
-#define TIMER_DURATION 10
-#define PUSH_TIMER_DURATION 5000
-#define MULTIPLE_RATIO 1
-#define MS_IN_SEC 1000
-#define BITS_IN_BYTE 8
-#define BYTES_IN_KB 1024
-#define WRITE_TILL_END_RETRIES 5
-#define SDIO_DLD_NORMAL_MODE_NAME "SDIO DLD NORMAL MODE"
-#define SDIO_DLD_BOOT_TEST_MODE_NAME "SDIO DLD BOOT TEST MODE"
-#define SDIO_DLD_AMSS_TEST_MODE_NAME "SDIO DLD AMSS TEST MODE"
-#define TEST_NAME_MAX_SIZE 30
-#define PUSH_STRING
-#define SDIO_DLD_OUTGOING_BUFFER_SIZE (48*1024*MULTIPLE_RATIO)
-
-/* FORWARD DECLARATIONS */
-static int sdio_dld_open(struct tty_struct *tty, struct file *file);
-static void sdio_dld_close(struct tty_struct *tty, struct file *file);
-static int sdio_dld_write_callback(struct tty_struct *tty,
- const unsigned char *buf, int count);
-static int sdio_dld_write_room(struct tty_struct *tty);
-static int sdio_dld_main_task(void *card);
-static void sdio_dld_print_info(void);
-#ifdef CONFIG_DEBUG_FS
-static int sdio_dld_debug_info_open(struct inode *inode, struct file *file);
-static ssize_t sdio_dld_debug_info_write(struct file *file,
- const char __user *buf, size_t count, loff_t *ppos);
-#endif
-
-static void sdio_dld_tear_down(struct work_struct *work);
-DECLARE_WORK(cleanup, sdio_dld_tear_down);
-
-/* STRUCTURES AND TYPES */
-enum sdio_dld_op_mode {
- SDIO_DLD_NO_MODE = 0,
- SDIO_DLD_NORMAL_MODE = 1,
- SDIO_DLD_BOOT_TEST_MODE = 2,
- SDIO_DLD_AMSS_TEST_MODE = 3,
- SDIO_DLD_NUM_OF_MODES,
-};
-
-struct sdioc_reg_sequential_chunk_ptrs {
- unsigned int dl_wr_ptr;
- unsigned int dl_rd_ptr;
- unsigned int up_wr_ptr;
- unsigned int up_rd_ptr;
-};
-
-struct sdioc_reg_sequential_chunk_cfg {
- unsigned int dl_buff_address;
- unsigned int up_buff_address;
- unsigned int dl_buff_size;
- unsigned int ul_buff_size;
-};
-
-struct sdioc_reg {
- unsigned int reg_val;
- unsigned int reg_offset;
-};
-
-struct sdioc_reg_chunk {
- struct sdioc_reg dl_buff_address;
- struct sdioc_reg up_buff_address;
- struct sdioc_reg dl_buff_size;
- struct sdioc_reg ul_buff_size;
- struct sdioc_reg dl_wr_ptr;
- struct sdioc_reg dl_rd_ptr;
- struct sdioc_reg up_wr_ptr;
- struct sdioc_reg up_rd_ptr;
- struct sdioc_reg good_to_exit_ptr;
-};
-
-struct sdio_data {
- char *data;
- int offset_read_p;
- int offset_write_p;
- int buffer_size;
- int num_of_bytes_in_use;
-};
-
-struct sdio_dld_data {
- struct sdioc_reg_chunk sdioc_reg;
- struct sdio_data incoming_data;
- struct sdio_data outgoing_data;
-};
-
-struct sdio_dld_wait_event {
- wait_queue_head_t wait_event;
- int wake_up_signal;
-};
-
-struct sdio_dld_task {
- struct task_struct *dld_task;
- const char *task_name;
- struct sdio_dld_wait_event exit_wait;
- atomic_t please_close;
-};
-
-#ifdef CONFIG_DEBUG_FS
-struct sdio_dloader_debug {
- struct dentry *sdio_dld_debug_root;
- struct dentry *sdio_al_dloader;
-};
-
-const struct file_operations sdio_dld_debug_info_ops = {
- .open = sdio_dld_debug_info_open,
- .write = sdio_dld_debug_info_write,
-};
-#endif
-
-struct sdio_downloader {
- int sdioc_boot_func;
- struct sdio_dld_wait_event write_callback_event;
- struct sdio_dld_task dld_main_thread;
- struct tty_driver *tty_drv;
- struct tty_struct *tty_str;
- struct sdio_dld_data sdio_dloader_data;
- struct mmc_card *card;
- int(*done_callback)(void);
- struct sdio_dld_wait_event main_loop_event;
- struct timer_list timer;
- unsigned int poll_ms;
- struct timer_list push_timer;
- unsigned int push_timer_ms;
- enum sdio_dld_op_mode op_mode;
- char op_mode_name[TEST_NAME_MAX_SIZE];
-};
-
-struct sdio_dld_global_info {
- int global_bytes_write_toio;
- int global_bytes_write_tty;
- int global_bytes_read_fromio;
- int global_bytes_push_tty;
- u64 start_time;
- u64 end_time;
- u64 delta_jiffies;
- unsigned int time_msec;
- unsigned int throughput;
- int cl_dl_wr_ptr;
- int cl_dl_rd_ptr;
- int cl_up_wr_ptr;
- int cl_up_rd_ptr;
- int host_read_ptr;
- int host_write_ptr;
- int cl_dl_buffer_size;
- int cl_up_buffer_size;
- int host_outgoing_buffer_size;
- int cl_dl_buffer_address;
- int cl_up_buffer_address;
-};
-
-static const struct tty_operations sdio_dloader_tty_ops = {
- .open = sdio_dld_open,
- .close = sdio_dld_close,
- .write = sdio_dld_write_callback,
- .write_room = sdio_dld_write_room,
-};
-
-/* GLOBAL VARIABLES */
-struct sdio_downloader *sdio_dld;
-struct sdio_dld_global_info sdio_dld_info;
-static char outgoing_data_buffer[SDIO_DLD_OUTGOING_BUFFER_SIZE];
-
-static DEFINE_SPINLOCK(lock1);
-static unsigned long lock_flags1;
-static DEFINE_SPINLOCK(lock2);
-static unsigned long lock_flags2;
-
-static atomic_t sdio_dld_in_use = ATOMIC_INIT(0);
-static atomic_t sdio_dld_setup_done = ATOMIC_INIT(0);
-
-/*
- * sdio_op_mode sets the operation mode of the sdio_dloader -
- * it may be in NORMAL_MODE, BOOT_TEST_MODE or AMSS_TEST_MODE
- */
-static int sdio_op_mode = (int)SDIO_DLD_NORMAL_MODE;
-module_param(sdio_op_mode, int, 0);
-
-#ifdef CONFIG_DEBUG_FS
-
-struct sdio_dloader_debug sdio_dld_debug;
-
-#define ARR_SIZE 30000
-#define SDIO_DLD_DEBUGFS_INIT_VALUE 87654321
-#define SDIO_DLD_DEBUGFS_CASE_1_CODE 11111111
-#define SDIO_DLD_DEBUGFS_CASE_2_CODE 22222222
-#define SDIO_DLD_DEBUGFS_CASE_3_CODE 33333333
-#define SDIO_DLD_DEBUGFS_CASE_4_CODE 44444444
-#define SDIO_DLD_DEBUGFS_CASE_5_CODE 55555555
-#define SDIO_DLD_DEBUGFS_CASE_6_CODE 66666666
-#define SDIO_DLD_DEBUGFS_CASE_7_CODE 77777777
-#define SDIO_DLD_DEBUGFS_CASE_8_CODE 88888888
-#define SDIO_DLD_DEBUGFS_CASE_9_CODE 99999999
-#define SDIO_DLD_DEBUGFS_CASE_10_CODE 10101010
-#define SDIO_DLD_DEBUGFS_CASE_11_CODE 11001100
-#define SDIO_DLD_DEBUGFS_CASE_12_CODE 12001200
-#define SDIO_DLD_DEBUGFS_LOOP_WAIT 7
-#define SDIO_DLD_DEBUGFS_LOOP_WAKEUP 8
-#define SDIO_DLD_DEBUGFS_CB_WAIT 3
-#define SDIO_DLD_DEBUGFS_CB_WAKEUP 4
-
-static int curr_index;
-struct ptrs {
- int h_w_ptr;
- int h_r_ptr;
- int c_u_w_ptr;
- int c_u_r_ptr;
- int code;
- int h_has_to_send;
- int c_has_to_receive;
- int min_of;
- int reserve2;
- int tty_count;
- int write_tty;
- int write_toio;
- int loop_wait_wake;
- int cb_wait_wake;
- int c_d_w_ptr;
- int c_d_r_ptr;
- int to_read;
- int push_to_tty;
- int global_tty_send;
- int global_sdio_send;
- int global_tty_received;
- int global_sdio_received;
- int reserve22;
- int reserve23;
- int reserve24;
- int reserve25;
- int reserve26;
- int reserve27;
- int reserve28;
- int reserve29;
- int reserve30;
- int reserve31;
-};
-
-struct global_data {
- int curr_i;
- int duration_ms;
- int global_bytes_sent;
- int throughput_Mbs;
- int host_outgoing_buffer_size_KB;
- int client_up_buffer_size_KB;
- int client_dl_buffer_size_KB;
- int client_dl_buffer_address;
- int client_up_buffer_address;
- int global_bytes_received;
- int global_bytes_pushed;
- int reserve11;
- int reserve12;
- int reserve13;
- int reserve14;
- int reserve15;
- int reserve16;
- int reserve17;
- int reserve18;
- int reserve19;
- int reserve20;
- int reserve21;
- int reserve22;
- int reserve23;
- int reserve24;
- int reserve25;
- int reserve26;
- int reserve27;
- int reserve28;
- int reserve29;
- int reserve30;
- int reserve31;
- struct ptrs ptr_array[ARR_SIZE];
-};
-
-static struct global_data gd;
-static struct debugfs_blob_wrapper blob;
-static struct dentry *root;
-static struct dentry *dld;
-
-struct debugfs_global {
- int global_8k_has;
- int global_9k_has;
- int global_min;
- int global_count;
- int global_write_tty;
- int global_write_toio;
- int global_bytes_cb_tty;
- int global_to_read;
- int global_push_to_tty;
- int global_tty_send;
- int global_sdio_send;
- int global_sdio_received;
- int global_tty_push;
-};
-
-static struct debugfs_global debugfs_glob;
-
-static void update_standard_fields(int index)
-{
-
- gd.ptr_array[index].global_tty_send =
- sdio_dld_info.global_bytes_write_tty;
- gd.ptr_array[index].global_sdio_send =
- sdio_dld_info.global_bytes_write_toio;
- gd.ptr_array[index].global_tty_received =
- sdio_dld_info.global_bytes_push_tty;
- gd.ptr_array[index].global_sdio_received =
- sdio_dld_info.global_bytes_read_fromio;
-}
-
-static void update_gd(int code)
-{
- struct sdioc_reg_chunk *reg_str =
- &sdio_dld->sdio_dloader_data.sdioc_reg;
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
- int index = curr_index%ARR_SIZE;
-
- gd.curr_i = curr_index;
- gd.duration_ms = 0;
- gd.global_bytes_sent = 0;
- gd.throughput_Mbs = 0;
- gd.host_outgoing_buffer_size_KB = 0;
- gd.client_up_buffer_size_KB = 0;
- gd.client_dl_buffer_size_KB = 0;
- gd.client_dl_buffer_address = 0;
- gd.client_up_buffer_address = 0;
- gd.global_bytes_received = 0;
- gd.global_bytes_pushed = 0;
- gd.reserve11 = 0;
- gd.reserve12 = 0;
- gd.reserve13 = 0;
- gd.reserve14 = 0;
- gd.reserve15 = 0;
- gd.reserve16 = 0;
- gd.reserve17 = 0;
- gd.reserve18 = 0;
- gd.reserve19 = 0;
- gd.reserve20 = 0;
- gd.reserve21 = 0;
- gd.reserve22 = 0;
- gd.reserve23 = 0;
- gd.reserve24 = 0;
- gd.reserve25 = 0;
- gd.reserve26 = 0;
- gd.reserve27 = 0;
- gd.reserve28 = 0;
- gd.reserve29 = 0;
- gd.reserve30 = 0;
- gd.reserve31 = 0;
-
- gd.ptr_array[index].h_w_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*0*/
- gd.ptr_array[index].h_r_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*1*/
- gd.ptr_array[index].c_u_w_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*2*/
- gd.ptr_array[index].c_u_r_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*3*/
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_INIT_VALUE; /*4*/
- gd.ptr_array[index].h_has_to_send = SDIO_DLD_DEBUGFS_INIT_VALUE;/*5*/
- gd.ptr_array[index].c_has_to_receive =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*6*/
- gd.ptr_array[index].min_of = SDIO_DLD_DEBUGFS_INIT_VALUE; /*7*/
- gd.ptr_array[index].reserve2 = SDIO_DLD_DEBUGFS_INIT_VALUE; /*8*/
- gd.ptr_array[index].tty_count = SDIO_DLD_DEBUGFS_INIT_VALUE; /*9*/
- gd.ptr_array[index].write_tty = SDIO_DLD_DEBUGFS_INIT_VALUE; /*A*/
- gd.ptr_array[index].write_toio = SDIO_DLD_DEBUGFS_INIT_VALUE; /*B*/
- gd.ptr_array[index].loop_wait_wake =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*C*/
- gd.ptr_array[index].cb_wait_wake = SDIO_DLD_DEBUGFS_INIT_VALUE; /*D*/
- gd.ptr_array[index].c_d_w_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*E*/
- gd.ptr_array[index].c_d_r_ptr = SDIO_DLD_DEBUGFS_INIT_VALUE; /*F*/
- gd.ptr_array[index].to_read =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x10*/
- gd.ptr_array[index].push_to_tty =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x11*/
- gd.ptr_array[index].global_tty_send =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x12*/
- gd.ptr_array[index].global_sdio_send =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x13*/
- gd.ptr_array[index].global_tty_received =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x14*/
- gd.ptr_array[index].global_sdio_received =
- SDIO_DLD_DEBUGFS_INIT_VALUE; /*0x15*/
- gd.ptr_array[index].reserve22 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve23 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve24 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve25 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve26 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve27 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve28 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve29 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve30 = SDIO_DLD_DEBUGFS_INIT_VALUE;
- gd.ptr_array[index].reserve31 = SDIO_DLD_DEBUGFS_INIT_VALUE;
-
- switch (code) {
- case SDIO_DLD_DEBUGFS_CASE_1_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_1_CODE;
- gd.ptr_array[index].h_w_ptr = outgoing->offset_write_p;
- gd.ptr_array[index].h_r_ptr = outgoing->offset_read_p;
- gd.ptr_array[index].c_u_w_ptr = reg_str->up_wr_ptr.reg_val;
- gd.ptr_array[index].c_u_r_ptr = reg_str->up_rd_ptr.reg_val;
- gd.ptr_array[index].c_d_w_ptr = reg_str->dl_wr_ptr.reg_val;
- gd.ptr_array[index].c_d_r_ptr = reg_str->dl_rd_ptr.reg_val;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_2_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_2_CODE;
- gd.ptr_array[index].c_u_r_ptr = reg_str->up_rd_ptr.reg_val;
- gd.ptr_array[index].c_u_w_ptr = reg_str->up_wr_ptr.reg_val;
- gd.ptr_array[index].h_has_to_send = debugfs_glob.global_8k_has;
- gd.ptr_array[index].c_has_to_receive =
- debugfs_glob.global_9k_has;
- gd.ptr_array[index].min_of = debugfs_glob.global_min;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_3_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_3_CODE;
- gd.ptr_array[index].h_w_ptr = outgoing->offset_write_p;
- gd.ptr_array[index].h_r_ptr = outgoing->offset_read_p;
- gd.ptr_array[index].write_tty = debugfs_glob.global_write_tty;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_4_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_4_CODE;
- gd.ptr_array[index].h_w_ptr = outgoing->offset_write_p;
- gd.ptr_array[index].h_r_ptr = outgoing->offset_read_p;
- gd.ptr_array[index].c_u_r_ptr = reg_str->up_rd_ptr.reg_val;
- gd.ptr_array[index].c_u_w_ptr = reg_str->up_wr_ptr.reg_val;
- gd.ptr_array[index].write_toio =
- debugfs_glob.global_write_toio;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_5_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_5_CODE;
- gd.ptr_array[index].tty_count = debugfs_glob.global_count;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_6_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_6_CODE;
- gd.ptr_array[index].loop_wait_wake = 7;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_7_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_7_CODE;
- gd.ptr_array[index].loop_wait_wake = 8;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_8_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_8_CODE;
- gd.ptr_array[index].cb_wait_wake = 3;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_9_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_9_CODE;
- gd.ptr_array[index].cb_wait_wake = 4;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_10_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_10_CODE;
- gd.ptr_array[index].cb_wait_wake =
- debugfs_glob.global_bytes_cb_tty;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_11_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_11_CODE;
- gd.ptr_array[index].to_read = debugfs_glob.global_to_read;
- break;
-
- case SDIO_DLD_DEBUGFS_CASE_12_CODE:
- gd.ptr_array[index].code = SDIO_DLD_DEBUGFS_CASE_12_CODE;
- gd.ptr_array[index].push_to_tty =
- debugfs_glob.global_push_to_tty;
- break;
-
- default:
- break;
- }
- update_standard_fields(index);
- curr_index++;
-}
-
-static int bootloader_debugfs_init(void)
-{
- /* /sys/kernel/debug/bootloader there will be dld_arr file */
- root = debugfs_create_dir("bootloader", NULL);
- if (!root) {
- pr_info(MODULE_NAME ": %s - creating root dir "
- "failed\n", __func__);
- return -ENODEV;
- }
-
- blob.data = &gd;
- blob.size = sizeof(struct global_data);
- dld = debugfs_create_blob("dld_arr", S_IRUGO, root, &blob);
- if (!dld) {
- debugfs_remove_recursive(root);
- pr_err(MODULE_NAME ": %s, failed to create debugfs entry\n",
- __func__);
- return -ENODEV;
- }
-
- return 0;
-}
-
-/*
-* for triggering the sdio_dld info use:
-* echo 1 > /sys/kernel/debug/sdio_al_dld/sdio_al_dloader_info
-*/
-static int sdio_dld_debug_init(void)
-{
- sdio_dld_debug.sdio_dld_debug_root =
- debugfs_create_dir("sdio_al_dld", NULL);
- if (!sdio_dld_debug.sdio_dld_debug_root) {
- pr_err(MODULE_NAME ": %s - Failed to create folder. "
- "sdio_dld_debug_root is NULL",
- __func__);
- return -ENOENT;
- }
-
- sdio_dld_debug.sdio_al_dloader = debugfs_create_file(
- "sdio_al_dloader_info",
- S_IRUGO | S_IWUGO,
- sdio_dld_debug.sdio_dld_debug_root,
- NULL,
- &sdio_dld_debug_info_ops);
-
- if (!sdio_dld_debug.sdio_al_dloader) {
- pr_err(MODULE_NAME ": %s - Failed to create a file. "
- "sdio_al_dloader is NULL",
- __func__);
- debugfs_remove(sdio_dld_debug.sdio_dld_debug_root);
- sdio_dld_debug.sdio_dld_debug_root = NULL;
- return -ENOENT;
- }
-
- return 0;
-}
-
-static int sdio_dld_debug_info_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- return 0;
-}
-
-static ssize_t sdio_dld_debug_info_write(struct file *file,
- const char __user *buf, size_t count, loff_t *ppos)
-{
- sdio_dld_print_info();
- return count;
-}
-#endif /* CONFIG_DEBUG_FS */
-
-static void sdio_dld_print_info(void)
-{
-
- sdio_dld_info.end_time = get_jiffies_64(); /* read the current time */
- sdio_dld_info.delta_jiffies =
- sdio_dld_info.end_time - sdio_dld_info.start_time;
- sdio_dld_info.time_msec = jiffies_to_msecs(sdio_dld_info.delta_jiffies);
-
- sdio_dld_info.throughput = sdio_dld_info.global_bytes_write_toio *
- BITS_IN_BYTE / sdio_dld_info.time_msec;
- sdio_dld_info.throughput /= MS_IN_SEC;
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - DURATION IN MSEC = %d\n",
- __func__,
- sdio_dld_info.time_msec);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - BYTES WRITTEN ON SDIO BUS "
- "= %d...BYTES SENT BY TTY = %d",
- __func__,
- sdio_dld_info.global_bytes_write_toio,
- sdio_dld_info.global_bytes_write_tty);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - BYTES RECEIVED ON SDIO BUS "
- "= %d...BYTES SENT TO TTY = %d",
- __func__,
- sdio_dld_info.global_bytes_read_fromio,
- sdio_dld_info.global_bytes_push_tty);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - THROUGHPUT=%d Mbit/Sec",
- __func__, sdio_dld_info.throughput);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT DL_BUFFER_SIZE=%d"
- " KB..CLIENT UL_BUFFER=%d KB\n",
- __func__,
- sdio_dld_info.cl_dl_buffer_size/BYTES_IN_KB,
- sdio_dld_info.cl_up_buffer_size/BYTES_IN_KB);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - HOST OUTGOING BUFFER_SIZE"
- "=%d KB",
- __func__,
- sdio_dld_info.host_outgoing_buffer_size/BYTES_IN_KB);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT DL BUFFER "
- "ADDRESS = 0x%x", __func__,
- sdio_dld_info.cl_dl_buffer_address);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT UP BUFFER "
- "ADDRESS = 0x%x",
- __func__,
- sdio_dld_info.cl_up_buffer_address);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT - UPLINK BUFFER - "
- "READ POINTER = %d", __func__,
- sdio_dld_info.cl_up_rd_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT - UPLINK BUFFER - "
- "WRITE POINTER = %d", __func__,
- sdio_dld_info.cl_up_wr_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT - DOWNLINK BUFFER - "
- "READ POINTER = %d", __func__,
- sdio_dld_info.cl_dl_rd_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - CLIENT - DOWNLINK BUFFER - "
- "WRITE POINTER = %d", __func__,
- sdio_dld_info.cl_dl_wr_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - HOST - OUTGOING BUFFER - "
- "READ POINTER = %d", __func__,
- sdio_dld_info.host_read_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - HOST - OUTGOING BUFFER - "
- "WRITE POINTER = %d", __func__,
- sdio_dld_info.host_write_ptr);
-
- pr_info(MODULE_NAME ": %s, FLASHLESS BOOT - END DEBUG INFO", __func__);
-}
-
-/**
- * sdio_dld_set_op_mode
- * sets the op_mode and the name of the op_mode. Also, in case
- * it's invalid mode sets op_mode to SDIO_DLD_NORMAL_MODE
- *
- * @op_mode: the operation mode to be set
- * @return NONE
- */
-static void sdio_dld_set_op_mode(enum sdio_dld_op_mode op_mode)
-{
- sdio_dld->op_mode = op_mode;
-
- switch (op_mode) {
- case SDIO_DLD_NORMAL_MODE:
- memcpy(sdio_dld->op_mode_name,
- SDIO_DLD_NORMAL_MODE_NAME, TEST_NAME_MAX_SIZE);
- break;
- case SDIO_DLD_BOOT_TEST_MODE:
- memcpy(sdio_dld->op_mode_name,
- SDIO_DLD_BOOT_TEST_MODE_NAME, TEST_NAME_MAX_SIZE);
- break;
- case SDIO_DLD_AMSS_TEST_MODE:
- memcpy(sdio_dld->op_mode_name,
- SDIO_DLD_AMSS_TEST_MODE_NAME, TEST_NAME_MAX_SIZE);
- break;
- default:
- sdio_dld->op_mode = SDIO_DLD_NORMAL_MODE;
- pr_err(MODULE_NAME ": %s - Invalid Op_Mode = %d. Settings "
- "Op_Mode to default - NORMAL_MODE\n",
- __func__, op_mode);
- memcpy(sdio_dld->op_mode_name,
- SDIO_DLD_NORMAL_MODE_NAME, TEST_NAME_MAX_SIZE);
- break;
- }
-
- if (sdio_dld->op_mode_name != NULL) {
- pr_info(MODULE_NAME ": %s - FLASHLESS BOOT - Op_Mode is set to "
- "%s\n", __func__, sdio_dld->op_mode_name);
- } else {
- pr_info(MODULE_NAME ": %s - FLASHLESS BOOT - op_mode_name is "
- "NULL\n", __func__);
- }
-}
-
-/**
- * sdio_dld_allocate_local_buffers
- * allocates local outgoing and incoming buffers and also sets
- * threshold for outgoing data.
- *
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_allocate_local_buffers(void)
-{
- struct sdioc_reg_chunk *reg_str = &sdio_dld->sdio_dloader_data.
- sdioc_reg;
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
- struct sdio_data *incoming = &sdio_dld->sdio_dloader_data.incoming_data;
-
- incoming->data =
- kzalloc(reg_str->dl_buff_size.reg_val, GFP_KERNEL);
-
- if (!incoming->data) {
- pr_err(MODULE_NAME ": %s - param ""incoming->data"" is NULL. "
- "Couldn't allocate incoming_data local buffer\n",
- __func__);
- return -ENOMEM;
- }
-
- incoming->buffer_size = reg_str->dl_buff_size.reg_val;
-
- outgoing->data = outgoing_data_buffer;
-
- outgoing->buffer_size = SDIO_DLD_OUTGOING_BUFFER_SIZE;
-
- if (outgoing->buffer_size !=
- reg_str->ul_buff_size.reg_val*MULTIPLE_RATIO) {
- pr_err(MODULE_NAME ": %s - HOST outgoing buffer size (%d bytes)"
- "must be a multiple of ClIENT uplink buffer size (%d "
- "bytes). HOST_SIZE == n*CLIENT_SIZE.(n=1,2,3...)\n",
- __func__,
- SDIO_DLD_OUTGOING_BUFFER_SIZE,
- reg_str->ul_buff_size.reg_val);
- kfree(incoming->data);
- return -EINVAL;
- }
-
- /* keep sdio_dld_info up to date */
- sdio_dld_info.host_outgoing_buffer_size = outgoing->buffer_size;
-
- return 0;
-}
-
-/**
- * sdio_dld_dealloc_local_buffers frees incoming and outgoing
- * buffers.
- *
- * @return None.
- */
-static void sdio_dld_dealloc_local_buffers(void)
-{
- kfree((void *)sdio_dld->sdio_dloader_data.incoming_data.data);
-}
-
-/**
- * mailbox_to_seq_chunk_read_cfg
- * reads 4 configuration registers of mailbox from str_func, as
- * a sequentail chunk in memory, and updates global struct
- * accordingly.
- *
- * @str_func: a pointer to func struct.
- * @return 0 on success or negative value on error.
- */
-static int mailbox_to_seq_chunk_read_cfg(struct sdio_func *str_func)
-{
- struct sdioc_reg_sequential_chunk_cfg seq_chunk;
- struct sdioc_reg_chunk *reg = &sdio_dld->sdio_dloader_data.sdioc_reg;
- int status = 0;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_claim_host(str_func);
-
- /* reading SDIOC_MAILBOX_SIZE bytes from SDIOC_MAILBOX_ADDRESS */
- status = sdio_memcpy_fromio(str_func,
- (void *)&seq_chunk,
- SDIOC_MAILBOX_ADDRESS,
- SDIOC_CFG_REGS_SIZE);
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_fromio()"
- " READING CFG MAILBOX failed. status=%d.\n",
- __func__, status);
- }
-
- sdio_release_host(str_func);
-
- reg->dl_buff_address.reg_val = seq_chunk.dl_buff_address;
- reg->up_buff_address.reg_val = seq_chunk.up_buff_address;
- reg->dl_buff_size.reg_val = seq_chunk.dl_buff_size;
- reg->ul_buff_size.reg_val = seq_chunk.ul_buff_size;
-
- /* keep sdio_dld_info up to date */
- sdio_dld_info.cl_dl_buffer_size = seq_chunk.dl_buff_size;
- sdio_dld_info.cl_up_buffer_size = seq_chunk.ul_buff_size;
- sdio_dld_info.cl_dl_buffer_address = seq_chunk.dl_buff_address;
- sdio_dld_info.cl_up_buffer_address = seq_chunk.up_buff_address;
-
- return status;
-}
-
-/**
- * mailbox_to_seq_chunk_read_ptrs
- * reads 4 pointers registers of mailbox from str_func, as a
- * sequentail chunk in memory, and updates global struct
- * accordingly.
- *
- * @str_func: a pointer to func struct.
- * @return 0 on success or negative value on error.
- */
-static int mailbox_to_seq_chunk_read_ptrs(struct sdio_func *str_func)
-{
- struct sdioc_reg_sequential_chunk_ptrs seq_chunk;
- struct sdioc_reg_chunk *reg = &sdio_dld->sdio_dloader_data.sdioc_reg;
- int status = 0;
-
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
- static int counter = 1;
- static int offset_write_p;
- static int offset_read_p;
- static int up_wr_ptr;
- static int up_rd_ptr;
- static int dl_wr_ptr;
- static int dl_rd_ptr;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_claim_host(str_func);
-
- /* reading SDIOC_MAILBOX_SIZE bytes from SDIOC_MAILBOX_ADDRESS */
- status = sdio_memcpy_fromio(str_func,
- (void *)&seq_chunk,
- SDIOC_PTRS_OFFSET,
- SDIOC_PTR_REGS_SIZE);
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_fromio()"
- " READING PTRS MAILBOX failed. status=%d.\n",
- __func__, status);
- }
-
- sdio_release_host(str_func);
-
- reg->dl_rd_ptr.reg_val = seq_chunk.dl_rd_ptr;
- reg->dl_wr_ptr.reg_val = seq_chunk.dl_wr_ptr;
- reg->up_rd_ptr.reg_val = seq_chunk.up_rd_ptr;
- reg->up_wr_ptr.reg_val = seq_chunk.up_wr_ptr;
-
- /* keeping sdio_dld_info up to date */
- sdio_dld_info.cl_dl_rd_ptr = seq_chunk.dl_rd_ptr;
- sdio_dld_info.cl_dl_wr_ptr = seq_chunk.dl_wr_ptr;
- sdio_dld_info.cl_up_rd_ptr = seq_chunk.up_rd_ptr;
- sdio_dld_info.cl_up_wr_ptr = seq_chunk.up_wr_ptr;
-
-
- /* DEBUG - if there was a change in value */
- if ((offset_write_p != outgoing->offset_write_p) ||
- (offset_read_p != outgoing->offset_read_p) ||
- (up_wr_ptr != reg->up_wr_ptr.reg_val) ||
- (up_rd_ptr != reg->up_rd_ptr.reg_val) ||
- (dl_wr_ptr != reg->dl_wr_ptr.reg_val) ||
- (dl_rd_ptr != reg->dl_rd_ptr.reg_val) ||
- (counter % PRINTING_GAP == 0)) {
- counter = 1;
- pr_debug(MODULE_NAME ": %s MailBox pointers: BLOCK_SIZE=%d, "
- "hw=%d, hr=%d, cuw=%d, cur=%d, cdw=%d, cdr=%d\n",
- __func__,
- SDIO_DL_BLOCK_SIZE,
- outgoing->offset_write_p,
- outgoing->offset_read_p,
- reg->up_wr_ptr.reg_val,
- reg->up_rd_ptr.reg_val,
- reg->dl_wr_ptr.reg_val,
- reg->dl_rd_ptr.reg_val);
-
-#ifdef CONFIG_DEBUG_FS
- update_gd(SDIO_DLD_DEBUGFS_CASE_1_CODE);
-#endif
- /* update static variables */
- offset_write_p = outgoing->offset_write_p;
- offset_read_p = outgoing->offset_read_p;
- up_wr_ptr = reg->up_wr_ptr.reg_val;
- up_rd_ptr = reg->up_rd_ptr.reg_val;
- dl_wr_ptr = reg->dl_wr_ptr.reg_val;
- dl_rd_ptr = reg->dl_rd_ptr.reg_val;
- } else {
- counter++;
- }
- return status;
-}
-
-/**
- * sdio_dld_init_func
- * enables the sdio func, and sets the func block size.
- *
- * @str_func: a pointer to func struct.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_init_func(struct sdio_func *str_func)
-{
- int status1 = 0;
- int status2 = 0;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_claim_host(str_func);
-
- status1 = sdio_enable_func(str_func);
- if (status1) {
- sdio_release_host(str_func);
- pr_err(MODULE_NAME ": %s - sdio_enable_func() failed. "
- "status=%d\n", __func__, status1);
- return status1;
- }
-
- status2 = sdio_set_block_size(str_func, SDIO_DL_BLOCK_SIZE);
- if (status2) {
- pr_err(MODULE_NAME ": %s - sdio_set_block_size() failed. "
- "status=%d\n", __func__, status2);
- status1 = sdio_disable_func(str_func);
- if (status1) {
- pr_err(MODULE_NAME ": %s - sdio_disable_func() "
- "failed. status=%d\n", __func__, status1);
- }
- sdio_release_host(str_func);
- return status2;
- }
-
- sdio_release_host(str_func);
- str_func->max_blksize = SDIO_DL_BLOCK_SIZE;
- return 0;
-}
-
-/**
- * sdio_dld_allocate_buffers
- * initializes the sdio func, and then reads the mailbox, in
- * order to allocate incoming and outgoing buffers according to
- * the size that was read from the mailbox.
- *
- * @str_func: a pointer to func struct.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_allocate_buffers(struct sdio_func *str_func)
-{
- int status = 0;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- status = mailbox_to_seq_chunk_read_cfg(str_func);
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "mailbox_to_seq_chunk_read_cfg(). status=%d\n",
- __func__, status);
- return status;
- }
-
- status = sdio_dld_allocate_local_buffers();
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_dld_allocate_local_buffers(). status=%d\n",
- __func__, status);
- return status;
- }
- return 0;
-}
-
-/**
- * sdio_dld_create_thread
- * creates thread and wakes it up.
- *
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_create_thread(void)
-{
- sdio_dld->dld_main_thread.task_name = SDIO_DL_MAIN_THREAD_NAME;
-
- sdio_dld->dld_main_thread.dld_task =
- kthread_create(sdio_dld_main_task,
- (void *)(sdio_dld->card),
- sdio_dld->dld_main_thread.task_name);
-
- if (IS_ERR(sdio_dld->dld_main_thread.dld_task)) {
- pr_err(MODULE_NAME ": %s - kthread_create() failed\n",
- __func__);
- return -ENOMEM;
- }
- wake_up_process(sdio_dld->dld_main_thread.dld_task);
- return 0;
-}
-
-/**
- * start_timer
- * sets the timer and starts.
- *
- * @timer: the timer to configure and add
- * @ms: the ms until it expires
- * @return None.
- */
-static void start_timer(struct timer_list *timer, unsigned int ms)
-{
- if ((ms == 0) || (timer == NULL)) {
- pr_err(MODULE_NAME ": %s - invalid parameter", __func__);
- } else {
- timer->expires = jiffies +
- msecs_to_jiffies(ms);
- add_timer(timer);
- }
-}
-
-/**
- * sdio_dld_timer_handler
- * this is the timer handler. whenever it is invoked, it wakes
- * up the main loop task, and the write callback, and starts
- * the timer again.
- *
- * @data: a pointer to the tty device driver structure.
- * @return None.
- */
-
-static void sdio_dld_timer_handler(unsigned long data)
-{
- pr_debug(MODULE_NAME " Timer Expired\n");
- spin_lock_irqsave(&lock2, lock_flags2);
- if (sdio_dld->main_loop_event.wake_up_signal == 0) {
- sdio_dld->main_loop_event.wake_up_signal = 1;
- wake_up(&sdio_dld->main_loop_event.wait_event);
- }
- spin_unlock_irqrestore(&lock2, lock_flags2);
-
- sdio_dld->write_callback_event.wake_up_signal = 1;
- wake_up(&sdio_dld->write_callback_event.wait_event);
-
- start_timer(&sdio_dld->timer, sdio_dld->poll_ms);
-}
-
-/**
- * sdio_dld_push_timer_handler
- * this is a timer handler of the push_timer.
- *
- * @data: a pointer to the tty device driver structure.
- * @return None.
- */
-static void sdio_dld_push_timer_handler(unsigned long data)
-{
- pr_err(MODULE_NAME " %s - Push Timer Expired... Trying to "
- "push data to TTY Core for over then %d ms.\n",
- __func__, sdio_dld->push_timer_ms);
-}
-
-/**
- * sdio_dld_open
- * this is the open callback of the tty driver.
- * it initializes the sdio func, allocates the buffers, and
- * creates the main thread.
- *
- * @tty: a pointer to the tty struct.
- * @file: file descriptor.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_open(struct tty_struct *tty, struct file *file)
-{
- int status = 0;
- int func_in_array =
- REAL_FUNC_TO_FUNC_IN_ARRAY(sdio_dld->sdioc_boot_func);
- struct sdio_func *str_func = sdio_dld->card->sdio_func[func_in_array];
-
- if (atomic_read(&sdio_dld_in_use) == 1)
- return -EBUSY;
-
- atomic_set(&sdio_dld_in_use, 1);
- sdio_dld->tty_str = tty;
- sdio_dld->tty_str->low_latency = 1;
- sdio_dld->tty_str->icanon = 0;
- set_bit(TTY_NO_WRITE_SPLIT, &sdio_dld->tty_str->flags);
-
- pr_info(MODULE_NAME ": %s, TTY DEVICE FOR FLASHLESS BOOT OPENED\n",
- __func__);
- sdio_dld_info.start_time = get_jiffies_64(); /* read the current time */
-
- if (!tty) {
- pr_err(MODULE_NAME ": %s - param ""tty"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- atomic_set(&sdio_dld->dld_main_thread.please_close, 0);
- sdio_dld->dld_main_thread.exit_wait.wake_up_signal = 0;
-
- status = sdio_dld_allocate_buffers(str_func);
- if (status) {
- pr_err(MODULE_NAME ": %s, failed in "
- "sdio_dld_allocate_buffers(). status=%d\n",
- __func__, status);
- return status;
- }
-
- /* init waiting event of the write callback */
- init_waitqueue_head(&sdio_dld->write_callback_event.wait_event);
-
- /* init waiting event of the main loop */
- init_waitqueue_head(&sdio_dld->main_loop_event.wait_event);
-
- /* configure and init the timer */
- sdio_dld->poll_ms = TIMER_DURATION;
- init_timer(&sdio_dld->timer);
- sdio_dld->timer.data = (unsigned long) sdio_dld;
- sdio_dld->timer.function = sdio_dld_timer_handler;
- sdio_dld->timer.expires = jiffies +
- msecs_to_jiffies(sdio_dld->poll_ms);
- add_timer(&sdio_dld->timer);
-
- sdio_dld->push_timer_ms = PUSH_TIMER_DURATION;
- init_timer(&sdio_dld->push_timer);
- sdio_dld->push_timer.data = (unsigned long) sdio_dld;
- sdio_dld->push_timer.function = sdio_dld_push_timer_handler;
-
- status = sdio_dld_create_thread();
- if (status) {
- del_timer_sync(&sdio_dld->timer);
- del_timer_sync(&sdio_dld->push_timer);
- sdio_dld_dealloc_local_buffers();
- pr_err(MODULE_NAME ": %s, failed in sdio_dld_create_thread()."
- "status=%d\n", __func__, status);
- return status;
- }
- return 0;
-}
-
-/**
- * sdio_dld_close
- * this is the close callback of the tty driver. it requests
- * the main thread to exit, and waits for notification of it.
- * it also de-allocates the buffers, and unregisters the tty
- * driver and device.
- *
- * @tty: a pointer to the tty struct.
- * @file: file descriptor.
- * @return None.
- */
-static void sdio_dld_close(struct tty_struct *tty, struct file *file)
-{
- struct sdioc_reg_chunk *reg = &sdio_dld->sdio_dloader_data.sdioc_reg;
-
- /* informing the SDIOC that it can exit boot phase */
- sdio_dld->sdio_dloader_data.sdioc_reg.good_to_exit_ptr.reg_val =
- SDIOC_EXIT_CODE;
-
- atomic_set(&sdio_dld->dld_main_thread.please_close, 1);
-
- pr_debug(MODULE_NAME ": %s - CLOSING - WAITING...", __func__);
-
- wait_event(sdio_dld->dld_main_thread.exit_wait.wait_event,
- sdio_dld->dld_main_thread.exit_wait.wake_up_signal);
- pr_debug(MODULE_NAME ": %s - CLOSING - WOKE UP...", __func__);
-
-#ifdef CONFIG_DEBUG_FS
- gd.curr_i = curr_index;
- gd.duration_ms = sdio_dld_info.time_msec;
- gd.global_bytes_sent = sdio_dld_info.global_bytes_write_toio;
- gd.global_bytes_received = 0;
- gd.throughput_Mbs = sdio_dld_info.throughput;
- gd.host_outgoing_buffer_size_KB = sdio_dld->sdio_dloader_data.
- outgoing_data.buffer_size/BYTES_IN_KB;
- gd.client_up_buffer_size_KB = reg->ul_buff_size.reg_val/BYTES_IN_KB;
- gd.client_dl_buffer_size_KB = reg->dl_buff_size.reg_val/BYTES_IN_KB;
- gd.client_dl_buffer_address = reg->dl_buff_address.reg_val;
- gd.client_up_buffer_address = reg->up_buff_address.reg_val;
- gd.global_bytes_received = sdio_dld_info.global_bytes_read_fromio;
- gd.global_bytes_pushed = sdio_dld_info.global_bytes_push_tty;
-#endif
-
- /* saving register values before deallocating sdio_dld
- in order to use it in sdio_dld_print_info() through shell command */
- sdio_dld_info.cl_dl_rd_ptr = reg->dl_rd_ptr.reg_val;
- sdio_dld_info.cl_dl_wr_ptr = reg->dl_wr_ptr.reg_val;
- sdio_dld_info.cl_up_rd_ptr = reg->up_rd_ptr.reg_val;
- sdio_dld_info.cl_up_wr_ptr = reg->up_wr_ptr.reg_val;
-
- sdio_dld_info.host_read_ptr =
- sdio_dld->sdio_dloader_data.outgoing_data.offset_read_p;
-
- sdio_dld_info.host_write_ptr =
- sdio_dld->sdio_dloader_data.outgoing_data.offset_write_p;
-
- sdio_dld_info.cl_dl_buffer_size =
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_buff_size.reg_val;
-
- sdio_dld_info.cl_up_buffer_size =
- sdio_dld->sdio_dloader_data.sdioc_reg.ul_buff_size.reg_val;
-
- sdio_dld_info.host_outgoing_buffer_size =
- sdio_dld->sdio_dloader_data.outgoing_data.buffer_size;
-
- sdio_dld_info.cl_dl_buffer_address =
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_buff_address.reg_val;
-
- sdio_dld_info.cl_up_buffer_address =
- sdio_dld->sdio_dloader_data.sdioc_reg.up_buff_address.reg_val;
-
- sdio_dld_print_info();
-
- if (sdio_dld->done_callback)
- sdio_dld->done_callback();
-
- schedule_work(&cleanup);
- pr_info(MODULE_NAME ": %s - Bootloader done, returning...", __func__);
-}
-
-/**
- * writing_size_to_buf
- * writes from src buffer into dest buffer. if dest buffer
- * reaches its end, rollover happens.
- *
- * @dest: destination buffer.
- * @src: source buffer.
- * @dest_wr_ptr: writing pointer in destination buffer.
- * @dest_size: destination buffer size.
- * @dest_rd_ptr: reading pointer in destination buffer.
- * @size_to_write: size of bytes to write.
- * @return -how many bytes actually written to destination
- * buffer.
- *
- * ONLY destination buffer is treated as cyclic buffer.
- */
-static int writing_size_to_buf(char *dest,
- const unsigned char *src,
- int *dest_wr_ptr,
- int dest_size,
- int dest_rd_ptr,
- int size_to_write)
-{
- int actually_written = 0;
- int size_to_add = *dest_wr_ptr;
-
- if (!dest) {
- pr_err(MODULE_NAME ": %s - param ""dest"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!src) {
- pr_err(MODULE_NAME ": %s - param ""src"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!dest_wr_ptr) {
- pr_err(MODULE_NAME ": %s - param ""dest_wr_ptr"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- for (actually_written = 0 ;
- actually_written < size_to_write ; ++actually_written) {
- /* checking if buffer is full */
- if (((size_to_add + 1) % dest_size) == dest_rd_ptr) {
- *dest_wr_ptr = size_to_add;
- return actually_written;
- }
-
- dest[size_to_add] = src[actually_written];
- size_to_add = (size_to_add+1)%dest_size;
- }
-
- *dest_wr_ptr = size_to_add;
-
- return actually_written;
-}
-
-/**
- * sdioc_bytes_till_end_of_buffer - this routine calculates how many bytes are
- * empty/in use. if calculation requires rap around - it will ignore the rap
- * around and will do the calculation untill the end of the buffer
- *
- * @write_ptr: writing pointer.
- * @read_ptr: reading pointer.
- * @total_size: buffer size.
- * @free_bytes: return value-how many free bytes.
- * @bytes_in_use: return value-how many bytes in use.
- * @return 0 on success or negative value on error.
- *
- * buffer is treated as a cyclic buffer.
- */
-static int sdioc_bytes_till_end_of_buffer(int write_ptr,
- int read_ptr,
- int total_size,
- int *free_bytes,
- int *bytes_in_use)
-{
- if (!free_bytes) {
- pr_err(MODULE_NAME ": %s - param ""free_bytes"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!bytes_in_use) {
- pr_err(MODULE_NAME ": %s - param ""bytes_in_use"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (write_ptr >= read_ptr) {
- if (read_ptr == 0)
- *free_bytes = total_size - write_ptr - 1;
- else
- *free_bytes = total_size - write_ptr;
- *bytes_in_use = write_ptr - read_ptr;
- } else {
- *bytes_in_use = total_size - read_ptr;
- *free_bytes = read_ptr - write_ptr - 1;
- }
-
- return 0;
-}
-
-/**
- * sdioc_bytes_free_in_buffer
- * this routine calculates how many bytes are free in a buffer
- * and how many are in use, according to its reading and
- * writing pointer offsets.
- *
- * @write_ptr: writing pointer.
- * @read_ptr: reading pointer.
- * @total_size: buffer size.
- * @free_bytes: return value-how many free bytes in buffer.
- * @bytes_in_use: return value-how many bytes in use in buffer.
- * @return 0 on success or negative value on error.
- *
- * buffer is treated as a cyclic buffer.
- */
-static int sdioc_bytes_free_in_buffer(int write_ptr,
- int read_ptr,
- int total_size,
- int *free_bytes,
- int *bytes_in_use)
-{
- if (!free_bytes) {
- pr_err(MODULE_NAME ": %s - param ""free_bytes"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!bytes_in_use) {
- pr_err(MODULE_NAME ": %s - param ""bytes_in_use"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- /* if pointers equel - buffers are empty. nothing to read/write */
-
- if (write_ptr >= read_ptr)
- *bytes_in_use = write_ptr - read_ptr;
- else
- *bytes_in_use = total_size - (read_ptr - write_ptr);
-
- *free_bytes = total_size - *bytes_in_use - 1;
-
- return 0;
-}
-
-/*
-* sdio_dld_write_room
-*
-* This is the write_room function of the tty driver.
-*
-* @tty: pointer to tty struct.
-* @return free bytes for write.
-*
-*/
-static int sdio_dld_write_room(struct tty_struct *tty)
-{
- return sdio_dld->sdio_dloader_data.outgoing_data.buffer_size;
-}
-
-/**
- * sdio_dld_write_callback
- * this is the write callback of the tty driver.
- *
- * @tty: pointer to tty struct.
- * @buf: buffer to write from.
- * @count: number of bytes to write.
- * @return bytes written or negative value on error.
- *
- * if destination buffer has not enough room for the incoming
- * data, returns an error.
- */
-static int sdio_dld_write_callback(struct tty_struct *tty,
- const unsigned char *buf, int count)
-{
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
- int dst_free_bytes = 0;
- int dummy = 0;
- int status = 0;
- int bytes_written = 0;
- int total_written = 0;
- static int write_retry;
- int pending_to_write = count;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_count = count;
- update_gd(SDIO_DLD_DEBUGFS_CASE_5_CODE);
-#endif
-
- pr_debug(MODULE_NAME ": %s - WRITING CALLBACK CALLED WITH %d bytes\n",
- __func__, count);
-
- if (!outgoing->data) {
- pr_err(MODULE_NAME ": %s - param ""outgoing->data"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- pr_debug(MODULE_NAME ": %s - WRITE CALLBACK size to write to outgoing"
- " buffer %d\n", __func__, count);
-
- /* as long as there is something to write to outgoing buffer */
- do {
- int bytes_to_write = 0;
- status = sdioc_bytes_free_in_buffer(
- outgoing->offset_write_p,
- outgoing->offset_read_p,
- outgoing->buffer_size,
- &dst_free_bytes,
- &dummy);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdioc_bytes_free_in_buffer(). status=%d\n",
- __func__, status);
- return status;
- }
-
- /*
- * if there is free room in outgoing buffer
- * lock mutex and request trigger notification from the main
- * task. unlock mutex, and wait for sinal
- */
- if (dst_free_bytes > 0) {
- write_retry = 0;
- /*
- * if there is more data to write to outgoing buffer
- * than it can receive, wait for signal from main task
- */
- if (pending_to_write > dst_free_bytes) {
-
- /* sampling updated dst_free_bytes */
- status = sdioc_bytes_free_in_buffer(
- outgoing->offset_write_p,
- outgoing->offset_read_p,
- outgoing->buffer_size,
- &dst_free_bytes,
- &dummy);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in "
- "Function "
- "sdioc_bytes_free_in_buffer(). "
- "status=%d\n", __func__, status);
- return status;
- }
- }
-
- bytes_to_write = min(pending_to_write, dst_free_bytes);
- bytes_written =
- writing_size_to_buf(outgoing->data,
- buf+total_written,
- &outgoing->offset_write_p,
- outgoing->buffer_size,
- outgoing->offset_read_p,
- bytes_to_write);
-
- /* keeping sdio_dld_info up to date */
- sdio_dld_info.host_write_ptr =
- sdio_dld->sdio_dloader_data.
- outgoing_data.offset_write_p;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_write_tty = bytes_written;
- update_gd(SDIO_DLD_DEBUGFS_CASE_3_CODE);
-#endif
- sdio_dld_info.global_bytes_write_tty += bytes_written;
-
- spin_lock_irqsave(&lock2, lock_flags2);
- if (sdio_dld->main_loop_event.wake_up_signal == 0) {
- sdio_dld->main_loop_event.wake_up_signal = 1;
- wake_up(&sdio_dld->main_loop_event.wait_event);
- }
- spin_unlock_irqrestore(&lock2, lock_flags2);
-
- /*
- * although outgoing buffer has enough room, writing
- * failed
- */
- if (bytes_written != bytes_to_write) {
- pr_err(MODULE_NAME ": %s - couldn't write "
- "%d bytes to " "outgoing buffer."
- "bytes_written=%d\n",
- __func__, bytes_to_write,
- bytes_written);
- return -EIO;
- }
-
- total_written += bytes_written;
- pending_to_write -= bytes_written;
- outgoing->num_of_bytes_in_use += bytes_written;
-
- pr_debug(MODULE_NAME ": %s - WRITE CHUNK to outgoing "
- "buffer. pending_to_write=%d, "
- "outgoing_free_bytes=%d, "
- "bytes_written=%d\n",
- __func__,
- pending_to_write,
- dst_free_bytes,
- bytes_written);
-
- } else {
- write_retry++;
-
- pr_debug(MODULE_NAME ": %s - WRITE CALLBACK - NO ROOM."
- " pending_to_write=%d, write_retry=%d\n",
- __func__,
- pending_to_write,
- write_retry);
-
- spin_lock_irqsave(&lock1, lock_flags1);
- sdio_dld->write_callback_event.wake_up_signal = 0;
- spin_unlock_irqrestore(&lock1, lock_flags1);
-
- pr_debug(MODULE_NAME ": %s - WRITE CALLBACK - "
- "WAITING...", __func__);
-#ifdef CONFIG_DEBUG_FS
- update_gd(SDIO_DLD_DEBUGFS_CASE_8_CODE);
-#endif
- wait_event(sdio_dld->write_callback_event.wait_event,
- sdio_dld->write_callback_event.
- wake_up_signal);
-#ifdef CONFIG_DEBUG_FS
- update_gd(SDIO_DLD_DEBUGFS_CASE_9_CODE);
-#endif
- pr_debug(MODULE_NAME ": %s - WRITE CALLBACK - "
- "WOKE UP...", __func__);
- }
- } while (pending_to_write > 0 && write_retry < WRITE_RETRIES);
-
- if (pending_to_write > 0) {
-
- pr_err(MODULE_NAME ": %s - WRITE CALLBACK - pending data is "
- "%d out of %d > 0. total written in this "
- "callback = %d\n",
- __func__, pending_to_write, count, total_written);
- }
-
- if (write_retry == WRITE_RETRIES) {
- pr_err(MODULE_NAME ": %s, write_retry=%d= max\n",
- __func__, write_retry);
- }
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_bytes_cb_tty = total_written;
- update_gd(SDIO_DLD_DEBUGFS_CASE_10_CODE);
-#endif
-
- return total_written;
-}
-
-/**
- * sdio_memcpy_fromio_wrapper -
- * reads from sdioc, and updats the sdioc registers according
- * to how many bytes were actually read.
- *
- * @str_func: a pointer to func struct.
- * @client_rd_ptr: sdioc value of downlink read ptr.
- * @client_wr_ptr: sdioc value of downlink write ptr.
- * @buffer_to_store: buffer to store incoming data.
- * @address_to_read: address to start reading from in sdioc.
- * @size_to_read: size of bytes to read.
- * @client_buffer_size: sdioc downlink buffer size.
- * @return 0 on success or negative value on error.
- */
-static int sdio_memcpy_fromio_wrapper(struct sdio_func *str_func,
- unsigned int client_rd_ptr,
- unsigned int client_wr_ptr,
- void *buffer_to_store,
- unsigned int address_to_read_from,
- int size_to_read,
- int client_buffer_size)
-{
- int status = 0;
- struct sdioc_reg_chunk *reg_str =
- &sdio_dld->sdio_dloader_data.sdioc_reg;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!buffer_to_store) {
- pr_err(MODULE_NAME ": %s - param ""buffer_to_store"" is "
- "NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (size_to_read < 0) {
- pr_err(MODULE_NAME ": %s - invalid size to read=%d\n",
- __func__, size_to_read);
- return -EINVAL;
- }
-
- sdio_claim_host(str_func);
-
- pr_debug(MODULE_NAME ": %s, READING DATA - from add %d, "
- "size_to_read=%d\n",
- __func__, address_to_read_from, size_to_read);
-
- status = sdio_memcpy_fromio(str_func,
- (void *)buffer_to_store,
- address_to_read_from,
- size_to_read);
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_fromio()"
- " DATA failed. status=%d.\n",
- __func__, status);
- sdio_release_host(str_func);
- return status;
- }
-
- /* updating an offset according to cyclic buffer size */
- reg_str->dl_rd_ptr.reg_val =
- (reg_str->dl_rd_ptr.reg_val + size_to_read) %
- client_buffer_size;
- /* keeping sdio_dld_info up to date */
- sdio_dld_info.cl_dl_rd_ptr = reg_str->dl_rd_ptr.reg_val;
-
- status = sdio_memcpy_toio(str_func,
- reg_str->dl_rd_ptr.reg_offset,
- (void *)®_str->dl_rd_ptr.reg_val,
- sizeof(reg_str->dl_rd_ptr.reg_val));
-
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_toio() "
- "UPDATE PTR failed. status=%d.\n",
- __func__, status);
- }
-
- sdio_release_host(str_func);
- return status;
-}
-
-/**
- * sdio_memcpy_toio_wrapper
- * writes to sdioc, and updats the sdioc registers according
- * to how many bytes were actually read.
- *
- * @str_func: a pointer to func struct.
- * @client_wr_ptr: sdioc downlink write ptr.
- * @h_read_ptr: host incoming read ptrs
- * @buf_write_from: buffer to write from.
- * @bytes_to_write: number of bytes to write.
- * @return 0 on success or negative value on error.
- */
-static int sdio_memcpy_toio_wrapper(struct sdio_func *str_func,
- unsigned int client_wr_ptr,
- unsigned int h_read_ptr,
- void *buf_write_from,
- int bytes_to_write)
-{
- int status = 0;
- struct sdioc_reg_chunk *reg_str =
- &sdio_dld->sdio_dloader_data.sdioc_reg;
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!buf_write_from) {
- pr_err(MODULE_NAME ": %s - param ""buf_write_from"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_claim_host(str_func);
-
- pr_debug(MODULE_NAME ": %s, WRITING DATA TOIO to address 0x%x, "
- "bytes_to_write=%d\n",
- __func__,
- reg_str->up_buff_address.reg_val + reg_str->up_wr_ptr.reg_val,
- bytes_to_write);
-
- status = sdio_memcpy_toio(str_func,
- reg_str->up_buff_address.reg_val +
- reg_str->up_wr_ptr.reg_val,
- (void *) (outgoing->data + h_read_ptr),
- bytes_to_write);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_toio() "
- "DATA failed. status=%d.\n", __func__, status);
- sdio_release_host(str_func);
- return status;
- }
-
- sdio_dld_info.global_bytes_write_toio += bytes_to_write;
- outgoing->num_of_bytes_in_use -= bytes_to_write;
-
- /*
- * if writing to client succeeded, then
- * 1. update the client up_wr_ptr
- * 2. update the host outgoing rd ptr
- **/
- reg_str->up_wr_ptr.reg_val =
- ((reg_str->up_wr_ptr.reg_val + bytes_to_write) %
- reg_str->ul_buff_size.reg_val);
-
- /* keeping sdio_dld_info up to date */
- sdio_dld_info.cl_up_wr_ptr = reg_str->up_wr_ptr.reg_val;
-
- outgoing->offset_read_p =
- ((outgoing->offset_read_p + bytes_to_write) %
- outgoing->buffer_size);
-
- /* keeping sdio_dld_info up to date*/
- sdio_dld_info.host_read_ptr = outgoing->offset_read_p;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_write_toio = bytes_to_write;
- update_gd(SDIO_DLD_DEBUGFS_CASE_4_CODE);
-#endif
-
- /* updating uplink write pointer according to size that was written */
- status = sdio_memcpy_toio(str_func,
- reg_str->up_wr_ptr.reg_offset,
- (void *)(®_str->up_wr_ptr.reg_val),
- sizeof(reg_str->up_wr_ptr.reg_val));
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_toio() "
- "UPDATE PTR failed. status=%d.\n",
- __func__, status);
- }
-
- sdio_release_host(str_func);
- return status;
-}
-
-/**
- * sdio_dld_read
- * reads from sdioc
- *
- * @client_rd_ptr: sdioc downlink read ptr.
- * @client_wr_ptr: sdioc downlink write ptr.
- * @reg_str: sdioc register shadowing struct.
- * @str_func: a pointer to func struct.
- * @bytes_read:how many bytes read.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_read(unsigned int client_rd_ptr,
- unsigned int client_wr_ptr,
- struct sdioc_reg_chunk *reg_str,
- struct sdio_func *str_func,
- int *bytes_read)
-{
- int status = 0;
- struct sdio_data *incoming = &sdio_dld->sdio_dloader_data.incoming_data;
-
- if (!reg_str) {
- pr_err(MODULE_NAME ": %s - param ""reg_str"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!bytes_read) {
- pr_err(MODULE_NAME ": %s - param ""bytes_read"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- /* there is data to read in ONE chunk */
- if (client_wr_ptr > client_rd_ptr) {
- status = sdio_memcpy_fromio_wrapper(
- str_func,
- client_rd_ptr,
- client_wr_ptr,
- (void *)incoming->data,
- reg_str->dl_buff_address.reg_val + client_rd_ptr,
- client_wr_ptr - client_rd_ptr,
- reg_str->dl_buff_size.reg_val);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_memcpy_fromio_wrapper(). "
- "SINGLE CHUNK READ. status=%d\n",
- __func__, status);
- return status;
- }
-
- incoming->num_of_bytes_in_use += client_wr_ptr - client_rd_ptr;
- *bytes_read = client_wr_ptr - client_rd_ptr;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_to_read =
- client_wr_ptr - client_rd_ptr;
- update_gd(SDIO_DLD_DEBUGFS_CASE_11_CODE);
-#endif
- }
-
- /* there is data to read in TWO chunks */
- else {
- int dl_buf_size = reg_str->dl_buff_size.reg_val;
- int tail_size = dl_buf_size - client_rd_ptr;
-
- /* reading chunk#1: from rd_ptr to the end of the buffer */
- status = sdio_memcpy_fromio_wrapper(
- str_func,
- client_rd_ptr,
- dl_buf_size,
- (void *)incoming->data,
- reg_str->dl_buff_address.reg_val + client_rd_ptr,
- tail_size,
- dl_buf_size);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_memcpy_fromio_wrapper(). "
- "1 of 2 CHUNKS READ. status=%d\n",
- __func__, status);
- return status;
- }
-
- incoming->num_of_bytes_in_use += tail_size;
- *bytes_read = tail_size;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_to_read = tail_size;
- update_gd(SDIO_DLD_DEBUGFS_CASE_11_CODE);
-#endif
-
- /* reading chunk#2: reading from beginning buffer */
- status = sdio_memcpy_fromio_wrapper(
- str_func,
- client_rd_ptr,
- client_wr_ptr,
- (void *)(incoming->data + tail_size),
- reg_str->dl_buff_address.reg_val,
- client_wr_ptr,
- reg_str->dl_buff_size.reg_val);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_memcpy_fromio_wrapper(). "
- "2 of 2 CHUNKS READ. status=%d\n",
- __func__, status);
- return status;
- }
-
- incoming->num_of_bytes_in_use += client_wr_ptr;
- *bytes_read += client_wr_ptr;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_to_read = client_wr_ptr;
- update_gd(SDIO_DLD_DEBUGFS_CASE_11_CODE);
-#endif
- }
- return 0;
-}
-
-/**
- * sdio_dld_main_task
- * sdio downloader main task. reads mailboxf checks if there is
- * anything to read, checks if host has anything to
- * write.
- *
- * @card: a pointer to mmc_card.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_main_task(void *card)
-{
- int status = 0;
- struct tty_struct *tty = sdio_dld->tty_str;
- struct sdioc_reg_chunk *reg_str =
- &sdio_dld->sdio_dloader_data.sdioc_reg;
- int func = sdio_dld->sdioc_boot_func;
- struct sdio_func *str_func = NULL;
- struct sdio_data *outgoing = &sdio_dld->sdio_dloader_data.outgoing_data;
- struct sdio_data *incoming = &sdio_dld->sdio_dloader_data.incoming_data;
- struct sdio_dld_task *task = &sdio_dld->dld_main_thread;
- int retries = 0;
-#ifdef PUSH_STRING
- int bytes_pushed = 0;
-#endif
-
- msleep(SLEEP_MS);
-
- if (!card) {
- pr_err(MODULE_NAME ": %s - param ""card"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!tty) {
- pr_err(MODULE_NAME ": %s - param ""tty"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- str_func = ((struct mmc_card *)card)->
- sdio_func[REAL_FUNC_TO_FUNC_IN_ARRAY(func)];
-
- if (!str_func) {
- pr_err(MODULE_NAME ": %s - param ""str_func"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- while (true) {
- /* client pointers for both buffers */
- int client_ul_wr_ptr = 0;
- int client_ul_rd_ptr = 0;
- int client_dl_wr_ptr = 0;
- int client_dl_rd_ptr = 0;
-
- /* host pointer for outgoing buffer */
- int h_out_wr_ptr = 0;
- int h_out_rd_ptr = 0;
-
- int h_bytes_rdy_wr = 0;
- int c_bytes_rdy_rcve = 0;
-
- int need_to_write = 0;
- int need_to_read = 0;
-
- /*
- * forever, checking for signal to die, then read MailBox.
- * if nothing to read or nothing to write to client, sleep,
- * and again read MailBox
- */
- do {
- int dummy = 0;
-
- /* checking if a signal to die was sent */
- if (atomic_read(&task->please_close) == 1) {
-
- pr_debug(MODULE_NAME ": %s - 0x%x was written "
- "to 9K\n", __func__, SDIOC_EXIT_CODE);
-
- sdio_claim_host(str_func);
-
- /* returned value is not checked on purpose */
- sdio_memcpy_toio(
- str_func,
- reg_str->good_to_exit_ptr.reg_offset,
- (void *)®_str->good_to_exit_ptr.
- reg_val,
- sizeof(reg_str->good_to_exit_ptr.
- reg_val));
-
- sdio_release_host(str_func);
-
- task->exit_wait.wake_up_signal = 1;
- wake_up(&task->exit_wait.wait_event);
- return 0;
- }
-
- status = mailbox_to_seq_chunk_read_ptrs(str_func);
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "mailbox_to_seq_chunk_read_ptrs(). "
- "status=%d\n", __func__, status);
- return status;
- }
-
- /* calculate how many bytes the host has send */
- h_out_wr_ptr = outgoing->offset_write_p;
- h_out_rd_ptr = outgoing->offset_read_p;
-
- status = sdioc_bytes_till_end_of_buffer(
- h_out_wr_ptr,
- h_out_rd_ptr,
- outgoing->buffer_size,
- &dummy,
- &h_bytes_rdy_wr);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdioc_bytes_till_end_of_buffer(). "
- "status=%d\n", __func__, status);
- return status;
- }
-
- /* is there something to read from client */
- client_dl_wr_ptr = reg_str->dl_wr_ptr.reg_val;
- client_dl_rd_ptr = reg_str->dl_rd_ptr.reg_val;
-
- if (client_dl_rd_ptr != client_dl_wr_ptr)
- need_to_read = 1;
-
- /*
- * calculate how many bytes the client can receive
- * from host
- */
- client_ul_wr_ptr = reg_str->up_wr_ptr.reg_val;
- client_ul_rd_ptr = reg_str->up_rd_ptr.reg_val;
-
- status = sdioc_bytes_till_end_of_buffer(
- client_ul_wr_ptr,
- client_ul_rd_ptr,
- reg_str->ul_buff_size.reg_val,
- &c_bytes_rdy_rcve,
- &dummy);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdioc_bytes_till_end_of_buffer(). "
- "status=%d\n", __func__, status);
- return status;
- }
-
- /* if host has anything to write */
- if (h_bytes_rdy_wr > 0)
- need_to_write = 1;
-
- if (need_to_write || need_to_read)
- break;
-
- spin_lock_irqsave(&lock2, lock_flags2);
- sdio_dld->main_loop_event.wake_up_signal = 0;
- spin_unlock_irqrestore(&lock2, lock_flags2);
-
- pr_debug(MODULE_NAME ": %s - MAIN LOOP - WAITING...\n",
- __func__);
-#ifdef CONFIG_DEBUG_FS
- update_gd(SDIO_DLD_DEBUGFS_CASE_6_CODE);
-#endif
- wait_event(sdio_dld->main_loop_event.wait_event,
- sdio_dld->main_loop_event.wake_up_signal);
-#ifdef CONFIG_DEBUG_FS
- update_gd(SDIO_DLD_DEBUGFS_CASE_7_CODE);
-#endif
-
- pr_debug(MODULE_NAME ": %s - MAIN LOOP - WOKE UP...\n",
- __func__);
-
- } while (1);
-
- /* CHECK IF THERE IS ANYTHING TO READ IN CLIENT */
- if (need_to_read) {
-#ifdef PUSH_STRING
- int num_push = 0;
- int left = 0;
- int bytes_read;
-#else
- int i;
-#endif
- need_to_read = 0;
-
- status = sdio_dld_read(client_dl_rd_ptr,
- client_dl_wr_ptr,
- reg_str,
- str_func,
- &bytes_read);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_dld_read(). status=%d\n",
- __func__, status);
- return status;
- }
-
- sdio_dld_info.global_bytes_read_fromio +=
- bytes_read;
-
- bytes_pushed = 0;
-#ifdef PUSH_STRING
- left = incoming->num_of_bytes_in_use;
- start_timer(&sdio_dld->push_timer,
- sdio_dld->push_timer_ms);
- do {
- num_push = tty_insert_flip_string(
- tty,
- incoming->data+bytes_pushed,
- left);
-
- bytes_pushed += num_push;
- left -= num_push;
- tty_flip_buffer_push(tty);
- } while (left != 0);
-
- del_timer(&sdio_dld->push_timer);
-
- if (bytes_pushed != incoming->num_of_bytes_in_use) {
- pr_err(MODULE_NAME ": %s - failed\n",
- __func__);
- }
-#else
- pr_debug(MODULE_NAME ": %s - NEED TO READ %d\n",
- __func__, incoming->num_of_bytes_in_use);
-
- for (i = 0 ; i < incoming->num_of_bytes_in_use ; ++i) {
- int err = 0;
- err = tty_insert_flip_char(tty,
- incoming->data[i],
- TTY_NORMAL);
- tty_flip_buffer_push(tty);
- }
-
- pr_debug(MODULE_NAME ": %s - JUST READ\n", __func__);
-#endif /*PUSH_STRING*/
- sdio_dld_info.global_bytes_push_tty +=
- incoming->num_of_bytes_in_use;
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_push_to_tty = bytes_read;
- update_gd(SDIO_DLD_DEBUGFS_CASE_12_CODE);
-#endif
- incoming->num_of_bytes_in_use = 0;
- tty_flip_buffer_push(tty);
- }
-
- /* CHECK IF THERE IS ANYTHING TO WRITE IN HOST AND HOW MUCH */
- if (need_to_write) {
- int dummy = 0;
-
- do {
- int bytes_to_write = min(c_bytes_rdy_rcve,
- h_bytes_rdy_wr);
-
- /*
- * in case nothing to send or no room to
- * receive
- */
- if (bytes_to_write == 0)
- break;
-
- if (client_ul_rd_ptr == 0 &&
- (client_ul_rd_ptr != client_ul_wr_ptr))
- break;
-
- /*
- * if client_rd_ptr points to start, but there
- * is data to read wait until WRITE_TILL_END
- * before writing a chunk of data, to avoid
- * writing until (BUF_SIZE - 1), because it will
- * yield an extra write of "1" bytes
- */
- if (client_ul_rd_ptr == 0 &&
- (client_ul_rd_ptr != client_ul_wr_ptr) &&
- retries < WRITE_TILL_END_RETRIES) {
- retries++;
- break;
- }
- retries = 0;
-
-#ifdef CONFIG_DEBUG_FS
- debugfs_glob.global_8k_has = h_bytes_rdy_wr;
- debugfs_glob.global_9k_has = c_bytes_rdy_rcve;
- debugfs_glob.global_min = bytes_to_write;
- update_gd(SDIO_DLD_DEBUGFS_CASE_2_CODE);
-#endif
- need_to_write = 0;
-
- pr_debug(MODULE_NAME ": %s - NEED TO WRITE "
- "TOIO %d\n",
- __func__, bytes_to_write);
-
- status = sdio_memcpy_toio_wrapper(
- str_func,
- reg_str->up_wr_ptr.reg_val,
- outgoing->offset_read_p,
- (void *)((char *)outgoing->data +
- outgoing->offset_read_p),
- bytes_to_write);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in "
- "Function "
- "sdio_memcpy_toio_wrapper(). "
- "SINGLE CHUNK WRITE. "
- "status=%d\n",
- __func__, status);
- return status;
- }
-
- sdio_claim_host(str_func);
-
- status = sdio_memcpy_fromio(
- str_func,
- (void *)®_str->up_rd_ptr.reg_val,
- SDIOC_UL_RD_PTR,
- sizeof(reg_str->up_rd_ptr.reg_val));
-
- if (status) {
- pr_err(MODULE_NAME ": %s - "
- "sdio_memcpy_fromio() "
- "failed. status=%d\n",
- __func__, status);
- sdio_release_host(str_func);
-
- return status;
- }
-
- sdio_release_host(str_func);
-
- spin_lock_irqsave(&lock1, lock_flags1);
- if (sdio_dld->write_callback_event.
- wake_up_signal == 0) {
- sdio_dld->write_callback_event.
- wake_up_signal = 1;
- wake_up(&sdio_dld->
- write_callback_event.
- wait_event);
- }
-
- spin_unlock_irqrestore(&lock1, lock_flags1);
- client_ul_wr_ptr = reg_str->up_wr_ptr.reg_val;
- client_ul_rd_ptr = reg_str->up_rd_ptr.reg_val;
-
- status = sdioc_bytes_till_end_of_buffer(
- client_ul_wr_ptr,
- client_ul_rd_ptr,
- reg_str->ul_buff_size.reg_val,
- &c_bytes_rdy_rcve,
- &dummy);
-
- /* calculate how many bytes host has to send */
- h_out_wr_ptr = outgoing->offset_write_p;
- h_out_rd_ptr = outgoing->offset_read_p;
-
- status = sdioc_bytes_till_end_of_buffer(
- h_out_wr_ptr,
- h_out_rd_ptr,
- outgoing->buffer_size,
- &dummy,
- &h_bytes_rdy_wr);
-
- } while (h_out_wr_ptr != h_out_rd_ptr);
- }
- }
- return 0;
-}
-
-/**
- * sdio_dld_init_global
- * initialization of sdio_dld global struct
- *
- * @card: a pointer to mmc_card.
- * @return 0 on success or negative value on error.
- */
-static int sdio_dld_init_global(struct mmc_card *card,
- int(*done)(void))
-{
- if (!card) {
- pr_err(MODULE_NAME ": %s - param ""card"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!done) {
- pr_err(MODULE_NAME ": %s - param ""done"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_dld->done_callback = done;
- sdio_dld->card = card;
- init_waitqueue_head(&sdio_dld->dld_main_thread.exit_wait.wait_event);
- sdio_dld->write_callback_event.wake_up_signal = 1;
- sdio_dld->main_loop_event.wake_up_signal = 1;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_buff_size.reg_offset =
- SDIOC_DL_BUFF_SIZE_OFFSET;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_rd_ptr.reg_offset =
- SDIOC_DL_RD_PTR;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_wr_ptr.reg_offset =
- SDIOC_DL_WR_PTR;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.ul_buff_size.reg_offset =
- SDIOC_UP_BUFF_SIZE_OFFSET;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.up_rd_ptr.reg_offset =
- SDIOC_UL_RD_PTR;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.up_wr_ptr.reg_offset =
- SDIOC_UL_WR_PTR;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.good_to_exit_ptr.reg_offset =
- SDIOC_EXIT_PTR;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.dl_buff_address.reg_offset =
- SDIOC_DL_BUFF_ADDRESS;
-
- sdio_dld->sdio_dloader_data.sdioc_reg.up_buff_address.reg_offset =
- SDIOC_UP_BUFF_ADDRESS;
-
- sdio_dld_set_op_mode(SDIO_DLD_NORMAL_MODE);
-
- return 0;
-}
-
-/**
- * sdio_downloader_setup
- * initializes the TTY driver
- *
- * @card: a pointer to mmc_card.
- * @num_of_devices: number of devices.
- * @channel_number: channel number.
- * @return 0 on success or negative value on error.
- *
- * The TTY stack needs to know in advance how many devices it should
- * plan to manage. Use this call to set up the ports that will
- * be exported through SDIO.
- */
-int sdio_downloader_setup(struct mmc_card *card,
- unsigned int num_of_devices,
- int channel_number,
- int(*done)(void))
-{
- int status = 0;
- int result = 0;
- int func_in_array = 0;
- struct sdio_func *str_func = NULL;
- struct device *tty_dev;
-
- if (atomic_read(&sdio_dld_in_use) == 1)
- return -EBUSY;
-
- /*
- * If the setup is already complete tear down the existing
- * one and reinitialize. This might happen during modem restarts
- * in boot phase.
- */
- if (atomic_read(&sdio_dld_setup_done) == 1)
- sdio_dld_tear_down(NULL);
-
- if (num_of_devices == 0 || num_of_devices > MAX_NUM_DEVICES) {
- pr_err(MODULE_NAME ": %s - invalid number of devices\n",
- __func__);
- return -EINVAL;
- }
-
- if (!card) {
- pr_err(MODULE_NAME ": %s - param ""card"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- if (!done) {
- pr_err(MODULE_NAME ": %s - param ""done"" is NULL.\n",
- __func__);
- return -EINVAL;
- }
-
- sdio_dld = kzalloc(sizeof(struct sdio_downloader), GFP_KERNEL);
- if (!sdio_dld) {
- pr_err(MODULE_NAME ": %s - couldn't allocate sdio_dld data "
- "structure.", __func__);
- return -ENOMEM;
- }
-
-#ifdef CONFIG_DEBUG_FS
- bootloader_debugfs_init();
-#endif /* CONFIG_DEBUG_FS */
-
- status = sdio_dld_init_global(card, done);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_dld_init_global(). status=%d\n",
- __func__, status);
- kfree(sdio_dld);
- return status;
- }
-
- sdio_dld->tty_drv = alloc_tty_driver(num_of_devices);
-
- if (!sdio_dld->tty_drv) {
- pr_err(MODULE_NAME ": %s - param ""sdio_dld->tty_drv"" is "
- "NULL.\n", __func__);
- kfree(sdio_dld);
- return -EINVAL;
- }
-
- sdio_dld_set_op_mode((enum sdio_dld_op_mode)sdio_op_mode);
-
- /* according to op_mode, a different tty device is created */
- if (sdio_dld->op_mode == SDIO_DLD_BOOT_TEST_MODE)
- sdio_dld->tty_drv->name = TTY_SDIO_DEV_TEST;
- else
- sdio_dld->tty_drv->name = TTY_SDIO_DEV;
-
- sdio_dld->tty_drv->owner = THIS_MODULE;
- sdio_dld->tty_drv->driver_name = "SDIO_Dloader";
-
- /* uses dynamically assigned dev_t values */
- sdio_dld->tty_drv->type = TTY_DRIVER_TYPE_SERIAL;
- sdio_dld->tty_drv->subtype = SERIAL_TYPE_NORMAL;
- sdio_dld->tty_drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV
- | TTY_DRIVER_RESET_TERMIOS;
-
- /* initializing the tty driver */
- sdio_dld->tty_drv->init_termios = tty_std_termios;
- sdio_dld->tty_drv->init_termios.c_cflag =
- B4800 | CS8 | CREAD | HUPCL | CLOCAL;
- sdio_dld->tty_drv->init_termios.c_ispeed = INPUT_SPEED;
- sdio_dld->tty_drv->init_termios.c_ospeed = OUTPUT_SPEED;
-
- tty_set_operations(sdio_dld->tty_drv, &sdio_dloader_tty_ops);
-
- status = tty_register_driver(sdio_dld->tty_drv);
- if (status) {
- put_tty_driver(sdio_dld->tty_drv);
- pr_err(MODULE_NAME ": %s - tty_register_driver() failed\n",
- __func__);
-
- sdio_dld->tty_drv = NULL;
- kfree(sdio_dld);
- return status;
- }
-
- tty_dev = tty_register_device(sdio_dld->tty_drv, 0, NULL);
- if (IS_ERR(tty_dev)) {
- pr_err(MODULE_NAME ": %s - tty_register_device() "
- "failed\n", __func__);
- tty_unregister_driver(sdio_dld->tty_drv);
- put_tty_driver(sdio_dld->tty_drv);
- kfree(sdio_dld);
- return PTR_ERR(tty_dev);
- }
-
- sdio_dld->sdioc_boot_func = SDIOC_CHAN_TO_FUNC_NUM(channel_number);
- func_in_array = REAL_FUNC_TO_FUNC_IN_ARRAY(sdio_dld->sdioc_boot_func);
- str_func = sdio_dld->card->sdio_func[func_in_array];
- status = sdio_dld_init_func(str_func);
- if (status) {
- pr_err(MODULE_NAME ": %s - Failure in Function "
- "sdio_dld_init_func(). status=%d\n",
- __func__, status);
- goto exit_err;
- }
-
-#ifdef CONFIG_DEBUG_FS
- sdio_dld_debug_init();
-#endif
-
- sdio_claim_host(str_func);
-
- /*
- * notifing the client by writing what mode we are by writing
- * to a special register
- */
- status = sdio_memcpy_toio(str_func,
- SDIOC_OP_MODE_PTR,
- (void *)&sdio_dld->op_mode,
- sizeof(sdio_dld->op_mode));
-
- sdio_release_host(str_func);
-
- if (status) {
- pr_err(MODULE_NAME ": %s - sdio_memcpy_toio() "
- "writing to OP_MODE_REGISTER failed. "
- "status=%d.\n",
- __func__, status);
- goto exit_err;
- }
-
- atomic_set(&sdio_dld_setup_done, 1);
- return 0;
-
-exit_err:
- tty_unregister_device(sdio_dld->tty_drv, 0);
- result = tty_unregister_driver(sdio_dld->tty_drv);
- if (result)
- pr_err(MODULE_NAME ": %s - tty_unregister_driver() "
- "failed. result=%d\n", __func__, -result);
- put_tty_driver(sdio_dld->tty_drv);
- kfree(sdio_dld);
- atomic_set(&sdio_dld_setup_done, 0);
- return status;
-}
-
-static void sdio_dld_tear_down(struct work_struct *work)
-{
- int status = 0;
-
- if (atomic_read(&sdio_dld_in_use) == 1) {
- del_timer_sync(&sdio_dld->timer);
- del_timer_sync(&sdio_dld->push_timer);
- sdio_dld_dealloc_local_buffers();
- }
-
- tty_unregister_device(sdio_dld->tty_drv, 0);
-
- status = tty_unregister_driver(sdio_dld->tty_drv);
- if (status) {
- pr_err(MODULE_NAME ": %s - tty_unregister_driver() failed\n",
- __func__);
- }
-
- put_tty_driver(sdio_dld->tty_drv);
- kfree(sdio_dld);
- atomic_set(&sdio_dld_in_use, 0);
- atomic_set(&sdio_dld_setup_done, 0);
-}
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SDIO Downloader");
-MODULE_AUTHOR("Yaniv Gardi <ygardi@codeaurora.org>");
-MODULE_VERSION(DRV_VERSION);
-
diff --git a/arch/arm/mach-msm/sdio_al_private.h b/arch/arm/mach-msm/sdio_al_private.h
deleted file mode 100644
index 3a5ab79..0000000
--- a/arch/arm/mach-msm/sdio_al_private.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * SDIO-Abstraction-Layer internal interface.
- */
-
-#ifndef __SDIO_AL_PRIVATE__
-#define __SDIO_AL_PRIVATE__
-
-#include <linux/mmc/card.h>
-#include <linux/platform_device.h>
-#include <mach/sdio_al.h>
-
-#define DRV_VERSION "1.30"
-#define MODULE_NAME "sdio_al"
-#define SDIOC_CHAN_TO_FUNC_NUM(x) ((x)+2)
-#define REAL_FUNC_TO_FUNC_IN_ARRAY(x) ((x)-1)
-#define SDIO_PREFIX "SDIO_"
-#define PEER_CHANNEL_NAME_SIZE 4
-#define CHANNEL_NAME_SIZE (sizeof(SDIO_PREFIX) + PEER_CHANNEL_NAME_SIZE)
-#define SDIO_TEST_POSTFIX_SIZE 5
-#define MAX_NUM_OF_SDIO_DEVICES 2
-#define TEST_CH_NAME_SIZE (CHANNEL_NAME_SIZE + SDIO_TEST_POSTFIX_SIZE)
-
-struct sdio_al_device; /* Forward Declaration */
-
-enum sdio_channel_state {
- SDIO_CHANNEL_STATE_INVALID, /* before reading software header */
- SDIO_CHANNEL_STATE_IDLE, /* channel valid, not opened */
- SDIO_CHANNEL_STATE_CLOSED, /* was closed */
- SDIO_CHANNEL_STATE_OPEN, /* opened */
- SDIO_CHANNEL_STATE_CLOSING, /* during flush, when closing */
-};
-/**
- * Peer SDIO-Client channel configuration.
- *
- * @is_ready - channel is ready and the data is valid.
- *
- * @max_rx_threshold - maximum rx threshold, according to the
- * total buffers size on the peer pipe.
- * @max_tx_threshold - maximum tx threshold, according to the
- * total buffers size on the peer pipe.
- * @tx_buf_size - size of a single buffer on the peer pipe; a
- * transfer smaller than the buffer size still
- * make the buffer unusable for the next transfer.
- * @max_packet_size
- * @is_host_ok_to_sleep - Host marks this bit when it's okay to
- * sleep (no pending transactions)
- */
-struct peer_sdioc_channel_config {
- u32 is_ready;
- u32 max_rx_threshold; /* Downlink */
- u32 max_tx_threshold; /* Uplink */
- u32 tx_buf_size;
- u32 max_packet_size;
- u32 is_host_ok_to_sleep;
- u32 is_packet_mode;
- u32 peer_operation;
- u32 is_low_latency_ch;
- u32 reserved[23];
-};
-
-
-/**
- * Peer SDIO-Client channel statsitics.
- *
- * @last_any_read_avail - the last read avail in all the
- * channels including this channel.
- * @last_read_avail - the last read_avail that was read from HW
- * mailbox.
- * @last_old_read_avail - the last read_avail channel shadow.
- * @total_notifs - the total number of read notifications sent
- * to this channel client
- * @total_read_times - the total number of successful sdio_read
- * calls for this channel
- */
-struct sdio_channel_statistics {
- int last_any_read_avail;
- int last_read_avail;
- int last_old_read_avail;
- int total_notifs;
- int total_read_times;
-};
-
-/**
- * SDIO Channel context.
- *
- * @name - channel name. Used by the caller to open the
- * channel.
- *
- * @read_threshold - Threshold on SDIO-Client mailbox for Rx
- * Data available bytes. When the limit exceed
- * the SDIO-Client generates an interrupt to the
- * host.
- *
- * @write_threshold - Threshold on SDIO-Client mailbox for Tx
- * Data available bytes. When the limit exceed
- * the SDIO-Client generates an interrupt to the
- * host.
- *
- * @def_read_threshold - Default theshold on SDIO-Client for Rx
- *
- * @min_write_avail - Threshold of minimal available bytes
- * to write. Below that threshold the host
- * will initiate reading the mailbox.
- *
- * @poll_delay_msec - Delay between polling the mailbox. When
- * the SDIO-Client doesn't generates EOT
- * interrupt for Rx Available bytes, the host
- * should poll the SDIO-Client mailbox.
- *
- * @is_packet_mode - The host get interrupt when a packet is
- * available at the SDIO-client (pipe EOT
- * indication).
- *
- * @num - channel number.
- *
- * @notify - Client's callback. Should not call sdio read/write.
- *
- * @priv - Client's private context, provided to callback.
- *
- * @is_valid - Channel is used (we have a list of
- * SDIO_AL_MAX_CHANNELS and not all of them are in
- * use).
- *
- * @is_open - Channel is open.
- *
- * @func - SDIO Function handle.
- *
- * @rx_pipe_index - SDIO-Client Pipe Index for Rx Data.
- *
- * @tx_pipe_index - SDIO-Client Pipe Index for Tx Data.
- *
- * @ch_lock - Channel lock to protect channel specific Data
- *
- * @rx_pending_bytes - Total number of Rx pending bytes, at Rx
- * packet list. Maximum of 16KB-1 limited by
- * SDIO-Client specification.
- *
- * @read_avail - Available bytes to read.
- *
- * @write_avail - Available bytes to write.
- *
- * @rx_size_list_head - The head of Rx Pending Packets List.
- *
- * @pdev - platform device - clients to probe for the sdio-al.
- *
- * @signature - Context Validity check.
- *
- * @sdio_al_dev - a pointer to the sdio_al_device instance of
- * this channel
- *
- * @statistics - channel statistics
- *
- */
-struct sdio_channel {
- /* Channel Configuration Parameters*/
- char name[CHANNEL_NAME_SIZE];
- char ch_test_name[TEST_CH_NAME_SIZE];
- int read_threshold;
- int write_threshold;
- int def_read_threshold;
- int threshold_change_cnt;
- int min_write_avail;
- int poll_delay_msec;
- int is_packet_mode;
- int is_low_latency_ch;
-
- struct peer_sdioc_channel_config ch_config;
-
- /* Channel Info */
- int num;
-
- void (*notify)(void *priv, unsigned channel_event);
- void *priv;
-
- int state;
-
- struct sdio_func *func;
-
- int rx_pipe_index;
- int tx_pipe_index;
-
- struct mutex ch_lock;
-
- u32 read_avail;
- u32 write_avail;
-
- u32 peer_tx_buf_size;
-
- u16 rx_pending_bytes;
-
- struct list_head rx_size_list_head;
-
- struct platform_device *pdev;
-
- u32 total_rx_bytes;
- u32 total_tx_bytes;
-
- u32 signature;
-
- struct sdio_al_device *sdio_al_dev;
-
- struct sdio_channel_statistics statistics;
-};
-
-/**
- * sdio_downloader_setup
- * initializes the TTY driver
- *
- * @card: a pointer to mmc_card.
- * @num_of_devices: number of devices.
- * @channel_number: channel number.
- * @return 0 on success or negative value on error.
- *
- * The TTY stack needs to know in advance how many devices it should
- * plan to manage. Use this call to set up the ports that will
- * be exported through SDIO.
- */
-int sdio_downloader_setup(struct mmc_card *card,
- unsigned int num_of_devices,
- int func_number,
- int(*func)(void));
-
-/**
- * test_channel_init
- * initializes a test channel
- *
- * @name: the channel name.
- * @return 0 on success or negative value on error.
- *
- */
-int test_channel_init(char *name);
-
-/**
- * sdio_al_register_lpm_cb
- * Allow the sdio_al test to register for lpm voting
- * notifications
- *
- * @device_handle: the device handle.
- * @wakeup_callback: callback function to be called when voting.
- *
- */
-void sdio_al_register_lpm_cb(void *device_handle,
- int(*lpm_callback)(void *, int));
-
-/**
- * sdio_al_unregister_lpm_cb
- * Allow the sdio_al test to unregister for lpm voting
- * notifications
- *
- * @device_handle: the device handle.
- *
- */
-void sdio_al_unregister_lpm_cb(void *device_handle);
-
-#endif /* __SDIO_AL_PRIVATE__ */
diff --git a/arch/arm/mach-msm/sdio_al_test.c b/arch/arm/mach-msm/sdio_al_test.c
deleted file mode 100644
index 2c9f675..0000000
--- a/arch/arm/mach-msm/sdio_al_test.c
+++ /dev/null
@@ -1,6500 +0,0 @@
-/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * SDIO-Abstraction-Layer Test Module.
- *
- */
-
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/workqueue.h>
-#include <linux/fs.h>
-#include <linux/cdev.h>
-#include <linux/sched.h>
-#include <linux/wait.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/random.h>
-#include <linux/platform_device.h>
-#include <mach/sdio_smem.h>
-#include <linux/wakelock.h>
-#include <linux/uaccess.h>
-
-#include "sdio_al_private.h"
-#include <linux/debugfs.h>
-
-#include <linux/kthread.h>
-enum lpm_test_msg_type {
- LPM_NO_MSG, /* 0 */
- LPM_MSG_SEND, /* 1 */
- LPM_MSG_REC, /* 2 */
- LPM_SLEEP, /* 3 */
- LPM_WAKEUP, /* 4 */
- LPM_NOTIFY /* 5 */
-};
-
-#define LPM_NO_MSG_NAME "LPM No Event"
-#define LPM_MSG_SEND_NAME "LPM Send Msg Event"
-#define LPM_MSG_REC_NAME "LPM Receive Msg Event"
-#define LPM_SLEEP_NAME "LPM Sleep Event"
-#define LPM_WAKEUP_NAME "LPM Wakeup Event"
-
-/** Module name string */
-#define TEST_MODULE_NAME "sdio_al_test"
-
-#define TEST_SIGNATURE 0x12345678
-#define TEST_CONFIG_SIGNATURE 0xBEEFCAFE
-
-#define MAX_XFER_SIZE (16*1024)
-#define SMEM_MAX_XFER_SIZE 0xBC000
-#define A2_MIN_PACKET_SIZE 5
-#define RMNT_PACKET_SIZE (4*1024)
-#define DUN_PACKET_SIZE (2*1024)
-#define CSVT_PACKET_SIZE 1700
-
-#define TEST_DBG(x...) if (test_ctx->runtime_debug) pr_info(x)
-
-#define LPM_TEST_NUM_OF_PACKETS 100
-#define LPM_MAX_OPEN_CHAN_PER_DEV 4
-#define LPM_ARRAY_SIZE (7*LPM_TEST_NUM_OF_PACKETS*LPM_MAX_OPEN_CHAN_PER_DEV)
-#define SDIO_LPM_TEST "sdio_lpm_test_reading_task"
-#define LPM_TEST_CONFIG_SIGNATURE 0xDEADBABE
-#define LPM_MSG_NAME_SIZE 20
-#define MAX_STR_SIZE 10
-#define MAX_AVG_RTT_TIME_USEC 2500
-#define SDIO_RMNT_RTT_PACKET_SIZE 32
-#define SDIO_CSVT_RTT_PACKET_SIZE 1900
-
-#define A2_HEADER_OVERHEAD 8
-
-enum rx_process_state {
- RX_PROCESS_PACKET_INIT,
- RX_PROCESS_A2_HEADER,
- RX_PROCESS_PACKET_DATA,
-};
-
-enum sdio_test_case_type {
- SDIO_TEST_LOOPBACK_HOST,
- SDIO_TEST_LOOPBACK_CLIENT,
- SDIO_TEST_LPM_HOST_WAKER,
- SDIO_TEST_LPM_CLIENT_WAKER,
- SDIO_TEST_LPM_RANDOM,
- SDIO_TEST_HOST_SENDER_NO_LP,
- SDIO_TEST_CLOSE_CHANNEL,
- SDIO_TEST_A2_VALIDATION,
- /* The following tests are not part of the 9k tests and should be
- * kept last in case new tests are added
- */
- SDIO_TEST_PERF,
- SDIO_TEST_RTT,
- SDIO_TEST_MODEM_RESET,
-};
-
-struct lpm_task {
- struct task_struct *lpm_task;
- const char *task_name;
-};
-
-struct lpm_entry_type {
- enum lpm_test_msg_type msg_type;
- char msg_name[LPM_MSG_NAME_SIZE];
- u32 counter;
- u32 current_ms;
- u32 read_avail_mask;
- char chan_name[CHANNEL_NAME_SIZE];
-};
-
-struct lpm_msg {
- u32 signature;
- u32 counter;
- u32 reserve1;
- u32 reserve2;
-};
-
-struct test_config_msg {
- u32 signature;
- u32 test_case;
- u32 test_param;
- u32 num_packets;
- u32 num_iterations;
-};
-
-struct test_result_msg {
- u32 signature;
- u32 is_successful;
-};
-
-struct test_work {
- struct work_struct work;
- struct test_channel *test_ch;
-};
-
-enum sdio_channels_ids {
- SDIO_RPC,
- SDIO_QMI,
- SDIO_RMNT,
- SDIO_DIAG,
- SDIO_DUN,
- SDIO_SMEM,
- SDIO_CSVT,
- SDIO_MAX_CHANNELS
-};
-
-enum sdio_test_results {
- TEST_NO_RESULT,
- TEST_FAILED,
- TEST_PASSED
-};
-
-enum sdio_lpm_vote_state {
- SDIO_NO_VOTE,
- SDIO_VOTE_FOR_SLEEP,
- SDIO_VOTE_AGAINST_SLEEP
-};
-
-struct sdio_test_device {
- int open_channels_counter_to_recv;
- int open_channels_counter_to_send;
- struct lpm_entry_type *lpm_arr;
- int array_size;
- void *sdio_al_device;
- spinlock_t lpm_array_lock;
- unsigned long lpm_array_lock_flags;
- u32 next_avail_entry_in_array;
- struct lpm_task lpm_test_task;
- u32 next_mask_id;
- u32 read_avail_mask;
- int modem_result_per_dev;
- int final_result_per_dev;
-};
-
-struct test_channel {
- struct sdio_channel *ch;
-
- char name[CHANNEL_NAME_SIZE];
- int ch_id;
-
- struct sdio_test_device *test_device;
-
- u32 *buf;
- u32 buf_size;
-
- struct workqueue_struct *workqueue;
- struct test_work test_work;
-
- u32 rx_bytes;
- u32 tx_bytes;
-
- wait_queue_head_t wait_q;
- atomic_t rx_notify_count;
- atomic_t tx_notify_count;
- atomic_t any_notify_count;
- atomic_t wakeup_client;
- atomic_t card_detected_event;
-
- int wait_counter;
-
- int is_used;
- int test_type;
- int ch_ready;
-
- struct test_config_msg config_msg;
-
- int test_completed;
- int test_result;
- struct timer_list timer;
- int timer_interval_ms;
-
- struct timer_list timeout_timer;
- int timeout_ms;
- void *sdio_al_device;
- int is_ok_to_sleep;
- unsigned int packet_length;
- int random_packet_size;
- int next_index_in_sent_msg_per_chan;
- int channel_mask_id;
- int modem_result_per_chan;
- int notify_counter_per_chan;
- int max_burst_size; /* number of writes before close/open */
- int card_removed;
-};
-
-struct sdio_al_test_debug {
- u32 dun_throughput;
- u32 rmnt_throughput;
- struct dentry *debug_root;
- struct dentry *debug_test_result;
- struct dentry *debug_dun_throughput;
- struct dentry *debug_rmnt_throughput;
- struct dentry *rpc_sender_test;
- struct dentry *rpc_qmi_diag_sender_test;
- struct dentry *smem_test;
- struct dentry *smem_rpc_test;
- struct dentry *rmnet_a2_validation_test;
- struct dentry *dun_a2_validation_test;
- struct dentry *rmnet_a2_perf_test;
- struct dentry *dun_a2_perf_test;
- struct dentry *csvt_a2_perf_test;
- struct dentry *rmnet_dun_a2_perf_test;
- struct dentry *rpc_sender_rmnet_a2_perf_test;
- struct dentry *all_channels_test;
- struct dentry *host_sender_no_lp_diag_test;
- struct dentry *host_sender_no_lp_diag_rpc_test;
- struct dentry *rmnet_small_packets_test;
- struct dentry *rmnet_rtt_test;
- struct dentry *csvt_rtt_test;
- struct dentry *modem_reset_rpc_test;
- struct dentry *modem_reset_rmnet_test;
- struct dentry *modem_reset_channels_4bit_dev_test;
- struct dentry *modem_reset_channels_8bit_dev_test;
- struct dentry *modem_reset_all_channels_test;
- struct dentry *open_close_test;
- struct dentry *open_close_dun_rmnet_test;
- struct dentry *close_chan_lpm_test;
- struct dentry *lpm_test_client_wakes_host_test;
- struct dentry *lpm_test_host_wakes_client_test;
- struct dentry *lpm_test_random_single_channel_test;
- struct dentry *lpm_test_random_multi_channel_test;
-};
-
-struct test_context {
- dev_t dev_num;
- struct device *dev;
- struct cdev *cdev;
- int number_of_active_devices;
- int max_number_of_devices;
-
- struct sdio_test_device test_dev_arr[MAX_NUM_OF_SDIO_DEVICES];
-
- struct test_channel *test_ch;
-
- struct test_channel *test_ch_arr[SDIO_MAX_CHANNELS];
-
- long testcase;
-
- const char *name;
-
- int exit_flag;
-
- u32 signature;
-
- int runtime_debug;
-
- struct platform_device *smem_pdev;
- struct sdio_smem_client *sdio_smem;
- int smem_was_init;
- u8 *smem_buf;
- uint32_t smem_counter;
-
- struct platform_device *csvt_app_pdev;
-
- wait_queue_head_t wait_q;
- int test_completed;
- int test_result;
- struct sdio_al_test_debug debug;
-
- struct wake_lock wake_lock;
-
- unsigned int lpm_pseudo_random_seed;
-};
-
-/* FORWARD DECLARATIONS */
-static int set_params_loopback_9k(struct test_channel *tch);
-static int set_params_smem_test(struct test_channel *tch);
-static int set_params_a2_validation(struct test_channel *tch);
-static int set_params_a2_perf(struct test_channel *tch);
-static int set_params_8k_sender_no_lp(struct test_channel *tch);
-static int set_params_a2_small_pkts(struct test_channel *tch);
-static int set_params_rtt(struct test_channel *tch);
-static int set_params_loopback_9k_close(struct test_channel *tch);
-static int close_channel_lpm_test(int channel_num);
-static int set_params_lpm_test(struct test_channel *tch,
- enum sdio_test_case_type test,
- int timer_interval_ms);
-static void set_pseudo_random_seed(void);
-static int set_params_modem_reset(struct test_channel *tch);
-static int test_start(void);
-static void rx_cleanup(struct test_channel *test_ch, int *rx_packet_count);
-static void sdio_al_test_cleanup_channels(void);
-static void notify(void *priv, unsigned channel_event);
-#ifdef CONFIG_MSM_SDIO_SMEM
-static int sdio_smem_open(struct sdio_smem_client *sdio_smem);
-#endif
-
-/*
- * Seed for pseudo random time sleeping in Random LPM test.
- * If not set, current time in jiffies is used.
- */
-static unsigned int seed;
-module_param(seed, int, 0);
-static struct test_context *test_ctx;
-
-static void sdio_al_test_initial_dev_and_chan(struct test_context *test_ctx)
-{
- int i = 0;
-
- if (!test_ctx) {
- pr_err(TEST_MODULE_NAME ":%s - test_ctx is NULL.\n", __func__);
- return;
- }
-
- for (i = 0 ; i < MAX_NUM_OF_SDIO_DEVICES ; ++i)
- test_ctx->test_dev_arr[i].sdio_al_device = NULL;
-
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
- if (!tch)
- continue;
- tch->is_used = 0;
- }
-
- sdio_al_test_cleanup_channels();
-}
-
-#ifdef CONFIG_DEBUG_FS
-
-static int message_repeat;
-
-static int sdio_al_test_extract_number(const char __user *buf,
- size_t count)
-{
- int ret = 0;
- int number = -1;
- char local_buf[MAX_STR_SIZE] = {0};
- char *start = NULL;
-
- if (count > MAX_STR_SIZE) {
- pr_err(TEST_MODULE_NAME ": %s - MAX_STR_SIZE(%d) < count(%d). "
- "Please choose smaller number\n",
- __func__, MAX_STR_SIZE, (int)count);
- return -EINVAL;
- }
-
- if (copy_from_user(local_buf, buf, count)) {
- pr_err(TEST_MODULE_NAME ": %s - copy_from_user() failed\n",
- __func__);
- return -EINVAL;
- }
-
- /* adding null termination to the string */
- local_buf[count] = '\0';
-
- /* stripping leading and trailing white spaces */
- start = strstrip(local_buf);
-
- ret = kstrtoint(start, 10, &number);
-
- if (ret) {
- pr_err(TEST_MODULE_NAME " : %s - kstrtoint() failed\n",
- __func__);
- return ret;
- }
-
- return number;
-}
-
-static int sdio_al_test_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- message_repeat = 1;
- return 0;
-}
-
-static void sdio_al_test_cleanup_channels(void)
-{
- int channel_num;
- int dummy = 0;
-
- for (channel_num = 0 ; channel_num < SDIO_MAX_CHANNELS ;
- ++channel_num) {
- if (channel_num == SDIO_SMEM)
- continue;
-
- rx_cleanup(test_ctx->test_ch_arr[channel_num], &dummy);
- }
-
- return;
-}
-
-/* RPC SENDER TEST */
-static ssize_t rpc_sender_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RPC SENDER TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_RPC]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rpc_sender_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRPC_SENDER_TEST\n"
- "===============\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rpc_sender_test_ops = {
- .open = sdio_al_test_open,
- .write = rpc_sender_test_write,
- .read = rpc_sender_test_read,
-};
-
-/* RPC, QMI & DIAG SENDER TEST */
-static ssize_t rpc_qmi_diag_sender_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RPC, QMI AND DIAG SENDER TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_QMI]);
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_DIAG]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rpc_qmi_diag_sender_test_read(struct file *file,
- char __user
- *buffer, size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRPC_QMI_DIAG_SENDER_TEST\n"
- "========================\n"
- "Description:\n"
- "TBD\n");
-
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rpc_qmi_diag_sender_test_ops = {
- .open = sdio_al_test_open,
- .write = rpc_qmi_diag_sender_test_write,
- .read = rpc_qmi_diag_sender_test_read,
-};
-
-/* SMEM TEST */
-static ssize_t smem_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- SMEM TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_smem_test(test_ctx->test_ch_arr[SDIO_SMEM]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t smem_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nSMEM_TEST\n"
- "=========\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations smem_test_ops = {
- .open = sdio_al_test_open,
- .write = smem_test_write,
- .read = smem_test_read,
-};
-
-/* SMEM & RPC TEST */
-static ssize_t smem_rpc_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- SMEM AND RPC TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_smem_test(test_ctx->test_ch_arr[SDIO_SMEM]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t smem_rpc_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nSMEM_RPC_TEST\n"
- "=============\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations smem_rpc_test_ops = {
- .open = sdio_al_test_open,
- .write = smem_rpc_test_write,
- .read = smem_rpc_test_read,
-};
-
-/* RMNET A2 VALIDATION TEST */
-static ssize_t rmnet_a2_validation_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RMNET A2 VALIDATION TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_validation(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rmnet_a2_validation_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRMNET_A2_VALIDATION_TEST\n"
- "=========================\n"
- "Description:\n"
- "In this test, the HOST sends multiple packets to the\n"
- "CLIENT and validates the packets loop backed from A2\n"
- "for the RMNET channel.\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rmnet_a2_validation_test_ops = {
- .open = sdio_al_test_open,
- .write = rmnet_a2_validation_test_write,
- .read = rmnet_a2_validation_test_read,
-};
-
-/* DUN A2 VALIDATION TEST */
-static ssize_t dun_a2_validation_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- DUN A2 VALIDATION TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_validation(test_ctx->test_ch_arr[SDIO_DUN]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t dun_a2_validation_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nDUN_A2_VALIDATION_TEST\n"
- "=========================\n"
- "Description:\n"
- "In this test, the HOST sends multiple packets to the\n"
- "CLIENT and validates the packets loop backed from A2\n"
- "for the DUN channel.\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations dun_a2_validation_test_ops = {
- .open = sdio_al_test_open,
- .write = dun_a2_validation_test_write,
- .read = dun_a2_validation_test_read,
-};
-
-/* RMNET A2 PERFORMANCE TEST */
-static ssize_t rmnet_a2_perf_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RMNET A2 PERFORMANCE TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rmnet_a2_perf_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRMNET_A2_PERFORMANCE_TEST\n"
- "=========================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rmnet_a2_perf_test_ops = {
- .open = sdio_al_test_open,
- .write = rmnet_a2_perf_test_write,
- .read = rmnet_a2_perf_test_read,
-};
-
-/* DUN A2 PERFORMANCE TEST */
-static ssize_t dun_a2_perf_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- DUN A2 PERFORMANCE TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_DUN]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t dun_a2_perf_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nDUN_A2_PERFORMANCE_TEST\n"
- "=======================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations dun_a2_perf_test_ops = {
- .open = sdio_al_test_open,
- .write = dun_a2_perf_test_write,
- .read = dun_a2_perf_test_read,
-};
-
-/* CSVT A2 PERFORMANCE TEST */
-static ssize_t csvt_a2_perf_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- CSVT A2 PERFORMANCE TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_CSVT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t csvt_a2_perf_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nCSVT_A2_PERFORMANCE_TEST\n"
- "========================\n"
- "Description:\n"
- "Loopback test on the CSVT Channel, in order to check "
- "throughput performance.\n"
- "Packet size that are sent on the CSVT channel in this "
- "test is %d.bytes\n\n"
- "END OF DESCRIPTION\n", CSVT_PACKET_SIZE);
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations csvt_a2_perf_test_ops = {
- .open = sdio_al_test_open,
- .write = csvt_a2_perf_test_write,
- .read = csvt_a2_perf_test_read,
-};
-
-/* RMNET DUN A2 PERFORMANCE TEST */
-static ssize_t rmnet_dun_a2_perf_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RMNET AND DUN A2 PERFORMANCE TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_RMNT]);
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_DUN]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rmnet_dun_a2_perf_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRMNET_DUN_A2_PERFORMANCE_TEST\n"
- "=============================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rmnet_dun_a2_perf_test_ops = {
- .open = sdio_al_test_open,
- .write = rmnet_dun_a2_perf_test_write,
- .read = rmnet_dun_a2_perf_test_read,
-};
-
-/* RPC SENDER & RMNET A2 PERFORMANCE TEST */
-static ssize_t rpc_sender_rmnet_a2_perf_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "--RPC SENDER AND RMNET A2 "
- "PERFORMANCE --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rpc_sender_rmnet_a2_perf_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRPC_SENDER_RMNET_A2_PERFORMANCE_TEST\n"
- "====================================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rpc_sender_rmnet_a2_perf_test_ops = {
- .open = sdio_al_test_open,
- .write = rpc_sender_rmnet_a2_perf_test_write,
- .read = rpc_sender_rmnet_a2_perf_test_read,
-};
-
-/* ALL CHANNELS TEST */
-static ssize_t all_channels_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- ALL THE CHANNELS TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_QMI]);
- set_params_loopback_9k(test_ctx->test_ch_arr[SDIO_DIAG]);
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_RMNT]);
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_DUN]);
- set_params_smem_test(test_ctx->test_ch_arr[SDIO_SMEM]);
- set_params_a2_perf(test_ctx->test_ch_arr[SDIO_CSVT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t all_channels_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nALL_CHANNELS_TEST\n"
- "=================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations all_channels_test_ops = {
- .open = sdio_al_test_open,
- .write = all_channels_test_write,
- .read = all_channels_test_read,
-};
-
-/* HOST SENDER NO LP DIAG TEST */
-static ssize_t host_sender_no_lp_diag_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- HOST SENDER NO LP FOR DIAG TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_8k_sender_no_lp(test_ctx->test_ch_arr[SDIO_DIAG]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t host_sender_no_lp_diag_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nHOST_SENDER_NO_LP_DIAG_TEST\n"
- "===========================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations host_sender_no_lp_diag_test_ops = {
- .open = sdio_al_test_open,
- .write = host_sender_no_lp_diag_test_write,
- .read = host_sender_no_lp_diag_test_read,
-};
-
-/* HOST SENDER NO LP DIAG, RPC TEST */
-static ssize_t host_sender_no_lp_diag_rpc_test_write(
- struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- HOST SENDER NO LP FOR DIAG, RPC "
- "TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_8k_sender_no_lp(test_ctx->test_ch_arr[SDIO_DIAG]);
- set_params_8k_sender_no_lp(test_ctx->test_ch_arr[SDIO_RPC]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t host_sender_no_lp_diag_rpc_test_read(
- struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nHOST_SENDER_NO_LP_DIAG_RPC_TEST\n"
- "===================================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations host_sender_no_lp_diag_rpc_test_ops = {
- .open = sdio_al_test_open,
- .write = host_sender_no_lp_diag_rpc_test_write,
- .read = host_sender_no_lp_diag_rpc_test_read,
-};
-
-/* RMNET SMALL PACKETS TEST */
-static ssize_t rmnet_small_packets_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RMNET SMALL PACKETS (5-128) TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_a2_small_pkts(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rmnet_small_packets_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRMNET_SMALL_PACKETS_TEST\n"
- "========================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rmnet_small_packets_test_ops = {
- .open = sdio_al_test_open,
- .write = rmnet_small_packets_test_write,
- .read = rmnet_small_packets_test_read,
-};
-
-/* RMNET RTT TEST */
-static ssize_t rmnet_rtt_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- RMNET RTT TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_rtt(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t rmnet_rtt_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nRMNET_RTT_TEST\n"
- "==============\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations rmnet_rtt_test_ops = {
- .open = sdio_al_test_open,
- .write = rmnet_rtt_test_write,
- .read = rmnet_rtt_test_read,
-};
-
-/* CSVT RTT TEST */
-static ssize_t csvt_rtt_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- CSVT RTT TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_rtt(test_ctx->test_ch_arr[SDIO_CSVT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t csvt_rtt_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nCSVT_RTT_TEST\n"
- "==============\n"
- "Description:\n"
- "In this test the HOST send a message of %d bytes "
- "to the CLIENT\n\n"
- "END OF DESCRIPTION\n", SDIO_CSVT_RTT_PACKET_SIZE);
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations csvt_rtt_test_ops = {
- .open = sdio_al_test_open,
- .write = csvt_rtt_test_write,
- .read = csvt_rtt_test_read,
-};
-
-/* MODEM RESET RPC TEST */
-static ssize_t modem_reset_rpc_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- MODEM RESET - RPC CHANNEL TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RPC]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t modem_reset_rpc_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nMODEM_RESET_RPC_TEST\n"
- "====================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations modem_reset_rpc_test_ops = {
- .open = sdio_al_test_open,
- .write = modem_reset_rpc_test_write,
- .read = modem_reset_rpc_test_read,
-};
-
-/* MODEM RESET RMNET TEST */
-static ssize_t modem_reset_rmnet_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- MODEM RESET - RMNT CHANNEL TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t modem_reset_rmnet_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nMODEM_RESET_RMNET_TEST\n"
- "======================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations modem_reset_rmnet_test_ops = {
- .open = sdio_al_test_open,
- .write = modem_reset_rmnet_test_write,
- .read = modem_reset_rmnet_test_read,
-};
-
-/* MODEM RESET - CHANNELS IN 4BIT DEVICE TEST */
-static ssize_t modem_reset_channels_4bit_dev_test_write(
- struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- MODEM RESET - ALL CHANNELS IN "
- "4BIT DEVICE TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_QMI]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_DIAG]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t modem_reset_channels_4bit_dev_test_read(
- struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nMODEM_RESET_CHANNELS_4BIT_DEV_TEST\n"
- "==================================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations modem_reset_channels_4bit_dev_test_ops = {
- .open = sdio_al_test_open,
- .write = modem_reset_channels_4bit_dev_test_write,
- .read = modem_reset_channels_4bit_dev_test_read,
-};
-
-/* MODEM RESET - CHANNELS IN 8BIT DEVICE TEST */
-static ssize_t modem_reset_channels_8bit_dev_test_write(
- struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- MODEM RESET - ALL CHANNELS IN "
- "8BIT DEVICE TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RMNT]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_DUN]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t modem_reset_channels_8bit_dev_test_read(
- struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nMODEM_RESET_CHANNELS_8BIT_DEV_TEST\n"
- "==================================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations modem_reset_channels_8bit_dev_test_ops = {
- .open = sdio_al_test_open,
- .write = modem_reset_channels_8bit_dev_test_write,
- .read = modem_reset_channels_8bit_dev_test_read,
-};
-
-/* MODEM RESET - ALL CHANNELS TEST */
-static ssize_t modem_reset_all_channels_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- MODEM RESET - ALL CHANNELS TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RPC]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_QMI]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_DIAG]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_RMNT]);
- set_params_modem_reset(test_ctx->test_ch_arr[SDIO_DUN]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t modem_reset_all_channels_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nMODEM_RESET_ALL_CHANNELS_TEST\n"
- "=============================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations modem_reset_all_channels_test_ops = {
- .open = sdio_al_test_open,
- .write = modem_reset_all_channels_test_write,
- .read = modem_reset_all_channels_test_read,
-};
-
-/* HOST SENDER WITH OPEN/CLOSE TEST */
-static ssize_t open_close_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- struct test_channel **ch_arr = test_ctx->test_ch_arr;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- HOST SENDER WITH OPEN/CLOSE TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k_close(ch_arr[SDIO_DIAG]);
- set_params_loopback_9k_close(ch_arr[SDIO_RPC]);
- set_params_loopback_9k_close(ch_arr[SDIO_SMEM]);
- set_params_loopback_9k_close(ch_arr[SDIO_QMI]);
- set_params_loopback_9k_close(ch_arr[SDIO_RMNT]);
- set_params_loopback_9k_close(ch_arr[SDIO_DUN]);
- set_params_loopback_9k_close(ch_arr[SDIO_CSVT]);
-
- ret = test_start();
-
- if (ret)
- break;
-
- pr_info(TEST_MODULE_NAME " -- correctness test for"
- "DIAG ");
- set_params_loopback_9k(ch_arr[SDIO_DIAG]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t open_close_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nOPEN_CLOSE_TEST\n"
- "============================\n"
- "Description:\n"
- "In this test the host sends 5k packets to the modem in the "
- "following sequence: Send a random burst of packets on "
- "Diag and Rmnet channels, read 0 or a random number "
- "of packets, close and re-open the channel. At the end of the "
- "test, the channel is verified by running a loopback test\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations open_close_test_ops = {
- .open = sdio_al_test_open,
- .write = open_close_test_write,
- .read = open_close_test_read,
-};
-
-/* HOST SENDER WITH OPEN/CLOSE FOR DUN & RMNET TEST */
-static ssize_t open_close_dun_rmnet_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- struct test_channel **ch_arr = test_ctx->test_ch_arr;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- HOST SENDER WITH OPEN/CLOSE FOR "
- "DUN AND RMNET TEST --");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_loopback_9k_close(ch_arr[SDIO_DUN]);
- set_params_loopback_9k_close(ch_arr[SDIO_RMNT]);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t open_close_dun_rmnet_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nOPEN_CLOSE_DUN_RMNET_TEST\n"
- "============================\n"
- "Description:\n"
- "In this test the host sends 5k packets to the modem in the "
- "following sequence: Send a random burst of packets on "
- "DUN and Rmnet channels, read 0 or a random number "
- "of packets, close and re-open the channel.\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations open_close_dun_rmnet_test_ops = {
- .open = sdio_al_test_open,
- .write = open_close_dun_rmnet_test_write,
- .read = open_close_dun_rmnet_test_read,
-};
-
-/* CLOSE CHANNEL & LPM TEST HOST WAKES THE CLIENT TEST */
-static ssize_t close_chan_lpm_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int channel_num = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- CLOSE CHANNEL & LPM TEST "
- "HOST WAKES THE CLIENT TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- for (channel_num = 0 ; channel_num < SDIO_MAX_CHANNELS ;
- channel_num++) {
-
- ret = close_channel_lpm_test(channel_num);
-
- if (ret)
- break;
-
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_RPC],
- SDIO_TEST_LPM_HOST_WAKER, 120);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- if (ret) {
- pr_err(TEST_MODULE_NAME " -- Close channel & LPM Test "
- "FAILED: %d --\n", ret);
- } else {
- pr_err(TEST_MODULE_NAME " -- Close channel & LPM Test "
- "PASSED\n");
- }
- }
-
- return count;
-}
-
-static ssize_t close_chan_lpm_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nCLOSE_CHAN_LPM_TEST\n"
- "===================\n"
- "Description:\n"
- "TBD\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations close_chan_lpm_test_ops = {
- .open = sdio_al_test_open,
- .write = close_chan_lpm_test_write,
- .read = close_chan_lpm_test_read,
-};
-
-/* LPM TEST FOR DEVICE 1. CLIENT WAKES THE HOST TEST */
-static ssize_t lpm_test_client_wakes_host_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- LPM TEST FOR DEVICE 1. CLIENT "
- "WAKES THE HOST TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_RPC],
- SDIO_TEST_LPM_CLIENT_WAKER, 90);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t lpm_test_client_wakes_host_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nLPM_TEST_CLIENT_WAKES_HOST_TEST\n"
- "===============================\n"
- "Description:\n"
- "In this test, the HOST is going into LPM mode,\n"
- "and the CLIENT is responsible to send it a message\n"
- "in order to wake it up\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations lpm_test_client_wakes_host_test_ops = {
- .open = sdio_al_test_open,
- .write = lpm_test_client_wakes_host_test_write,
- .read = lpm_test_client_wakes_host_test_read,
-};
-
-/* LPM TEST FOR DEVICE 1. HOST WAKES THE CLIENT TEST */
-static ssize_t lpm_test_host_wakes_client_test_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- LPM TEST FOR DEVICE 1. HOST "
- "WAKES THE CLIENT TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_RPC],
- SDIO_TEST_LPM_HOST_WAKER, 120);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t lpm_test_host_wakes_client_test_read(struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nLPM_TEST_HOST_WAKES_CLIENT_TEST\n"
- "===============================\n"
- "Description:\n"
- "In this test, the CLIENT goes into LPM mode, and the\n"
- "HOST is responsible to send it a message\n"
- "in order to wake it up\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations lpm_test_host_wakes_client_test_ops = {
- .open = sdio_al_test_open,
- .write = lpm_test_host_wakes_client_test_write,
- .read = lpm_test_host_wakes_client_test_read,
-};
-
-/* LPM TEST RANDOM, SINGLE CHANNEL TEST */
-static ssize_t lpm_test_random_single_channel_test_write(
- struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- LPM TEST RANDOM SINGLE "
- "CHANNEL TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_pseudo_random_seed();
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_RPC],
- SDIO_TEST_LPM_RANDOM, 0);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t lpm_test_random_single_channel_test_read(
- struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nLPM_TEST_RANDOM_SINGLE_CHANNEL_TEST\n"
- "===================================\n"
- "Description:\n"
- "In this test, the HOST and CLIENT "
- "send messages to each other,\n"
- "random in time, over RPC channel only.\n"
- "All events are being recorded, and later on,\n"
- "they are being analysed by the HOST and by the CLIENT\n,"
- "in order to check if the LPM mechanism worked properly,\n"
- "meaning:"
- " When all the relevant conditions are met, a device should:\n"
- "1. Go to sleep\n"
- "2. Wake up\n"
- "3. Stay awake\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations lpm_test_random_single_channel_test_ops = {
- .open = sdio_al_test_open,
- .write = lpm_test_random_single_channel_test_write,
- .read = lpm_test_random_single_channel_test_read,
-};
-
-/* LPM TEST RANDOM, MULTI CHANNEL TEST */
-static ssize_t lpm_test_random_multi_channel_test_write(
- struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int ret = 0;
- int i = 0;
- int number = -1;
-
- pr_info(TEST_MODULE_NAME "-- LPM TEST RANDOM MULTI CHANNEL TEST --\n");
-
- number = sdio_al_test_extract_number(buf, count);
-
- if (number < 0) {
- pr_err(TEST_MODULE_NAME " : %s - sdio_al_test_extract_number() "
- "failed. number = %d\n", __func__, number);
- return count;
- }
-
- for (i = 0 ; i < number ; ++i) {
- pr_info(TEST_MODULE_NAME " - Cycle # %d / %d\n", i+1, number);
- pr_info(TEST_MODULE_NAME " ===================");
-
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- set_pseudo_random_seed();
-
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_RPC],
- SDIO_TEST_LPM_RANDOM, 0);
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_DIAG],
- SDIO_TEST_LPM_RANDOM, 0);
- set_params_lpm_test(test_ctx->test_ch_arr[SDIO_QMI],
- SDIO_TEST_LPM_RANDOM, 0);
-
- ret = test_start();
-
- if (ret)
- break;
- }
-
- return count;
-}
-
-static ssize_t lpm_test_random_multi_channel_test_read(
- struct file *file,
- char __user *buffer,
- size_t count,
- loff_t *offset)
-{
- memset((void *)buffer, 0, count);
-
- snprintf(buffer, count,
- "\nLPM_TEST_RANDOM_MULTI_CHANNEL_TEST\n"
- "==================================\n"
- "Description:\n"
- "In this test, the HOST and CLIENT "
- "send messages to each other,\n"
- "random in time, over RPC, QMI AND DIAG channels\n"
- "(i.e, on both SDIO devices).\n"
- "All events are being recorded, and later on,\n"
- "they are being analysed by the HOST and by the CLIENT,\n"
- "in order to check if the LPM mechanism worked properly,\n"
- "meaning:"
- " When all the relevant conditions are met, a device should:\n"
- "1. Go to sleep\n"
- "2. Wake up\n"
- "3. Stay awake\n\n"
- "END OF DESCRIPTION\n");
-
- if (message_repeat == 1) {
- message_repeat = 0;
- return strnlen(buffer, count);
- } else {
- return 0;
- }
-}
-
-const struct file_operations lpm_test_random_multi_channel_test_ops = {
- .open = sdio_al_test_open,
- .write = lpm_test_random_multi_channel_test_write,
- .read = lpm_test_random_multi_channel_test_read,
-};
-
-static int sdio_al_test_debugfs_init(void)
-{
- test_ctx->debug.debug_root = debugfs_create_dir("sdio_al_test",
- NULL);
- if (!test_ctx->debug.debug_root)
- return -ENOENT;
-
- test_ctx->debug.debug_test_result = debugfs_create_u32(
- "test_result",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- &test_ctx->test_result);
-
- test_ctx->debug.debug_dun_throughput = debugfs_create_u32(
- "dun_throughput",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- &test_ctx->debug.dun_throughput);
-
- test_ctx->debug.debug_rmnt_throughput = debugfs_create_u32(
- "rmnt_throughput",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- &test_ctx->debug.rmnt_throughput);
-
- test_ctx->debug.rpc_sender_test =
- debugfs_create_file("10_rpc_sender_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rpc_sender_test_ops);
-
- test_ctx->debug.rpc_qmi_diag_sender_test =
- debugfs_create_file("20_rpc_qmi_diag_sender_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rpc_qmi_diag_sender_test_ops);
-
- test_ctx->debug.rmnet_a2_validation_test =
- debugfs_create_file("30_rmnet_a2_validation_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rmnet_a2_validation_test_ops);
-
- test_ctx->debug.dun_a2_validation_test =
- debugfs_create_file("40_dun_a2_validation_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &dun_a2_validation_test_ops);
-
- test_ctx->debug.rmnet_a2_perf_test =
- debugfs_create_file("50_rmnet_a2_perf_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rmnet_a2_perf_test_ops);
-
- test_ctx->debug.dun_a2_perf_test =
- debugfs_create_file("60_dun_a2_perf_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &dun_a2_perf_test_ops);
-
- test_ctx->debug.csvt_a2_perf_test =
- debugfs_create_file("71_csvt_a2_perf_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &csvt_a2_perf_test_ops);
-
- test_ctx->debug.rmnet_dun_a2_perf_test =
- debugfs_create_file("70_rmnet_dun_a2_perf_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rmnet_dun_a2_perf_test_ops);
-
- test_ctx->debug.rpc_sender_rmnet_a2_perf_test =
- debugfs_create_file("80_rpc_sender_rmnet_a2_perf_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rpc_sender_rmnet_a2_perf_test_ops);
-
- test_ctx->debug.smem_test =
- debugfs_create_file("90_smem_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &smem_test_ops);
-
- test_ctx->debug.smem_rpc_test =
- debugfs_create_file("100_smem_rpc_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &smem_rpc_test_ops);
-
- test_ctx->debug.all_channels_test =
- debugfs_create_file("150_all_channels_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &all_channels_test_ops);
-
- test_ctx->debug.host_sender_no_lp_diag_test =
- debugfs_create_file("160_host_sender_no_lp_diag_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &host_sender_no_lp_diag_test_ops);
-
- test_ctx->debug.host_sender_no_lp_diag_rpc_test =
- debugfs_create_file("170_host_sender_no_lp_diag_rpc_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &host_sender_no_lp_diag_rpc_test_ops);
-
- test_ctx->debug.rmnet_small_packets_test =
- debugfs_create_file("180_rmnet_small_packets_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rmnet_small_packets_test_ops);
-
- test_ctx->debug.rmnet_rtt_test =
- debugfs_create_file("190_rmnet_rtt_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &rmnet_rtt_test_ops);
-
- test_ctx->debug.csvt_rtt_test =
- debugfs_create_file("191_csvt_rtt_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &csvt_rtt_test_ops);
-
- test_ctx->debug.modem_reset_rpc_test =
- debugfs_create_file("220_modem_reset_rpc_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &modem_reset_rpc_test_ops);
-
- test_ctx->debug.modem_reset_rmnet_test =
- debugfs_create_file("230_modem_reset_rmnet_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &modem_reset_rmnet_test_ops);
-
- test_ctx->debug.modem_reset_channels_4bit_dev_test =
- debugfs_create_file("240_modem_reset_channels_4bit_dev_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &modem_reset_channels_4bit_dev_test_ops);
-
- test_ctx->debug.modem_reset_channels_8bit_dev_test =
- debugfs_create_file("250_modem_reset_channels_8bit_dev_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &modem_reset_channels_8bit_dev_test_ops);
-
- test_ctx->debug.modem_reset_all_channels_test =
- debugfs_create_file("260_modem_reset_all_channels_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &modem_reset_all_channels_test_ops);
-
- test_ctx->debug.open_close_test =
- debugfs_create_file("270_open_close_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &open_close_test_ops);
-
- test_ctx->debug.open_close_dun_rmnet_test =
- debugfs_create_file("271_open_close_dun_rmnet_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &open_close_dun_rmnet_test_ops);
-
- test_ctx->debug.close_chan_lpm_test =
- debugfs_create_file("280_close_chan_lpm_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &close_chan_lpm_test_ops);
-
- test_ctx->debug.lpm_test_client_wakes_host_test =
- debugfs_create_file("600_lpm_test_client_wakes_host_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &lpm_test_client_wakes_host_test_ops);
-
- test_ctx->debug.lpm_test_host_wakes_client_test =
- debugfs_create_file("610_lpm_test_host_wakes_client_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &lpm_test_host_wakes_client_test_ops);
-
- test_ctx->debug.lpm_test_random_single_channel_test =
- debugfs_create_file("620_lpm_test_random_single_channel_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &lpm_test_random_single_channel_test_ops);
-
- test_ctx->debug.lpm_test_random_multi_channel_test =
- debugfs_create_file("630_lpm_test_random_multi_channel_test",
- S_IRUGO | S_IWUGO,
- test_ctx->debug.debug_root,
- NULL,
- &lpm_test_random_multi_channel_test_ops);
-
- if ((!test_ctx->debug.debug_dun_throughput) &&
- (!test_ctx->debug.debug_rmnt_throughput)) {
- debugfs_remove_recursive(test_ctx->debug.debug_root);
- test_ctx->debug.debug_root = NULL;
- return -ENOENT;
- }
- return 0;
-}
-
-static void sdio_al_test_debugfs_cleanup(void)
-{
- debugfs_remove(test_ctx->debug.debug_dun_throughput);
- debugfs_remove(test_ctx->debug.debug_rmnt_throughput);
- debugfs_remove(test_ctx->debug.debug_root);
-}
-#endif
-
-static int channel_name_to_id(char *name)
-{
- pr_info(TEST_MODULE_NAME "%s: channel name %s\n",
- __func__, name);
-
- if (!strncmp(name, "SDIO_RPC_TEST",
- strnlen("SDIO_RPC_TEST", CHANNEL_NAME_SIZE)))
- return SDIO_RPC;
- else if (!strncmp(name, "SDIO_QMI_TEST",
- strnlen("SDIO_QMI_TEST", TEST_CH_NAME_SIZE)))
- return SDIO_QMI;
- else if (!strncmp(name, "SDIO_RMNT_TEST",
- strnlen("SDIO_RMNT_TEST", TEST_CH_NAME_SIZE)))
- return SDIO_RMNT;
- else if (!strncmp(name, "SDIO_DIAG_TEST",
- strnlen("SDIO_DIAG", TEST_CH_NAME_SIZE)))
- return SDIO_DIAG;
- else if (!strncmp(name, "SDIO_DUN_TEST",
- strnlen("SDIO_DUN_TEST", TEST_CH_NAME_SIZE)))
- return SDIO_DUN;
- else if (!strncmp(name, "SDIO_SMEM_TEST",
- strnlen("SDIO_SMEM_TEST", TEST_CH_NAME_SIZE)))
- return SDIO_SMEM;
- else if (!strncmp(name, "SDIO_CSVT_TEST",
- strnlen("SDIO_CSVT_TEST", TEST_CH_NAME_SIZE)))
- return SDIO_CSVT;
- else
- return SDIO_MAX_CHANNELS;
-
- return SDIO_MAX_CHANNELS;
-}
-
-/**
- * Allocate and add SDIO_SMEM platform device
- */
-#ifdef CONFIG_MSM_SDIO_SMEM
-static int add_sdio_smem(void)
-{
- int ret = 0;
-
- test_ctx->smem_pdev = platform_device_alloc("SDIO_SMEM", -1);
- ret = platform_device_add(test_ctx->smem_pdev);
- if (ret) {
- pr_err(TEST_MODULE_NAME ": platform_device_add failed, "
- "ret=%d\n", ret);
- return ret;
- }
- return 0;
-}
-#endif
-
-static int open_sdio_ch(struct test_channel *tch)
-{
- int ret = 0;
-
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s NULL tch\n", __func__);
- return -EINVAL;
- }
-
- if (!tch->ch_ready) {
- TEST_DBG(TEST_MODULE_NAME ":openning channel %s\n",
- tch->name);
- if (tch->ch_id == SDIO_SMEM) {
-#ifdef CONFIG_MSM_SDIO_SMEM
- if (!test_ctx->smem_pdev)
- ret = add_sdio_smem();
- else
- ret = sdio_smem_open(test_ctx->sdio_smem);
- if (ret) {
- pr_err(TEST_MODULE_NAME
- ":openning channel %s failed\n",
- tch->name);
- tch->ch_ready = false;
- return -EINVAL;
- }
-#endif
- } else {
- tch->ch_ready = true;
- ret = sdio_open(tch->name , &tch->ch, tch,
- notify);
- if (ret) {
- pr_err(TEST_MODULE_NAME
- ":openning channel %s failed\n",
- tch->name);
- tch->ch_ready = false;
- return -EINVAL;
- }
- }
- }
- return ret;
-}
-
-static int close_sdio_ch(struct test_channel *tch)
-{
- int ret = 0;
-
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s NULL tch\n", __func__);
- return -EINVAL;
- }
-
- if (tch->ch_id == SDIO_SMEM) {
-#ifdef CONFIG_MSM_SDIO_SMEM
- TEST_DBG(TEST_MODULE_NAME":%s closing channel %s",
- __func__, tch->name);
- ret = sdio_smem_unregister_client();
- test_ctx->smem_counter = 0;
-#endif
- } else {
- ret = sdio_close(tch->ch);
- }
-
- if (ret) {
- pr_err(TEST_MODULE_NAME":%s close channel %s"
- " failed\n", __func__, tch->name);
- } else {
- TEST_DBG(TEST_MODULE_NAME":%s close channel %s"
- " success\n", __func__, tch->name);
- tch->ch_ready = false;
- }
- return ret;
-}
-
-/**
- * Config message
- */
-
-static void send_config_msg(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 write_avail = 0;
- int size = sizeof(test_ch->config_msg);
-
- pr_debug(TEST_MODULE_NAME "%s\n", __func__);
-
- memcpy(test_ch->buf, (void *)&test_ch->config_msg, size);
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- pr_info(TEST_MODULE_NAME ":Sending the config message.\n");
-
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- pr_debug(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- pr_debug(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- pr_info(TEST_MODULE_NAME ":not enough write avail.\n");
- return;
- }
-
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret)
- pr_err(TEST_MODULE_NAME ":%s sdio_write err=%d.\n",
- __func__, -ret);
- else
- pr_info(TEST_MODULE_NAME ":%s sent config_msg successfully.\n",
- __func__);
-}
-
-/**
- * Loopback Test
- */
-static void loopback_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
-
- while (1) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- TEST_DBG(TEST_MODULE_NAME "--LOOPBACK WAIT FOR EVENT--.\n");
- /* wait for data ready event */
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
-
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail == 0)
- continue;
-
-
- write_avail = sdio_write_avail(test_ch->ch);
- if (write_avail < read_avail) {
- pr_info(TEST_MODULE_NAME
- ":not enough write avail.\n");
- continue;
- }
-
- ret = sdio_read(test_ch->ch, test_ch->buf, read_avail);
- if (ret) {
- pr_info(TEST_MODULE_NAME
- ":worker, sdio_read err=%d.\n", -ret);
- continue;
- }
- test_ch->rx_bytes += read_avail;
-
- TEST_DBG(TEST_MODULE_NAME ":worker total rx bytes = 0x%x.\n",
- test_ch->rx_bytes);
-
-
- ret = sdio_write(test_ch->ch,
- test_ch->buf, read_avail);
- if (ret) {
- pr_info(TEST_MODULE_NAME
- ":loopback sdio_write err=%d.\n",
- -ret);
- continue;
- }
- test_ch->tx_bytes += read_avail;
-
- TEST_DBG(TEST_MODULE_NAME
- ":loopback total tx bytes = 0x%x.\n",
- test_ch->tx_bytes);
- } /* end of while */
-}
-
-/**
- * Check if all tests completed
- */
-static void check_test_completion(void)
-{
- int i;
-
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used) || (!tch->ch_ready))
- continue;
- if (!tch->test_completed) {
- pr_info(TEST_MODULE_NAME ": %s - Channel %s test is "
- "not completed", __func__, tch->name);
- return;
- }
- }
- pr_info(TEST_MODULE_NAME ": %s - Test is completed", __func__);
- test_ctx->test_completed = 1;
- wake_up(&test_ctx->wait_q);
-}
-
-static int pseudo_random_seed(unsigned int *seed_number)
-{
- if (!seed_number)
- return 0;
-
- *seed_number = (unsigned int)(((unsigned long)*seed_number *
- (unsigned long)1103515367) + 35757);
- return (int)((*seed_number / (64*1024)) % 500);
-}
-
-/* this function must be locked before accessing it */
-static void lpm_test_update_entry(struct test_channel *tch,
- enum lpm_test_msg_type msg_type,
- char *msg_name,
- int counter)
-{
- u32 index = 0;
- static int print_full = 1;
- struct sdio_test_device *test_device;
-
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test channel\n", __func__);
- return;
- }
-
- test_device = tch->test_device;
-
- if (!test_device) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test device\n", __func__);
- return;
- }
-
- if (!test_device->lpm_arr) {
- pr_err(TEST_MODULE_NAME ": %s - NULL lpm_arr\n", __func__);
- return;
- }
-
- if (test_device->next_avail_entry_in_array >=
- test_device->array_size) {
- pr_err(TEST_MODULE_NAME ": %s - lpm array is full",
- __func__);
-
- if (print_full) {
- print_hex_dump(KERN_INFO, TEST_MODULE_NAME ": lpm_arr:",
- 0, 32, 2,
- (void *)test_device->lpm_arr,
- sizeof(test_device->lpm_arr), false);
- print_full = 0;
- }
- return;
- }
-
- index = test_device->next_avail_entry_in_array;
- if ((msg_type == LPM_MSG_SEND) || (msg_type == LPM_MSG_REC))
- test_device->lpm_arr[index].counter = counter;
- else
- test_device->lpm_arr[index].counter = 0;
-
- test_device->lpm_arr[index].msg_type = msg_type;
- memcpy(test_device->lpm_arr[index].msg_name, msg_name,
- LPM_MSG_NAME_SIZE);
- test_device->lpm_arr[index].current_ms =
- jiffies_to_msecs(get_jiffies_64());
-
- test_device->lpm_arr[index].read_avail_mask =
- test_device->read_avail_mask;
-
- if ((msg_type == LPM_SLEEP) || (msg_type == LPM_WAKEUP))
- memcpy(test_device->lpm_arr[index].chan_name, "DEVICE ",
- CHANNEL_NAME_SIZE);
- else
- memcpy(test_device->lpm_arr[index].chan_name, tch->name,
- CHANNEL_NAME_SIZE);
-
- test_device->next_avail_entry_in_array++;
-}
-
-static int wait_for_result_msg(struct test_channel *test_ch)
-{
- u32 read_avail = 0;
- int ret = 0;
-
- pr_info(TEST_MODULE_NAME ": %s - START, channel %s\n",
- __func__, test_ch->name);
-
- while (1) {
- read_avail = sdio_read_avail(test_ch->ch);
-
- if (read_avail == 0) {
- pr_info(TEST_MODULE_NAME
- ": read_avail is 0 for chan %s\n",
- test_ch->name);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
- continue;
- }
-
- memset(test_ch->buf, 0x00, test_ch->buf_size);
-
- ret = sdio_read(test_ch->ch, test_ch->buf, read_avail);
- if (ret) {
- pr_info(TEST_MODULE_NAME ": sdio_read for chan"
- "%s failed, err=%d.\n",
- test_ch->name, -ret);
- goto exit_err;
- }
-
- if (test_ch->buf[0] != TEST_CONFIG_SIGNATURE) {
- pr_info(TEST_MODULE_NAME ": Not a test_result "
- "signature. expected 0x%x. received 0x%x "
- "for chan %s\n",
- TEST_CONFIG_SIGNATURE,
- test_ch->buf[0],
- test_ch->name);
- continue;
- } else {
- pr_info(TEST_MODULE_NAME ": Signature is "
- "TEST_CONFIG_SIGNATURE as expected for"
- "channel %s\n", test_ch->name);
- break;
- }
- }
-
- return test_ch->buf[1];
-
-exit_err:
- return 0;
-}
-
-static void print_random_lpm_test_array(struct sdio_test_device *test_dev)
-{
- int i;
-
- if (!test_dev) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test device\n", __func__);
- return;
- }
-
- for (i = 0 ; i < test_dev->next_avail_entry_in_array ; ++i) {
- if (i == 0)
- pr_err(TEST_MODULE_NAME ": index %4d, chan=%2s, "
- "code=%1d=%4s, msg#%1d, ms from before=-1, "
- "read_mask=0x%d, ms=%2u",
- i,
- test_dev->lpm_arr[i].chan_name,
- test_dev->lpm_arr[i].msg_type,
- test_dev->lpm_arr[i].msg_name,
- test_dev->lpm_arr[i].counter,
- test_dev->lpm_arr[i].read_avail_mask,
- test_dev->lpm_arr[i].current_ms);
- else
- pr_err(TEST_MODULE_NAME ": index "
- "%4d, %2s, code=%1d=%4s, msg#%1d, ms from "
- "before=%2u, read_mask=0x%d, ms=%2u",
- i,
- test_dev->lpm_arr[i].chan_name,
- test_dev->lpm_arr[i].msg_type,
- test_dev->lpm_arr[i].msg_name,
- test_dev->lpm_arr[i].counter,
- test_dev->lpm_arr[i].current_ms -
- test_dev->lpm_arr[i-1].current_ms,
- test_dev->lpm_arr[i].read_avail_mask,
- test_dev->lpm_arr[i].current_ms);
-
- udelay(1000);
- }
-}
-
-static int check_random_lpm_test_array(struct sdio_test_device *test_dev)
-{
- int i = 0, j = 0;
- unsigned int delta_ms = 0;
- int arr_ind = 0;
- int ret = 0;
- int notify_counter = 0;
- int sleep_counter = 0;
- int wakeup_counter = 0;
- int lpm_activity_counter = 0;
-
- if (!test_dev) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test device\n", __func__);
- return -ENODEV;
- }
-
- for (i = 0; i < test_dev->next_avail_entry_in_array; i++) {
- notify_counter = 0;
- sleep_counter = 0;
- wakeup_counter = 0;
-
- if ((test_dev->lpm_arr[i].msg_type == LPM_MSG_SEND) ||
- (test_dev->lpm_arr[i].msg_type == LPM_MSG_REC)) {
- /* find the next message in the array */
- arr_ind = test_dev->next_avail_entry_in_array;
- for (j = i+1; j < arr_ind; j++) {
- if ((test_dev->lpm_arr[j].msg_type ==
- LPM_MSG_SEND) ||
- (test_dev->lpm_arr[j].msg_type ==
- LPM_MSG_REC) ||
- (test_dev->lpm_arr[j].msg_type ==
- LPM_NOTIFY))
- break;
- if (test_dev->lpm_arr[j].msg_type ==
- LPM_SLEEP)
- sleep_counter++;
- if (test_dev->lpm_arr[j].msg_type ==
- LPM_WAKEUP)
- wakeup_counter++;
- }
- if (j == arr_ind) {
- ret = 0;
- break;
- }
-
- delta_ms = test_dev->lpm_arr[j].current_ms -
- test_dev->lpm_arr[i].current_ms;
- if (delta_ms < 30) {
- if ((sleep_counter == 0)
- && (wakeup_counter == 0)) {
- continue;
- } else {
- pr_err(TEST_MODULE_NAME "%s: lpm "
- "activity while delta is less "
- "than 30, i=%d, j=%d, "
- "sleep_counter=%d, "
- "wakeup_counter=%d",
- __func__, i, j,
- sleep_counter, wakeup_counter);
- ret = -ENODEV;
- break;
- }
- } else {
- if ((delta_ms > 90) &&
- (test_dev->lpm_arr[i].
- read_avail_mask == 0)) {
- if (j != i+3) {
- pr_err(TEST_MODULE_NAME
- "%s: unexpected "
- "lpm activity "
- "while delta is "
- "bigger than "
- "90, i=%d, "
- "j=%d, "
- "notify_counter"
- "=%d",
- __func__, i, j,
- notify_counter);
- ret = -ENODEV;
- break;
- }
- lpm_activity_counter++;
- }
- }
- }
- }
-
- pr_info(TEST_MODULE_NAME ": %s - lpm_activity_counter=%d",
- __func__, lpm_activity_counter);
-
- return ret;
-}
-
-static int lpm_test_main_task(void *ptr)
-{
- u32 read_avail = 0;
- int last_msg_index = 0;
- struct test_channel *test_ch = (struct test_channel *)ptr;
- struct sdio_test_device *test_dev;
- struct lpm_msg lpm_msg;
- int ret = 0;
- int host_result = 0;
-
- if (!test_ch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL channel\n", __func__);
- return -ENODEV;
- }
-
- pr_err(TEST_MODULE_NAME ": %s - STARTED. channel %s\n",
- __func__, test_ch->name);
-
- test_dev = test_ch->test_device;
-
- if (!test_dev) {
- pr_err(TEST_MODULE_NAME ": %s - NULL Test Device\n", __func__);
- return -ENODEV;
- }
-
- while (last_msg_index < test_ch->config_msg.num_packets - 1) {
-
- TEST_DBG(TEST_MODULE_NAME ": %s - "
- "IN LOOP last_msg_index=%d\n",
- __func__, last_msg_index);
-
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail == 0) {
- TEST_DBG(TEST_MODULE_NAME
- ":read_avail 0 for chan %s, "
- "wait for event\n",
- test_ch->name);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
-
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail == 0) {
- pr_err(TEST_MODULE_NAME
- ":read_avail size %d for chan %s not as"
- " expected\n",
- read_avail, test_ch->name);
- continue;
- }
- }
-
- memset(test_ch->buf, 0x00, sizeof(test_ch->buf));
-
- ret = sdio_read(test_ch->ch, test_ch->buf, read_avail);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sdio_read for chan %s"
- " err=%d.\n", test_ch->name, -ret);
- goto exit_err;
- }
-
- memcpy((void *)&lpm_msg, test_ch->buf, sizeof(lpm_msg));
-
- /*
- * when reading from channel, we want to turn off the bit
- * mask that implies that there is pending data on that channel
- */
- if (test_ch->test_device != NULL) {
- spin_lock_irqsave(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
-
- test_ch->notify_counter_per_chan--;
-
- /*
- * if the channel has no pending data, turn off the
- * pending data bit mask of the channel
- */
- if (test_ch->notify_counter_per_chan == 0) {
- test_ch->test_device->read_avail_mask =
- test_ch->test_device->read_avail_mask &
- ~test_ch->channel_mask_id;
- }
-
- last_msg_index = lpm_msg.counter;
- lpm_test_update_entry(test_ch,
- LPM_MSG_REC,
- "RECEIVE",
- last_msg_index);
-
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- }
- }
-
- pr_info(TEST_MODULE_NAME ":%s: Finished to recieve all (%d) "
- "packets from the modem %s. Waiting for result_msg",
- __func__, test_ch->config_msg.num_packets, test_ch->name);
-
- /* Wait for the resault message from the modem */
- test_ch->modem_result_per_chan = wait_for_result_msg(test_ch);
-
- /*
- * the DEVICE modem result is a failure if one of the channels on
- * that device, got modem_result = 0. this is why we bitwise "AND" each
- * time another channel completes its task
- */
- test_dev->modem_result_per_dev &= test_ch->modem_result_per_chan;
-
- /*
- * when reading from channel, we want to turn off the bit
- * mask that implies that there is pending data on that channel
- */
- spin_lock_irqsave(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
-
- test_dev->open_channels_counter_to_recv--;
-
- /* turning off the read_avail bit of the channel */
- test_ch->test_device->read_avail_mask =
- test_ch->test_device->read_avail_mask &
- ~test_ch->channel_mask_id;
-
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
-
- /* Wait for all the packets to be sent to the modem */
- while (1) {
- spin_lock_irqsave(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
-
- if (test_ch->next_index_in_sent_msg_per_chan >=
- test_ch->config_msg.num_packets - 1) {
-
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- break;
- } else {
- pr_info(TEST_MODULE_NAME ":%s: Didn't finished to send "
- "all packets, "
- "next_index_in_sent_msg_per_chan = %d ",
- __func__,
- test_ch->next_index_in_sent_msg_per_chan);
- }
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- msleep(60);
- }
-
- /*
- * if device has still open channels to test, then the test on the
- * device is still running but the test on current channel is completed
- */
- if (test_dev->open_channels_counter_to_recv != 0 ||
- test_dev->open_channels_counter_to_send != 0) {
- test_ch->test_completed = 1;
- return 0;
- } else {
- test_ctx->number_of_active_devices--;
- sdio_al_unregister_lpm_cb(test_ch->sdio_al_device);
-
- if (test_ch->test_type == SDIO_TEST_LPM_RANDOM)
- host_result = check_random_lpm_test_array(test_dev);
-
- if (host_result ||
- !test_dev->modem_result_per_dev ||
- test_ctx->runtime_debug)
- print_random_lpm_test_array(test_dev);
-
- pr_info(TEST_MODULE_NAME ": %s - host_result=%d.(0 for "
- "SUCCESS) device_modem_result=%d (1 for SUCCESS)",
- __func__, host_result, test_dev->modem_result_per_dev);
-
- test_ch->test_completed = 1;
- if (test_dev->modem_result_per_dev && !host_result) {
- pr_info(TEST_MODULE_NAME ": %s - Random LPM "
- "TEST_PASSED for device %d of %d\n",
- __func__,
- (test_ctx->max_number_of_devices-
- test_ctx->number_of_active_devices),
- test_ctx->max_number_of_devices);
- test_dev->final_result_per_dev = 1; /* PASSED */
- } else {
- pr_info(TEST_MODULE_NAME ": %s - Random LPM "
- "TEST_FAILED for device %d of %d\n",
- __func__,
- (test_ctx->max_number_of_devices-
- test_ctx->number_of_active_devices),
- test_ctx->max_number_of_devices);
- test_dev->final_result_per_dev = 0; /* FAILED */
- }
-
- check_test_completion();
-
- kfree(test_ch->test_device->lpm_arr);
-
- return 0;
- }
-
-exit_err:
- pr_info(TEST_MODULE_NAME ": TEST FAIL for chan %s.\n",
- test_ch->name);
- test_ch->test_completed = 1;
- test_dev->open_channels_counter_to_recv--;
- test_dev->next_avail_entry_in_array = 0;
- test_ch->next_index_in_sent_msg_per_chan = 0;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return -ENODEV;
-}
-
-static int lpm_test_create_read_thread(struct test_channel *test_ch)
-{
- struct sdio_test_device *test_dev;
-
- pr_info(TEST_MODULE_NAME ": %s - STARTED channel %s\n",
- __func__, test_ch->name);
-
- if (!test_ch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test channel\n", __func__);
- return -ENODEV;
- }
-
- test_dev = test_ch->test_device;
-
- if (!test_dev) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test device\n", __func__);
- return -ENODEV;
- }
-
- test_dev->lpm_test_task.task_name = SDIO_LPM_TEST;
-
- test_dev->lpm_test_task.lpm_task =
- kthread_create(lpm_test_main_task,
- (void *)(test_ch),
- test_dev->lpm_test_task.task_name);
-
- if (IS_ERR(test_dev->lpm_test_task.lpm_task)) {
- pr_err(TEST_MODULE_NAME ": %s - kthread_create() failed\n",
- __func__);
- return -ENOMEM;
- }
-
- wake_up_process(test_dev->lpm_test_task.lpm_task);
-
- return 0;
-}
-
-static void lpm_continuous_rand_test(struct test_channel *test_ch)
-{
- unsigned int local_ms = 0;
- int ret = 0;
- unsigned int write_avail = 0;
- struct sdio_test_device *test_dev;
-
- pr_info(MODULE_NAME ": %s - STARTED\n", __func__);
-
- if (!test_ch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL channel\n", __func__);
- return;
- }
-
- test_dev = test_ch->test_device;
-
- if (!test_dev) {
- pr_err(TEST_MODULE_NAME ": %s - NULL Test Device\n", __func__);
- return;
- }
-
- ret = lpm_test_create_read_thread(test_ch);
- if (ret != 0) {
- pr_err(TEST_MODULE_NAME ": %s - failed to create lpm reading "
- "thread", __func__);
- }
-
- while (1) {
-
- struct lpm_msg msg;
- u32 ret = 0;
-
- /* sleeping period is dependent on number of open channels */
- test_ch->config_msg.test_param =
- test_ctx->lpm_pseudo_random_seed;
-
- local_ms = test_dev->open_channels_counter_to_send *
- test_ctx->lpm_pseudo_random_seed;
- TEST_DBG(TEST_MODULE_NAME ":%s: SLEEPING for %d ms",
- __func__, local_ms);
- msleep(local_ms);
-
- msg.counter = test_ch->next_index_in_sent_msg_per_chan;
- msg.signature = LPM_TEST_CONFIG_SIGNATURE;
- msg.reserve1 = 0;
- msg.reserve2 = 0;
-
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- pr_debug(TEST_MODULE_NAME ": %s: write_avail=%d\n",
- __func__, write_avail);
- if (write_avail < sizeof(msg)) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- if (write_avail < sizeof(msg)) {
- pr_info(TEST_MODULE_NAME ": %s: not enough write "
- "avail.\n", __func__);
- break;
- }
-
- ret = sdio_write(test_ch->ch, (u32 *)&msg, sizeof(msg));
- if (ret)
- pr_err(TEST_MODULE_NAME ":%s: sdio_write err=%d.\n",
- __func__, -ret);
-
- TEST_DBG(TEST_MODULE_NAME ": %s: for chan %s, write, "
- "msg # %d\n",
- __func__,
- test_ch->name,
- test_ch->next_index_in_sent_msg_per_chan);
-
- if (test_ch->test_type == SDIO_TEST_LPM_RANDOM) {
- spin_lock_irqsave(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- lpm_test_update_entry(test_ch, LPM_MSG_SEND,
- "SEND ",
- test_ch->
- next_index_in_sent_msg_per_chan);
-
- test_ch->next_index_in_sent_msg_per_chan++;
-
- if (test_ch->next_index_in_sent_msg_per_chan ==
- test_ch->config_msg.num_packets) {
- spin_unlock_irqrestore(
- &test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- break;
- }
-
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- }
- }
-
- spin_lock_irqsave(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
- test_dev->open_channels_counter_to_send--;
- spin_unlock_irqrestore(&test_dev->lpm_array_lock,
- test_dev->lpm_array_lock_flags);
-
- pr_info(TEST_MODULE_NAME ": %s: - Finished to send all (%d) "
- "packets to the modem on channel %s",
- __func__, test_ch->config_msg.num_packets, test_ch->name);
-
- return;
-}
-
-static void lpm_test(struct test_channel *test_ch)
-{
- pr_info(TEST_MODULE_NAME ": %s - START channel %s\n", __func__,
- test_ch->name);
-
- if (!test_ch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL test channel\n", __func__);
- return;
- }
-
- test_ch->modem_result_per_chan = wait_for_result_msg(test_ch);
- pr_debug(TEST_MODULE_NAME ": %s - delete the timeout timer\n",
- __func__);
- del_timer_sync(&test_ch->timeout_timer);
-
- if (test_ch->modem_result_per_chan == 0) {
- pr_err(TEST_MODULE_NAME ": LPM TEST - Client didn't sleep. "
- "Result Msg - is_successful=%d\n", test_ch->buf[1]);
- goto exit_err;
- } else {
- pr_info(TEST_MODULE_NAME ": %s -"
- "LPM 9K WAS SLEEPING - PASS\n", __func__);
- if (test_ch->test_result == TEST_PASSED) {
- pr_info(TEST_MODULE_NAME ": LPM TEST_PASSED\n");
- test_ch->test_completed = 1;
- check_test_completion();
- } else {
- pr_err(TEST_MODULE_NAME ": LPM TEST - Host didn't "
- "sleep. Client slept\n");
- goto exit_err;
- }
- }
-
- return;
-
-exit_err:
- pr_info(TEST_MODULE_NAME ": TEST FAIL for chan %s.\n",
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-
-/**
- * LPM Test while the host wakes up the modem
- */
-static void lpm_test_host_waker(struct test_channel *test_ch)
-{
- pr_info(TEST_MODULE_NAME ": %s - START\n", __func__);
- wait_event(test_ch->wait_q, atomic_read(&test_ch->wakeup_client));
- atomic_set(&test_ch->wakeup_client, 0);
-
- pr_info(TEST_MODULE_NAME ": %s - Sending the config_msg to wakeup "
- " the client\n", __func__);
- send_config_msg(test_ch);
-
- lpm_test(test_ch);
-}
-
-/**
- * Writes number of packets into test channel
- * @test_ch: test channel control struct
- * @burst_size: number of packets to send
- */
-static int write_packet_burst(struct test_channel *test_ch,
- int burst_size)
-{
- int ret = 0;
- int packet_count = 0;
- unsigned int random_num = 0;
- int size = test_ch->packet_length; /* first packet size */
- u32 write_avail = 0;
-
- while (packet_count < burst_size) {
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":%s write_avail=%d,size=%d on chan"
- " %s\n", __func__,
- write_avail, size, test_ch->name);
- if (write_avail < size) {
- TEST_DBG(TEST_MODULE_NAME ":%s wait for event on"
- " chan %s\n", __func__, test_ch->name);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
- write_avail = sdio_write_avail(test_ch->ch);
- if (write_avail < size) {
- pr_info(TEST_MODULE_NAME ":%s not enough write"
- " avail %d, need %d on chan %s\n",
- __func__, write_avail, size,
- test_ch->name);
- continue;
- }
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s sdio_write "
- "failed (%d) on chan %s\n", __func__,
- ret, test_ch->name);
- break;
- }
- udelay(1000); /*low bus usage while running number of channels*/
- TEST_DBG(TEST_MODULE_NAME ":%s() successfully write %d bytes"
- ", packet_count=%d on chan %s\n", __func__,
- size, packet_count, test_ch->name);
- test_ch->tx_bytes += size;
- packet_count++;
- /* get next packet size */
- random_num = get_random_int();
- size = (random_num % test_ch->packet_length) + 1;
- }
- return ret;
-}
-
-/**
- * Reads packet from test channel and checks that packet number
- * encoded into the packet is equal to packet_counter
- * This function is applicable for packet mode channels only
- *
- * @test_ch: test channel
- * @size: expected packet size
- * @packet_counter: number to validate readed packet
- */
-static int read_data_from_packet_ch(struct test_channel *test_ch,
- unsigned int size,
- int packet_counter)
-{
- u32 read_avail = 0;
- int ret = 0;
-
- if (!test_ch || !test_ch->ch) {
- pr_err(TEST_MODULE_NAME
- ":%s: NULL channel\n", __func__);
- return -EINVAL;
- }
-
- if (!test_ch->ch->is_packet_mode) {
- pr_err(TEST_MODULE_NAME
- ":%s:not packet mode ch %s\n",
- __func__, test_ch->name);
- return -EINVAL;
- }
- read_avail = sdio_read_avail(test_ch->ch);
- /* wait for read data ready event */
- if (read_avail < size) {
- TEST_DBG(TEST_MODULE_NAME ":%s() wait for rx data on "
- "chan %s\n", __func__, test_ch->name);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
- }
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":%s read_avail=%d bytes on chan %s\n",
- __func__, read_avail, test_ch->name);
-
- if (read_avail != size) {
- pr_err(TEST_MODULE_NAME
- ":read_avail size %d for chan %s not as "
- "expected size %d\n",
- read_avail, test_ch->name, size);
- return -EINVAL;
- }
-
- ret = sdio_read(test_ch->ch, test_ch->buf, read_avail);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s() sdio_read for chan %s (%d)\n",
- __func__, test_ch->name, -ret);
- return ret;
- }
- if ((test_ch->buf[0] != packet_counter) && (size != 1)) {
- pr_err(TEST_MODULE_NAME ":Read WRONG DATA"
- " for chan %s, size=%d\n",
- test_ch->name, size);
- return -EINVAL;
- }
- return 0;
-}
-
-
-/**
- * Reads packet from test channel and checks that packet number
- * encoded into the packet is equal to packet_counter
- * This function is applicable for streaming mode channels only
- *
- * @test_ch: test channel
- * @size: expected packet size
- * @packet_counter: number to validate readed packet
- */
-static int read_data_from_stream_ch(struct test_channel *test_ch,
- unsigned int size,
- int packet_counter)
-{
- u32 read_avail = 0;
- int ret = 0;
-
- if (!test_ch || !test_ch->ch) {
- pr_err(TEST_MODULE_NAME
- ":%s: NULL channel\n", __func__);
- return -EINVAL;
- }
-
- if (test_ch->ch->is_packet_mode) {
- pr_err(TEST_MODULE_NAME
- ":%s:not streaming mode ch %s\n",
- __func__, test_ch->name);
- return -EINVAL;
- }
- read_avail = sdio_read_avail(test_ch->ch);
- /* wait for read data ready event */
- if (read_avail < size) {
- TEST_DBG(TEST_MODULE_NAME ":%s() wait for rx data on "
- "chan %s\n", __func__, test_ch->name);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
- }
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":%s read_avail=%d bytes on chan %s\n",
- __func__, read_avail, test_ch->name);
-
- if (read_avail < size) {
- pr_err(TEST_MODULE_NAME
- ":read_avail size %d for chan %s not as "
- "expected size %d\n",
- read_avail, test_ch->name, size);
- return -EINVAL;
- }
-
- ret = sdio_read(test_ch->ch, test_ch->buf, size + A2_HEADER_OVERHEAD);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s() sdio_read for chan %s (%d)\n",
- __func__, test_ch->name, -ret);
- return ret;
- }
- if ((test_ch->buf[A2_HEADER_OVERHEAD/4] != packet_counter) &&
- (size != 1)) {
- pr_err(TEST_MODULE_NAME ":Read WRONG DATA"
- " for chan %s, size=%d, packet_counter=%d\n",
- test_ch->name, size, packet_counter);
- print_hex_dump(KERN_INFO, TEST_MODULE_NAME ": rmnet:",
- 0, 32, 2,
- (void *)test_ch->buf,
- size + A2_HEADER_OVERHEAD, false);
- return -EINVAL;
- }
- return 0;
-}
-
-/**
- * Test close channel feature for SDIO_SMEM channel:
- * close && re-open the SDIO_SMEM channel.
- */
-#ifdef CONFIG_MSM_SDIO_SMEM
-static void open_close_smem_test(struct test_channel *test_ch)
-{
- int i = 0;
- int ret = 0;
-
- pr_info(TEST_MODULE_NAME ":%s\n", __func__);
-
- for (i = 0; i < 100 ; ++i) {
- ret = close_sdio_ch(test_ch);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s close_sdio_ch for ch %s"
- " failed\n",
- __func__, test_ch->name);
- goto exit_err;
- }
- ret = open_sdio_ch(test_ch);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s open_sdio_ch for ch %s "
- " failed\n",
- __func__, test_ch->name);
- goto exit_err;
- }
- }
-
- pr_info(TEST_MODULE_NAME ":%s TEST PASS for chan %s.\n", __func__,
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-exit_err:
- pr_info(TEST_MODULE_NAME ":%s TEST FAIL for chan %s.\n", __func__,
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-#endif
-
-/**
- * Test close channel feature:
- * 1. write random packet number into channel
- * 2. read some data from channel (do this only for second half of
- * requested packets to send).
- * 3. close && re-open then repeat 1.
- *
- * Total packets to send: test_ch->config_msg.num_packets.
- * Burst size is random in [1..test_ch->max_burst_size] range
- * Packet size is random in [1..test_ch->packet_length]
- */
-static void open_close_test(struct test_channel *test_ch)
-{
- int ret = 0;
- u32 read_avail = 0;
- int total_packet_count = 0;
- int size = 0;
- u16 *buf16 = NULL;
- int i;
- int max_packet_count = 0;
- unsigned int random_num = 0;
- int curr_burst_size = 0;
-
- if (!test_ch || !test_ch->ch) {
- pr_err(TEST_MODULE_NAME ":%s NULL channel\n",
- __func__);
- return;
- }
-
- curr_burst_size = test_ch->max_burst_size;
- size = test_ch->packet_length;
- buf16 = (u16 *) test_ch->buf;
-
- /* the test sends configured number of packets in
- 2 portions: first without reading between write bursts,
- second with it */
- max_packet_count = test_ch->config_msg.num_packets / 2;
-
- pr_info(TEST_MODULE_NAME ":%s channel %s, total packets:%d,"
- " max packet size %d, max burst size:%d\n",
- __func__, test_ch->name,
- test_ch->config_msg.num_packets, test_ch->packet_length,
- test_ch->max_burst_size);
- for (i = 0 ; i < size / 2 ; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
- for (i = 0; i < 2 ; i++) {
- total_packet_count = 0;
- while (total_packet_count < max_packet_count) {
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":%s exit test\n",
- __func__);
- return;
- }
- test_ch->buf[0] = total_packet_count;
- random_num = get_random_int();
- curr_burst_size = (random_num %
- test_ch->max_burst_size) + 1;
-
- /* limit burst size to send
- * no more than configured packets */
- if (curr_burst_size + total_packet_count >
- max_packet_count) {
- curr_burst_size = max_packet_count -
- total_packet_count;
- }
- TEST_DBG(TEST_MODULE_NAME ":%s Current burst size:%d"
- " on chan %s\n", __func__,
- curr_burst_size, test_ch->name);
- ret = write_packet_burst(test_ch, curr_burst_size);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s write burst failed (%d), ch %s\n",
- __func__, ret, test_ch->name);
- goto exit_err;
- }
- if (i > 0) {
- /* read from channel */
- if (test_ch->ch->is_packet_mode)
- ret = read_data_from_packet_ch(test_ch,
- size,
- total_packet_count);
- else
- ret = read_data_from_stream_ch(test_ch,
- size,
- total_packet_count);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s read"
- " failed:%d, chan %s\n",
- __func__, ret,
- test_ch->name);
- goto exit_err;
- }
- }
- TEST_DBG(TEST_MODULE_NAME ":%s before close, ch %s\n",
- __func__, test_ch->name);
- ret = close_sdio_ch(test_ch);
- if (ret) {
- pr_err(TEST_MODULE_NAME":%s close channel %s"
- " failed (%d)\n",
- __func__, test_ch->name, ret);
- goto exit_err;
- } else {
- TEST_DBG(TEST_MODULE_NAME":%s close channel %s"
- " success\n", __func__,
- test_ch->name);
- total_packet_count += curr_burst_size;
- atomic_set(&test_ch->rx_notify_count, 0);
- atomic_set(&test_ch->tx_notify_count, 0);
- atomic_set(&test_ch->any_notify_count, 0);
- }
- TEST_DBG(TEST_MODULE_NAME ":%s before open, ch %s\n",
- __func__, test_ch->name);
- ret = open_sdio_ch(test_ch);
- if (ret) {
- pr_err(TEST_MODULE_NAME":%s open channel %s"
- " failed (%d)\n",
- __func__, test_ch->name, ret);
- goto exit_err;
- } else {
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail > 0) {
- pr_err(TEST_MODULE_NAME": after open"
- " ch %s read_availis not zero"
- " (%d bytes)\n",
- test_ch->name, read_avail);
- goto exit_err;
- }
- }
- TEST_DBG(TEST_MODULE_NAME ":%s total tx = %d,"
- " packet# = %d, size = %d for ch %s\n",
- __func__, test_ch->tx_bytes,
- total_packet_count, size,
- test_ch->name);
- } /* end of while */
- }
- pr_info(TEST_MODULE_NAME ":%s Test end: total rx bytes = 0x%x,"
- " total tx bytes = 0x%x for chan %s\n", __func__,
- test_ch->rx_bytes, test_ch->tx_bytes, test_ch->name);
- pr_info(TEST_MODULE_NAME ":%s TEST PASS for chan %s.\n", __func__,
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-exit_err:
- pr_info(TEST_MODULE_NAME ":%s TEST FAIL for chan %s.\n", __func__,
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-/**
- * sender Test
- */
-static void sender_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
- int packet_count = 0;
- int size = 512;
- u16 *buf16 = (u16 *) test_ch->buf;
- int i;
- int max_packet_count = 10000;
- int random_num = 0;
-
- max_packet_count = test_ch->config_msg.num_packets;
-
- for (i = 0 ; i < size / 2 ; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
-
- pr_info(TEST_MODULE_NAME
- ":SENDER TEST START for chan %s\n", test_ch->name);
-
- while (packet_count < max_packet_count) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- random_num = get_random_int();
- size = (random_num % test_ch->packet_length) + 1;
-
- TEST_DBG(TEST_MODULE_NAME "SENDER WAIT FOR EVENT for chan %s\n",
- test_ch->name);
-
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- pr_info(TEST_MODULE_NAME ":not enough write avail.\n");
- continue;
- }
-
- test_ch->buf[0] = packet_count;
-
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sender sdio_write err=%d.\n",
- -ret);
- goto exit_err;
- }
-
- /* wait for read data ready event */
- TEST_DBG(TEST_MODULE_NAME ":sender wait for rx data for "
- "chan %s\n",
- test_ch->name);
- read_avail = sdio_read_avail(test_ch->ch);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->rx_notify_count));
- atomic_dec(&test_ch->rx_notify_count);
-
- read_avail = sdio_read_avail(test_ch->ch);
-
- if (read_avail != size) {
- pr_info(TEST_MODULE_NAME
- ":read_avail size %d for chan %s not as "
- "expected size %d.\n",
- read_avail, test_ch->name, size);
- goto exit_err;
- }
-
- memset(test_ch->buf, 0x00, size);
-
- ret = sdio_read(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sender sdio_read for chan %s"
- " err=%d.\n",
- test_ch->name, -ret);
- goto exit_err;
- }
-
-
- if ((test_ch->buf[0] != packet_count) && (size != 1)) {
- pr_info(TEST_MODULE_NAME ":sender sdio_read WRONG DATA"
- " for chan %s, size=%d\n",
- test_ch->name, size);
- goto exit_err;
- }
-
- test_ch->tx_bytes += size;
- test_ch->rx_bytes += size;
- packet_count++;
-
- TEST_DBG(TEST_MODULE_NAME
- ":sender total rx bytes = 0x%x , packet#=%d, size=%d"
- " for chan %s\n",
- test_ch->rx_bytes, packet_count, size, test_ch->name);
- TEST_DBG(TEST_MODULE_NAME
- ":sender total tx bytes = 0x%x , packet#=%d, size=%d"
- " for chan %s\n",
- test_ch->tx_bytes, packet_count, size, test_ch->name);
-
- } /* end of while */
-
- pr_info(TEST_MODULE_NAME
- ":SENDER TEST END: total rx bytes = 0x%x, "
- " total tx bytes = 0x%x for chan %s\n",
- test_ch->rx_bytes, test_ch->tx_bytes, test_ch->name);
-
- pr_info(TEST_MODULE_NAME ": TEST PASS for chan %s.\n",
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-
-exit_err:
- pr_info(TEST_MODULE_NAME ": TEST FAIL for chan %s.\n",
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-/**
- * A2 Perf Test
- */
-static void a2_performance_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
- int tx_packet_count = 0;
- int rx_packet_count = 0;
- int size = 0;
- u16 *buf16 = (u16 *) test_ch->buf;
- int i;
- int total_bytes = 0;
- int max_packets = 10000;
- u32 packet_size = test_ch->buf_size;
- int rand_size = 0;
-
- u64 start_jiffy, end_jiffy, delta_jiffies;
- unsigned int time_msec = 0;
- u32 throughput = 0;
-
- max_packets = test_ch->config_msg.num_packets;
- packet_size = test_ch->packet_length;
-
- for (i = 0; i < packet_size / 2; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
- pr_info(TEST_MODULE_NAME ": A2 PERFORMANCE TEST START for chan %s\n",
- test_ch->name);
-
- start_jiffy = get_jiffies_64(); /* read the current time */
-
- while (tx_packet_count < max_packets) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- if (test_ch->random_packet_size) {
- rand_size = get_random_int();
- packet_size = (rand_size % test_ch->packet_length) + 1;
- if (packet_size < A2_MIN_PACKET_SIZE)
- packet_size = A2_MIN_PACKET_SIZE;
- }
-
- /* wait for data ready event */
- /* use a func to avoid compiler optimizations */
- write_avail = sdio_write_avail(test_ch->ch);
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, write_avail=%d, "
- "read_avail=%d for chan %s\n",
- test_ch->name, write_avail, read_avail,
- test_ch->name);
- if ((write_avail == 0) && (read_avail == 0)) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->any_notify_count));
- atomic_set(&test_ch->any_notify_count, 0);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, write_avail=%d\n",
- test_ch->name, write_avail);
- if (write_avail > 0) {
- size = min(packet_size, write_avail) ;
- TEST_DBG(TEST_MODULE_NAME ":tx size = %d for chan %s\n",
- size, test_ch->name);
- test_ch->buf[0] = tx_packet_count;
- test_ch->buf[(size/4)-1] = tx_packet_count;
-
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sdio_write err=%d"
- " for chan %s\n",
- -ret, test_ch->name);
- goto exit_err;
- }
- tx_packet_count++;
- test_ch->tx_bytes += size;
- }
-
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, read_avail=%d\n",
- test_ch->name, read_avail);
- if (read_avail > 0) {
- size = min(packet_size, read_avail);
- pr_debug(TEST_MODULE_NAME ":rx size = %d.\n", size);
- ret = sdio_read(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ": sdio_read size %d "
- " err=%d"
- " for chan %s\n",
- size, -ret, test_ch->name);
- goto exit_err;
- }
- rx_packet_count++;
- test_ch->rx_bytes += size;
- }
-
- TEST_DBG(TEST_MODULE_NAME
- ":total rx bytes = %d , rx_packet#=%d"
- " for chan %s\n",
- test_ch->rx_bytes, rx_packet_count, test_ch->name);
- TEST_DBG(TEST_MODULE_NAME
- ":total tx bytes = %d , tx_packet#=%d"
- " for chan %s\n",
- test_ch->tx_bytes, tx_packet_count, test_ch->name);
-
- } /* while (tx_packet_count < max_packets ) */
-
- end_jiffy = get_jiffies_64(); /* read the current time */
-
- delta_jiffies = end_jiffy - start_jiffy;
- time_msec = jiffies_to_msecs(delta_jiffies);
-
- pr_info(TEST_MODULE_NAME ":total rx bytes = 0x%x , rx_packet#=%d for"
- " chan %s.\n",
- test_ch->rx_bytes, rx_packet_count, test_ch->name);
- pr_info(TEST_MODULE_NAME ":total tx bytes = 0x%x , tx_packet#=%d"
- " for chan %s.\n",
- test_ch->tx_bytes, tx_packet_count, test_ch->name);
-
- total_bytes = (test_ch->tx_bytes + test_ch->rx_bytes);
- pr_err(TEST_MODULE_NAME ":total bytes = %d, time msec = %d"
- " for chan %s\n",
- total_bytes , (int) time_msec, test_ch->name);
-
- if (!test_ch->random_packet_size) {
- if (time_msec) {
- throughput = (total_bytes / time_msec) * 8 / 1000;
- pr_err(TEST_MODULE_NAME ": %s - Performance = "
- "%d Mbit/sec for chan %s\n",
- __func__, throughput, test_ch->name);
- } else {
- pr_err(TEST_MODULE_NAME ": %s - time_msec = 0 Couldn't "
- "calculate performence for chan %s\n",
- __func__, test_ch->name);
- }
-
- }
-
-#ifdef CONFIG_DEBUG_FS
- switch (test_ch->ch_id) {
- case SDIO_DUN:
- test_ctx->debug.dun_throughput = throughput;
- break;
- case SDIO_RMNT:
- test_ctx->debug.rmnt_throughput = throughput;
- break;
- default:
- pr_err(TEST_MODULE_NAME "No debugfs for this channel "
- "throughput");
- }
-#endif
-
- pr_err(TEST_MODULE_NAME ": A2 PERFORMANCE TEST END for chan %s.\n",
- test_ch->name);
-
- pr_err(TEST_MODULE_NAME ": TEST PASS for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-
-exit_err:
- pr_err(TEST_MODULE_NAME ": TEST FAIL for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-/**
- * rx_cleanup
- * This function reads all the messages sent by the modem until
- * the read_avail is 0 after 1 second of sleep.
- * The function returns the number of packets that was received.
- */
-static void rx_cleanup(struct test_channel *test_ch, int *rx_packet_count)
-{
- int read_avail = 0;
- int ret = 0;
- int counter = 0;
-
- if (!test_ch || !test_ch->ch) {
- pr_err(TEST_MODULE_NAME ":%s NULL channel\n",
- __func__);
- return;
- }
-
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, read_avail=%d\n",
- test_ch->name, read_avail);
-
- /* If no pending messages, wait to see if the modem sends data */
- if (read_avail == 0) {
- msleep(1000);
- read_avail = sdio_read_avail(test_ch->ch);
- }
-
- while ((read_avail > 0) && (counter < 10)) {
- TEST_DBG(TEST_MODULE_NAME ": read_avail=%d for ch %s\n",
- read_avail, test_ch->name);
-
- ret = sdio_read(test_ch->ch, test_ch->buf, read_avail);
- if (ret) {
- pr_info(TEST_MODULE_NAME ": sdio_read size %d "
- " err=%d for chan %s\n",
- read_avail, -ret, test_ch->name);
- break;
- }
- (*rx_packet_count)++;
- test_ch->rx_bytes += read_avail;
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail == 0) {
- msleep(1000);
- counter++;
- read_avail = sdio_read_avail(test_ch->ch);
- }
- }
- pr_info(TEST_MODULE_NAME ": finished cleanup for ch %s, "
- "rx_packet_count=%d, total rx bytes=%d\n",
- test_ch->name, *rx_packet_count, test_ch->rx_bytes);
-}
-
-
-/**
- * A2 RTT Test
- * This function sends a packet and calculate the RTT time of
- * this packet.
- * The test also calculte Min, Max and Average RTT
- */
-static void a2_rtt_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
- int tx_packet_count = 0;
- int rx_packet_count = 0;
- u16 *buf16 = NULL;
- int i;
- int max_packets = 0;
- u32 packet_size = 0;
- s64 start_time, end_time;
- int delta_usec = 0;
- int time_average = 0;
- int min_delta_usec = 0xFFFF;
- int max_delta_usec = 0;
- int total_time = 0;
- int expected_read_size = 0;
- int delay_ms = 0;
- int slow_rtt_counter = 0;
- int read_avail_so_far = 0;
-
- if (test_ch) {
- /*
- * Cleanup the pending RX data (such as loopback of the
- * config msg)
- */
- rx_cleanup(test_ch, &rx_packet_count);
- rx_packet_count = 0;
- } else {
- return;
- }
-
- max_packets = test_ch->config_msg.num_packets;
- packet_size = test_ch->packet_length;
- buf16 = (u16 *) test_ch->buf;
-
- for (i = 0; i < packet_size / 2; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
- pr_info(TEST_MODULE_NAME ": A2 RTT TEST START for chan %s\n",
- test_ch->name);
-
- switch (test_ch->ch_id) {
- case SDIO_RMNT:
- delay_ms = 100;
- break;
- case SDIO_CSVT:
- delay_ms = 0;
- break;
- default:
- pr_err(TEST_MODULE_NAME ": %s - ch_id invalid.\n",
- __func__);
- return;
- }
-
- while (tx_packet_count < max_packets) {
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
- start_time = 0;
- end_time = 0;
- read_avail_so_far = 0;
-
- if (delay_ms)
- msleep(delay_ms);
-
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":ch %s: write_avail=%d\n",
- test_ch->name, write_avail);
- if (write_avail == 0) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, write_avail=%d\n",
- test_ch->name, write_avail);
- if (write_avail > 0) {
- TEST_DBG(TEST_MODULE_NAME ":tx size = %d for chan %s\n",
- packet_size, test_ch->name);
- test_ch->buf[0] = tx_packet_count;
-
- start_time = ktime_to_us(ktime_get());
- ret = sdio_write(test_ch->ch, test_ch->buf,
- packet_size);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":sdio_write err=%d"
- " for chan %s\n",
- -ret, test_ch->name);
- goto exit_err;
- }
- tx_packet_count++;
- test_ch->tx_bytes += packet_size;
- } else {
- pr_err(TEST_MODULE_NAME ": Invalid write_avail"
- " %d for chan %s\n",
- write_avail, test_ch->name);
- goto exit_err;
- }
-
- expected_read_size = packet_size + A2_HEADER_OVERHEAD;
-
- while (read_avail_so_far < expected_read_size) {
-
- read_avail = sdio_read_avail(test_ch->ch);
-
- if (!read_avail) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->
- rx_notify_count));
-
- atomic_dec(&test_ch->rx_notify_count);
- continue;
- }
-
- read_avail_so_far += read_avail;
-
- if (read_avail_so_far > expected_read_size) {
- pr_err(TEST_MODULE_NAME ": %s - Invalid "
- "read_avail(%d) read_avail_so_far(%d) "
- "can't be larger than "
- "expected_read_size(%d).",
- __func__,
- read_avail,
- read_avail_so_far,
- expected_read_size);
- goto exit_err;
- }
-
- /*
- * must read entire pending bytes, so later, we will
- * get a notification when more data arrives
- */
- ret = sdio_read(test_ch->ch, test_ch->buf,
- read_avail);
-
- if (ret) {
- pr_info(TEST_MODULE_NAME ": sdio_read size %d "
- " err=%d for chan %s\n",
- read_avail, -ret,
- test_ch->name);
- goto exit_err;
- }
- }
-
- end_time = ktime_to_us(ktime_get());
- rx_packet_count++;
- test_ch->rx_bytes += expected_read_size;
-
- delta_usec = (int)(end_time - start_time);
- total_time += delta_usec;
- if (delta_usec < min_delta_usec)
- min_delta_usec = delta_usec;
- if (delta_usec > max_delta_usec)
- max_delta_usec = delta_usec;
-
- /* checking the RTT per channel criteria */
- if (delta_usec > MAX_AVG_RTT_TIME_USEC) {
- pr_err(TEST_MODULE_NAME ": %s - "
- "msg # %d - rtt time (%d usec) is "
- "longer than %d usec\n",
- __func__,
- tx_packet_count,
- delta_usec,
- MAX_AVG_RTT_TIME_USEC);
- slow_rtt_counter++;
- }
-
- TEST_DBG(TEST_MODULE_NAME
- ":RTT time=%d for packet #%d for chan %s\n",
- delta_usec, tx_packet_count, test_ch->name);
- } /* while (tx_packet_count < max_packets ) */
-
- pr_info(TEST_MODULE_NAME ": %s - tx_packet_count = %d\n",
- __func__, tx_packet_count);
-
- pr_info(TEST_MODULE_NAME ": %s - total rx bytes = 0x%x, "
- "rx_packet# = %d for chan %s.\n",
- __func__, test_ch->rx_bytes, rx_packet_count, test_ch->name);
-
- pr_info(TEST_MODULE_NAME ": %s - total tx bytes = 0x%x, "
- "tx_packet# = %d for chan %s.\n",
- __func__, test_ch->tx_bytes, tx_packet_count, test_ch->name);
-
- pr_info(TEST_MODULE_NAME ": %s - slow_rtt_counter = %d for "
- "chan %s.\n",
- __func__, slow_rtt_counter, test_ch->name);
-
- if (tx_packet_count) {
- time_average = total_time / tx_packet_count;
- pr_info(TEST_MODULE_NAME ":Average RTT time = %d for chan %s\n",
- time_average, test_ch->name);
- } else {
- pr_err(TEST_MODULE_NAME ": %s - tx_packet_count=0. couldn't "
- "calculate average rtt time", __func__);
- }
-
- pr_info(TEST_MODULE_NAME ":MIN RTT time = %d for chan %s\n",
- min_delta_usec, test_ch->name);
- pr_info(TEST_MODULE_NAME ":MAX RTT time = %d for chan %s\n",
- max_delta_usec, test_ch->name);
-
- pr_info(TEST_MODULE_NAME ": A2 RTT TEST END for chan %s.\n",
- test_ch->name);
-
- if (ret)
- goto exit_err;
-
- if (time_average == 0 || time_average > MAX_AVG_RTT_TIME_USEC) {
- pr_err(TEST_MODULE_NAME ": %s - average_time = %d. Invalid "
- "value",
- __func__, time_average);
- goto exit_err;
-
- }
-
- pr_info(TEST_MODULE_NAME ": TEST PASS for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-
-exit_err:
- pr_err(TEST_MODULE_NAME ": TEST FAIL for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-/**
- * Process Rx Data - Helper for A2 Validation Test
- * @test_ch(in/out) : Test channel that contains Rx data buffer to process.
- *
- * @rx_unprocessed_bytes(in) : Number of bytes to process in the buffer.
- *
- * @rx_process_packet_state(in/out) :
- * Current processing state (used to identify what to process
- * next in a partial packet)
- *
- * @rx_packet_size(in/out) :
- * Number of bytes remaining in the packet to be processed.
- *
- * @rx_packet_count(in/out) :
- * Number of packets processed.
- */
-static int process_rx_data(struct test_channel *test_ch,
- u32 rx_unprocessed_bytes,
- int *rx_process_packet_state,
- u16 *rx_packet_size,
- int *rx_packet_count)
-{
- u8 *buf = (u8 *)test_ch->buf;
- int eop = 0;
- int i = 0;
- int ret = 0;
- u32 *ptr = 0;
- u16 size = 0;
-
- /* process rx data */
- while (rx_unprocessed_bytes) {
- TEST_DBG(TEST_MODULE_NAME ": unprocessed bytes : %u\n",
- rx_unprocessed_bytes);
-
- switch (*rx_process_packet_state) {
- case RX_PROCESS_PACKET_INIT:
- /* process the A2 header */
- TEST_DBG(TEST_MODULE_NAME ": "
- "RX_PROCESS_PACKET_INIT\n");
- *rx_process_packet_state = RX_PROCESS_PACKET_INIT;
- if (rx_unprocessed_bytes < 4)
- break;
-
- i += 4;
- rx_unprocessed_bytes -= 4;
-
- case RX_PROCESS_A2_HEADER:
- /* process the rest of A2 header */
- TEST_DBG(TEST_MODULE_NAME ": RX_PROCESS_A2_HEADER\n");
- *rx_process_packet_state = RX_PROCESS_A2_HEADER;
- if (rx_unprocessed_bytes < 4)
- break;
-
- ptr = (u32 *)&buf[i];
- /*
- * upper 2 bytes of the last 4 bytes of A2 header
- * contains the size of the packet
- */
- *rx_packet_size = *ptr >> 0x10;
-
- i += 4;
- rx_unprocessed_bytes -= 4;
-
- case RX_PROCESS_PACKET_DATA:
- /* process the2_2_ packet data */
- TEST_DBG(TEST_MODULE_NAME ": RX_PROCESS_PACKET_DATA "
- "- packet size - %u\n", *rx_packet_size);
- *rx_process_packet_state = RX_PROCESS_PACKET_DATA;
-
- size = *rx_packet_size;
- if (*rx_packet_size <= rx_unprocessed_bytes) {
- eop = *rx_packet_size;
- *rx_packet_size = 0;
- } else {
- eop = rx_unprocessed_bytes;
- *rx_packet_size = *rx_packet_size -
- rx_unprocessed_bytes;
- }
-
- /* no more bytes available to process */
- if (!eop)
- break;
- /*
- * end of packet is starting from
- * the current position
- */
- eop = eop + i;
- TEST_DBG(TEST_MODULE_NAME ": size - %u, "
- "packet size - %u eop - %d\n",
- size, *rx_packet_size, eop);
-
- /* validate the data */
- for (; i < eop; i++) {
- if (buf[i] != (test_ch->rx_bytes % 256)) {
- pr_err(TEST_MODULE_NAME ": "
- "Corrupt data. buf:%u, "
- "data:%u\n", buf[i],
- test_ch->rx_bytes % 256);
- ret = -EINVAL;
- goto err;
- }
- rx_unprocessed_bytes--;
- test_ch->rx_bytes++;
- }
-
- /* have more data to be processed */
- if (*rx_packet_size)
- break;
-
- /*
- * A2 sends data in 4 byte alignment,
- * skip the padding
- */
- if (size % 4) {
- i += 4 - (size % 4);
- rx_unprocessed_bytes -= 4 - (size % 4);
- }
- *rx_packet_count = *rx_packet_count + 1;
-
- /* re init the state to process new packet */
- *rx_process_packet_state = RX_PROCESS_PACKET_INIT;
- break;
- default:
- pr_err(TEST_MODULE_NAME ": Invalid case: %d\n",
- *rx_process_packet_state);
- ret = -EINVAL;
- goto err;
- }
- TEST_DBG(TEST_MODULE_NAME ": Continue processing "
- "if more data is available\n");
- }
-
-err:
- return ret;
-}
-
-/**
- * A2 Validation Test
- * Send packets and validate the returned packets.
- * Transmit one packet at a time, while process multiple rx
- * packets in a single transaction.
- * A transaction is of size min(random number, write_avail).
- * A packet consists of a min of 1 byte to channel supported max.
- */
-static void a2_validation_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
- int tx_packet_count = 0;
- int rx_packet_count = 0;
- int initial_rx_packet_count = 0;
- u32 size = 0;
- u8 *buf8 = (u8 *)test_ch->buf;
- int i = 0;
- int max_packets = test_ch->config_msg.num_packets;
- u16 tx_packet_size = 0;
- u16 rx_packet_size = 0;
- u32 random_num = 0;
- int rx_process_packet_state = RX_PROCESS_PACKET_INIT;
-
- pr_info(TEST_MODULE_NAME ": A2 VALIDATION TEST START for chan %s\n",
- test_ch->name);
-
- /* Wait for the initial rx messages before starting the test. */
- rx_cleanup(test_ch, &initial_rx_packet_count);
-
- test_ch->tx_bytes = 0;
- test_ch->rx_bytes = 0;
-
- /* Continue till we have transmitted and received all packets */
- while ((tx_packet_count < max_packets) ||
- (rx_packet_count < max_packets)) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- random_num = get_random_int();
- size = (random_num % test_ch->packet_length) + 1;
- TEST_DBG(TEST_MODULE_NAME ": Random tx packet size =%u", size);
-
- /*
- * wait for data ready event
- * use a func to avoid compiler optimizations
- */
- write_avail = sdio_write_avail(test_ch->ch);
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ": write_avail=%d, "
- "read_avail=%d for chan %s\n",
- write_avail, read_avail, test_ch->name);
-
- if ((write_avail == 0) && (read_avail == 0)) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->any_notify_count));
- atomic_set(&test_ch->any_notify_count, 0);
- }
-
- /* Transmit data */
- write_avail = sdio_write_avail(test_ch->ch);
- if ((tx_packet_count < max_packets) && (write_avail > 0)) {
- tx_packet_size = min(size, write_avail) ;
- TEST_DBG(TEST_MODULE_NAME ": tx size = %u, "
- "write_avail = %u tx_packet# = %d\n",
- tx_packet_size, write_avail,
- tx_packet_count);
- memset(test_ch->buf, 0, test_ch->buf_size);
- /* populate the buffer */
- for (i = 0; i < tx_packet_size; i++) {
- buf8[i] = test_ch->tx_bytes % 256;
- test_ch->tx_bytes++;
- }
-
- ret = sdio_write(test_ch->ch, test_ch->buf,
- tx_packet_size);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":sdio_write err=%d"
- " for chan %s\n",
- -ret, test_ch->name);
- goto exit_err;
- }
- tx_packet_count++;
- }
-
- /* Receive data */
- read_avail = sdio_read_avail(test_ch->ch);
- if (read_avail > 0) {
- TEST_DBG(TEST_MODULE_NAME ": rx size = %u, "
- "rx_packet#=%d.\n",
- read_avail, rx_packet_count);
- memset(test_ch->buf, 0, test_ch->buf_size);
-
- ret = sdio_read(test_ch->ch, test_ch->buf,
- read_avail);
- if (ret) {
- pr_err(TEST_MODULE_NAME ": sdio_read "
- "size %d err=%d for chan %s\n",
- size, -ret, test_ch->name);
- goto exit_err;
- }
-
- /* Process data */
- ret = process_rx_data(test_ch, read_avail,
- &rx_process_packet_state,
- &rx_packet_size,
- &rx_packet_count);
-
- if (ret != 0)
- goto exit_err;
- }
- TEST_DBG(TEST_MODULE_NAME ": Continue loop ...\n");
- }
-
- if (test_ch->tx_bytes != test_ch->rx_bytes) {
- pr_err(TEST_MODULE_NAME ": Total number of bytes "
- "transmitted (%u) does not match the total "
- "number of bytes received (%u).", test_ch->tx_bytes,
- test_ch->rx_bytes);
- goto exit_err;
- }
-
- pr_info(TEST_MODULE_NAME ": A2 VALIDATION TEST END for chan %s.\n",
- test_ch->name);
-
- pr_info(TEST_MODULE_NAME ": TEST PASS for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-
-exit_err:
- pr_info(TEST_MODULE_NAME ": TEST FAIL for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-/**
- * sender No loopback Test
- */
-static void sender_no_loopback_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 write_avail = 0;
- int packet_count = 0;
- int size = 512;
- u16 *buf16 = (u16 *) test_ch->buf;
- int i;
- int max_packet_count = 10000;
- unsigned int random_num = 0;
-
- max_packet_count = test_ch->config_msg.num_packets;
-
- for (i = 0 ; i < size / 2 ; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
- pr_info(TEST_MODULE_NAME
- ":SENDER NO LP TEST START for chan %s\n", test_ch->name);
-
- while (packet_count < max_packet_count) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- random_num = get_random_int();
- size = (random_num % test_ch->packet_length) + 1;
-
- TEST_DBG(TEST_MODULE_NAME ":SENDER WAIT FOR EVENT "
- "for chan %s\n",
- test_ch->name);
-
- /* wait for data ready event */
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->tx_notify_count));
- atomic_dec(&test_ch->tx_notify_count);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":write_avail=%d\n", write_avail);
- if (write_avail < size) {
- pr_info(TEST_MODULE_NAME ":not enough write avail.\n");
- continue;
- }
-
- test_ch->buf[0] = packet_count;
-
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sender sdio_write err=%d.\n",
- -ret);
- goto exit_err;
- }
-
- test_ch->tx_bytes += size;
- packet_count++;
-
- TEST_DBG(TEST_MODULE_NAME
- ":sender total tx bytes = 0x%x , packet#=%d, size=%d"
- " for chan %s\n",
- test_ch->tx_bytes, packet_count, size, test_ch->name);
-
- } /* end of while */
-
- pr_info(TEST_MODULE_NAME
- ":SENDER TEST END: total tx bytes = 0x%x, "
- " for chan %s\n",
- test_ch->tx_bytes, test_ch->name);
-
- test_ch->modem_result_per_chan = wait_for_result_msg(test_ch);
-
- if (test_ch->modem_result_per_chan) {
- pr_info(TEST_MODULE_NAME ": TEST PASS for chan %s.\n",
- test_ch->name);
- test_ch->test_result = TEST_PASSED;
- } else {
- pr_info(TEST_MODULE_NAME ": TEST FAILURE for chan %s.\n",
- test_ch->name);
- test_ch->test_result = TEST_FAILED;
- }
- test_ch->test_completed = 1;
- check_test_completion();
- return;
-
-exit_err:
- pr_info(TEST_MODULE_NAME ": TEST FAIL for chan %s.\n",
- test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-
-/**
- * Modem reset Test
- * The test verifies that it finished sending all the packets
- * while there might be modem reset in the middle
- */
-static void modem_reset_test(struct test_channel *test_ch)
-{
- int ret = 0 ;
- u32 read_avail = 0;
- u32 write_avail = 0;
- int tx_packet_count = 0;
- int rx_packet_count = 0;
- int size = 0;
- u16 *buf16 = (u16 *) test_ch->buf;
- int i;
- int max_packets = 10000;
- u32 packet_size = test_ch->buf_size;
- int is_err = 0;
-
- max_packets = test_ch->config_msg.num_packets;
- packet_size = test_ch->packet_length;
-
- for (i = 0; i < packet_size / 2; i++)
- buf16[i] = (u16) (i & 0xFFFF);
-
- pr_info(TEST_MODULE_NAME ": Modem Reset TEST START for chan %s\n",
- test_ch->name);
-
- while (tx_packet_count < max_packets) {
-
- if (test_ctx->exit_flag) {
- pr_info(TEST_MODULE_NAME ":Exit Test.\n");
- return;
- }
-
- if (test_ch->card_removed) {
- pr_info(TEST_MODULE_NAME ": card removal was detected "
- "for chan %s, tx_total=0x%x\n",
- test_ch->name, test_ch->tx_bytes);
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->card_detected_event));
- atomic_set(&test_ch->card_detected_event, 0);
- pr_info(TEST_MODULE_NAME ": card_detected_event "
- "for chan %s\n", test_ch->name);
- if (test_ch->card_removed)
- continue;
- is_err = 0;
- /* Need to wait for the modem to be ready */
- msleep(5000);
- pr_info(TEST_MODULE_NAME ": sending the config message "
- "for chan %s\n", test_ch->name);
- send_config_msg(test_ch);
- }
-
- /* wait for data ready event */
- /* use a func to avoid compiler optimizations */
- write_avail = sdio_write_avail(test_ch->ch);
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, write_avail=%d, "
- "read_avail=%d for chan %s\n",
- test_ch->name, write_avail, read_avail,
- test_ch->name);
- if ((write_avail == 0) && (read_avail == 0)) {
- wait_event(test_ch->wait_q,
- atomic_read(&test_ch->any_notify_count));
- atomic_set(&test_ch->any_notify_count, 0);
- }
- if (atomic_read(&test_ch->card_detected_event)) {
- atomic_set(&test_ch->card_detected_event, 0);
- pr_info(TEST_MODULE_NAME ": card_detected_event "
- "for chan %s, tx_total=0x%x\n",
- test_ch->name, test_ch->tx_bytes);
- if (test_ch->card_removed)
- continue;
- /* Need to wait for the modem to be ready */
- msleep(5000);
- is_err = 0;
- pr_info(TEST_MODULE_NAME ": sending the config message "
- "for chan %s\n", test_ch->name);
- send_config_msg(test_ch);
- }
-
- write_avail = sdio_write_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, write_avail=%d\n",
- test_ch->name, write_avail);
- if (write_avail > 0) {
- size = min(packet_size, write_avail) ;
- pr_debug(TEST_MODULE_NAME ":tx size = %d for chan %s\n",
- size, test_ch->name);
- test_ch->buf[0] = tx_packet_count;
- test_ch->buf[(size/4)-1] = tx_packet_count;
-
- TEST_DBG(TEST_MODULE_NAME ":channel %s, sdio_write, "
- "size=%d\n", test_ch->name, size);
- if (is_err) {
- msleep(100);
- continue;
- }
- ret = sdio_write(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ":sdio_write err=%d"
- " for chan %s\n",
- -ret, test_ch->name);
- is_err = 1;
- msleep(20);
- continue;
- }
- tx_packet_count++;
- test_ch->tx_bytes += size;
- test_ch->config_msg.num_packets--;
- }
-
- read_avail = sdio_read_avail(test_ch->ch);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, read_avail=%d\n",
- test_ch->name, read_avail);
- if (read_avail > 0) {
- size = min(packet_size, read_avail);
- pr_debug(TEST_MODULE_NAME ":rx size = %d.\n", size);
- TEST_DBG(TEST_MODULE_NAME ":channel %s, sdio_read, "
- "size=%d\n", test_ch->name, size);
- if (is_err) {
- msleep(100);
- continue;
- }
- ret = sdio_read(test_ch->ch, test_ch->buf, size);
- if (ret) {
- pr_info(TEST_MODULE_NAME ": sdio_read size %d "
- " err=%d"
- " for chan %s\n",
- size, -ret, test_ch->name);
- is_err = 1;
- msleep(20);
- continue;
- }
- rx_packet_count++;
- test_ch->rx_bytes += size;
- }
-
- TEST_DBG(TEST_MODULE_NAME
- ":total rx bytes = %d , rx_packet#=%d"
- " for chan %s\n",
- test_ch->rx_bytes, rx_packet_count, test_ch->name);
- TEST_DBG(TEST_MODULE_NAME
- ":total tx bytes = %d , tx_packet#=%d"
- " for chan %s\n",
- test_ch->tx_bytes, tx_packet_count, test_ch->name);
-
- udelay(500);
-
- } /* while (tx_packet_count < max_packets ) */
-
- pr_info(TEST_MODULE_NAME ":total rx bytes = 0x%x , rx_packet#=%d for"
- " chan %s.\n",
- test_ch->rx_bytes, rx_packet_count, test_ch->name);
- pr_info(TEST_MODULE_NAME ":total tx bytes = 0x%x , tx_packet#=%d"
- " for chan %s.\n",
- test_ch->tx_bytes, tx_packet_count, test_ch->name);
-
- pr_err(TEST_MODULE_NAME ": Modem Reset TEST END for chan %s.\n",
- test_ch->name);
-
- pr_err(TEST_MODULE_NAME ": TEST PASS for chan %s\n", test_ch->name);
- test_ch->test_completed = 1;
- test_ch->test_result = TEST_PASSED;
- check_test_completion();
- return;
-}
-
-/**
- * Worker thread to handle the tests types
- */
-static void worker(struct work_struct *work)
-{
- struct test_channel *test_ch = NULL;
- struct test_work *test_work = container_of(work,
- struct test_work,
- work);
- int test_type = 0;
-
- test_ch = test_work->test_ch;
-
- if (test_ch == NULL) {
- pr_err(TEST_MODULE_NAME ":NULL test_ch\n");
- return;
- }
-
- test_type = test_ch->test_type;
-
- switch (test_type) {
- case SDIO_TEST_LOOPBACK_HOST:
- loopback_test(test_ch);
- break;
- case SDIO_TEST_LOOPBACK_CLIENT:
- sender_test(test_ch);
- break;
- case SDIO_TEST_PERF:
- a2_performance_test(test_ch);
- break;
- case SDIO_TEST_LPM_CLIENT_WAKER:
- lpm_test(test_ch);
- break;
- case SDIO_TEST_LPM_HOST_WAKER:
- lpm_test_host_waker(test_ch);
- break;
- case SDIO_TEST_HOST_SENDER_NO_LP:
- sender_no_loopback_test(test_ch);
- break;
- case SDIO_TEST_LPM_RANDOM:
- lpm_continuous_rand_test(test_ch);
- break;
- case SDIO_TEST_RTT:
- a2_rtt_test(test_ch);
- break;
- case SDIO_TEST_CLOSE_CHANNEL:
- if (test_ch->ch_id != SDIO_SMEM)
- open_close_test(test_ch);
- break;
- case SDIO_TEST_MODEM_RESET:
- modem_reset_test(test_ch);
- break;
- case SDIO_TEST_A2_VALIDATION:
- a2_validation_test(test_ch);
- break;
- default:
- pr_err(TEST_MODULE_NAME ":Bad Test type = %d.\n",
- (int) test_type);
- }
-}
-
-
-/**
- * Notification Callback
- *
- * Notify the worker
- *
- */
-static void notify(void *priv, unsigned channel_event)
-{
- struct test_channel *test_ch = (struct test_channel *) priv;
-
- pr_debug(TEST_MODULE_NAME ": %s - notify event=%d.\n",
- __func__, channel_event);
-
- if (test_ch->ch == NULL) {
- pr_info(TEST_MODULE_NAME ": %s - notify before ch ready.\n",
- __func__);
- return;
- }
-
- switch (channel_event) {
- case SDIO_EVENT_DATA_READ_AVAIL:
- atomic_inc(&test_ch->rx_notify_count);
- atomic_set(&test_ch->any_notify_count, 1);
- TEST_DBG(TEST_MODULE_NAME ": %s - SDIO_EVENT_DATA_READ_AVAIL, "
- "any_notify_count=%d, rx_notify_count=%d\n",
- __func__,
- atomic_read(&test_ch->any_notify_count),
- atomic_read(&test_ch->rx_notify_count));
- /*
- * when there is pending data on a channel we would like to
- * turn on the bit mask that implies that there is pending
- * data for that channel on that deivce
- */
- if (test_ch->test_device != NULL &&
- test_ch->test_type == SDIO_TEST_LPM_RANDOM) {
- spin_lock_irqsave(&test_ch->test_device->lpm_array_lock,
- test_ch->test_device->
- lpm_array_lock_flags);
- test_ch->test_device->read_avail_mask |=
- test_ch->channel_mask_id;
- test_ch->notify_counter_per_chan++;
-
- lpm_test_update_entry(test_ch, LPM_NOTIFY, "NOTIFY", 0);
- spin_unlock_irqrestore(&test_ch->test_device->
- lpm_array_lock,
- test_ch->test_device->
- lpm_array_lock_flags);
- }
- break;
-
- case SDIO_EVENT_DATA_WRITE_AVAIL:
- atomic_inc(&test_ch->tx_notify_count);
- atomic_set(&test_ch->any_notify_count, 1);
- TEST_DBG(TEST_MODULE_NAME ": %s - SDIO_EVENT_DATA_WRITE_AVAIL, "
- "any_notify_count=%d, tx_notify_count=%d\n",
- __func__,
- atomic_read(&test_ch->any_notify_count),
- atomic_read(&test_ch->tx_notify_count));
- break;
-
- default:
- BUG();
- }
- wake_up(&test_ch->wait_q);
-
-}
-
-#ifdef CONFIG_MSM_SDIO_SMEM
-static int sdio_smem_test_cb(int event)
-{
- struct test_channel *tch = test_ctx->test_ch_arr[SDIO_SMEM];
- int i;
- int *smem_buf = (int *)test_ctx->smem_buf;
- uint32_t val = 0;
- int ret = 0;
-
- pr_debug(TEST_MODULE_NAME ":%s: Received event %d\n", __func__, event);
-
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s NULL tch\n", __func__);
- return -EINVAL;
- }
-
- switch (event) {
- case SDIO_SMEM_EVENT_READ_DONE:
- tch->rx_bytes += SMEM_MAX_XFER_SIZE;
- for (i = 0; i < SMEM_MAX_XFER_SIZE;) {
- val = (int)*smem_buf;
- if ((val != test_ctx->smem_counter) && tch->is_used) {
- pr_err(TEST_MODULE_NAME ":%s: Invalid value %d "
- "expected %d in smem arr",
- __func__, val, test_ctx->smem_counter);
- pr_err(TEST_MODULE_NAME ":SMEM test FAILED\n");
- tch->test_completed = 1;
- tch->test_result = TEST_FAILED;
- check_test_completion();
- ret = -EINVAL;
- goto exit;
- }
- i += 4;
- smem_buf++;
- test_ctx->smem_counter++;
- }
- if (tch->rx_bytes >= 40000000) {
- if ((!tch->test_completed) && tch->is_used) {
- pr_info(TEST_MODULE_NAME ":SMEM test PASSED\n");
- tch->test_completed = 1;
- tch->test_result = TEST_PASSED;
- check_test_completion();
- }
- }
- break;
- case SDIO_SMEM_EVENT_READ_ERR:
- if (tch->is_used) {
- pr_err(TEST_MODULE_NAME ":Read overflow, "
- "SMEM test FAILED\n");
- tch->test_completed = 1;
- tch->test_result = TEST_FAILED;
- ret = -EIO;
- }
- break;
- default:
- if (tch->is_used) {
- pr_err(TEST_MODULE_NAME ":Unhandled event %d\n", event);
- ret = -EINVAL;
- }
- break;
- }
-exit:
- return ret;
-}
-
-static int sdio_smem_open(struct sdio_smem_client *sdio_smem)
-{
- int ret = 0;
-
- if (!sdio_smem) {
- pr_info(TEST_MODULE_NAME "%s: NULL sdio_smem_client\n",
- __func__);
- return -EINVAL;
- }
-
- if (test_ctx->test_ch_arr[SDIO_SMEM]->ch_ready) {
- pr_info(TEST_MODULE_NAME "%s: SDIO_SMEM channel is already opened\n",
- __func__);
- return 0;
- }
-
- test_ctx->test_ch_arr[SDIO_SMEM]->ch_ready = 1;
- sdio_smem->buf = test_ctx->smem_buf;
- sdio_smem->size = SMEM_MAX_XFER_SIZE;
- sdio_smem->cb_func = sdio_smem_test_cb;
- ret = sdio_smem_register_client();
- if (ret)
- pr_info(TEST_MODULE_NAME "%s: Error (%d) registering sdio_smem "
- "test client\n",
- __func__, ret);
-
- return ret;
-}
-
-static int sdio_smem_test_probe(struct platform_device *pdev)
-{
- test_ctx->sdio_smem = container_of(pdev, struct sdio_smem_client,
- plat_dev);
-
- return sdio_smem_open(test_ctx->sdio_smem);
-}
-
-static struct platform_driver sdio_smem_client_drv = {
- .probe = sdio_smem_test_probe,
- .driver = {
- .name = "SDIO_SMEM_CLIENT",
- .owner = THIS_MODULE,
- },
-};
-#endif
-
-static void sdio_test_lpm_timeout_handler(unsigned long data)
-{
- struct test_channel *tch = (struct test_channel *)data;
-
- pr_info(TEST_MODULE_NAME ": %s - LPM TEST TIMEOUT Expired after "
- "%d ms\n", __func__, tch->timeout_ms);
- tch->test_completed = 1;
- pr_info(TEST_MODULE_NAME ": %s - tch->test_result = TEST_FAILED\n",
- __func__);
- tch->test_completed = 1;
- tch->test_result = TEST_FAILED;
- check_test_completion();
- return;
-}
-
-static void sdio_test_lpm_timer_handler(unsigned long data)
-{
- struct test_channel *tch = (struct test_channel *)data;
-
- pr_info(TEST_MODULE_NAME ": %s - LPM TEST Timer Expired after "
- "%d ms\n", __func__, tch->timer_interval_ms);
-
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s - LPM TEST FAILED. "
- "tch is NULL\n", __func__);
- return;
- }
-
- if (!tch->ch) {
- pr_err(TEST_MODULE_NAME ": %s - LPM TEST FAILED. tch->ch "
- "is NULL\n", __func__);
- tch->test_result = TEST_FAILED;
- return;
- }
-
- /* Verfiy that we voted for sleep */
- if (tch->is_ok_to_sleep) {
- tch->test_result = TEST_PASSED;
- pr_info(TEST_MODULE_NAME ": %s - 8K voted for sleep\n",
- __func__);
- } else {
- tch->test_result = TEST_FAILED;
- pr_info(TEST_MODULE_NAME ": %s - 8K voted against sleep\n",
- __func__);
-
- }
-
- sdio_al_unregister_lpm_cb(tch->sdio_al_device);
-
- if (tch->test_type == SDIO_TEST_LPM_HOST_WAKER) {
- atomic_set(&tch->wakeup_client, 1);
- wake_up(&tch->wait_q);
- }
-}
-
-int sdio_test_wakeup_callback(void *device_handle, int is_vote_for_sleep)
-{
- int i = 0;
-
- TEST_DBG(TEST_MODULE_NAME ": %s is_vote_for_sleep=%d!!!",
- __func__, is_vote_for_sleep);
-
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used) || (!tch->ch_ready))
- continue;
- if (tch->sdio_al_device == device_handle) {
- tch->is_ok_to_sleep = is_vote_for_sleep;
-
- if (tch->test_type == SDIO_TEST_LPM_RANDOM) {
- spin_lock_irqsave(&tch->test_device->
- lpm_array_lock,
- tch->test_device->
- lpm_array_lock_flags);
- if (is_vote_for_sleep == 1)
- lpm_test_update_entry(tch,
- LPM_SLEEP,
- "SLEEP ", 0);
- else
- lpm_test_update_entry(tch,
- LPM_WAKEUP,
- "WAKEUP", 0);
-
- spin_unlock_irqrestore(&tch->test_device->
- lpm_array_lock,
- tch->test_device->
- lpm_array_lock_flags);
- break;
- }
- }
- }
-
- return 0;
-}
-
-static int sdio_test_find_dev(struct test_channel *tch)
-{
- int j;
- int null_index = -1;
-
- for (j = 0 ; j < MAX_NUM_OF_SDIO_DEVICES; ++j) {
-
- struct sdio_test_device *test_dev =
- &test_ctx->test_dev_arr[j];
-
- if (test_dev->sdio_al_device == NULL) {
- if (null_index == -1)
- null_index = j;
- continue;
- }
-
- if (test_dev->sdio_al_device ==
- tch->ch->sdio_al_dev) {
- test_dev->open_channels_counter_to_recv++;
- test_dev->open_channels_counter_to_send++;
- tch->test_device = test_dev;
- /* setting mask id for pending data for
- this channel */
- tch->channel_mask_id = test_dev->next_mask_id;
- test_dev->next_mask_id *= 2;
- pr_info(TEST_MODULE_NAME ": %s - channel %s "
- "got read_mask_id = 0x%x. device "
- "next_mask_id=0x%x",
- __func__, tch->name, tch->channel_mask_id,
- test_dev->next_mask_id);
- break;
- }
- }
-
- /*
- * happens ones a new device is "discovered" while testing. i.e
- * if testing a few channels, a new deivce will be "discovered" once
- * the first channel of a device is being tested
- */
- if (j == MAX_NUM_OF_SDIO_DEVICES) {
-
- struct sdio_test_device *test_dev =
- &test_ctx->
- test_dev_arr[null_index];
- test_dev->sdio_al_device =
- tch->ch->sdio_al_dev;
-
- test_ctx->number_of_active_devices++;
- test_ctx->max_number_of_devices++;
- test_dev->open_channels_counter_to_recv++;
- test_dev->open_channels_counter_to_send++;
- test_dev->next_avail_entry_in_array = 0;
- tch->test_device = test_dev;
- tch->test_device->array_size =
- LPM_ARRAY_SIZE;
- test_dev->modem_result_per_dev = 1;
- tch->modem_result_per_chan = 0;
- test_dev->next_avail_entry_in_array = 0;
-
- spin_lock_init(&test_dev->
- lpm_array_lock);
-
- if (tch->test_type == SDIO_TEST_LPM_RANDOM) {
- pr_err(MODULE_NAME ": %s - "
- "Allocating Msg Array for "
- "Maximum open channels for device (%d) "
- "Channels. Array has %d entries",
- __func__,
- LPM_MAX_OPEN_CHAN_PER_DEV,
- test_dev->array_size);
-
- test_dev->lpm_arr =
- kzalloc(sizeof(
- struct lpm_entry_type) *
- tch->
- test_device->array_size,
- GFP_KERNEL);
-
- if (!test_dev->lpm_arr) {
- pr_err(MODULE_NAME ": %s - "
- "lpm_arr is NULL",
- __func__);
- return -ENOMEM;
- }
- }
-
- /*
- * in new device, initialize next_mask_id, and setting
- * mask_id to the channel
- */
- test_dev->next_mask_id = 0x1;
- tch->channel_mask_id = test_dev->next_mask_id;
- test_dev->next_mask_id *= 2;
- pr_info(TEST_MODULE_NAME ": %s - channel %s got "
- "read_mask_id = 0x%x. device next_mask_id=0x%x",
- __func__,
- tch->name,
- tch->channel_mask_id,
- test_dev->next_mask_id);
- }
-
- return 0;
-}
-
-static void check_test_result(void)
-{
- int result = 1;
- int i = 0;
-
- test_ctx->max_number_of_devices = 0;
-
- pr_info(TEST_MODULE_NAME ": %s - Woke Up\n", __func__);
-
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used) || (!tch->ch_ready))
- continue;
-
- if (tch->test_type == SDIO_TEST_LPM_RANDOM)
- result &= tch->test_device->final_result_per_dev;
- else
- if (tch->test_result == TEST_FAILED) {
- pr_info(TEST_MODULE_NAME ": %s - "
- "Test FAILED\n", __func__);
- test_ctx->test_result = TEST_FAILED;
- pr_err(TEST_MODULE_NAME ": %s - "
- "test_result %d",
- __func__, test_ctx->test_result);
- return;
- }
- }
-
- if (result == 0) {
- pr_info(TEST_MODULE_NAME ": %s - Test FAILED\n", __func__);
- test_ctx->test_result = TEST_FAILED;
- pr_err(TEST_MODULE_NAME ": %s - "
- "test_result %d",
- __func__, test_ctx->test_result);
- return;
- }
-
- pr_info(TEST_MODULE_NAME ": %s - Test PASSED", __func__);
- test_ctx->test_result = TEST_PASSED;
- pr_err(TEST_MODULE_NAME ": %s - "
- "test_result %d",
- __func__, test_ctx->test_result);
- return;
-}
-
-/**
- * Test Main
- */
-static int test_start(void)
-{
- int ret = -ENOMEM;
- int i;
-
- pr_debug(TEST_MODULE_NAME ":Starting Test ....\n");
-
- test_ctx->test_completed = 0;
- test_ctx->test_result = TEST_NO_RESULT;
- test_ctx->debug.dun_throughput = 0;
- test_ctx->debug.rmnt_throughput = 0;
- test_ctx->number_of_active_devices = 0;
-
- pr_err(TEST_MODULE_NAME ": %s - test_result %d",
- __func__, test_ctx->test_result);
-
- memset(test_ctx->test_dev_arr, 0,
- sizeof(struct sdio_test_device)*MAX_NUM_OF_SDIO_DEVICES);
-
- /* Open The Channels */
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used))
- continue;
-
- tch->rx_bytes = 0;
- tch->tx_bytes = 0;
-
- atomic_set(&tch->tx_notify_count, 0);
- atomic_set(&tch->rx_notify_count, 0);
- atomic_set(&tch->any_notify_count, 0);
- atomic_set(&tch->wakeup_client, 0);
-
- /* in case there are values left from previous tests */
- tch->notify_counter_per_chan = 0;
- tch->next_index_in_sent_msg_per_chan = 0;
-
- memset(tch->buf, 0x00, tch->buf_size);
- tch->test_result = TEST_NO_RESULT;
-
- tch->test_completed = 0;
-
- ret = open_sdio_ch(tch);
- if (ret)
- continue;
-
- if (tch->ch_id != SDIO_SMEM) {
- ret = sdio_test_find_dev(tch);
-
- if (ret) {
- pr_err(TEST_MODULE_NAME ": %s - "
- "sdio_test_find_dev() returned with "
- "error", __func__);
- return -ENODEV;
- }
-
- tch->sdio_al_device = tch->ch->sdio_al_dev;
- }
-
- if ((tch->test_type == SDIO_TEST_LPM_HOST_WAKER) ||
- (tch->test_type == SDIO_TEST_LPM_CLIENT_WAKER) ||
- (tch->test_type == SDIO_TEST_LPM_RANDOM))
- sdio_al_register_lpm_cb(tch->sdio_al_device,
- sdio_test_wakeup_callback);
- }
-
- /*
- * make some space between opening the channels and sending the
- * config messages
- */
- msleep(100);
-
- /*
- * try to delay send_config_msg of all channels to after the point
- * when we open them all
- */
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used))
- continue;
-
- if ((tch->ch_ready) && (tch->ch_id != SDIO_SMEM))
- send_config_msg(tch);
-
- if ((tch->test_type == SDIO_TEST_LPM_HOST_WAKER) ||
- (tch->test_type == SDIO_TEST_LPM_CLIENT_WAKER) ||
- (tch->test_type == SDIO_TEST_LPM_RANDOM)) {
- if (tch->timer_interval_ms > 0) {
- pr_info(TEST_MODULE_NAME ": %s - init timer, "
- "ms=%d\n",
- __func__, tch->timer_interval_ms);
- init_timer(&tch->timer);
- tch->timer.data = (unsigned long)tch;
- tch->timer.function =
- sdio_test_lpm_timer_handler;
- tch->timer.expires = jiffies +
- msecs_to_jiffies(tch->timer_interval_ms);
- add_timer(&tch->timer);
- }
- }
- }
-
- pr_debug(TEST_MODULE_NAME ":queue_work..\n");
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used) || (!tch->ch_ready))
- continue;
-
- if (tch->ch_id == SDIO_SMEM) {
-#ifdef CONFIG_MSM_SDIO_SMEM
- if (tch->test_type == SDIO_TEST_CLOSE_CHANNEL)
- open_close_smem_test(tch);
-#endif
- } else {
- queue_work(tch->workqueue, &tch->test_work.work);
- }
-
- }
-
- pr_info(TEST_MODULE_NAME ": %s - Waiting for the test completion\n",
- __func__);
-
- wait_event(test_ctx->wait_q, test_ctx->test_completed);
- check_test_result();
-
- /*
- * Close the channels and zero the is_used flag so that if the modem
- * will be reset after the test completion we won't re-open
- * the channels
- */
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
-
- if ((!tch) || (!tch->is_used))
- continue;
- if (!tch->ch_ready) {
- tch->is_used = 0;
- continue;
- }
-
- close_sdio_ch(tch);
- tch->is_used = 0;
- }
-
- if (test_ctx->test_result == TEST_PASSED)
- return 0;
- else
- return -EINVAL;
-}
-
-static int set_params_loopback_9k(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_LOOPBACK_CLIENT;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
- tch->config_msg.num_packets = 10000;
- tch->config_msg.num_iterations = 1;
-
- tch->packet_length = 512;
- if (tch->ch_id == SDIO_RPC)
- tch->packet_length = 128;
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-static int set_params_loopback_9k_close(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_CLOSE_CHANNEL;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
- tch->config_msg.num_packets = 5000;
- tch->config_msg.num_iterations = 1;
- tch->max_burst_size = 10;
- switch (tch->ch_id) {
- case SDIO_DUN:
- case SDIO_RPC:
- tch->packet_length = 128; /* max is 2K*/
- break;
- case SDIO_DIAG:
- case SDIO_RMNT:
- default:
- tch->packet_length = 512; /* max is 4k */
- }
- tch->timer_interval_ms = 0;
- return 0;
-}
-static int set_params_a2_perf(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_PERF;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
-
- switch (tch->ch_id) {
- case SDIO_DIAG:
- tch->packet_length = 512;
- break;
- case SDIO_DUN:
- tch->packet_length = DUN_PACKET_SIZE;
- break;
- case SDIO_CSVT:
- tch->packet_length = CSVT_PACKET_SIZE;
- break;
- default:
- tch->packet_length = MAX_XFER_SIZE;
- break;
- }
-
- pr_info(TEST_MODULE_NAME ": %s: packet_length=%d", __func__,
- tch->packet_length);
-
- tch->config_msg.num_packets = 10000;
- tch->config_msg.num_iterations = 1;
- tch->random_packet_size = 0;
-
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_rtt(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_RTT;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
-
- switch (tch->ch_id) {
- case SDIO_RMNT:
- tch->packet_length = SDIO_RMNT_RTT_PACKET_SIZE;
- break;
- case SDIO_CSVT:
- tch->packet_length = SDIO_CSVT_RTT_PACKET_SIZE;
- break;
- default:
- pr_err(TEST_MODULE_NAME ": %s - ch_id invalid.\n", __func__);
- return -EINVAL;
- }
-
- pr_info(TEST_MODULE_NAME ": %s: packet_length=%d", __func__,
- tch->packet_length);
-
- tch->config_msg.num_packets = 200;
- tch->config_msg.num_iterations = 1;
- tch->random_packet_size = 0;
-
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_a2_small_pkts(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_PERF;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
- tch->packet_length = 128;
-
- tch->config_msg.num_packets = 1000000;
- tch->config_msg.num_iterations = 1;
- tch->random_packet_size = 1;
-
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_modem_reset(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_MODEM_RESET;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
- tch->packet_length = 512;
- if (tch->ch_id == SDIO_RPC)
- tch->packet_length = 128;
- else if ((tch->ch_id == SDIO_RMNT) || (tch->ch_id == SDIO_DUN))
- tch->packet_length = MAX_XFER_SIZE;
-
- tch->config_msg.num_packets = 50000;
- tch->config_msg.num_iterations = 1;
-
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_a2_validation(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_A2_VALIDATION;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_LOOPBACK_CLIENT;
-
- if (tch->ch_id == SDIO_RMNT)
- tch->packet_length = RMNT_PACKET_SIZE;
- else if (tch->ch_id == SDIO_DUN)
- tch->packet_length = DUN_PACKET_SIZE;
- else
- tch->packet_length = MAX_XFER_SIZE;
-
- tch->config_msg.num_packets = 10000;
- tch->config_msg.num_iterations = 1;
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_smem_test(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static int set_params_lpm_test(struct test_channel *tch,
- enum sdio_test_case_type test,
- int timer_interval_ms)
-{
- static int first_time = 1;
- if (!tch) {
- pr_err(TEST_MODULE_NAME ": %s - NULL channel\n", __func__);
- return -EINVAL;
- }
-
- tch->is_used = 1;
- tch->test_type = test;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = test;
- tch->config_msg.num_packets = LPM_TEST_NUM_OF_PACKETS;
- tch->config_msg.num_iterations = 1;
- tch->timer_interval_ms = timer_interval_ms;
- tch->timeout_ms = 10000;
-
- tch->packet_length = 0;
- if (test != SDIO_TEST_LPM_RANDOM) {
- init_timer(&tch->timeout_timer);
- tch->timeout_timer.data = (unsigned long)tch;
- tch->timeout_timer.function = sdio_test_lpm_timeout_handler;
- tch->timeout_timer.expires = jiffies +
- msecs_to_jiffies(tch->timeout_ms);
- add_timer(&tch->timeout_timer);
- pr_info(TEST_MODULE_NAME ": %s - Initiated LPM TIMEOUT TIMER."
- "set to %d ms\n",
- __func__, tch->timeout_ms);
- }
-
- if (first_time) {
- pr_info(TEST_MODULE_NAME ": %s - wake_lock_init() called\n",
- __func__);
- wake_lock_init(&test_ctx->wake_lock,
- WAKE_LOCK_SUSPEND, TEST_MODULE_NAME);
- first_time = 0;
- }
-
- pr_info(TEST_MODULE_NAME ": %s - wake_lock() for the TEST is "
- "called channel %s. to prevent real sleeping\n",
- __func__, tch->name);
- wake_lock(&test_ctx->wake_lock);
-
- return 0;
-}
-
-static int set_params_8k_sender_no_lp(struct test_channel *tch)
-{
- if (!tch) {
- pr_err(TEST_MODULE_NAME ":NULL channel\n");
- return -EINVAL;
- }
- tch->is_used = 1;
- tch->test_type = SDIO_TEST_HOST_SENDER_NO_LP;
- tch->config_msg.signature = TEST_CONFIG_SIGNATURE;
- tch->config_msg.test_case = SDIO_TEST_HOST_SENDER_NO_LP;
- tch->config_msg.num_packets = 1000;
- tch->config_msg.num_iterations = 1;
-
- tch->packet_length = 512;
- if (tch->ch_id == SDIO_RPC)
- tch->packet_length = 128;
- tch->timer_interval_ms = 0;
-
- return 0;
-}
-
-static void set_pseudo_random_seed(void)
-{
- /* Set the seed accoring to the kernel command parameters if any or
- get a random value */
- if (seed != 0) {
- test_ctx->lpm_pseudo_random_seed = seed;
- } else {
- test_ctx->lpm_pseudo_random_seed =
- (unsigned int)(get_jiffies_64() & 0xFFFF);
- test_ctx->lpm_pseudo_random_seed =
- pseudo_random_seed(&test_ctx->lpm_pseudo_random_seed);
- }
-
- pr_info(TEST_MODULE_NAME ":%s: seed is %u",
- __func__, test_ctx->lpm_pseudo_random_seed);
-}
-
-/*
- for each channel
- 1. open channel
- 2. close channel
-*/
-static int close_channel_lpm_test(int channel_num)
-{
- int ret = 0;
- struct test_channel *tch = NULL;
- tch = test_ctx->test_ch_arr[channel_num];
-
- if (!tch) {
- pr_info(TEST_MODULE_NAME ":%s ch#%d is NULL\n",
- __func__, channel_num);
- return 0;
- }
-
- ret = open_sdio_ch(tch);
- if (ret) {
- pr_err(TEST_MODULE_NAME":%s open channel %s"
- " failed\n", __func__, tch->name);
- return ret;
- } else {
- pr_info(TEST_MODULE_NAME":%s open channel %s"
- " success\n", __func__, tch->name);
- }
- ret = close_sdio_ch(tch);
- if (ret) {
- pr_err(TEST_MODULE_NAME":%s close channel %s"
- " failed\n", __func__, tch->name);
- return ret;
- } else {
- pr_info(TEST_MODULE_NAME":%s close channel %s"
- " success\n", __func__, tch->name);
- }
-
- tch->is_used = 0;
-
- return ret;
-}
-
-/**
- * Write File.
- *
- * @note Trigger the test from user space by:
- * echo 1 > /dev/sdio_al_test
- *
- */
-ssize_t test_write(struct file *filp, const char __user *buf, size_t size,
- loff_t *f_pos)
-{
- sdio_al_test_initial_dev_and_chan(test_ctx);
-
- if (strict_strtol(buf, 10, &test_ctx->testcase))
- return -EINVAL;
-
- switch (test_ctx->testcase) {
- case 98:
- pr_info(TEST_MODULE_NAME " set runtime debug on");
- test_ctx->runtime_debug = 1;
- return size;
- case 99:
- pr_info(TEST_MODULE_NAME " set runtime debug off");
- test_ctx->runtime_debug = 0;
- return size;
- default:
- pr_info(TEST_MODULE_NAME ":Bad Test number = %d.\n",
- (int)test_ctx->testcase);
- return size;
- }
-
- return size;
-}
-
-/**
- * Test Channel Init.
- */
-int test_channel_init(char *name)
-{
- struct test_channel *test_ch;
- int ch_id = 0;
- int ret;
-
- pr_debug(TEST_MODULE_NAME ":%s.\n", __func__);
- pr_info(TEST_MODULE_NAME ": init test channel %s.\n", name);
-
- ch_id = channel_name_to_id(name);
- pr_debug(TEST_MODULE_NAME ":id = %d.\n", ch_id);
- if (test_ctx->test_ch_arr[ch_id] == NULL) {
- test_ch = kzalloc(sizeof(*test_ch), GFP_KERNEL);
- if (test_ch == NULL) {
- pr_err(TEST_MODULE_NAME ":kzalloc err for allocating "
- "test_ch %s.\n",
- name);
- return -ENOMEM;
- }
- test_ctx->test_ch_arr[ch_id] = test_ch;
-
- test_ch->ch_id = ch_id;
-
- strncpy(test_ch->name, name,
- strnlen(name, TEST_CH_NAME_SIZE)-SDIO_TEST_POSTFIX_SIZE);
-
- test_ch->buf_size = MAX_XFER_SIZE;
-
- test_ch->buf = kzalloc(test_ch->buf_size, GFP_KERNEL);
- if (test_ch->buf == NULL) {
- kfree(test_ch);
- test_ctx->test_ch = NULL;
- return -ENOMEM;
- }
-
- if (test_ch->ch_id == SDIO_SMEM) {
- test_ctx->smem_buf = kzalloc(SMEM_MAX_XFER_SIZE,
- GFP_KERNEL);
- if (test_ctx->smem_buf == NULL) {
- pr_err(TEST_MODULE_NAME ":%s: Unable to "
- "allocate smem buf\n",
- __func__);
- kfree(test_ch);
- test_ctx->test_ch = NULL;
- return -ENOMEM;
- }
-
-#ifdef CONFIG_MSM_SDIO_SMEM
- ret = platform_driver_register(&sdio_smem_client_drv);
- if (ret) {
- pr_err(TEST_MODULE_NAME ":%s: Unable to "
- "register sdio smem "
- "test client\n",
- __func__);
- return ret;
- }
-#endif
- } else {
- test_ch->workqueue =
- create_singlethread_workqueue(test_ch->name);
- test_ch->test_work.test_ch = test_ch;
- INIT_WORK(&test_ch->test_work.work, worker);
-
- init_waitqueue_head(&test_ch->wait_q);
- }
- } else {
- test_ch = test_ctx->test_ch_arr[ch_id];
- pr_info(TEST_MODULE_NAME ":%s: ch %s was detected again\n",
- __func__, test_ch->name);
- test_ch->card_removed = 0;
- if ((test_ch->is_used) &&
- (test_ch->test_type == SDIO_TEST_MODEM_RESET)) {
- if (test_ch->ch_id == SDIO_SMEM) {
-#ifdef CONFIG_MSM_SDIO_SMEM
- ret = add_sdio_smem();
- if (ret) {
- test_ch->ch_ready = false;
- return 0;
- }
-#endif
- } else {
- ret = open_sdio_ch(test_ch);
- if (ret) {
- pr_info(TEST_MODULE_NAME
- ":%s: open channel %s failed\n",
- __func__, test_ch->name);
- return 0;
- }
- ret = sdio_test_find_dev(test_ch);
-
- if (ret) {
- pr_err(TEST_MODULE_NAME ": %s - "
- "sdio_test_find_dev() returned "
- "with error", __func__);
- return -ENODEV;
- }
-
- test_ch->sdio_al_device =
- test_ch->ch->sdio_al_dev;
- }
- atomic_set(&test_ch->card_detected_event, 1);
- wake_up(&test_ch->wait_q);
- }
- }
-
- return 0;
-}
-
-static int sdio_test_channel_probe(struct platform_device *pdev)
-{
- if (!pdev)
- return -EIO;
- return test_channel_init((char *)pdev->name);
-}
-
-static int sdio_test_channel_remove(struct platform_device *pdev)
-{
- int ch_id;
-
- if (!pdev)
- return -EIO;
-
- ch_id = channel_name_to_id((char *)pdev->name);
- if (test_ctx->test_ch_arr[ch_id] == NULL)
- return 0;
-
- pr_info(TEST_MODULE_NAME "%s: remove ch %s\n",
- __func__, test_ctx->test_ch_arr[ch_id]->name);
-
- if ((ch_id == SDIO_SMEM) && (test_ctx->smem_pdev)) {
- platform_device_unregister(test_ctx->smem_pdev);
- test_ctx->smem_pdev = NULL;
- }
-
- test_ctx->test_ch_arr[ch_id]->ch_ready = 0;
- test_ctx->test_ch_arr[ch_id]->card_removed = 1;
-
- return 0;
-
-}
-
-static int sdio_test_channel_csvt_probe(struct platform_device *pdev)
-{
- int ret = 0;
-
- if (!pdev)
- return -ENODEV;
-
- test_ctx->csvt_app_pdev = platform_device_alloc("SDIO_CSVT_TEST_APP",
- -1);
- ret = platform_device_add(test_ctx->csvt_app_pdev);
- if (ret) {
- pr_err(MODULE_NAME ":platform_device_add failed, "
- "ret=%d\n", ret);
- return ret;
- }
-
- return sdio_test_channel_probe(pdev);
-}
-
-static int sdio_test_channel_csvt_remove(struct platform_device *pdev)
-{
- if (!pdev)
- return -ENODEV;
-
- platform_device_unregister(test_ctx->csvt_app_pdev);
-
- return sdio_test_channel_remove(pdev);
-}
-
-static struct platform_driver sdio_rpc_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_RPC_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_qmi_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_QMI_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_diag_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_DIAG_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_smem_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_SMEM_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_rmnt_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_RMNT_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_dun_drv = {
- .probe = sdio_test_channel_probe,
- .remove = sdio_test_channel_remove,
- .driver = {
- .name = "SDIO_DUN_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct platform_driver sdio_csvt_drv = {
- .probe = sdio_test_channel_csvt_probe,
- .remove = sdio_test_channel_csvt_remove,
- .driver = {
- .name = "SDIO_CSVT_TEST",
- .owner = THIS_MODULE,
- },
-};
-
-static struct class *test_class;
-
-const struct file_operations test_fops = {
- .owner = THIS_MODULE,
- .write = test_write,
-};
-
-/**
- * Module Init.
- */
-static int __init test_init(void)
-{
- int ret;
-
- pr_debug(TEST_MODULE_NAME ":test_init.\n");
-
- test_ctx = kzalloc(sizeof(struct test_context), GFP_KERNEL);
-
- if (test_ctx == NULL) {
- pr_err(TEST_MODULE_NAME ":kzalloc err.\n");
- return -ENOMEM;
- }
- test_ctx->test_ch = NULL;
- test_ctx->signature = TEST_SIGNATURE;
-
- test_ctx->name = "UNKNOWN";
-
- init_waitqueue_head(&test_ctx->wait_q);
-
-#ifdef CONFIG_DEBUG_FS
- sdio_al_test_debugfs_init();
-#endif
-
- test_class = class_create(THIS_MODULE, TEST_MODULE_NAME);
-
- ret = alloc_chrdev_region(&test_ctx->dev_num, 0, 1, TEST_MODULE_NAME);
- if (ret) {
- pr_err(TEST_MODULE_NAME "alloc_chrdev_region err.\n");
- return -ENODEV;
- }
-
- test_ctx->dev = device_create(test_class, NULL, test_ctx->dev_num,
- test_ctx, TEST_MODULE_NAME);
- if (IS_ERR(test_ctx->dev)) {
- pr_err(TEST_MODULE_NAME ":device_create err.\n");
- return -ENODEV;
- }
-
- test_ctx->cdev = cdev_alloc();
- if (test_ctx->cdev == NULL) {
- pr_err(TEST_MODULE_NAME ":cdev_alloc err.\n");
- return -ENODEV;
- }
- cdev_init(test_ctx->cdev, &test_fops);
- test_ctx->cdev->owner = THIS_MODULE;
-
- ret = cdev_add(test_ctx->cdev, test_ctx->dev_num, 1);
- if (ret)
- pr_err(TEST_MODULE_NAME ":cdev_add err=%d\n", -ret);
- else
- pr_debug(TEST_MODULE_NAME ":SDIO-AL-Test init OK..\n");
-
- platform_driver_register(&sdio_rpc_drv);
- platform_driver_register(&sdio_qmi_drv);
- platform_driver_register(&sdio_diag_drv);
- platform_driver_register(&sdio_smem_drv);
- platform_driver_register(&sdio_rmnt_drv);
- platform_driver_register(&sdio_dun_drv);
- platform_driver_register(&sdio_csvt_drv);
-
- return ret;
-}
-
-/**
- * Module Exit.
- */
-static void __exit test_exit(void)
-{
- int i;
-
- pr_debug(TEST_MODULE_NAME ":test_exit.\n");
-
- test_ctx->exit_flag = true;
-
- msleep(100); /* allow gracefully exit of the worker thread */
-
- cdev_del(test_ctx->cdev);
- device_destroy(test_class, test_ctx->dev_num);
- unregister_chrdev_region(test_ctx->dev_num, 1);
-
- platform_driver_unregister(&sdio_rpc_drv);
- platform_driver_unregister(&sdio_qmi_drv);
- platform_driver_unregister(&sdio_diag_drv);
- platform_driver_unregister(&sdio_smem_drv);
- platform_driver_unregister(&sdio_rmnt_drv);
- platform_driver_unregister(&sdio_dun_drv);
- platform_driver_unregister(&sdio_csvt_drv);
-
- for (i = 0; i < SDIO_MAX_CHANNELS; i++) {
- struct test_channel *tch = test_ctx->test_ch_arr[i];
- if (!tch)
- continue;
- kfree(tch->buf);
- kfree(tch);
- }
-
-#ifdef CONFIG_DEBUG_FS
- sdio_al_test_debugfs_cleanup();
-#endif
-
- kfree(test_ctx);
-
- pr_debug(TEST_MODULE_NAME ":test_exit complete.\n");
-}
-
-module_init(test_init);
-module_exit(test_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("SDIO_AL Test");
-MODULE_AUTHOR("Amir Samuelov <amirs@codeaurora.org>");
-
-
diff --git a/arch/arm/mach-msm/sdio_cmux.c b/arch/arm/mach-msm/sdio_cmux.c
deleted file mode 100644
index 48ca6b7..0000000
--- a/arch/arm/mach-msm/sdio_cmux.c
+++ /dev/null
@@ -1,901 +0,0 @@
-/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#define DEBUG
-
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/mutex.h>
-#include <linux/uaccess.h>
-#include <linux/workqueue.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/termios.h>
-#include <linux/debugfs.h>
-#include <linux/moduleparam.h>
-
-#include <mach/sdio_al.h>
-#include <mach/sdio_cmux.h>
-
-#include "modem_notifier.h"
-
-#define MAX_WRITE_RETRY 5
-#define MAGIC_NO_V1 0x33FC
-
-static int msm_sdio_cmux_debug_mask;
-module_param_named(debug_mask, msm_sdio_cmux_debug_mask,
- int, S_IRUGO | S_IWUSR | S_IWGRP);
-
-enum cmd_type {
- DATA = 0,
- OPEN,
- CLOSE,
- STATUS,
- NUM_CMDS
-};
-
-#define DSR_POS 0x1
-#define CTS_POS 0x2
-#define RI_POS 0x4
-#define CD_POS 0x8
-
-struct sdio_cmux_ch {
- int lc_id;
-
- struct mutex lc_lock;
- wait_queue_head_t open_wait_queue;
- int is_remote_open;
- int is_local_open;
- int is_channel_reset;
-
- char local_status;
- char remote_status;
-
- struct mutex tx_lock;
- struct list_head tx_list;
-
- void *priv;
- struct mutex rx_cb_lock;
- void (*receive_cb)(void *, int, void *);
- void (*write_done)(void *, int, void *);
- void (*status_callback)(int, void *);
-} logical_ch[SDIO_CMUX_NUM_CHANNELS];
-
-struct sdio_cmux_hdr {
- uint16_t magic_no;
- uint8_t status; /* This field is reserved for commands other
- * than STATUS */
- uint8_t cmd;
- uint8_t pad_bytes;
- uint8_t lc_id;
- uint16_t pkt_len;
-};
-
-struct sdio_cmux_pkt {
- struct sdio_cmux_hdr *hdr;
- void *data;
-};
-
-struct sdio_cmux_list_elem {
- struct list_head list;
- struct sdio_cmux_pkt cmux_pkt;
-};
-
-#define logical_ch_is_local_open(x) \
- (logical_ch[(x)].is_local_open)
-
-#define logical_ch_is_remote_open(x) \
- (logical_ch[(x)].is_remote_open)
-
-static void sdio_cdemux_fn(struct work_struct *work);
-static DECLARE_WORK(sdio_cdemux_work, sdio_cdemux_fn);
-static struct workqueue_struct *sdio_cdemux_wq;
-
-static DEFINE_MUTEX(write_lock);
-static uint32_t bytes_to_write;
-static DEFINE_MUTEX(temp_rx_lock);
-static LIST_HEAD(temp_rx_list);
-
-static void sdio_cmux_fn(struct work_struct *work);
-static DECLARE_WORK(sdio_cmux_work, sdio_cmux_fn);
-static struct workqueue_struct *sdio_cmux_wq;
-
-static struct sdio_channel *sdio_qmi_chl;
-static uint32_t sdio_cmux_inited;
-
-static uint32_t abort_tx;
-static DEFINE_MUTEX(modem_reset_lock);
-
-static DEFINE_MUTEX(probe_lock);
-
-enum {
- MSM_SDIO_CMUX_DEBUG = 1U << 0,
- MSM_SDIO_CMUX_DUMP_BUFFER = 1U << 1,
-};
-
-static struct platform_device sdio_ctl_dev = {
- .name = "SDIO_CTL",
- .id = -1,
-};
-
-#if defined(DEBUG)
-#define D_DUMP_BUFFER(prestr, cnt, buf) \
-do { \
- if (msm_sdio_cmux_debug_mask & MSM_SDIO_CMUX_DUMP_BUFFER) { \
- int i; \
- pr_debug("%s", prestr); \
- for (i = 0; i < cnt; i++) \
- pr_info("%.2x", buf[i]); \
- pr_debug("\n"); \
- } \
-} while (0)
-
-#define D(x...) \
-do { \
- if (msm_sdio_cmux_debug_mask & MSM_SDIO_CMUX_DEBUG) \
- pr_debug(x); \
-} while (0)
-
-#else
-#define D_DUMP_BUFFER(prestr, cnt, buf) do {} while (0)
-#define D(x...) do {} while (0)
-#endif
-
-static int sdio_cmux_ch_alloc(int id)
-{
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid lc_id - %d\n", __func__, id);
- return -EINVAL;
- }
-
- logical_ch[id].lc_id = id;
- mutex_init(&logical_ch[id].lc_lock);
- init_waitqueue_head(&logical_ch[id].open_wait_queue);
- logical_ch[id].is_remote_open = 0;
- logical_ch[id].is_local_open = 0;
- logical_ch[id].is_channel_reset = 0;
-
- INIT_LIST_HEAD(&logical_ch[id].tx_list);
- mutex_init(&logical_ch[id].tx_lock);
-
- logical_ch[id].priv = NULL;
- mutex_init(&logical_ch[id].rx_cb_lock);
- logical_ch[id].receive_cb = NULL;
- logical_ch[id].write_done = NULL;
- return 0;
-}
-
-static int sdio_cmux_ch_clear_and_signal(int id)
-{
- struct sdio_cmux_list_elem *list_elem;
-
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid lc_id - %d\n", __func__, id);
- return -EINVAL;
- }
-
- mutex_lock(&logical_ch[id].lc_lock);
- logical_ch[id].is_remote_open = 0;
- mutex_lock(&logical_ch[id].tx_lock);
- while (!list_empty(&logical_ch[id].tx_list)) {
- list_elem = list_first_entry(&logical_ch[id].tx_list,
- struct sdio_cmux_list_elem,
- list);
- list_del(&list_elem->list);
- kfree(list_elem->cmux_pkt.hdr);
- kfree(list_elem);
- }
- mutex_unlock(&logical_ch[id].tx_lock);
- mutex_lock(&logical_ch[id].rx_cb_lock);
- if (logical_ch[id].receive_cb)
- logical_ch[id].receive_cb(NULL, 0, logical_ch[id].priv);
- mutex_unlock(&logical_ch[id].rx_cb_lock);
- if (logical_ch[id].write_done)
- logical_ch[id].write_done(NULL, 0, logical_ch[id].priv);
- mutex_unlock(&logical_ch[id].lc_lock);
- wake_up(&logical_ch[id].open_wait_queue);
- return 0;
-}
-
-static int sdio_cmux_write_cmd(const int id, enum cmd_type type)
-{
- int write_size = 0;
- void *write_data = NULL;
- struct sdio_cmux_list_elem *list_elem;
-
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid lc_id - %d\n", __func__, id);
- return -EINVAL;
- }
-
- if (type < 0 || type > NUM_CMDS) {
- pr_err("%s: Invalid cmd - %d\n", __func__, type);
- return -EINVAL;
- }
-
- write_size = sizeof(struct sdio_cmux_hdr);
- list_elem = kmalloc(sizeof(struct sdio_cmux_list_elem), GFP_KERNEL);
- if (!list_elem) {
- pr_err("%s: list_elem alloc failed\n", __func__);
- return -ENOMEM;
- }
-
- write_data = kmalloc(write_size, GFP_KERNEL);
- if (!write_data) {
- pr_err("%s: write_data alloc failed\n", __func__);
- kfree(list_elem);
- return -ENOMEM;
- }
-
- list_elem->cmux_pkt.hdr = (struct sdio_cmux_hdr *)write_data;
- list_elem->cmux_pkt.data = NULL;
-
- list_elem->cmux_pkt.hdr->lc_id = (uint8_t)id;
- list_elem->cmux_pkt.hdr->pkt_len = (uint16_t)0;
- list_elem->cmux_pkt.hdr->cmd = (uint8_t)type;
- list_elem->cmux_pkt.hdr->status = (uint8_t)0;
- if (type == STATUS)
- list_elem->cmux_pkt.hdr->status = logical_ch[id].local_status;
- list_elem->cmux_pkt.hdr->pad_bytes = (uint8_t)0;
- list_elem->cmux_pkt.hdr->magic_no = (uint16_t)MAGIC_NO_V1;
-
- mutex_lock(&logical_ch[id].tx_lock);
- list_add_tail(&list_elem->list, &logical_ch[id].tx_list);
- mutex_unlock(&logical_ch[id].tx_lock);
-
- mutex_lock(&write_lock);
- bytes_to_write += write_size;
- mutex_unlock(&write_lock);
- queue_work(sdio_cmux_wq, &sdio_cmux_work);
-
- return 0;
-}
-
-int sdio_cmux_open(const int id,
- void (*receive_cb)(void *, int, void *),
- void (*write_done)(void *, int, void *),
- void (*status_callback)(int, void *),
- void *priv)
-{
- int r;
- struct sdio_cmux_list_elem *list_elem, *list_elem_tmp;
-
- if (!sdio_cmux_inited)
- return -ENODEV;
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid id - %d\n", __func__, id);
- return -EINVAL;
- }
-
- r = wait_event_timeout(logical_ch[id].open_wait_queue,
- logical_ch[id].is_remote_open, (1 * HZ));
- if (r < 0) {
- pr_err("ERROR %s: wait_event_timeout() failed for"
- " ch%d with rc %d\n", __func__, id, r);
- return r;
- }
- if (r == 0) {
- pr_err("ERROR %s: Wait Timed Out for ch%d\n", __func__, id);
- return -ETIMEDOUT;
- }
-
- mutex_lock(&logical_ch[id].lc_lock);
- if (!logical_ch[id].is_remote_open) {
- pr_err("%s: Remote ch%d not opened\n", __func__, id);
- mutex_unlock(&logical_ch[id].lc_lock);
- return -EINVAL;
- }
- if (logical_ch[id].is_local_open) {
- mutex_unlock(&logical_ch[id].lc_lock);
- return 0;
- }
- logical_ch[id].is_local_open = 1;
- logical_ch[id].priv = priv;
- logical_ch[id].write_done = write_done;
- logical_ch[id].status_callback = status_callback;
- mutex_lock(&logical_ch[id].rx_cb_lock);
- logical_ch[id].receive_cb = receive_cb;
- if (logical_ch[id].receive_cb) {
- mutex_lock(&temp_rx_lock);
- list_for_each_entry_safe(list_elem, list_elem_tmp,
- &temp_rx_list, list) {
- if ((int)list_elem->cmux_pkt.hdr->lc_id == id) {
- logical_ch[id].receive_cb(
- list_elem->cmux_pkt.data,
- (int)list_elem->cmux_pkt.hdr->pkt_len,
- logical_ch[id].priv);
- list_del(&list_elem->list);
- kfree(list_elem->cmux_pkt.hdr);
- kfree(list_elem);
- }
- }
- mutex_unlock(&temp_rx_lock);
- }
- mutex_unlock(&logical_ch[id].rx_cb_lock);
- mutex_unlock(&logical_ch[id].lc_lock);
- sdio_cmux_write_cmd(id, OPEN);
- return 0;
-}
-EXPORT_SYMBOL(sdio_cmux_open);
-
-int sdio_cmux_close(int id)
-{
- struct sdio_cmux_ch *ch;
-
- if (!sdio_cmux_inited)
- return -ENODEV;
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid channel close\n", __func__);
- return -EINVAL;
- }
-
- ch = &logical_ch[id];
- mutex_lock(&ch->lc_lock);
- mutex_lock(&logical_ch[id].rx_cb_lock);
- ch->receive_cb = NULL;
- mutex_unlock(&logical_ch[id].rx_cb_lock);
- mutex_lock(&ch->tx_lock);
- ch->write_done = NULL;
- mutex_unlock(&ch->tx_lock);
- ch->is_local_open = 0;
- ch->priv = NULL;
- mutex_unlock(&ch->lc_lock);
- sdio_cmux_write_cmd(ch->lc_id, CLOSE);
- return 0;
-}
-EXPORT_SYMBOL(sdio_cmux_close);
-
-int sdio_cmux_write_avail(int id)
-{
- int write_avail;
-
- mutex_lock(&logical_ch[id].lc_lock);
- if (logical_ch[id].is_channel_reset) {
- mutex_unlock(&logical_ch[id].lc_lock);
- return -ENETRESET;
- }
- mutex_unlock(&logical_ch[id].lc_lock);
- write_avail = sdio_write_avail(sdio_qmi_chl);
- return write_avail - bytes_to_write;
-}
-EXPORT_SYMBOL(sdio_cmux_write_avail);
-
-int sdio_cmux_write(int id, void *data, int len)
-{
- struct sdio_cmux_list_elem *list_elem;
- uint32_t write_size;
- void *write_data = NULL;
- struct sdio_cmux_ch *ch;
- int ret;
-
- if (!sdio_cmux_inited)
- return -ENODEV;
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS) {
- pr_err("%s: Invalid channel id %d\n", __func__, id);
- return -ENODEV;
- }
-
- ch = &logical_ch[id];
- if (len <= 0) {
- pr_err("%s: Invalid len %d bytes to write\n",
- __func__, len);
- return -EINVAL;
- }
-
- write_size = sizeof(struct sdio_cmux_hdr) + len;
- list_elem = kmalloc(sizeof(struct sdio_cmux_list_elem), GFP_KERNEL);
- if (!list_elem) {
- pr_err("%s: list_elem alloc failed\n", __func__);
- return -ENOMEM;
- }
-
- write_data = kmalloc(write_size, GFP_KERNEL);
- if (!write_data) {
- pr_err("%s: write_data alloc failed\n", __func__);
- kfree(list_elem);
- return -ENOMEM;
- }
-
- list_elem->cmux_pkt.hdr = (struct sdio_cmux_hdr *)write_data;
- list_elem->cmux_pkt.data = (void *)((char *)write_data +
- sizeof(struct sdio_cmux_hdr));
- memcpy(list_elem->cmux_pkt.data, data, len);
-
- list_elem->cmux_pkt.hdr->lc_id = (uint8_t)ch->lc_id;
- list_elem->cmux_pkt.hdr->pkt_len = (uint16_t)len;
- list_elem->cmux_pkt.hdr->cmd = (uint8_t)DATA;
- list_elem->cmux_pkt.hdr->status = (uint8_t)0;
- list_elem->cmux_pkt.hdr->pad_bytes = (uint8_t)0;
- list_elem->cmux_pkt.hdr->magic_no = (uint16_t)MAGIC_NO_V1;
-
- mutex_lock(&ch->lc_lock);
- if (!ch->is_remote_open || !ch->is_local_open) {
- pr_err("%s: Local ch%d sending data before sending/receiving"
- " OPEN command\n", __func__, ch->lc_id);
- if (ch->is_channel_reset)
- ret = -ENETRESET;
- else
- ret = -ENODEV;
- mutex_unlock(&ch->lc_lock);
- kfree(write_data);
- kfree(list_elem);
- return ret;
- }
- mutex_lock(&ch->tx_lock);
- list_add_tail(&list_elem->list, &ch->tx_list);
- mutex_unlock(&ch->tx_lock);
- mutex_unlock(&ch->lc_lock);
-
- mutex_lock(&write_lock);
- bytes_to_write += write_size;
- mutex_unlock(&write_lock);
- queue_work(sdio_cmux_wq, &sdio_cmux_work);
-
- return len;
-}
-EXPORT_SYMBOL(sdio_cmux_write);
-
-int is_remote_open(int id)
-{
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS)
- return -ENODEV;
-
- return logical_ch_is_remote_open(id);
-}
-EXPORT_SYMBOL(is_remote_open);
-
-int sdio_cmux_is_channel_reset(int id)
-{
- int ret;
- if (id < 0 || id >= SDIO_CMUX_NUM_CHANNELS)
- return -ENODEV;
-
- mutex_lock(&logical_ch[id].lc_lock);
- ret = logical_ch[id].is_channel_reset;
- mutex_unlock(&logical_ch[id].lc_lock);
- return ret;
-}
-EXPORT_SYMBOL(sdio_cmux_is_channel_reset);
-
-int sdio_cmux_tiocmget(int id)
-{
- int ret = (logical_ch[id].remote_status & DSR_POS ? TIOCM_DSR : 0) |
- (logical_ch[id].remote_status & CTS_POS ? TIOCM_CTS : 0) |
- (logical_ch[id].remote_status & CD_POS ? TIOCM_CD : 0) |
- (logical_ch[id].remote_status & RI_POS ? TIOCM_RI : 0) |
- (logical_ch[id].local_status & CTS_POS ? TIOCM_RTS : 0) |
- (logical_ch[id].local_status & DSR_POS ? TIOCM_DTR : 0);
- return ret;
-}
-EXPORT_SYMBOL(sdio_cmux_tiocmget);
-
-int sdio_cmux_tiocmset(int id, unsigned int set, unsigned int clear)
-{
- if (set & TIOCM_DTR)
- logical_ch[id].local_status |= DSR_POS;
-
- if (set & TIOCM_RTS)
- logical_ch[id].local_status |= CTS_POS;
-
- if (clear & TIOCM_DTR)
- logical_ch[id].local_status &= ~DSR_POS;
-
- if (clear & TIOCM_RTS)
- logical_ch[id].local_status &= ~CTS_POS;
-
- sdio_cmux_write_cmd(id, STATUS);
- return 0;
-}
-EXPORT_SYMBOL(sdio_cmux_tiocmset);
-
-static int copy_packet(void *pkt, int size)
-{
- struct sdio_cmux_list_elem *list_elem = NULL;
- void *temp_pkt = NULL;
-
- list_elem = kmalloc(sizeof(struct sdio_cmux_list_elem), GFP_KERNEL);
- if (!list_elem) {
- pr_err("%s: list_elem alloc failed\n", __func__);
- return -ENOMEM;
- }
- temp_pkt = kmalloc(size, GFP_KERNEL);
- if (!temp_pkt) {
- pr_err("%s: temp_pkt alloc failed\n", __func__);
- kfree(list_elem);
- return -ENOMEM;
- }
-
- memcpy(temp_pkt, pkt, size);
- list_elem->cmux_pkt.hdr = temp_pkt;
- list_elem->cmux_pkt.data = (void *)((char *)temp_pkt +
- sizeof(struct sdio_cmux_hdr));
- mutex_lock(&temp_rx_lock);
- list_add_tail(&list_elem->list, &temp_rx_list);
- mutex_unlock(&temp_rx_lock);
- return 0;
-}
-
-static int process_cmux_pkt(void *pkt, int size)
-{
- struct sdio_cmux_hdr *mux_hdr;
- uint32_t id, data_size;
- void *data;
- char *dump_buf = (char *)pkt;
-
- D_DUMP_BUFFER("process_cmux_pkt:", size, dump_buf);
- mux_hdr = (struct sdio_cmux_hdr *)pkt;
- switch (mux_hdr->cmd) {
- case OPEN:
- id = (uint32_t)(mux_hdr->lc_id);
- D("%s: Received OPEN command for ch%d\n", __func__, id);
- mutex_lock(&logical_ch[id].lc_lock);
- logical_ch[id].is_remote_open = 1;
- if (logical_ch[id].is_channel_reset) {
- sdio_cmux_write_cmd(id, OPEN);
- logical_ch[id].is_channel_reset = 0;
- }
- mutex_unlock(&logical_ch[id].lc_lock);
- wake_up(&logical_ch[id].open_wait_queue);
- break;
-
- case CLOSE:
- id = (uint32_t)(mux_hdr->lc_id);
- D("%s: Received CLOSE command for ch%d\n", __func__, id);
- sdio_cmux_ch_clear_and_signal(id);
- break;
-
- case DATA:
- id = (uint32_t)(mux_hdr->lc_id);
- D("%s: Received DATA for ch%d\n", __func__, id);
- /*Channel is not locally open & if single packet received
- then drop it*/
- mutex_lock(&logical_ch[id].lc_lock);
- if (!logical_ch[id].is_remote_open) {
- mutex_unlock(&logical_ch[id].lc_lock);
- pr_err("%s: Remote Ch%d sent data before sending/"
- "receiving OPEN command\n", __func__, id);
- return -ENODEV;
- }
-
- data = (void *)((char *)pkt + sizeof(struct sdio_cmux_hdr));
- data_size = (int)(((struct sdio_cmux_hdr *)pkt)->pkt_len);
- mutex_unlock(&logical_ch[id].lc_lock);
- /*
- * The lc_lock is released before the call to receive_cb
- * to avoid a dead lock where in the receive_cb would call a
- * function that tries to acquire a rx_lock which is already
- * acquired by a Thread that is waiting on lc_lock.
- */
- mutex_lock(&logical_ch[id].rx_cb_lock);
- if (logical_ch[id].receive_cb)
- logical_ch[id].receive_cb(data, data_size,
- logical_ch[id].priv);
- else
- copy_packet(pkt, size);
- mutex_unlock(&logical_ch[id].rx_cb_lock);
- break;
-
- case STATUS:
- id = (uint32_t)(mux_hdr->lc_id);
- D("%s: Received STATUS command for ch%d\n", __func__, id);
- if (logical_ch[id].remote_status != mux_hdr->status) {
- mutex_lock(&logical_ch[id].lc_lock);
- logical_ch[id].remote_status = mux_hdr->status;
- mutex_unlock(&logical_ch[id].lc_lock);
- if (logical_ch[id].status_callback)
- logical_ch[id].status_callback(
- sdio_cmux_tiocmget(id),
- logical_ch[id].priv);
- }
- break;
- }
- return 0;
-}
-
-static void parse_cmux_data(void *data, int size)
-{
- int data_parsed = 0, pkt_size;
- char *temp_ptr;
-
- D("Entered %s\n", __func__);
- temp_ptr = (char *)data;
- while (data_parsed < size) {
- pkt_size = sizeof(struct sdio_cmux_hdr) +
- (int)(((struct sdio_cmux_hdr *)temp_ptr)->pkt_len);
- D("Parsed %d bytes, Current Pkt Size %d bytes,"
- " Total size %d bytes\n", data_parsed, pkt_size, size);
- process_cmux_pkt((void *)temp_ptr, pkt_size);
- data_parsed += pkt_size;
- temp_ptr += pkt_size;
- }
-
- kfree(data);
-}
-
-static void sdio_cdemux_fn(struct work_struct *work)
-{
- int r = 0, read_avail = 0;
- void *cmux_data;
-
- while (1) {
- read_avail = sdio_read_avail(sdio_qmi_chl);
- if (read_avail < 0) {
- pr_err("%s: sdio_read_avail failed with rc %d\n",
- __func__, read_avail);
- return;
- }
-
- if (read_avail == 0) {
- D("%s: Nothing to read\n", __func__);
- return;
- }
-
- D("%s: kmalloc %d bytes\n", __func__, read_avail);
- cmux_data = kmalloc(read_avail, GFP_KERNEL);
- if (!cmux_data) {
- pr_err("%s: kmalloc Failed\n", __func__);
- return;
- }
-
- D("%s: sdio_read %d bytes\n", __func__, read_avail);
- r = sdio_read(sdio_qmi_chl, cmux_data, read_avail);
- if (r < 0) {
- pr_err("%s: sdio_read failed with rc %d\n",
- __func__, r);
- kfree(cmux_data);
- return;
- }
-
- parse_cmux_data(cmux_data, read_avail);
- }
- return;
-}
-
-static void sdio_cmux_fn(struct work_struct *work)
-{
- int i, r = 0;
- void *write_data;
- uint32_t write_size, write_avail, write_retry = 0;
- int bytes_written;
- struct sdio_cmux_list_elem *list_elem = NULL;
- struct sdio_cmux_ch *ch;
-
- for (i = 0; i < SDIO_CMUX_NUM_CHANNELS; ++i) {
- ch = &logical_ch[i];
- bytes_written = 0;
- mutex_lock(&ch->tx_lock);
- while (!list_empty(&ch->tx_list)) {
- list_elem = list_first_entry(&ch->tx_list,
- struct sdio_cmux_list_elem,
- list);
- list_del(&list_elem->list);
- mutex_unlock(&ch->tx_lock);
-
- write_data = (void *)list_elem->cmux_pkt.hdr;
- write_size = sizeof(struct sdio_cmux_hdr) +
- (uint32_t)list_elem->cmux_pkt.hdr->pkt_len;
-
- mutex_lock(&modem_reset_lock);
- while (!(abort_tx) &&
- ((write_avail = sdio_write_avail(sdio_qmi_chl))
- < write_size)) {
- mutex_unlock(&modem_reset_lock);
- pr_err("%s: sdio_write_avail %d bytes, "
- "write size %d bytes. Waiting...\n",
- __func__, write_avail, write_size);
- msleep(250);
- mutex_lock(&modem_reset_lock);
- }
- while (!(abort_tx) &&
- ((r = sdio_write(sdio_qmi_chl,
- write_data, write_size)) < 0)
- && (r != -ENODEV)
- && (write_retry++ < MAX_WRITE_RETRY)) {
- mutex_unlock(&modem_reset_lock);
- pr_err("%s: sdio_write failed with rc %d."
- "Retrying...", __func__, r);
- msleep(250);
- mutex_lock(&modem_reset_lock);
- }
- if (!r && !abort_tx) {
- D("%s: sdio_write_completed %dbytes\n",
- __func__, write_size);
- bytes_written += write_size;
- } else if (r == -ENODEV) {
- pr_err("%s: aborting_tx because sdio_write"
- " returned %d\n", __func__, r);
- r = 0;
- abort_tx = 1;
- }
- mutex_unlock(&modem_reset_lock);
- kfree(list_elem->cmux_pkt.hdr);
- kfree(list_elem);
- mutex_lock(&write_lock);
- bytes_to_write -= write_size;
- mutex_unlock(&write_lock);
- mutex_lock(&ch->tx_lock);
- }
- if (ch->write_done)
- ch->write_done(NULL, bytes_written, ch->priv);
- mutex_unlock(&ch->tx_lock);
- }
- return;
-}
-
-static void sdio_qmi_chl_notify(void *priv, unsigned event)
-{
- if (event == SDIO_EVENT_DATA_READ_AVAIL) {
- D("%s: Received SDIO_EVENT_DATA_READ_AVAIL\n", __func__);
- queue_work(sdio_cdemux_wq, &sdio_cdemux_work);
- }
-}
-
-#ifdef CONFIG_DEBUG_FS
-
-static int debug_tbl(char *buf, int max)
-{
- int i = 0;
- int j;
-
- for (j = 0; j < SDIO_CMUX_NUM_CHANNELS; ++j) {
- i += scnprintf(buf + i, max - i,
- "ch%02d local open=%s remote open=%s\n",
- j, logical_ch_is_local_open(j) ? "Y" : "N",
- logical_ch_is_remote_open(j) ? "Y" : "N");
- }
-
- return i;
-}
-
-#define DEBUG_BUFMAX 4096
-static char debug_buffer[DEBUG_BUFMAX];
-
-static ssize_t debug_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
-{
- int (*fill)(char *buf, int max) = file->private_data;
- int bsize = fill(debug_buffer, DEBUG_BUFMAX);
- return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize);
-}
-
-static int debug_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- return 0;
-}
-
-
-static const struct file_operations debug_ops = {
- .read = debug_read,
- .open = debug_open,
-};
-
-static void debug_create(const char *name, mode_t mode,
- struct dentry *dent,
- int (*fill)(char *buf, int max))
-{
- debugfs_create_file(name, mode, dent, fill, &debug_ops);
-}
-
-#endif
-
-static int sdio_cmux_probe(struct platform_device *pdev)
-{
- int i, r;
-
- mutex_lock(&probe_lock);
- D("%s Begins\n", __func__);
- if (sdio_cmux_inited) {
- mutex_lock(&modem_reset_lock);
- r = sdio_open("SDIO_QMI", &sdio_qmi_chl, NULL,
- sdio_qmi_chl_notify);
- if (r < 0) {
- mutex_unlock(&modem_reset_lock);
- pr_err("%s: sdio_open() failed\n", __func__);
- goto error0;
- }
- abort_tx = 0;
- mutex_unlock(&modem_reset_lock);
- mutex_unlock(&probe_lock);
- return 0;
- }
-
- for (i = 0; i < SDIO_CMUX_NUM_CHANNELS; ++i)
- sdio_cmux_ch_alloc(i);
- INIT_LIST_HEAD(&temp_rx_list);
-
- sdio_cmux_wq = create_singlethread_workqueue("sdio_cmux");
- if (IS_ERR(sdio_cmux_wq)) {
- pr_err("%s: create_singlethread_workqueue() ENOMEM\n",
- __func__);
- r = -ENOMEM;
- goto error0;
- }
-
- sdio_cdemux_wq = create_singlethread_workqueue("sdio_cdemux");
- if (IS_ERR(sdio_cdemux_wq)) {
- pr_err("%s: create_singlethread_workqueue() ENOMEM\n",
- __func__);
- r = -ENOMEM;
- goto error1;
- }
-
- r = sdio_open("SDIO_QMI", &sdio_qmi_chl, NULL, sdio_qmi_chl_notify);
- if (r < 0) {
- pr_err("%s: sdio_open() failed\n", __func__);
- goto error2;
- }
-
- platform_device_register(&sdio_ctl_dev);
- sdio_cmux_inited = 1;
- D("SDIO Control MUX Driver Initialized.\n");
- mutex_unlock(&probe_lock);
- return 0;
-
-error2:
- destroy_workqueue(sdio_cdemux_wq);
-error1:
- destroy_workqueue(sdio_cmux_wq);
-error0:
- mutex_unlock(&probe_lock);
- return r;
-}
-
-static int sdio_cmux_remove(struct platform_device *pdev)
-{
- int i;
-
- mutex_lock(&modem_reset_lock);
- abort_tx = 1;
-
- for (i = 0; i < SDIO_CMUX_NUM_CHANNELS; ++i) {
- mutex_lock(&logical_ch[i].lc_lock);
- logical_ch[i].is_channel_reset = 1;
- mutex_unlock(&logical_ch[i].lc_lock);
- sdio_cmux_ch_clear_and_signal(i);
- }
- sdio_qmi_chl = NULL;
- mutex_unlock(&modem_reset_lock);
-
- return 0;
-}
-
-static struct platform_driver sdio_cmux_driver = {
- .probe = sdio_cmux_probe,
- .remove = sdio_cmux_remove,
- .driver = {
- .name = "SDIO_QMI",
- .owner = THIS_MODULE,
- },
-};
-
-static int __init sdio_cmux_init(void)
-{
-#ifdef CONFIG_DEBUG_FS
- struct dentry *dent;
-
- dent = debugfs_create_dir("sdio_cmux", 0);
- if (!IS_ERR(dent))
- debug_create("tbl", 0444, dent, debug_tbl);
-#endif
-
- msm_sdio_cmux_debug_mask = 0;
- return platform_driver_register(&sdio_cmux_driver);
-}
-
-module_init(sdio_cmux_init);
-MODULE_DESCRIPTION("MSM SDIO Control MUX");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/sdio_ctl.c b/arch/arm/mach-msm/sdio_ctl.c
deleted file mode 100644
index cacdce9..0000000
--- a/arch/arm/mach-msm/sdio_ctl.c
+++ /dev/null
@@ -1,575 +0,0 @@
-/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * SDIO Control Driver -- Provides a binary SDIO muxed control port
- * interface.
- */
-
-#include <linux/cdev.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/device.h>
-#include <linux/delay.h>
-#include <linux/sched.h>
-#include <linux/spinlock.h>
-#include <linux/mutex.h>
-#include <linux/uaccess.h>
-#include <linux/workqueue.h>
-#include <linux/poll.h>
-#include <asm/ioctls.h>
-#include <linux/platform_device.h>
-#include <mach/msm_smd.h>
-#include <mach/sdio_al.h>
-#include <mach/sdio_cmux.h>
-#include "modem_notifier.h"
-#include <linux/slab.h>
-
-#define MAX_WRITE_RETRY 5
-#define MAGIC_NO_V1 0x33FC
-#define NUM_SDIO_CTL_PORTS 10
-#define DEVICE_NAME "sdioctl"
-#define MAX_BUF_SIZE 2048
-#define DEBUG
-
-static int msm_sdio_ctl_debug_mask;
-module_param_named(debug_mask, msm_sdio_ctl_debug_mask,
- int, S_IRUGO | S_IWUSR | S_IWGRP);
-
-struct sdio_ctl_dev {
- int id;
- char name[9];
- struct cdev cdev;
- struct device *devicep;
- struct mutex dev_lock;
- int ref_count;
-
- struct mutex rx_lock;
- uint32_t read_avail;
- struct list_head rx_list;
-
- wait_queue_head_t read_wait_queue;
- wait_queue_head_t write_wait_queue;
-} *sdio_ctl_devp[NUM_SDIO_CTL_PORTS];
-
-struct sdio_ctl_pkt {
- int data_size;
- void *data;
-};
-
-struct sdio_ctl_list_elem {
- struct list_head list;
- struct sdio_ctl_pkt ctl_pkt;
-};
-
-struct class *sdio_ctl_classp;
-static dev_t sdio_ctl_number;
-static uint32_t sdio_ctl_inited;
-
-enum {
- MSM_SDIO_CTL_DEBUG = 1U << 0,
- MSM_SDIO_CTL_DUMP_BUFFER = 1U << 1,
-};
-
-#if defined(DEBUG)
-#define D_DUMP_BUFFER(prestr, cnt, buf) \
-do { \
- if (msm_sdio_ctl_debug_mask & MSM_SDIO_CTL_DUMP_BUFFER) { \
- int i; \
- pr_info("%s", prestr); \
- for (i = 0; i < cnt; i++) \
- pr_info("%.2x", buf[i]); \
- pr_info("\n"); \
- } \
-} while (0)
-
-#define D(x...) \
-do { \
- if (msm_sdio_ctl_debug_mask & MSM_SDIO_CTL_DEBUG) \
- pr_info(x); \
-} while (0)
-
-#else
-#define D_DUMP_BUFFER(prestr, cnt, buf) do {} while (0)
-#define D(x...) do {} while (0)
-#endif
-
-static uint32_t cmux_ch_id[] = {
- SDIO_CMUX_DATA_CTL_0,
- SDIO_CMUX_DATA_CTL_1,
- SDIO_CMUX_DATA_CTL_2,
- SDIO_CMUX_DATA_CTL_3,
- SDIO_CMUX_DATA_CTL_4,
- SDIO_CMUX_DATA_CTL_5,
- SDIO_CMUX_DATA_CTL_6,
- SDIO_CMUX_DATA_CTL_7,
- SDIO_CMUX_USB_CTL_0,
- SDIO_CMUX_CSVT_CTL_0
-};
-
-static int get_ctl_dev_index(int id)
-{
- int dev_index;
- for (dev_index = 0; dev_index < NUM_SDIO_CTL_PORTS; dev_index++) {
- if (cmux_ch_id[dev_index] == id)
- return dev_index;
- }
- return -ENODEV;
-}
-
-static void sdio_ctl_receive_cb(void *data, int size, void *priv)
-{
- struct sdio_ctl_list_elem *list_elem = NULL;
- int id = ((struct sdio_ctl_dev *)(priv))->id;
- int dev_index;
-
- if (id < 0 || id > cmux_ch_id[NUM_SDIO_CTL_PORTS - 1])
- return;
- dev_index = get_ctl_dev_index(id);
- if (dev_index < 0) {
- pr_err("%s: Ch%d is not exported to user-space\n",
- __func__, id);
- return;
- }
-
- if (!data || size <= 0) {
- wake_up(&sdio_ctl_devp[dev_index]->read_wait_queue);
- return;
- }
-
- list_elem = kmalloc(sizeof(struct sdio_ctl_list_elem), GFP_KERNEL);
- if (!list_elem) {
- pr_err("%s: list_elem alloc failed\n", __func__);
- return;
- }
-
- list_elem->ctl_pkt.data = kmalloc(size, GFP_KERNEL);
- if (!list_elem->ctl_pkt.data) {
- pr_err("%s: list_elem->data alloc failed\n", __func__);
- kfree(list_elem);
- return;
- }
- memcpy(list_elem->ctl_pkt.data, data, size);
- list_elem->ctl_pkt.data_size = size;
- mutex_lock(&sdio_ctl_devp[dev_index]->rx_lock);
- list_add_tail(&list_elem->list, &sdio_ctl_devp[dev_index]->rx_list);
- sdio_ctl_devp[dev_index]->read_avail += size;
- mutex_unlock(&sdio_ctl_devp[dev_index]->rx_lock);
- wake_up(&sdio_ctl_devp[dev_index]->read_wait_queue);
-}
-
-static void sdio_ctl_write_done(void *data, int size, void *priv)
-{
- int id = ((struct sdio_ctl_dev *)(priv))->id;
- int dev_index;
- if (id < 0 || id > cmux_ch_id[NUM_SDIO_CTL_PORTS - 1])
- return;
-
- dev_index = get_ctl_dev_index(id);
- if (dev_index < 0) {
- pr_err("%s: Ch%d is not exported to user-space\n",
- __func__, id);
- return;
- }
- wake_up(&sdio_ctl_devp[dev_index]->write_wait_queue);
-}
-
-static long sdio_ctl_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg)
-{
- int ret;
- struct sdio_ctl_dev *sdio_ctl_devp;
-
- sdio_ctl_devp = file->private_data;
- if (!sdio_ctl_devp)
- return -ENODEV;
-
- switch (cmd) {
- case TIOCMGET:
- ret = sdio_cmux_tiocmget(sdio_ctl_devp->id);
- break;
- case TIOCMSET:
- ret = sdio_cmux_tiocmset(sdio_ctl_devp->id, arg, ~arg);
- break;
- default:
- ret = -EINVAL;
- }
-
- return ret;
-}
-
-static unsigned int sdio_ctl_poll(struct file *file, poll_table *wait)
-{
- struct sdio_ctl_dev *sdio_ctl_devp;
- unsigned int mask = 0;
-
- sdio_ctl_devp = file->private_data;
- if (!sdio_ctl_devp) {
- pr_err("%s: on a NULL device\n", __func__);
- return POLLERR;
- }
-
- poll_wait(file, &sdio_ctl_devp->read_wait_queue, wait);
- mutex_lock(&sdio_ctl_devp->rx_lock);
- if (sdio_cmux_is_channel_reset(sdio_ctl_devp->id)) {
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- pr_err("%s notifying reset for sdio_ctl_dev id:%d\n",
- __func__, sdio_ctl_devp->id);
- return POLLERR;
- }
-
- if (sdio_ctl_devp->read_avail > 0)
- mask |= POLLIN | POLLRDNORM;
-
- mutex_unlock(&sdio_ctl_devp->rx_lock);
-
- return mask;
-}
-
-ssize_t sdio_ctl_read(struct file *file,
- char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int r = 0, id, bytes_to_read;
- struct sdio_ctl_dev *sdio_ctl_devp;
- struct sdio_ctl_list_elem *list_elem = NULL;
-
- sdio_ctl_devp = file->private_data;
-
- if (!sdio_ctl_devp)
- return -ENODEV;
-
- D("%s: read from ch%d\n", __func__, sdio_ctl_devp->id);
-
- id = sdio_ctl_devp->id;
- mutex_lock(&sdio_ctl_devp->rx_lock);
- while (sdio_ctl_devp->read_avail <= 0) {
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- r = wait_event_interruptible(sdio_ctl_devp->read_wait_queue,
- sdio_ctl_devp->read_avail > 0 ||
- !is_remote_open(id));
- if (sdio_cmux_is_channel_reset(id))
- return -ENETRESET;
-
- if (!is_remote_open(id))
- return -ENODEV;
-
- if (r < 0) {
- /* qualify error message */
- /* we get this anytime a signal comes in */
- if (r != -ERESTARTSYS)
- pr_err("ERROR:%s: wait_event_interruptible "
- "ret %i\n", __func__, r);
- return r;
- }
- mutex_lock(&sdio_ctl_devp->rx_lock);
- }
-
- if (list_empty(&sdio_ctl_devp->rx_list)) {
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- D("%s: Nothing in ch%d's rx_list\n", __func__,
- sdio_ctl_devp->id);
- return -EAGAIN;
- }
-
- list_elem = list_first_entry(&sdio_ctl_devp->rx_list,
- struct sdio_ctl_list_elem, list);
- bytes_to_read = (uint32_t)(list_elem->ctl_pkt.data_size);
- if (bytes_to_read > count) {
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- pr_err("%s: Packet size %d > buf size %d\n", __func__,
- bytes_to_read, count);
- return -ENOMEM;
- }
-
- if (copy_to_user(buf, list_elem->ctl_pkt.data, bytes_to_read)) {
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- pr_err("%s: copy_to_user failed for ch%d\n", __func__,
- sdio_ctl_devp->id);
- return -EFAULT;
- }
- sdio_ctl_devp->read_avail -= bytes_to_read;
- list_del(&list_elem->list);
- kfree(list_elem->ctl_pkt.data);
- kfree(list_elem);
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- D("%s: Returning %d bytes to ch%d\n", __func__,
- bytes_to_read, sdio_ctl_devp->id);
- return bytes_to_read;
-}
-
-
-ssize_t sdio_ctl_write(struct file *file,
- const char __user *buf,
- size_t count,
- loff_t *ppos)
-{
- int r = 0, id;
- char *temp_buf;
- struct sdio_ctl_dev *sdio_ctl_devp;
-
- if (count <= 0)
- return -EINVAL;
-
- sdio_ctl_devp = file->private_data;
- if (!sdio_ctl_devp)
- return -ENODEV;
-
- D("%s: writing %i bytes on ch%d\n",
- __func__, count, sdio_ctl_devp->id);
- id = sdio_ctl_devp->id;
- mutex_lock(&sdio_ctl_devp->dev_lock);
- while (sdio_cmux_write_avail(id) < count) {
- mutex_unlock(&sdio_ctl_devp->dev_lock);
- r = wait_event_interruptible(sdio_ctl_devp->write_wait_queue,
- sdio_cmux_write_avail(id) >= count
- || !is_remote_open(id));
-
- if (sdio_cmux_is_channel_reset(id))
- return -ENETRESET;
-
- if (!is_remote_open(id))
- return -ENODEV;
-
- if (r < 0) {
- /* qualify error message */
- /* we get this anytime a signal comes in */
- if (r != -ERESTARTSYS)
- pr_err("ERROR:%s: wait_event_interruptible "
- "ret %i\n", __func__, r);
- return r;
- }
- mutex_lock(&sdio_ctl_devp->dev_lock);
- }
-
- temp_buf = kmalloc(count, GFP_KERNEL);
- if (!temp_buf) {
- mutex_unlock(&sdio_ctl_devp->dev_lock);
- pr_err("%s: temp_buf alloc failed\n", __func__);
- return -ENOMEM;
- }
-
- if (copy_from_user(temp_buf, buf, count)) {
- mutex_unlock(&sdio_ctl_devp->dev_lock);
- pr_err("%s: copy_from_user failed\n", __func__);
- kfree(temp_buf);
- return -EFAULT;
- }
-
- r = sdio_cmux_write(id, (void *)temp_buf, count);
- kfree(temp_buf);
- mutex_unlock(&sdio_ctl_devp->dev_lock);
- return r;
-}
-
-
-int sdio_ctl_open(struct inode *inode, struct file *file)
-{
- int r = 0;
- struct sdio_ctl_dev *sdio_ctl_devp;
-
- if (!sdio_ctl_inited)
- return -EIO;
-
- sdio_ctl_devp = container_of(inode->i_cdev, struct sdio_ctl_dev, cdev);
-
- if (!sdio_ctl_devp)
- return -ENODEV;
-
- D("%s called on sdioctl%d device\n", __func__, sdio_ctl_devp->id);
- r = sdio_cmux_open(sdio_ctl_devp->id, sdio_ctl_receive_cb,
- sdio_ctl_write_done, NULL,
- sdio_ctl_devp);
- if (r < 0) {
- pr_err("ERROR %s: sdio_cmux_open failed with rc %d\n",
- __func__, r);
- return r;
- }
-
- mutex_lock(&sdio_ctl_devp->dev_lock);
- sdio_ctl_devp->ref_count++;
- mutex_unlock(&sdio_ctl_devp->dev_lock);
-
- file->private_data = sdio_ctl_devp;
- return 0;
-}
-
-int sdio_ctl_release(struct inode *inode, struct file *file)
-{
- struct sdio_ctl_dev *sdio_ctl_devp;
- struct sdio_ctl_list_elem *list_elem = NULL;
-
- sdio_ctl_devp = file->private_data;
- if (!sdio_ctl_devp)
- return -EINVAL;
-
- D("%s called on sdioctl%d device\n", __func__, sdio_ctl_devp->id);
-
- mutex_lock(&sdio_ctl_devp->dev_lock);
- if (sdio_ctl_devp->ref_count > 0) {
- sdio_ctl_devp->ref_count--;
- if (!sdio_ctl_devp->ref_count) {
- mutex_lock(&sdio_ctl_devp->rx_lock);
- while (!list_empty(&sdio_ctl_devp->rx_list)) {
- list_elem = list_first_entry(
- &sdio_ctl_devp->rx_list,
- struct sdio_ctl_list_elem,
- list);
- list_del(&list_elem->list);
- kfree(list_elem->ctl_pkt.data);
- kfree(list_elem);
- }
- sdio_ctl_devp->read_avail = 0;
- mutex_unlock(&sdio_ctl_devp->rx_lock);
- sdio_cmux_close(sdio_ctl_devp->id);
- }
- }
- mutex_unlock(&sdio_ctl_devp->dev_lock);
-
- file->private_data = NULL;
- return 0;
-}
-
-static const struct file_operations sdio_ctl_fops = {
- .owner = THIS_MODULE,
- .open = sdio_ctl_open,
- .release = sdio_ctl_release,
- .read = sdio_ctl_read,
- .write = sdio_ctl_write,
- .poll = sdio_ctl_poll,
- .unlocked_ioctl = sdio_ctl_ioctl,
-};
-
-static int sdio_ctl_probe(struct platform_device *pdev)
-{
- int i;
- int r;
-
- pr_info("%s Begins\n", __func__);
- for (i = 0; i < NUM_SDIO_CTL_PORTS; ++i) {
- sdio_ctl_devp[i] = kzalloc(sizeof(struct sdio_ctl_dev),
- GFP_KERNEL);
- if (IS_ERR(sdio_ctl_devp[i])) {
- pr_err("ERROR:%s kmalloc() ENOMEM\n", __func__);
- r = -ENOMEM;
- goto error0;
- }
-
- sdio_ctl_devp[i]->id = cmux_ch_id[i];
- sdio_ctl_devp[i]->ref_count = 0;
-
- mutex_init(&sdio_ctl_devp[i]->dev_lock);
- init_waitqueue_head(&sdio_ctl_devp[i]->read_wait_queue);
- init_waitqueue_head(&sdio_ctl_devp[i]->write_wait_queue);
- mutex_init(&sdio_ctl_devp[i]->rx_lock);
- INIT_LIST_HEAD(&sdio_ctl_devp[i]->rx_list);
- sdio_ctl_devp[i]->read_avail = 0;
- }
-
- r = alloc_chrdev_region(&sdio_ctl_number, 0, NUM_SDIO_CTL_PORTS,
- DEVICE_NAME);
- if (IS_ERR_VALUE(r)) {
- pr_err("ERROR:%s: alloc_chrdev_region() ret %i.\n",
- __func__, r);
- goto error0;
- }
-
- sdio_ctl_classp = class_create(THIS_MODULE, DEVICE_NAME);
- if (IS_ERR(sdio_ctl_classp)) {
- pr_err("ERROR:%s: class_create() ENOMEM\n", __func__);
- r = -ENOMEM;
- goto error1;
- }
-
- for (i = 0; i < NUM_SDIO_CTL_PORTS; ++i) {
- cdev_init(&sdio_ctl_devp[i]->cdev, &sdio_ctl_fops);
- sdio_ctl_devp[i]->cdev.owner = THIS_MODULE;
-
- r = cdev_add(&sdio_ctl_devp[i]->cdev, (sdio_ctl_number + i),
- 1);
-
- if (IS_ERR_VALUE(r)) {
- pr_err("%s: cdev_add() ret %i\n", __func__, r);
- kfree(sdio_ctl_devp[i]);
- goto error2;
- }
-
- sdio_ctl_devp[i]->devicep =
- device_create(sdio_ctl_classp, NULL,
- (sdio_ctl_number + i), NULL,
- DEVICE_NAME "%d", cmux_ch_id[i]);
-
- if (IS_ERR(sdio_ctl_devp[i]->devicep)) {
- pr_err("%s: device_create() ENOMEM\n", __func__);
- r = -ENOMEM;
- cdev_del(&sdio_ctl_devp[i]->cdev);
- kfree(sdio_ctl_devp[i]);
- goto error2;
- }
- }
-
- sdio_ctl_inited = 1;
- D("SDIO Control Port Driver Initialized.\n");
- return 0;
-
-error2:
- while (--i >= 0) {
- cdev_del(&sdio_ctl_devp[i]->cdev);
- device_destroy(sdio_ctl_classp,
- MKDEV(MAJOR(sdio_ctl_number), i));
- }
-
- class_destroy(sdio_ctl_classp);
- i = NUM_SDIO_CTL_PORTS;
-error1:
- unregister_chrdev_region(MAJOR(sdio_ctl_number), NUM_SDIO_CTL_PORTS);
-error0:
- while (--i >= 0)
- kfree(sdio_ctl_devp[i]);
- return r;
-}
-
-static int sdio_ctl_remove(struct platform_device *pdev)
-{
- int i;
-
- for (i = 0; i < NUM_SDIO_CTL_PORTS; ++i) {
- cdev_del(&sdio_ctl_devp[i]->cdev);
- kfree(sdio_ctl_devp[i]);
- device_destroy(sdio_ctl_classp,
- MKDEV(MAJOR(sdio_ctl_number), i));
- }
- class_destroy(sdio_ctl_classp);
- unregister_chrdev_region(MAJOR(sdio_ctl_number), NUM_SDIO_CTL_PORTS);
-
- return 0;
-}
-
-static struct platform_driver sdio_ctl_driver = {
- .probe = sdio_ctl_probe,
- .remove = sdio_ctl_remove,
- .driver = {
- .name = "SDIO_CTL",
- .owner = THIS_MODULE,
- },
-};
-
-static int __init sdio_ctl_init(void)
-{
- msm_sdio_ctl_debug_mask = 0;
- return platform_driver_register(&sdio_ctl_driver);
-}
-
-module_init(sdio_ctl_init);
-MODULE_DESCRIPTION("MSM SDIO Control Port");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/sdio_dmux.c b/arch/arm/mach-msm/sdio_dmux.c
deleted file mode 100644
index c6d665d..0000000
--- a/arch/arm/mach-msm/sdio_dmux.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-/*
- * SDIO DMUX module.
- */
-
-#define DEBUG
-
-#include <linux/delay.h>
-#include <linux/module.h>
-#include <linux/netdevice.h>
-#include <linux/platform_device.h>
-#include <linux/sched.h>
-#include <linux/skbuff.h>
-#include <linux/wakelock.h>
-#include <linux/debugfs.h>
-#include <linux/smp.h>
-#include <linux/cpumask.h>
-
-#include <mach/sdio_al.h>
-#include <mach/sdio_dmux.h>
-
-#define SDIO_CH_LOCAL_OPEN 0x1
-#define SDIO_CH_REMOTE_OPEN 0x2
-#define SDIO_CH_IN_RESET 0x4
-
-#define SDIO_MUX_HDR_MAGIC_NO 0x33fc
-
-#define SDIO_MUX_HDR_CMD_DATA 0
-#define SDIO_MUX_HDR_CMD_OPEN 1
-#define SDIO_MUX_HDR_CMD_CLOSE 2
-
-#define LOW_WATERMARK 2
-#define HIGH_WATERMARK 4
-
-static int msm_sdio_dmux_debug_enable;
-module_param_named(debug_enable, msm_sdio_dmux_debug_enable,
- int, S_IRUGO | S_IWUSR | S_IWGRP);
-
-#if defined(DEBUG)
-static uint32_t sdio_dmux_read_cnt;
-static uint32_t sdio_dmux_write_cnt;
-static uint32_t sdio_dmux_write_cpy_cnt;
-static uint32_t sdio_dmux_write_cpy_bytes;
-
-#define DBG(x...) do { \
- if (msm_sdio_dmux_debug_enable) \
- pr_debug(x); \
- } while (0)
-
-#define DBG_INC_READ_CNT(x) do { \
- sdio_dmux_read_cnt += (x); \
- if (msm_sdio_dmux_debug_enable) \
- pr_debug("%s: total read bytes %u\n", \
- __func__, sdio_dmux_read_cnt); \
- } while (0)
-
-#define DBG_INC_WRITE_CNT(x) do { \
- sdio_dmux_write_cnt += (x); \
- if (msm_sdio_dmux_debug_enable) \
- pr_debug("%s: total written bytes %u\n", \
- __func__, sdio_dmux_write_cnt); \
- } while (0)
-
-#define DBG_INC_WRITE_CPY(x) do { \
- sdio_dmux_write_cpy_bytes += (x); \
- sdio_dmux_write_cpy_cnt++; \
- if (msm_sdio_dmux_debug_enable) \
- pr_debug("%s: total write copy cnt %u, bytes %u\n", \
- __func__, sdio_dmux_write_cpy_cnt, \
- sdio_dmux_write_cpy_bytes); \
- } while (0)
-#else
-#define DBG(x...) do { } while (0)
-#define DBG_INC_READ_CNT(x...) do { } while (0)
-#define DBG_INC_WRITE_CNT(x...) do { } while (0)
-#define DBG_INC_WRITE_CPY(x...) do { } while (0)
-#endif
-
-struct sdio_ch_info {
- uint32_t status;
- void (*receive_cb)(void *, struct sk_buff *);
- void (*write_done)(void *, struct sk_buff *);
- void *priv;
- spinlock_t lock;
- int num_tx_pkts;
- int use_wm;
-};
-
-static struct sk_buff_head sdio_mux_write_pool;
-static spinlock_t sdio_mux_write_lock;
-
-static struct sdio_channel *sdio_mux_ch;
-static struct sdio_ch_info sdio_ch[SDIO_DMUX_NUM_CHANNELS];
-struct wake_lock sdio_mux_ch_wakelock;
-static int sdio_mux_initialized;
-static int fatal_error;
-
-struct sdio_mux_hdr {
- uint16_t magic_num;
- uint8_t reserved;
- uint8_t cmd;
- uint8_t pad_len;
- uint8_t ch_id;
- uint16_t pkt_len;
-};
-
-struct sdio_partial_pkt_info {
- uint32_t valid;
- struct sk_buff *skb;
- struct sdio_mux_hdr *hdr;
-};
-
-static void sdio_mux_read_data(struct work_struct *work);
-static void sdio_mux_write_data(struct work_struct *work);
-static void sdio_mux_send_open_cmd(uint32_t id);
-
-static DEFINE_MUTEX(sdio_mux_lock);
-static DECLARE_WORK(work_sdio_mux_read, sdio_mux_read_data);
-static DECLARE_WORK(work_sdio_mux_write, sdio_mux_write_data);
-static DECLARE_DELAYED_WORK(delayed_work_sdio_mux_write, sdio_mux_write_data);
-
-static struct workqueue_struct *sdio_mux_workqueue;
-static struct sdio_partial_pkt_info sdio_partial_pkt;
-
-#define sdio_ch_is_open(x) \
- (sdio_ch[(x)].status == (SDIO_CH_LOCAL_OPEN | SDIO_CH_REMOTE_OPEN))
-
-#define sdio_ch_is_local_open(x) \
- (sdio_ch[(x)].status & SDIO_CH_LOCAL_OPEN)
-
-#define sdio_ch_is_remote_open(x) \
- (sdio_ch[(x)].status & SDIO_CH_REMOTE_OPEN)
-
-#define sdio_ch_is_in_reset(x) \
- (sdio_ch[(x)].status & SDIO_CH_IN_RESET)
-
-static inline void skb_set_data(struct sk_buff *skb,
- unsigned char *data,
- unsigned int len)
-{
- /* panic if tail > end */
- skb->data = data;
- skb->tail = skb->data + len;
- skb->len = len;
- skb->truesize = len + sizeof(struct sk_buff);
-}
-
-static void sdio_mux_save_partial_pkt(struct sdio_mux_hdr *hdr,
- struct sk_buff *skb_mux)
-{
- struct sk_buff *skb;
-
- /* i think we can avoid cloning here */
- skb = skb_clone(skb_mux, GFP_KERNEL);
- if (!skb) {
- pr_err("%s: cannot clone skb\n", __func__);
- return;
- }
-
- /* protect? */
- skb_set_data(skb, (unsigned char *)hdr,
- skb->tail - (unsigned char *)hdr);
- sdio_partial_pkt.skb = skb;
- sdio_partial_pkt.valid = 1;
- DBG("%s: head %p data %p tail %p end %p len %d\n", __func__,
- skb->head, skb->data, skb->tail, skb->end, skb->len);
- return;
-}
-
-static void *handle_sdio_mux_data(struct sdio_mux_hdr *hdr,
- struct sk_buff *skb_mux)
-{
- struct sk_buff *skb;
- void *rp = (void *)hdr;
- unsigned long flags;
-
- /* protect? */
- rp += sizeof(*hdr);
- if (rp < (void *)skb_mux->tail)
- rp += (hdr->pkt_len + hdr->pad_len);
-
- if (rp > (void *)skb_mux->tail) {
- /* partial packet */
- sdio_mux_save_partial_pkt(hdr, skb_mux);
- goto packet_done;
- }
-
- DBG("%s: hdr %p next %p tail %p pkt_size %d\n",
- __func__, hdr, rp, skb_mux->tail, hdr->pkt_len + hdr->pad_len);
-
- skb = skb_clone(skb_mux, GFP_KERNEL);
- if (!skb) {
- pr_err("%s: cannot clone skb\n", __func__);
- goto packet_done;
- }
-
- skb_set_data(skb, (unsigned char *)(hdr + 1), hdr->pkt_len);
- DBG("%s: head %p data %p tail %p end %p len %d\n",
- __func__, skb->head, skb->data, skb->tail, skb->end, skb->len);
-
- /* probably we should check channel status */
- /* discard packet early if local side not open */
- spin_lock_irqsave(&sdio_ch[hdr->ch_id].lock, flags);
- if (sdio_ch[hdr->ch_id].receive_cb)
- sdio_ch[hdr->ch_id].receive_cb(sdio_ch[hdr->ch_id].priv, skb);
- else
- dev_kfree_skb_any(skb);
- spin_unlock_irqrestore(&sdio_ch[hdr->ch_id].lock, flags);
-
-packet_done:
- return rp;
-}
-
-static void *handle_sdio_mux_command(struct sdio_mux_hdr *hdr,
- struct sk_buff *skb_mux)
-{
- void *rp;
- unsigned long flags;
- int send_open = 0;
-
- DBG("%s: cmd %d ch %d\n", __func__, hdr->cmd, hdr->ch_id);
- switch (hdr->cmd) {
- case SDIO_MUX_HDR_CMD_DATA:
- rp = handle_sdio_mux_data(hdr, skb_mux);
- break;
- case SDIO_MUX_HDR_CMD_OPEN:
- spin_lock_irqsave(&sdio_ch[hdr->ch_id].lock, flags);
- sdio_ch[hdr->ch_id].status |= SDIO_CH_REMOTE_OPEN;
- sdio_ch[hdr->ch_id].num_tx_pkts = 0;
-
- if (sdio_ch_is_in_reset(hdr->ch_id)) {
- DBG("%s: in reset - sending open cmd\n", __func__);
- sdio_ch[hdr->ch_id].status &= ~SDIO_CH_IN_RESET;
- send_open = 1;
- }
-
- /* notify client so it can update its status */
- if (sdio_ch[hdr->ch_id].receive_cb)
- sdio_ch[hdr->ch_id].receive_cb(
- sdio_ch[hdr->ch_id].priv, NULL);
-
- if (sdio_ch[hdr->ch_id].write_done)
- sdio_ch[hdr->ch_id].write_done(
- sdio_ch[hdr->ch_id].priv, NULL);
- spin_unlock_irqrestore(&sdio_ch[hdr->ch_id].lock, flags);
- rp = hdr + 1;
- if (send_open)
- sdio_mux_send_open_cmd(hdr->ch_id);
-
- break;
- case SDIO_MUX_HDR_CMD_CLOSE:
- /* probably should drop pending write */
- spin_lock_irqsave(&sdio_ch[hdr->ch_id].lock, flags);
- sdio_ch[hdr->ch_id].status &= ~SDIO_CH_REMOTE_OPEN;
- spin_unlock_irqrestore(&sdio_ch[hdr->ch_id].lock, flags);
- rp = hdr + 1;
- break;
- default:
- rp = hdr + 1;
- }
-
- return rp;
-}
-
-static void *handle_sdio_partial_pkt(struct sk_buff *skb_mux)
-{
- struct sk_buff *p_skb;
- struct sdio_mux_hdr *p_hdr;
- void *ptr, *rp = skb_mux->data;
-
- /* protoect? */
- if (sdio_partial_pkt.valid) {
- p_skb = sdio_partial_pkt.skb;
-
- ptr = skb_push(skb_mux, p_skb->len);
- memcpy(ptr, p_skb->data, p_skb->len);
- sdio_partial_pkt.skb = NULL;
- sdio_partial_pkt.valid = 0;
- dev_kfree_skb_any(p_skb);
-
- DBG("%s: head %p data %p tail %p end %p len %d\n", __func__,
- skb_mux->head, skb_mux->data, skb_mux->tail,
- skb_mux->end, skb_mux->len);
-
- p_hdr = (struct sdio_mux_hdr *)skb_mux->data;
- rp = handle_sdio_mux_command(p_hdr, skb_mux);
- }
- return rp;
-}
-
-static void sdio_mux_read_data(struct work_struct *work)
-{
- struct sk_buff *skb_mux;
- void *ptr = 0;
- int sz, rc, len = 0;
- struct sdio_mux_hdr *hdr;
- static int workqueue_pinned;
-
- if (!workqueue_pinned) {
- struct cpumask cpus;
-
- cpumask_clear(&cpus);
- cpumask_set_cpu(0, &cpus);
-
- if (sched_setaffinity(current->pid, &cpus))
- pr_err("%s: sdio_dmux set CPU affinity failed\n",
- __func__);
- workqueue_pinned = 1;
- }
-
- DBG("%s: reading\n", __func__);
- /* should probably have a separate read lock */
- mutex_lock(&sdio_mux_lock);
- sz = sdio_read_avail(sdio_mux_ch);
- DBG("%s: read avail %d\n", __func__, sz);
- if (sz <= 0) {
- if (sz)
- pr_err("%s: read avail failed %d\n", __func__, sz);
- mutex_unlock(&sdio_mux_lock);
- return;
- }
-
- /* net_ip_aling is probably not required */
- if (sdio_partial_pkt.valid)
- len = sdio_partial_pkt.skb->len;
-
- /* If allocation fails attempt to get a smaller chunk of mem */
- do {
- skb_mux = __dev_alloc_skb(sz + NET_IP_ALIGN + len, GFP_KERNEL);
- if (skb_mux)
- break;
-
- pr_err("%s: cannot allocate skb of size:%d + "
- "%d (NET_SKB_PAD)\n", __func__,
- sz + NET_IP_ALIGN + len, NET_SKB_PAD);
- /* the skb structure adds NET_SKB_PAD bytes to the memory
- * request, which may push the actual request above PAGE_SIZE
- * in that case, we need to iterate one more time to make sure
- * we get the memory request under PAGE_SIZE
- */
- if (sz + NET_IP_ALIGN + len + NET_SKB_PAD <= PAGE_SIZE) {
- pr_err("%s: allocation failed\n", __func__);
- mutex_unlock(&sdio_mux_lock);
- return;
- }
- sz /= 2;
- } while (1);
-
- skb_reserve(skb_mux, NET_IP_ALIGN + len);
- ptr = skb_put(skb_mux, sz);
-
- /* half second wakelock is fine? */
- wake_lock_timeout(&sdio_mux_ch_wakelock, HZ / 2);
- rc = sdio_read(sdio_mux_ch, ptr, sz);
- DBG("%s: read %d\n", __func__, rc);
- if (rc) {
- pr_err("%s: sdio read failed %d\n", __func__, rc);
- dev_kfree_skb_any(skb_mux);
- mutex_unlock(&sdio_mux_lock);
- queue_work(sdio_mux_workqueue, &work_sdio_mux_read);
- return;
- }
- mutex_unlock(&sdio_mux_lock);
-
- DBG_INC_READ_CNT(sz);
- DBG("%s: head %p data %p tail %p end %p len %d\n", __func__,
- skb_mux->head, skb_mux->data, skb_mux->tail,
- skb_mux->end, skb_mux->len);
-
- /* move to a separate function */
- /* probably do skb_pull instead of pointer adjustment */
- hdr = handle_sdio_partial_pkt(skb_mux);
- while ((void *)hdr < (void *)skb_mux->tail) {
-
- if (((void *)hdr + sizeof(*hdr)) > (void *)skb_mux->tail) {
- /* handle partial header */
- sdio_mux_save_partial_pkt(hdr, skb_mux);
- break;
- }
-
- if (hdr->magic_num != SDIO_MUX_HDR_MAGIC_NO) {
- pr_err("%s: packet error\n", __func__);
- break;
- }
-
- hdr = handle_sdio_mux_command(hdr, skb_mux);
- }
- dev_kfree_skb_any(skb_mux);
-
- DBG("%s: read done\n", __func__);
- queue_work(sdio_mux_workqueue, &work_sdio_mux_read);
-}
-
-static int sdio_mux_write(struct sk_buff *skb)
-{
- int rc, sz;
-
- mutex_lock(&sdio_mux_lock);
- sz = sdio_write_avail(sdio_mux_ch);
- DBG("%s: avail %d len %d\n", __func__, sz, skb->len);
- if (skb->len <= sz) {
- rc = sdio_write(sdio_mux_ch, skb->data, skb->len);
- DBG("%s: write returned %d\n", __func__, rc);
- if (rc == 0)
- DBG_INC_WRITE_CNT(skb->len);
- } else
- rc = -ENOMEM;
-
- mutex_unlock(&sdio_mux_lock);
- return rc;
-}
-
-static int sdio_mux_write_cmd(void *data, uint32_t len)
-{
- int avail, rc;
- for (;;) {
- mutex_lock(&sdio_mux_lock);
- avail = sdio_write_avail(sdio_mux_ch);
- DBG("%s: avail %d len %d\n", __func__, avail, len);
- if (avail >= len) {
- rc = sdio_write(sdio_mux_ch, data, len);
- DBG("%s: write returned %d\n", __func__, rc);
- if (!rc) {
- DBG_INC_WRITE_CNT(len);
- break;
- }
- }
- mutex_unlock(&sdio_mux_lock);
- msleep(250);
- }
- mutex_unlock(&sdio_mux_lock);
- return 0;
-}
-
-static void sdio_mux_send_open_cmd(uint32_t id)
-{
- struct sdio_mux_hdr hdr = {
- .magic_num = SDIO_MUX_HDR_MAGIC_NO,
- .cmd = SDIO_MUX_HDR_CMD_OPEN,
- .reserved = 0,
- .ch_id = id,
- .pkt_len = 0,
- .pad_len = 0
- };
-
- sdio_mux_write_cmd((void *)&hdr, sizeof(hdr));
-}
-
-static void sdio_mux_write_data(struct work_struct *work)
-{
- int rc, reschedule = 0;
- int notify = 0;
- struct sk_buff *skb;
- unsigned long flags;
- int avail;
- int ch_id;
-
- spin_lock_irqsave(&sdio_mux_write_lock, flags);
- while ((skb = __skb_dequeue(&sdio_mux_write_pool))) {
- ch_id = ((struct sdio_mux_hdr *)skb->data)->ch_id;
-
- avail = sdio_write_avail(sdio_mux_ch);
- if (avail < skb->len) {
- /* we may have to wait for write avail
- * notification from sdio al
- */
- DBG("%s: sdio_write_avail(%d) < skb->len(%d)\n",
- __func__, avail, skb->len);
-
- reschedule = 1;
- break;
- }
- spin_unlock_irqrestore(&sdio_mux_write_lock, flags);
- rc = sdio_mux_write(skb);
- spin_lock_irqsave(&sdio_mux_write_lock, flags);
- if (rc == 0) {
-
- spin_lock(&sdio_ch[ch_id].lock);
- sdio_ch[ch_id].num_tx_pkts--;
- spin_unlock(&sdio_ch[ch_id].lock);
-
- if (sdio_ch[ch_id].write_done)
- sdio_ch[ch_id].write_done(
- sdio_ch[ch_id].priv, skb);
- else
- dev_kfree_skb_any(skb);
- } else if (rc == -EAGAIN || rc == -ENOMEM) {
- /* recoverable error - retry again later */
- reschedule = 1;
- break;
- } else if (rc == -ENODEV) {
- /*
- * sdio_al suffered some kind of fatal error
- * prevent future writes and clean up pending ones
- */
- fatal_error = 1;
- do {
- ch_id = ((struct sdio_mux_hdr *)
- skb->data)->ch_id;
- spin_lock(&sdio_ch[ch_id].lock);
- sdio_ch[ch_id].num_tx_pkts--;
- spin_unlock(&sdio_ch[ch_id].lock);
- dev_kfree_skb_any(skb);
- } while ((skb = __skb_dequeue(&sdio_mux_write_pool)));
- spin_unlock_irqrestore(&sdio_mux_write_lock, flags);
- return;
- } else {
- /* unknown error condition - drop the
- * skb and reschedule for the
- * other skb's
- */
- pr_err("%s: sdio_mux_write error %d"
- " for ch %d, skb=%p\n",
- __func__, rc, ch_id, skb);
- notify = 1;
- break;
- }
- }
-
- if (reschedule) {
- if (sdio_ch_is_in_reset(ch_id)) {
- notify = 1;
- } else {
- __skb_queue_head(&sdio_mux_write_pool, skb);
- queue_delayed_work(sdio_mux_workqueue,
- &delayed_work_sdio_mux_write,
- msecs_to_jiffies(250)
- );
- }
- }
-
- if (notify) {
- spin_lock(&sdio_ch[ch_id].lock);
- sdio_ch[ch_id].num_tx_pkts--;
- spin_unlock(&sdio_ch[ch_id].lock);
-
- if (sdio_ch[ch_id].write_done)
- sdio_ch[ch_id].write_done(
- sdio_ch[ch_id].priv, skb);
- else
- dev_kfree_skb_any(skb);
- }
- spin_unlock_irqrestore(&sdio_mux_write_lock, flags);
-}
-
-int msm_sdio_is_channel_in_reset(uint32_t id)
-{
- int rc = 0;
-
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
-
- if (sdio_ch_is_in_reset(id))
- rc = 1;
-
- return rc;
-}
-
-int msm_sdio_dmux_write(uint32_t id, struct sk_buff *skb)
-{
- int rc = 0;
- struct sdio_mux_hdr *hdr;
- unsigned long flags;
- struct sk_buff *new_skb;
-
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
- if (!skb)
- return -EINVAL;
- if (!sdio_mux_initialized)
- return -ENODEV;
- if (fatal_error)
- return -ENODEV;
-
- DBG("%s: writing to ch %d len %d\n", __func__, id, skb->len);
- spin_lock_irqsave(&sdio_ch[id].lock, flags);
- if (sdio_ch_is_in_reset(id)) {
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
- pr_err("%s: port is in reset: %d\n", __func__,
- sdio_ch[id].status);
- return -ENETRESET;
- }
- if (!sdio_ch_is_local_open(id)) {
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
- pr_err("%s: port not open: %d\n", __func__, sdio_ch[id].status);
- return -ENODEV;
- }
- if (sdio_ch[id].use_wm &&
- (sdio_ch[id].num_tx_pkts >= HIGH_WATERMARK)) {
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
- pr_err("%s: watermark exceeded: %d\n", __func__, id);
- return -EAGAIN;
- }
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
-
- spin_lock_irqsave(&sdio_mux_write_lock, flags);
- /* if skb do not have any tailroom for padding,
- copy the skb into a new expanded skb */
- if ((skb->len & 0x3) && (skb_tailroom(skb) < (4 - (skb->len & 0x3)))) {
- /* revisit, probably dev_alloc_skb and memcpy is effecient */
- new_skb = skb_copy_expand(skb, skb_headroom(skb),
- 4 - (skb->len & 0x3), GFP_ATOMIC);
- if (new_skb == NULL) {
- pr_err("%s: cannot allocate skb\n", __func__);
- rc = -ENOMEM;
- goto write_done;
- }
- dev_kfree_skb_any(skb);
- skb = new_skb;
- DBG_INC_WRITE_CPY(skb->len);
- }
-
- hdr = (struct sdio_mux_hdr *)skb_push(skb, sizeof(struct sdio_mux_hdr));
-
- /* caller should allocate for hdr and padding
- hdr is fine, padding is tricky */
- hdr->magic_num = SDIO_MUX_HDR_MAGIC_NO;
- hdr->cmd = SDIO_MUX_HDR_CMD_DATA;
- hdr->reserved = 0;
- hdr->ch_id = id;
- hdr->pkt_len = skb->len - sizeof(struct sdio_mux_hdr);
- if (skb->len & 0x3)
- skb_put(skb, 4 - (skb->len & 0x3));
-
- hdr->pad_len = skb->len - (sizeof(struct sdio_mux_hdr) + hdr->pkt_len);
-
- DBG("%s: data %p, tail %p skb len %d pkt len %d pad len %d\n",
- __func__, skb->data, skb->tail, skb->len,
- hdr->pkt_len, hdr->pad_len);
- __skb_queue_tail(&sdio_mux_write_pool, skb);
-
- spin_lock(&sdio_ch[id].lock);
- sdio_ch[id].num_tx_pkts++;
- spin_unlock(&sdio_ch[id].lock);
-
- queue_work(sdio_mux_workqueue, &work_sdio_mux_write);
-
-write_done:
- spin_unlock_irqrestore(&sdio_mux_write_lock, flags);
- return rc;
-}
-
-int msm_sdio_dmux_open(uint32_t id, void *priv,
- void (*receive_cb)(void *, struct sk_buff *),
- void (*write_done)(void *, struct sk_buff *))
-{
- unsigned long flags;
-
- DBG("%s: opening ch %d\n", __func__, id);
- if (!sdio_mux_initialized)
- return -ENODEV;
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
-
- spin_lock_irqsave(&sdio_ch[id].lock, flags);
- if (sdio_ch_is_local_open(id)) {
- pr_info("%s: Already opened %d\n", __func__, id);
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
- goto open_done;
- }
-
- sdio_ch[id].receive_cb = receive_cb;
- sdio_ch[id].write_done = write_done;
- sdio_ch[id].priv = priv;
- sdio_ch[id].status |= SDIO_CH_LOCAL_OPEN;
- sdio_ch[id].num_tx_pkts = 0;
- sdio_ch[id].use_wm = 0;
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
-
- sdio_mux_send_open_cmd(id);
-
-open_done:
- pr_info("%s: opened ch %d\n", __func__, id);
- return 0;
-}
-
-int msm_sdio_dmux_close(uint32_t id)
-{
- struct sdio_mux_hdr hdr;
- unsigned long flags;
-
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
- DBG("%s: closing ch %d\n", __func__, id);
- if (!sdio_mux_initialized)
- return -ENODEV;
- spin_lock_irqsave(&sdio_ch[id].lock, flags);
-
- sdio_ch[id].receive_cb = NULL;
- sdio_ch[id].priv = NULL;
- sdio_ch[id].status &= ~SDIO_CH_LOCAL_OPEN;
- sdio_ch[id].status &= ~SDIO_CH_IN_RESET;
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
-
- hdr.magic_num = SDIO_MUX_HDR_MAGIC_NO;
- hdr.cmd = SDIO_MUX_HDR_CMD_CLOSE;
- hdr.reserved = 0;
- hdr.ch_id = id;
- hdr.pkt_len = 0;
- hdr.pad_len = 0;
-
- sdio_mux_write_cmd((void *)&hdr, sizeof(hdr));
-
- pr_info("%s: closed ch %d\n", __func__, id);
- return 0;
-}
-
-static void sdio_mux_notify(void *_dev, unsigned event)
-{
- DBG("%s: event %d notified\n", __func__, event);
-
- /* write avail may not be enouogh for a packet, but should be fine */
- if ((event == SDIO_EVENT_DATA_WRITE_AVAIL) &&
- sdio_write_avail(sdio_mux_ch))
- queue_work(sdio_mux_workqueue, &work_sdio_mux_write);
-
- if ((event == SDIO_EVENT_DATA_READ_AVAIL) &&
- sdio_read_avail(sdio_mux_ch))
- queue_work(sdio_mux_workqueue, &work_sdio_mux_read);
-}
-
-int msm_sdio_dmux_is_ch_full(uint32_t id)
-{
- unsigned long flags;
- int ret;
-
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
-
- spin_lock_irqsave(&sdio_ch[id].lock, flags);
- sdio_ch[id].use_wm = 1;
- ret = sdio_ch[id].num_tx_pkts >= HIGH_WATERMARK;
- DBG("%s: ch %d num tx pkts=%d, HWM=%d\n", __func__,
- id, sdio_ch[id].num_tx_pkts, ret);
- if (!sdio_ch_is_local_open(id)) {
- ret = -ENODEV;
- pr_err("%s: port not open: %d\n", __func__, sdio_ch[id].status);
- }
- spin_unlock_irqrestore(&sdio_ch[id].lock, flags);
-
- return ret;
-}
-
-int msm_sdio_dmux_is_ch_low(uint32_t id)
-{
- int ret;
-
- if (id >= SDIO_DMUX_NUM_CHANNELS)
- return -EINVAL;
-
- sdio_ch[id].use_wm = 1;
- ret = sdio_ch[id].num_tx_pkts <= LOW_WATERMARK;
- DBG("%s: ch %d num tx pkts=%d, LWM=%d\n", __func__,
- id, sdio_ch[id].num_tx_pkts, ret);
- if (!sdio_ch_is_local_open(id)) {
- ret = -ENODEV;
- pr_err("%s: port not open: %d\n", __func__, sdio_ch[id].status);
- }
-
- return ret;
-}
-
-#ifdef CONFIG_DEBUG_FS
-
-static int debug_tbl(char *buf, int max)
-{
- int i = 0;
- int j;
-
- for (j = 0; j < SDIO_DMUX_NUM_CHANNELS; ++j) {
- i += scnprintf(buf + i, max - i,
- "ch%02d local open=%s remote open=%s\n",
- j, sdio_ch_is_local_open(j) ? "Y" : "N",
- sdio_ch_is_remote_open(j) ? "Y" : "N");
- }
-
- return i;
-}
-
-#define DEBUG_BUFMAX 4096
-static char debug_buffer[DEBUG_BUFMAX];
-
-static ssize_t debug_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
-{
- int (*fill)(char *buf, int max) = file->private_data;
- int bsize = fill(debug_buffer, DEBUG_BUFMAX);
- return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize);
-}
-
-static int debug_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- return 0;
-}
-
-
-static const struct file_operations debug_ops = {
- .read = debug_read,
- .open = debug_open,
-};
-
-static void debug_create(const char *name, mode_t mode,
- struct dentry *dent,
- int (*fill)(char *buf, int max))
-{
- debugfs_create_file(name, mode, dent, fill, &debug_ops);
-}
-
-#endif
-
-static int sdio_dmux_probe(struct platform_device *pdev)
-{
- int rc;
-
- DBG("%s probe called\n", __func__);
-
- if (!sdio_mux_initialized) {
- sdio_mux_workqueue = create_singlethread_workqueue("sdio_dmux");
- if (!sdio_mux_workqueue)
- return -ENOMEM;
-
- skb_queue_head_init(&sdio_mux_write_pool);
- spin_lock_init(&sdio_mux_write_lock);
-
- for (rc = 0; rc < SDIO_DMUX_NUM_CHANNELS; ++rc)
- spin_lock_init(&sdio_ch[rc].lock);
-
-
- wake_lock_init(&sdio_mux_ch_wakelock, WAKE_LOCK_SUSPEND,
- "sdio_dmux");
- }
-
- rc = sdio_open("SDIO_RMNT", &sdio_mux_ch, NULL, sdio_mux_notify);
- if (rc < 0) {
- pr_err("%s: sido open failed %d\n", __func__, rc);
- wake_lock_destroy(&sdio_mux_ch_wakelock);
- destroy_workqueue(sdio_mux_workqueue);
- sdio_mux_initialized = 0;
- return rc;
- }
-
- fatal_error = 0;
- sdio_mux_initialized = 1;
- return 0;
-}
-
-static int sdio_dmux_remove(struct platform_device *pdev)
-{
- int i;
- unsigned long ch_lock_flags;
- unsigned long write_lock_flags;
- struct sk_buff *skb;
-
- DBG("%s remove called\n", __func__);
- if (!sdio_mux_initialized)
- return 0;
-
- /* set reset state for any open channels */
- for (i = 0; i < SDIO_DMUX_NUM_CHANNELS; ++i) {
- spin_lock_irqsave(&sdio_ch[i].lock, ch_lock_flags);
- if (sdio_ch_is_open(i)) {
- sdio_ch[i].status |= SDIO_CH_IN_RESET;
- sdio_ch[i].status &= ~SDIO_CH_REMOTE_OPEN;
-
- /* notify client so it can update its status */
- if (sdio_ch[i].receive_cb)
- sdio_ch[i].receive_cb(
- sdio_ch[i].priv, NULL);
- }
- spin_unlock_irqrestore(&sdio_ch[i].lock, ch_lock_flags);
- }
-
- /* cancel any pending writes */
- spin_lock_irqsave(&sdio_mux_write_lock, write_lock_flags);
- while ((skb = __skb_dequeue(&sdio_mux_write_pool))) {
- i = ((struct sdio_mux_hdr *)skb->data)->ch_id;
- if (sdio_ch[i].write_done)
- sdio_ch[i].write_done(
- sdio_ch[i].priv, skb);
- else
- dev_kfree_skb_any(skb);
- }
- spin_unlock_irqrestore(&sdio_mux_write_lock,
- write_lock_flags);
-
- return 0;
-}
-
-static struct platform_driver sdio_dmux_driver = {
- .probe = sdio_dmux_probe,
- .remove = sdio_dmux_remove,
- .driver = {
- .name = "SDIO_RMNT",
- .owner = THIS_MODULE,
- },
-};
-
-static int __init sdio_dmux_init(void)
-{
-#ifdef CONFIG_DEBUG_FS
- struct dentry *dent;
-
- dent = debugfs_create_dir("sdio_dmux", 0);
- if (!IS_ERR(dent))
- debug_create("tbl", 0444, dent, debug_tbl);
-#endif
- return platform_driver_register(&sdio_dmux_driver);
-}
-
-module_init(sdio_dmux_init);
-MODULE_DESCRIPTION("MSM SDIO DMUX");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/sdio_smem.c b/arch/arm/mach-msm/sdio_smem.c
deleted file mode 100644
index edc0d23..0000000
--- a/arch/arm/mach-msm/sdio_smem.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#define pr_fmt(fmt) "%s: " fmt, __func__
-
-#include <linux/sched.h>
-#include <linux/wait.h>
-#include <linux/workqueue.h>
-#include <linux/module.h>
-#include <mach/sdio_al.h>
-#include <mach/sdio_smem.h>
-
-static void sdio_smem_read(struct work_struct *work);
-
-static struct sdio_channel *channel;
-static struct workqueue_struct *workq;
-static DECLARE_WORK(work_read, sdio_smem_read);
-static DECLARE_WAIT_QUEUE_HEAD(waitq);
-static int bytes_avail;
-static int sdio_ch_opened;
-
-static void sdio_smem_release(struct device *dev)
-{
- pr_debug("sdio smem released\n");
-}
-
-static struct sdio_smem_client client;
-
-static void sdio_smem_read(struct work_struct *work)
-{
- int err;
- int read_avail;
- char *data = client.buf;
-
- if (!sdio_ch_opened)
- return;
-
- read_avail = sdio_read_avail(channel);
- if (read_avail > bytes_avail ||
- read_avail < 0) {
- pr_err("Error: read_avail=%d bytes_avail=%d\n",
- read_avail, bytes_avail);
- goto read_err;
- }
-
- if (read_avail == 0)
- return;
-
- err = sdio_read(channel,
- &data[client.size - bytes_avail],
- read_avail);
- if (err) {
- pr_err("sdio_read error (%d)", err);
- goto read_err;
- }
-
- bytes_avail -= read_avail;
- pr_debug("read %d bytes (bytes_avail = %d)\n",
- read_avail, bytes_avail);
-
- if (!bytes_avail) {
- bytes_avail = client.size;
- err = client.cb_func(SDIO_SMEM_EVENT_READ_DONE);
- }
- if (err)
- pr_err("error (%d) on callback\n", err);
-
- return;
-
-read_err:
- if (sdio_ch_opened)
- client.cb_func(SDIO_SMEM_EVENT_READ_ERR);
- return;
-}
-
-static void sdio_smem_notify(void *priv, unsigned event)
-{
- pr_debug("%d event received\n", event);
-
- if (event == SDIO_EVENT_DATA_READ_AVAIL ||
- event == SDIO_EVENT_DATA_WRITE_AVAIL)
- queue_work(workq, &work_read);
-}
-
-int sdio_smem_register_client(void)
-{
- int err = 0;
-
- if (!client.buf || !client.size || !client.cb_func)
- return -EINVAL;
-
- pr_debug("buf = %p\n", client.buf);
- pr_debug("size = 0x%x\n", client.size);
-
- bytes_avail = client.size;
- workq = create_singlethread_workqueue("sdio_smem");
- if (!workq)
- return -ENOMEM;
-
- sdio_ch_opened = 1;
- err = sdio_open("SDIO_SMEM", &channel, NULL, sdio_smem_notify);
- if (err) {
- sdio_ch_opened = 0;
- pr_err("sdio_open error (%d)\n", err);
- destroy_workqueue(workq);
- return err;
- }
- pr_debug("SDIO SMEM channel opened\n");
- return err;
-}
-
-int sdio_smem_unregister_client(void)
-{
- int err = 0;
-
- sdio_ch_opened = 0;
- err = sdio_close(channel);
- if (err) {
- pr_err("sdio_close error (%d)\n", err);
- return err;
- }
- pr_debug("SDIO SMEM channel closed\n");
- flush_workqueue(workq);
- destroy_workqueue(workq);
- bytes_avail = 0;
- client.buf = NULL;
- client.cb_func = NULL;
- client.size = 0;
-
- return 0;
-}
-
-static int sdio_smem_probe(struct platform_device *pdev)
-{
- client.plat_dev.name = "SDIO_SMEM_CLIENT";
- client.plat_dev.id = -1;
- client.plat_dev.dev.release = sdio_smem_release;
-
- return platform_device_register(&client.plat_dev);
-}
-
-static int sdio_smem_remove(struct platform_device *pdev)
-{
- platform_device_unregister(&client.plat_dev);
- memset(&client, 0, sizeof(client));
- sdio_ch_opened = 0;
- return 0;
-}
-static struct platform_driver sdio_smem_drv = {
- .probe = sdio_smem_probe,
- .remove = sdio_smem_remove,
- .driver = {
- .name = "SDIO_SMEM",
- .owner = THIS_MODULE,
- },
-};
-
-static int __init sdio_smem_init(void)
-{
- return platform_driver_register(&sdio_smem_drv);
-};
-
-module_init(sdio_smem_init);
-
-MODULE_DESCRIPTION("SDIO SMEM");
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/sdio_tty.c b/arch/arm/mach-msm/sdio_tty.c
deleted file mode 100644
index c4b7673..0000000
--- a/arch/arm/mach-msm/sdio_tty.c
+++ /dev/null
@@ -1,824 +0,0 @@
-/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include <linux/slab.h>
-#include <linux/sched.h>
-#include <linux/wait.h>
-#include <linux/workqueue.h>
-#include <linux/platform_device.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/module.h>
-#include <linux/debugfs.h>
-#include <mach/sdio_al.h>
-
-#define INPUT_SPEED 4800
-#define OUTPUT_SPEED 4800
-#define SDIO_TTY_MODULE_NAME "sdio_tty"
-#define SDIO_TTY_MAX_PACKET_SIZE 4096
-#define MAX_SDIO_TTY_DRV 1
-#define MAX_SDIO_TTY_DEVS 2
-#define MAX_SDIO_TTY_DEV_NAME_SIZE 25
-
-/* Configurations per channel device */
-/* CSVT */
-#define SDIO_TTY_CSVT_DEV "sdio_tty_csvt_0"
-#define SDIO_TTY_CSVT_TEST_DEV "sdio_tty_csvt_test_0"
-#define SDIO_TTY_CH_CSVT "SDIO_CSVT"
-
-enum sdio_tty_state {
- TTY_INITIAL = 0,
- TTY_REGISTERED = 1,
- TTY_OPENED = 2,
- TTY_CLOSED = 3,
-};
-
-enum sdio_tty_devices {
- SDIO_CSVT,
- SDIO_CSVT_TEST_APP,
-};
-
-static const struct platform_device_id sdio_tty_id_table[] = {
- { "SDIO_CSVT", SDIO_CSVT },
- { "SDIO_CSVT_TEST_APP", SDIO_CSVT_TEST_APP },
- { },
-};
-MODULE_DEVICE_TABLE(platform, sdio_tty_id_table);
-
-struct sdio_tty {
- struct sdio_channel *ch;
- char *sdio_ch_name;
- char tty_dev_name[MAX_SDIO_TTY_DEV_NAME_SIZE];
- int device_id;
- struct workqueue_struct *workq;
- struct work_struct work_read;
- wait_queue_head_t waitq;
- struct tty_driver *tty_drv;
- struct tty_struct *tty_str;
- int debug_msg_on;
- char *read_buf;
- enum sdio_tty_state sdio_tty_state;
- int is_sdio_open;
- int tty_open_count;
- int total_rx;
- int total_tx;
-};
-
-static struct sdio_tty *sdio_tty[MAX_SDIO_TTY_DEVS];
-
-#ifdef CONFIG_DEBUG_FS
-struct dentry *sdio_tty_debug_root;
-struct dentry *sdio_tty_debug_info;
-#endif
-
-#define DEBUG_MSG(sdio_tty_drv, x...) if (sdio_tty_drv->debug_msg_on) pr_info(x)
-
-/*
- * Enable sdio_tty debug messages
- * By default the sdio_tty debug messages are turned off
- */
-static int csvt_debug_msg_on;
-module_param(csvt_debug_msg_on, int, 0);
-
-static void sdio_tty_read(struct work_struct *work)
-{
- int ret = 0;
- int read_avail = 0;
- int left = 0;
- int total_push = 0;
- int num_push = 0;
- struct sdio_tty *sdio_tty_drv = NULL;
-
- sdio_tty_drv = container_of(work, struct sdio_tty, work_read);
-
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty", __func__);
- return ;
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_state = %d",
- __func__, sdio_tty_drv->sdio_tty_state);
- return;
- }
-
- if (!sdio_tty_drv->read_buf) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL read_buf for dev %s",
- __func__, sdio_tty_drv->tty_dev_name);
- return;
- }
-
- /* Read the data from the SDIO channel as long as there is available
- data */
- while (1) {
- if (test_bit(TTY_THROTTLED, &sdio_tty_drv->tty_str->flags)) {
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME
- ": %s: TTY_THROTTLED bit is set for "
- "dev %s, exit", __func__,
- sdio_tty_drv->tty_dev_name);
- return;
- }
-
- total_push = 0;
- read_avail = sdio_read_avail(sdio_tty_drv->ch);
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME
- ": %s: read_avail is %d for dev %s", __func__,
- read_avail, sdio_tty_drv->tty_dev_name);
-
- if (read_avail == 0) {
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME
- ": %s: read_avail is 0 for dev %s",
- __func__, sdio_tty_drv->tty_dev_name);
- return;
- }
-
- if (read_avail > SDIO_TTY_MAX_PACKET_SIZE) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: read_avail(%d) is "
- "bigger than SDIO_TTY_MAX_PACKET_SIZE(%d) "
- "for dev %s", __func__, read_avail,
- SDIO_TTY_MAX_PACKET_SIZE,
- sdio_tty_drv->tty_dev_name);
- return;
- }
-
- ret = sdio_read(sdio_tty_drv->ch,
- sdio_tty_drv->read_buf,
- read_avail);
- if (ret < 0) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_read error(%d) "
- "for dev %s", __func__, ret,
- sdio_tty_drv->tty_dev_name);
- return;
- }
-
- left = read_avail;
- do {
- num_push = tty_insert_flip_string(
- sdio_tty_drv->tty_str,
- sdio_tty_drv->read_buf+total_push,
- left);
- total_push += num_push;
- left -= num_push;
- tty_flip_buffer_push(sdio_tty_drv->tty_str);
- } while (left != 0);
-
- if (total_push != read_avail) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: failed, total_push"
- "(%d) != read_avail(%d) for dev %s\n",
- __func__, total_push, read_avail,
- sdio_tty_drv->tty_dev_name);
- }
-
- tty_flip_buffer_push(sdio_tty_drv->tty_str);
- sdio_tty_drv->total_rx += read_avail;
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: Rx: %d, "
- "Total Rx = %d bytes for dev %s", __func__,
- read_avail, sdio_tty_drv->total_rx,
- sdio_tty_drv->tty_dev_name);
- }
-}
-
-/**
- * sdio_tty_write_room
- *
- * This is the write_room function of the tty driver.
- *
- * @tty: pointer to tty struct.
- * @return free bytes for write.
- *
- */
-static int sdio_tty_write_room(struct tty_struct *tty)
-{
- int write_avail = 0;
- struct sdio_tty *sdio_tty_drv = NULL;
-
- if (!tty) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL tty", __func__);
- return -ENODEV;
- }
- sdio_tty_drv = tty->driver_data;
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return -ENODEV;
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_state = %d",
- __func__, sdio_tty_drv->sdio_tty_state);
- return -EPERM;
- }
-
- write_avail = sdio_write_avail(sdio_tty_drv->ch);
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: write_avail=%d "
- "for dev %s", __func__, write_avail,
- sdio_tty_drv->tty_dev_name);
-
- return write_avail;
-}
-
-/**
- * sdio_tty_write_callback
- * this is the write callback of the tty driver.
- *
- * @tty: pointer to tty struct.
- * @buf: buffer to write from.
- * @count: number of bytes to write.
- * @return bytes written or negative value on error.
- *
- * if destination buffer has not enough room for the incoming
- * data, writes the possible amount of bytes .
- */
-static int sdio_tty_write_callback(struct tty_struct *tty,
- const unsigned char *buf, int count)
-{
- int write_avail = 0;
- int len = count;
- int ret = 0;
- struct sdio_tty *sdio_tty_drv = NULL;
-
- if (!tty) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL tty", __func__);
- return -ENODEV;
- }
- sdio_tty_drv = tty->driver_data;
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return -ENODEV;
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_state = %d",
- __func__, sdio_tty_drv->sdio_tty_state);
- return -EPERM;
- }
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: Write Callback "
- "called with %d bytes for dev %s\n", __func__, count,
- sdio_tty_drv->tty_dev_name);
- write_avail = sdio_write_avail(sdio_tty_drv->ch);
- if (write_avail == 0) {
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: "
- "write_avail is 0 for dev %s\n",
- __func__, sdio_tty_drv->tty_dev_name);
- return 0;
- }
- if (write_avail > SDIO_TTY_MAX_PACKET_SIZE) {
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: "
- "write_avail(%d) is bigger than max packet "
- "size(%d) for dev %s, setting to "
- "max_packet_size\n", __func__, write_avail,
- SDIO_TTY_MAX_PACKET_SIZE,
- sdio_tty_drv->tty_dev_name);
- write_avail = SDIO_TTY_MAX_PACKET_SIZE;
- }
- if (write_avail < count) {
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: "
- "write_avail(%d) is smaller than required(%d) "
- "for dev %s, writing only %d bytes\n",
- __func__, write_avail, count,
- sdio_tty_drv->tty_dev_name, write_avail);
- len = write_avail;
- }
- ret = sdio_write(sdio_tty_drv->ch, buf, len);
- if (ret) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_write failed for "
- "dev %s, ret=%d\n", __func__,
- sdio_tty_drv->tty_dev_name, ret);
- return 0;
- }
-
- sdio_tty_drv->total_tx += len;
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: Tx: %d, "
- "Total Tx = %d for dev %s", __func__, len,
- sdio_tty_drv->total_tx, sdio_tty_drv->tty_dev_name);
- return len;
-}
-
-static void sdio_tty_notify(void *priv, unsigned event)
-{
- struct sdio_tty *sdio_tty_drv = priv;
-
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_state = %d",
- __func__, sdio_tty_drv->sdio_tty_state);
- return;
- }
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: event %d "
- "received for dev %s\n", __func__, event,
- sdio_tty_drv->tty_dev_name);
-
- if (event == SDIO_EVENT_DATA_READ_AVAIL)
- queue_work(sdio_tty_drv->workq, &sdio_tty_drv->work_read);
-}
-
-/**
- * sdio_tty_open
- * This is the open callback of the tty driver. it opens
- * the sdio channel, and creates the workqueue.
- *
- * @tty: a pointer to the tty struct.
- * @file: file descriptor.
- * @return 0 on success or negative value on error.
- */
-static int sdio_tty_open(struct tty_struct *tty, struct file *file)
-{
- int ret = 0;
- int i = 0;
- struct sdio_tty *sdio_tty_drv = NULL;
-
- if (!tty) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL tty", __func__);
- return -ENODEV;
- }
-
- for (i = 0; i < MAX_SDIO_TTY_DEVS; i++) {
- if (sdio_tty[i] == NULL)
- continue;
- if (!strncmp(sdio_tty[i]->tty_dev_name, tty->name,
- MAX_SDIO_TTY_DEV_NAME_SIZE)) {
- sdio_tty_drv = sdio_tty[i];
- break;
- }
- }
-
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return -ENODEV;
- }
-
- sdio_tty_drv->tty_open_count++;
- if (sdio_tty_drv->sdio_tty_state == TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: tty dev(%s) is already open",
- __func__, sdio_tty_drv->tty_dev_name);
- return -EBUSY;
- }
-
- tty->driver_data = sdio_tty_drv;
-
- sdio_tty_drv->tty_str = tty;
- sdio_tty_drv->tty_str->low_latency = 1;
- sdio_tty_drv->tty_str->icanon = 0;
- set_bit(TTY_NO_WRITE_SPLIT, &sdio_tty_drv->tty_str->flags);
-
- sdio_tty_drv->read_buf = kzalloc(SDIO_TTY_MAX_PACKET_SIZE, GFP_KERNEL);
- if (sdio_tty_drv->read_buf == NULL) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: failed to allocate read_buf "
- "for dev %s", __func__, sdio_tty_drv->tty_dev_name);
- return -ENOMEM;
- }
-
- sdio_tty_drv->workq = create_singlethread_workqueue("sdio_tty_read");
- if (!sdio_tty_drv->workq) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: failed to create workq "
- "for dev %s", __func__, sdio_tty_drv->tty_dev_name);
- return -ENOMEM;
- }
-
- if (!sdio_tty_drv->is_sdio_open) {
- ret = sdio_open(sdio_tty_drv->sdio_ch_name, &sdio_tty_drv->ch,
- sdio_tty_drv, sdio_tty_notify);
- if (ret < 0) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_open err=%d "
- "for dev %s\n", __func__, ret,
- sdio_tty_drv->tty_dev_name);
- destroy_workqueue(sdio_tty_drv->workq);
- return ret;
- }
-
- pr_info(SDIO_TTY_MODULE_NAME ": %s: SDIO_TTY channel(%s) "
- "opened\n", __func__, sdio_tty_drv->sdio_ch_name);
-
- sdio_tty_drv->is_sdio_open = 1;
- } else {
- /* If SDIO channel is already open try to read the data
- * from the modem
- */
- queue_work(sdio_tty_drv->workq, &sdio_tty_drv->work_read);
-
- }
-
- sdio_tty_drv->sdio_tty_state = TTY_OPENED;
-
- pr_info(SDIO_TTY_MODULE_NAME ": %s: TTY device(%s) opened\n",
- __func__, sdio_tty_drv->tty_dev_name);
-
- return ret;
-}
-
-/**
- * sdio_tty_close
- * This is the close callback of the tty driver. it requests
- * the main thread to exit, and waits for notification of it.
- * it also de-allocates the buffers, and unregisters the tty
- * driver and device.
- *
- * @tty: a pointer to the tty struct.
- * @file: file descriptor.
- * @return None.
- */
-static void sdio_tty_close(struct tty_struct *tty, struct file *file)
-{
- struct sdio_tty *sdio_tty_drv = NULL;
-
- if (!tty) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL tty", __func__);
- return;
- }
- sdio_tty_drv = tty->driver_data;
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return;
- }
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: trying to close a "
- "TTY device that was not opened\n", __func__);
- return;
- }
- if (--sdio_tty_drv->tty_open_count != 0)
- return;
-
- flush_workqueue(sdio_tty_drv->workq);
- destroy_workqueue(sdio_tty_drv->workq);
-
- kfree(sdio_tty_drv->read_buf);
- sdio_tty_drv->read_buf = NULL;
-
- sdio_tty_drv->sdio_tty_state = TTY_CLOSED;
-
- pr_info(SDIO_TTY_MODULE_NAME ": %s: SDIO_TTY device(%s) closed\n",
- __func__, sdio_tty_drv->tty_dev_name);
-}
-
-static void sdio_tty_unthrottle(struct tty_struct *tty)
-{
- struct sdio_tty *sdio_tty_drv = NULL;
-
- if (!tty) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL tty", __func__);
- return;
- }
- sdio_tty_drv = tty->driver_data;
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return;
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_OPENED) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_state = %d",
- __func__, sdio_tty_drv->sdio_tty_state);
- return;
- }
-
- queue_work(sdio_tty_drv->workq, &sdio_tty_drv->work_read);
- return;
-}
-
-static const struct tty_operations sdio_tty_ops = {
- .open = sdio_tty_open,
- .close = sdio_tty_close,
- .write = sdio_tty_write_callback,
- .write_room = sdio_tty_write_room,
- .unthrottle = sdio_tty_unthrottle,
-};
-
-int sdio_tty_init_tty(char *tty_name, char *sdio_ch_name,
- enum sdio_tty_devices device_id, int debug_msg_on)
-{
- int ret = 0;
- int i = 0;
- struct device *tty_dev = NULL;
- struct sdio_tty *sdio_tty_drv = NULL;
-
- sdio_tty_drv = kzalloc(sizeof(struct sdio_tty), GFP_KERNEL);
- if (sdio_tty_drv == NULL) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: failed to allocate sdio_tty "
- "for dev %s", __func__, tty_name);
- return -ENOMEM;
- }
-
- for (i = 0; i < MAX_SDIO_TTY_DEVS; i++) {
- if (sdio_tty[i] == NULL) {
- sdio_tty[i] = sdio_tty_drv;
- break;
- }
- }
-
- if (i == MAX_SDIO_TTY_DEVS) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: tty dev(%s) creation failed,"
- " max limit(%d) reached.", __func__, tty_name,
- MAX_SDIO_TTY_DEVS);
- kfree(sdio_tty_drv);
- return -ENODEV;
- }
-
- snprintf(sdio_tty_drv->tty_dev_name, MAX_SDIO_TTY_DEV_NAME_SIZE,
- "%s%d", tty_name, 0);
- sdio_tty_drv->sdio_ch_name = sdio_ch_name;
- sdio_tty_drv->device_id = device_id;
- pr_info(SDIO_TTY_MODULE_NAME ": %s: dev=%s, id=%d, channel=%s\n",
- __func__, sdio_tty_drv->tty_dev_name, sdio_tty_drv->device_id,
- sdio_tty_drv->sdio_ch_name);
-
- INIT_WORK(&sdio_tty_drv->work_read, sdio_tty_read);
-
- sdio_tty_drv->tty_drv = alloc_tty_driver(MAX_SDIO_TTY_DRV);
-
- if (!sdio_tty_drv->tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s - tty_drv is NULL for dev %s",
- __func__, sdio_tty_drv->tty_dev_name);
- kfree(sdio_tty_drv);
- return -ENODEV;
- }
-
- sdio_tty_drv->tty_drv->name = tty_name;
- sdio_tty_drv->tty_drv->owner = THIS_MODULE;
- sdio_tty_drv->tty_drv->driver_name = "SDIO_tty";
- /* uses dynamically assigned dev_t values */
- sdio_tty_drv->tty_drv->type = TTY_DRIVER_TYPE_SERIAL;
- sdio_tty_drv->tty_drv->subtype = SERIAL_TYPE_NORMAL;
- sdio_tty_drv->tty_drv->flags = TTY_DRIVER_REAL_RAW
- | TTY_DRIVER_DYNAMIC_DEV
- | TTY_DRIVER_RESET_TERMIOS;
-
- /* initializing the tty driver */
- sdio_tty_drv->tty_drv->init_termios = tty_std_termios;
- sdio_tty_drv->tty_drv->init_termios.c_cflag =
- B4800 | CS8 | CREAD | HUPCL | CLOCAL;
- sdio_tty_drv->tty_drv->init_termios.c_ispeed = INPUT_SPEED;
- sdio_tty_drv->tty_drv->init_termios.c_ospeed = OUTPUT_SPEED;
-
- tty_set_operations(sdio_tty_drv->tty_drv, &sdio_tty_ops);
-
- ret = tty_register_driver(sdio_tty_drv->tty_drv);
- if (ret) {
- put_tty_driver(sdio_tty_drv->tty_drv);
- pr_err(SDIO_TTY_MODULE_NAME ": %s: tty_register_driver() "
- "failed for dev %s\n", __func__,
- sdio_tty_drv->tty_dev_name);
-
- sdio_tty_drv->tty_drv = NULL;
- kfree(sdio_tty_drv);
- return -ENODEV;
- }
-
- tty_dev = tty_register_device(sdio_tty_drv->tty_drv, 0, NULL);
- if (IS_ERR(tty_dev)) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: tty_register_device() "
- "failed for dev %s\n", __func__,
- sdio_tty_drv->tty_dev_name);
- tty_unregister_driver(sdio_tty_drv->tty_drv);
- put_tty_driver(sdio_tty_drv->tty_drv);
- kfree(sdio_tty_drv);
- return -ENODEV;
- }
-
- sdio_tty_drv->sdio_tty_state = TTY_REGISTERED;
- if (debug_msg_on) {
- pr_info(SDIO_TTY_MODULE_NAME ": %s: turn on debug msg for %s",
- __func__, sdio_tty_drv->tty_dev_name);
- sdio_tty_drv->debug_msg_on = debug_msg_on;
- }
- return 0;
-}
-
-int sdio_tty_uninit_tty(void *sdio_tty_handle)
-{
- int ret = 0;
- int i = 0;
- struct sdio_tty *sdio_tty_drv = sdio_tty_handle;
-
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return -ENODEV;
- }
- if (sdio_tty_drv->sdio_tty_state == TTY_OPENED) {
- flush_workqueue(sdio_tty_drv->workq);
- destroy_workqueue(sdio_tty_drv->workq);
-
- kfree(sdio_tty_drv->read_buf);
- sdio_tty_drv->read_buf = NULL;
- }
-
- if (sdio_tty_drv->sdio_tty_state != TTY_INITIAL) {
- tty_unregister_device(sdio_tty_drv->tty_drv, 0);
-
- ret = tty_unregister_driver(sdio_tty_drv->tty_drv);
- if (ret) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: "
- "tty_unregister_driver() failed for dev %s\n",
- __func__, sdio_tty_drv->tty_dev_name);
- }
- put_tty_driver(sdio_tty_drv->tty_drv);
- sdio_tty_drv->sdio_tty_state = TTY_INITIAL;
- sdio_tty_drv->tty_drv = NULL;
- }
-
- for (i = 0; i < MAX_SDIO_TTY_DEVS; i++) {
- if (sdio_tty[i] == NULL)
- continue;
- if (sdio_tty[i]->device_id == sdio_tty_drv->device_id) {
- sdio_tty[i] = NULL;
- break;
- }
- }
-
- DEBUG_MSG(sdio_tty_drv, SDIO_TTY_MODULE_NAME ": %s: Freeing sdio_tty "
- "structure, dev=%s", __func__,
- sdio_tty_drv->tty_dev_name);
- kfree(sdio_tty_drv);
-
- return 0;
-}
-
-static int sdio_tty_probe(struct platform_device *pdev)
-{
- const struct platform_device_id *id = platform_get_device_id(pdev);
- enum sdio_tty_devices device_id = id->driver_data;
- char *device_name = NULL;
- char *channel_name = NULL;
- int debug_msg_on = 0;
- int ret = 0;
-
- pr_debug(SDIO_TTY_MODULE_NAME ": %s for %s", __func__, pdev->name);
-
- switch (device_id) {
- case SDIO_CSVT:
- device_name = SDIO_TTY_CSVT_DEV;
- channel_name = SDIO_TTY_CH_CSVT;
- debug_msg_on = csvt_debug_msg_on;
- break;
- case SDIO_CSVT_TEST_APP:
- device_name = SDIO_TTY_CSVT_TEST_DEV;
- channel_name = SDIO_TTY_CH_CSVT;
- debug_msg_on = csvt_debug_msg_on;
- break;
- default:
- pr_err(SDIO_TTY_MODULE_NAME ": %s Invalid device:%s, id:%d",
- __func__, pdev->name, device_id);
- ret = -ENODEV;
- break;
- }
-
- if (device_name) {
- ret = sdio_tty_init_tty(device_name, channel_name,
- device_id, debug_msg_on);
- if (ret) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_init_tty "
- "failed for dev:%s", __func__, device_name);
- }
- }
- return ret;
-}
-
-static int sdio_tty_remove(struct platform_device *pdev)
-{
- const struct platform_device_id *id = platform_get_device_id(pdev);
- enum sdio_tty_devices device_id = id->driver_data;
- struct sdio_tty *sdio_tty_drv = NULL;
- int i = 0;
- int ret = 0;
-
- pr_debug(SDIO_TTY_MODULE_NAME ": %s for %s", __func__, pdev->name);
-
- for (i = 0; i < MAX_SDIO_TTY_DEVS; i++) {
- if (sdio_tty[i] == NULL)
- continue;
- if (sdio_tty[i]->device_id == device_id) {
- sdio_tty_drv = sdio_tty[i];
- break;
- }
- }
-
- if (!sdio_tty_drv) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: NULL sdio_tty_drv",
- __func__);
- return -ENODEV;
- }
-
- ret = sdio_tty_uninit_tty(sdio_tty_drv);
- if (ret) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: sdio_tty_uninit_tty "
- "failed for %s", __func__, pdev->name);
- }
- return ret;
-}
-
-static struct platform_driver sdio_tty_pdrv = {
- .probe = sdio_tty_probe,
- .remove = sdio_tty_remove,
- .id_table = sdio_tty_id_table,
- .driver = {
- .name = "SDIO_TTY",
- .owner = THIS_MODULE,
- },
-};
-
-#ifdef CONFIG_DEBUG_FS
-void sdio_tty_print_info(void)
-{
- int i = 0;
-
- for (i = 0; i < MAX_SDIO_TTY_DEVS; i++) {
- if (sdio_tty[i] == NULL)
- continue;
- pr_info(SDIO_TTY_MODULE_NAME ": %s: Total Rx=%d, Tx = %d "
- "for dev %s", __func__, sdio_tty[i]->total_rx,
- sdio_tty[i]->total_tx, sdio_tty[i]->tty_dev_name);
- }
-}
-
-static int tty_debug_info_open(struct inode *inode, struct file *file)
-{
- file->private_data = inode->i_private;
- return 0;
-}
-
-static ssize_t tty_debug_info_write(struct file *file,
- const char __user *buf, size_t count, loff_t *ppos)
-{
- sdio_tty_print_info();
- return count;
-}
-
-const struct file_operations tty_debug_info_ops = {
- .open = tty_debug_info_open,
- .write = tty_debug_info_write,
-};
-#endif
-
-/*
- * Module Init.
- *
- * Register SDIO TTY driver.
- *
- */
-static int __init sdio_tty_init(void)
-{
- int ret = 0;
-
- ret = platform_driver_register(&sdio_tty_pdrv);
- if (ret) {
- pr_err(SDIO_TTY_MODULE_NAME ": %s: platform_driver_register "
- "failed", __func__);
- }
-#ifdef CONFIG_DEBUG_FS
- else {
- sdio_tty_debug_root = debugfs_create_dir("sdio_tty", NULL);
- if (sdio_tty_debug_root) {
- sdio_tty_debug_info = debugfs_create_file(
- "sdio_tty_debug",
- S_IRUGO | S_IWUGO,
- sdio_tty_debug_root,
- NULL,
- &tty_debug_info_ops);
- }
- }
-#endif
- return ret;
-};
-
-/*
- * Module Exit.
- *
- * Unregister SDIO TTY driver.
- *
- */
-static void __exit sdio_tty_exit(void)
-{
-#ifdef CONFIG_DEBUG_FS
- debugfs_remove(sdio_tty_debug_info);
- debugfs_remove(sdio_tty_debug_root);
-#endif
- platform_driver_unregister(&sdio_tty_pdrv);
-}
-
-module_init(sdio_tty_init);
-module_exit(sdio_tty_exit);
-
-MODULE_DESCRIPTION("SDIO TTY");
-MODULE_LICENSE("GPL v2");
-MODULE_AUTHOR("Maya Erez <merez@codeaurora.org>");
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index 09b3113..1241e44 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -2285,7 +2285,7 @@
edge_to_pids[ch->type].subsys_name);
irq_chip->irq_mask(irq_data);
if (cpumask)
- irq_chip->irq_set_affinity(irq_data, cpumask, true);
+ irq_set_affinity(int_cfg->irq_id, cpumask);
} else {
SMD_POWER_INFO("SMD Unmasking interrupts from %s\n",
edge_to_pids[ch->type].subsys_name);
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index a1a2e51..669b10e 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1500,7 +1500,9 @@
vm->flags = VM_LOWMEM | VM_ARM_STATIC_MAPPING;
vm->flags |= VM_ARM_MTYPE(type);
vm->caller = map_lowmem;
- vm_area_add_early(vm++);
+ vm_area_add_early(vm);
+ mark_vmalloc_reserved_area(vm->addr, vm->size);
+ vm++;
}
}
diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c
index 2dbb2f5..414207f 100644
--- a/drivers/char/diag/diag_dci.c
+++ b/drivers/char/diag/diag_dci.c
@@ -216,7 +216,11 @@
if (recv_pkt_cmd_code != DCI_PKT_RSP_CODE)
cmd_code_len = 4; /* delayed response */
write_len = (int)(*(uint16_t *)(buf+2)) - cmd_code_len;
-
+ if (write_len <= 0) {
+ pr_err("diag: Invalid length in %s, write_len: %d",
+ __func__, write_len);
+ return;
+ }
pr_debug("diag: len = %d\n", write_len);
tag = (int *)(buf + (4 + cmd_code_len)); /* Retrieve the Tag field */
req_entry = diag_dci_get_request_entry(*tag);
@@ -383,17 +387,23 @@
void extract_dci_log(unsigned char *buf)
{
- uint16_t log_code, item_num;
+ uint16_t log_code, item_num, log_length;
uint8_t equip_id, *log_mask_ptr, byte_mask;
unsigned int i, byte_index, byte_offset = 0;
struct diag_dci_client_tbl *entry;
+ log_length = *(uint16_t *)(buf + 2);
log_code = *(uint16_t *)(buf + 6);
equip_id = LOG_GET_EQUIP_ID(log_code);
item_num = LOG_GET_ITEM_NUM(log_code);
byte_index = item_num/8 + 2;
byte_mask = 0x01 << (item_num % 8);
+ if (log_length > USHRT_MAX - 4) {
+ pr_err("diag: Integer overflow in %s, log_len:%d",
+ __func__, log_length);
+ return;
+ }
byte_offset = (equip_id * 514) + byte_index;
if (byte_offset >= DCI_LOG_MASK_SIZE) {
pr_err("diag: Invalid byte_offset %d in dci log\n",
@@ -430,8 +440,8 @@
*(int *)(entry->dci_data+entry->data_len) =
DCI_LOG_TYPE;
memcpy(entry->dci_data + entry->data_len + 4,
- buf + 4, *(uint16_t *)(buf + 2));
- entry->data_len += 4 + *(uint16_t *)(buf + 2);
+ buf + 4, log_length);
+ entry->data_len += 4 + log_length;
}
mutex_unlock(&entry->data_mutex);
mutex_unlock(&dci_health_mutex);
diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c
index 6ead0ad..002bd0c 100644
--- a/drivers/char/diag/diagchar_core.c
+++ b/drivers/char/diag/diagchar_core.c
@@ -1117,7 +1117,7 @@
case DIAG_IOCTL_VOTE_REAL_TIME:
if (copy_from_user(&rt_vote, (void *)ioarg, sizeof(struct
real_time_vote_t)))
- result = -EFAULT;
+ return -EFAULT;
driver->real_time_update_busy++;
if (rt_vote.proc == DIAG_PROC_DCI) {
diag_dci_set_real_time(current->tgid,
diff --git a/drivers/char/diag/diagfwd_cntl.c b/drivers/char/diag/diagfwd_cntl.c
index d3c311d..53e8e72 100644
--- a/drivers/char/diag/diagfwd_cntl.c
+++ b/drivers/char/diag/diagfwd_cntl.c
@@ -349,10 +349,19 @@
int wr_size = -ENOMEM, retry_count = 0, timer;
struct diag_smd_info *data = NULL;
- /* For now only allow the modem to receive the message */
- if (!smd_info || smd_info->type != SMD_CNTL_TYPE ||
- (smd_info->peripheral != MODEM_DATA))
+ if (!smd_info || smd_info->type != SMD_CNTL_TYPE) {
+ pr_err("diag: In %s, invalid channel info, smd_info: %p type: %d\n",
+ __func__, smd_info,
+ ((smd_info) ? smd_info->type : -1));
return;
+ }
+
+ if (smd_info->peripheral < MODEM_DATA ||
+ smd_info->peripheral > WCNSS_DATA) {
+ pr_err("diag: In %s, invalid peripheral %d\n", __func__,
+ smd_info->peripheral);
+ return;
+ }
data = &driver->smd_data[smd_info->peripheral];
if (!data)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 975a42f..4605685 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1726,7 +1726,8 @@
memcpy(&policy->cpuinfo, &data->cpuinfo,
sizeof(struct cpufreq_cpuinfo));
- if (policy->min > data->max || policy->max < data->min) {
+ if (policy->min > data->user_policy.max
+ || policy->max < data->user_policy.min) {
ret = -EINVAL;
goto error_out;
}
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 22448a1..45a41eb 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -124,11 +124,14 @@
static bool io_is_busy;
/*
- * If the max load among the other CPUs is higher than sync_freq_load_threshold
- * then do not let the frequency to drop below sync_freq
+ * If the max load among other CPUs is higher than up_threshold_any_cpu_load
+ * and if the highest frequency among the other CPUs is higher than
+ * up_threshold_any_cpu_freq then do not let the frequency to drop below
+ * sync_freq
*/
-static unsigned int sync_freq_load_threshold;
+static unsigned int up_threshold_any_cpu_load;
static unsigned int sync_freq;
+static unsigned int up_threshold_any_cpu_freq;
static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
unsigned int event);
@@ -393,8 +396,9 @@
unsigned long flags;
bool boosted;
unsigned long mod_min_sample_time;
- int i, max_load_other_cpu;
- unsigned int max_freq_other_cpu;
+ int i, max_load;
+ unsigned int max_freq;
+ struct cpufreq_interactive_cpuinfo *picpu;
if (!down_read_trylock(&pcpu->enable_sem))
return;
@@ -416,20 +420,6 @@
pcpu->prev_load = cpu_load;
boosted = boost_val || now < boostpulse_endtime;
- max_load_other_cpu = 0;
- max_freq_other_cpu = 0;
- for_each_online_cpu(i) {
- struct cpufreq_interactive_cpuinfo *picpu =
- &per_cpu(cpuinfo, i);
- if (i == data)
- continue;
- if (max_load_other_cpu < picpu->prev_load)
- max_load_other_cpu = picpu->prev_load;
-
- if (picpu->policy->cur > max_freq_other_cpu)
- max_freq_other_cpu = picpu->policy->cur;
- }
-
if (cpu_load >= go_hispeed_load || boosted) {
if (pcpu->target_freq < hispeed_freq) {
new_freq = hispeed_freq;
@@ -441,10 +431,27 @@
}
} else {
new_freq = choose_freq(pcpu, loadadjfreq);
- if (sync_freq && (max_freq_other_cpu > sync_freq) &&
- (max_load_other_cpu > sync_freq_load_threshold) &&
- (new_freq < sync_freq))
- new_freq = sync_freq;
+
+ if (sync_freq && new_freq < sync_freq) {
+
+ max_load = 0;
+ max_freq = 0;
+
+ for_each_online_cpu(i) {
+ picpu = &per_cpu(cpuinfo, i);
+
+ if (i == data || picpu->prev_load <
+ up_threshold_any_cpu_load)
+ continue;
+
+ max_load = max(max_load, picpu->prev_load);
+ max_freq = max(max_freq, picpu->policy->cur);
+ }
+
+ if (max_freq > up_threshold_any_cpu_freq &&
+ max_load >= up_threshold_any_cpu_load)
+ new_freq = sync_freq;
+ }
}
if (pcpu->target_freq >= hispeed_freq &&
@@ -470,11 +477,10 @@
* Do not scale below floor_freq unless we have been at or above the
* floor frequency for the minimum sample time since last validated.
*/
- if (pcpu->policy->cur == pcpu->policy->max) {
+ if (sampling_down_factor && pcpu->policy->cur == pcpu->policy->max)
mod_min_sample_time = sampling_down_factor;
- } else {
+ else
mod_min_sample_time = min_sample_time;
- }
if (new_freq < pcpu->floor_freq) {
if (now - pcpu->floor_validate_time < mod_min_sample_time) {
@@ -1121,13 +1127,13 @@
static struct global_attr sync_freq_attr = __ATTR(sync_freq, 0644,
show_sync_freq, store_sync_freq);
-static ssize_t show_sync_freq_load_threshold(struct kobject *kobj,
+static ssize_t show_up_threshold_any_cpu_load(struct kobject *kobj,
struct attribute *attr, char *buf)
{
- return sprintf(buf, "%u\n", sync_freq_load_threshold);
+ return snprintf(buf, PAGE_SIZE, "%u\n", up_threshold_any_cpu_load);
}
-static ssize_t store_sync_freq_load_threshold(struct kobject *kobj,
+static ssize_t store_up_threshold_any_cpu_load(struct kobject *kobj,
struct attribute *attr, const char *buf, size_t count)
{
int ret;
@@ -1136,14 +1142,38 @@
ret = kstrtoul(buf, 0, &val);
if (ret < 0)
return ret;
- sync_freq_load_threshold = val;
+ up_threshold_any_cpu_load = val;
return count;
}
-static struct global_attr sync_freq_load_threshold_attr =
- __ATTR(sync_freq_load_threshold, 0644,
- show_sync_freq_load_threshold, store_sync_freq_load_threshold);
+static struct global_attr up_threshold_any_cpu_load_attr =
+ __ATTR(up_threshold_any_cpu_load, 0644,
+ show_up_threshold_any_cpu_load,
+ store_up_threshold_any_cpu_load);
+static ssize_t show_up_threshold_any_cpu_freq(struct kobject *kobj,
+ struct attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%u\n", up_threshold_any_cpu_freq);
+}
+
+static ssize_t store_up_threshold_any_cpu_freq(struct kobject *kobj,
+ struct attribute *attr, const char *buf, size_t count)
+{
+ int ret;
+ unsigned long val;
+
+ ret = kstrtoul(buf, 0, &val);
+ if (ret < 0)
+ return ret;
+ up_threshold_any_cpu_freq = val;
+ return count;
+}
+
+static struct global_attr up_threshold_any_cpu_freq_attr =
+ __ATTR(up_threshold_any_cpu_freq, 0644,
+ show_up_threshold_any_cpu_freq,
+ store_up_threshold_any_cpu_freq);
static struct attribute *interactive_attributes[] = {
&target_loads_attr.attr,
@@ -1159,7 +1189,8 @@
&io_is_busy_attr.attr,
&sampling_down_factor_attr.attr,
&sync_freq_attr.attr,
- &sync_freq_load_threshold_attr.attr,
+ &up_threshold_any_cpu_load_attr.attr,
+ &up_threshold_any_cpu_freq_attr.attr,
NULL,
};
diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 17bbe19..ca7953d 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -71,6 +71,25 @@
Sets the frequency using a "on-demand" algorithm.
This governor is unlikely to be useful for other devices.
+config DEVFREQ_GOV_MSM_CPUFREQ
+ bool "MSM CPUfreq"
+ depends on CPU_FREQ_MSM
+ help
+ MSM CPUfreq based governor for CPU bandwidth voting. Sets the CPU
+ to DDR BW vote based on the current CPU frequency. This governor
+ is unlikely to be useful for non-MSM devices.
+
+config DEVFREQ_GOV_MSM_CPUBW_HWMON
+ tristate "HW monitor based governor for CPUBW"
+ depends on ARCH_MSM_KRAIT
+ help
+ HW monitor based governor for CPU to DDR bandwidth voting. This
+ goveror currently supports only Krait L2 PM counters. Sets the CPU
+ BW vote by using L2 PM counters to monitor the Krait's use of DDR.
+ Since this governor uses some of the PM counters it can conflict
+ with existing profiling tools. This governor is unlikely to be
+ useful for other devices.
+
comment "DEVFREQ Drivers"
config ARM_EXYNOS4_BUS_DEVFREQ
diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile
index 29b48ff..e06ed9f 100644
--- a/drivers/devfreq/Makefile
+++ b/drivers/devfreq/Makefile
@@ -4,6 +4,8 @@
obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o
obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o
obj-$(CONFIG_DEVFREQ_GOV_MSM_ADRENO_TZ) += governor_msm_adreno_tz.o
+obj-$(CONFIG_DEVFREQ_GOV_MSM_CPUFREQ) += governor_msm_cpufreq.o
+obj-$(CONFIG_DEVFREQ_GOV_MSM_CPUBW_HWMON) += governor_cpubw_hwmon.o
# DEVFREQ Drivers
obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos4_bus.o
diff --git a/drivers/devfreq/governor_cpubw_hwmon.c b/drivers/devfreq/governor_cpubw_hwmon.c
new file mode 100644
index 0000000..fb5a562
--- /dev/null
+++ b/drivers/devfreq/governor_cpubw_hwmon.c
@@ -0,0 +1,461 @@
+/*
+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt) "cpubw-hwmon: " fmt
+
+#include <linux/kernel.h>
+#include <asm/sizes.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/ktime.h>
+#include <linux/time.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/mutex.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/devfreq.h>
+#include "governor.h"
+
+#include <mach/msm-krait-l2-accessors.h>
+
+#define L2PMRESR2 0x412
+#define L2PMCR 0x400
+#define L2PMCNTENCLR 0x402
+#define L2PMCNTENSET 0x403
+#define L2PMINTENCLR 0x404
+#define L2PMINTENSET 0x405
+#define L2PMOVSR 0x406
+#define L2PMOVSSET 0x407
+#define L2PMnEVCNTCR(n) (0x420 + n * 0x10)
+#define L2PMnEVCNTR(n) (0x421 + n * 0x10)
+#define L2PMnEVCNTSR(n) (0x422 + n * 0x10)
+#define L2PMnEVFILTER(n) (0x423 + n * 0x10)
+#define L2PMnEVTYPER(n) (0x424 + n * 0x10)
+
+#define show_attr(name) \
+static ssize_t show_##name(struct device *dev, \
+ struct device_attribute *attr, char *buf) \
+{ \
+ return sprintf(buf, "%u\n", name); \
+}
+
+#define store_attr(name, _min, _max) \
+static ssize_t store_##name(struct device *dev, \
+ struct device_attribute *attr, const char *buf, \
+ size_t count) \
+{ \
+ int ret; \
+ unsigned int val; \
+ ret = sscanf(buf, "%u", &val); \
+ if (ret != 1) \
+ return -EINVAL; \
+ val = max(val, _min); \
+ val = min(val, _max); \
+ name = val; \
+ return count; \
+}
+
+#define gov_attr(__attr, min, max) \
+show_attr(__attr) \
+store_attr(__attr, min, max) \
+static DEVICE_ATTR(__attr, 0644, show_##__attr, store_##__attr)
+
+
+static int l2pm_irq;
+static unsigned int bytes_per_beat;
+static unsigned int sample_ms = 50;
+static unsigned int tolerance_percent = 10;
+static unsigned int guard_band_mbps = 100;
+static unsigned int decay_rate = 90;
+static unsigned int io_percent = 15;
+static unsigned int bw_step = 200;
+
+static u32 prev_r_start_val;
+static u32 prev_w_start_val;
+static unsigned long prev_ab;
+static ktime_t prev_ts;
+
+#define RD_MON 0
+#define WR_MON 1
+static void mon_init(void)
+{
+ /* Set up counters 0/1 to count write/read beats */
+ set_l2_indirect_reg(L2PMRESR2, 0x8B0B0000);
+ set_l2_indirect_reg(L2PMnEVCNTCR(RD_MON), 0x0);
+ set_l2_indirect_reg(L2PMnEVCNTCR(WR_MON), 0x0);
+ set_l2_indirect_reg(L2PMnEVCNTR(RD_MON), 0xFFFFFFFF);
+ set_l2_indirect_reg(L2PMnEVCNTR(WR_MON), 0xFFFFFFFF);
+ set_l2_indirect_reg(L2PMnEVFILTER(RD_MON), 0xF003F);
+ set_l2_indirect_reg(L2PMnEVFILTER(WR_MON), 0xF003F);
+ set_l2_indirect_reg(L2PMnEVTYPER(RD_MON), 0xA);
+ set_l2_indirect_reg(L2PMnEVTYPER(WR_MON), 0xB);
+}
+
+static void global_mon_enable(bool en)
+{
+ u32 regval;
+
+ /* Global counter enable */
+ regval = get_l2_indirect_reg(L2PMCR);
+ if (en)
+ regval |= BIT(0);
+ else
+ regval &= ~BIT(0);
+ set_l2_indirect_reg(L2PMCR, regval);
+}
+
+static void mon_enable(int n)
+{
+ /* Clear previous overflow state for event counter n */
+ set_l2_indirect_reg(L2PMOVSR, BIT(n));
+
+ /* Enable event counter n */
+ set_l2_indirect_reg(L2PMCNTENSET, BIT(n));
+}
+
+static void mon_disable(int n)
+{
+ /* Disable event counter n */
+ set_l2_indirect_reg(L2PMCNTENCLR, BIT(n));
+}
+
+static void mon_irq_enable(int n, bool en)
+{
+ if (en)
+ set_l2_indirect_reg(L2PMINTENSET, BIT(n));
+ else
+ set_l2_indirect_reg(L2PMINTENCLR, BIT(n));
+}
+
+/* Returns start counter value to be used with mon_get_mbps() */
+static u32 mon_set_limit_mbyte(int n, unsigned int mbytes)
+{
+ u32 regval, beats;
+
+ beats = mult_frac(mbytes, SZ_1M, bytes_per_beat);
+ regval = 0xFFFFFFFF - beats;
+ set_l2_indirect_reg(L2PMnEVCNTR(n), regval);
+ pr_debug("EV%d MB: %d, start val: %x\n", n, mbytes, regval);
+
+ return regval;
+}
+
+long mon_get_count(int n, u32 start_val)
+{
+ u32 overflow, count;
+
+ count = get_l2_indirect_reg(L2PMnEVCNTR(n));
+ overflow = get_l2_indirect_reg(L2PMOVSR);
+
+ pr_debug("EV%d ov: %x, cnt: %x\n", n, overflow, count);
+
+ if (overflow & BIT(n))
+ return 0xFFFFFFFF - start_val + count;
+ else
+ return count - start_val;
+}
+
+/* Returns MBps of read/writes for the sampling window. */
+unsigned int beats_to_mbps(long long beats, unsigned int us)
+{
+ beats *= USEC_PER_SEC;
+ beats *= bytes_per_beat;
+ do_div(beats, us);
+ beats = DIV_ROUND_UP_ULL(beats, SZ_1M);
+
+ return beats;
+}
+
+static int to_limit(int mbps)
+{
+ mbps *= (100 + tolerance_percent) * sample_ms;
+ mbps /= 100;
+ mbps = DIV_ROUND_UP(mbps, MSEC_PER_SEC);
+ return mbps;
+}
+
+unsigned long measure_bw_and_set_irq(void)
+{
+ long r_mbps, w_mbps, mbps;
+ ktime_t ts;
+ unsigned int us;
+
+ /*
+ * Since we are stopping the counters, we don't want this short work
+ * to be interrupted by other tasks and cause the measurements to be
+ * wrong. Not blocking interrupts to avoid affecting interrupt
+ * latency and since they should be short anyway because they run in
+ * atomic context.
+ */
+ preempt_disable();
+
+ ts = ktime_get();
+ us = ktime_to_us(ktime_sub(ts, prev_ts));
+ if (!us)
+ us = 1;
+
+ mon_disable(RD_MON);
+ mon_disable(WR_MON);
+
+ r_mbps = mon_get_count(RD_MON, prev_r_start_val);
+ r_mbps = beats_to_mbps(r_mbps, us);
+ w_mbps = mon_get_count(WR_MON, prev_w_start_val);
+ w_mbps = beats_to_mbps(w_mbps, us);
+
+ prev_r_start_val = mon_set_limit_mbyte(RD_MON, to_limit(r_mbps));
+ prev_w_start_val = mon_set_limit_mbyte(WR_MON, to_limit(w_mbps));
+ prev_ts = ts;
+
+ mon_enable(RD_MON);
+ mon_enable(WR_MON);
+
+ preempt_enable();
+
+ mbps = r_mbps + w_mbps;
+ pr_debug("R/W/BW/us = %ld/%ld/%ld/%d\n", r_mbps, w_mbps, mbps, us);
+
+ return mbps;
+}
+
+static void compute_bw(int mbps, unsigned long *freq, unsigned long *ab)
+{
+ int new_bw;
+
+ mbps += guard_band_mbps;
+
+ if (mbps > prev_ab) {
+ new_bw = mbps;
+ } else {
+ new_bw = mbps * decay_rate + prev_ab * (100 - decay_rate);
+ new_bw /= 100;
+ }
+
+ *ab = roundup(mbps, bw_step);
+ *freq = roundup((mbps * 100) / io_percent, bw_step);
+}
+
+#define TOO_SOON_US (1 * USEC_PER_MSEC)
+static irqreturn_t mon_intr_handler(int irq, void *dev)
+{
+ struct devfreq *df = dev;
+ ktime_t ts;
+ unsigned int us;
+ u32 regval;
+ int ret;
+
+ regval = get_l2_indirect_reg(L2PMOVSR);
+ pr_debug("Got interrupt: %x\n", regval);
+
+ devfreq_monitor_stop(df);
+
+ /*
+ * Don't recalc bandwidth if the interrupt comes right after a
+ * previous bandwidth calculation. This is done for two reasons:
+ *
+ * 1. Sampling the BW during a very short duration can result in a
+ * very inaccurate measurement due to very short bursts.
+ * 2. This can only happen if the limit was hit very close to the end
+ * of the previous sample period. Which means the current BW
+ * estimate is not very off and doesn't need to be readjusted.
+ */
+ ts = ktime_get();
+ us = ktime_to_us(ktime_sub(ts, prev_ts));
+ if (us > TOO_SOON_US) {
+ mutex_lock(&df->lock);
+ ret = update_devfreq(df);
+ if (ret)
+ pr_err("Unable to update freq on IRQ!\n");
+ mutex_unlock(&df->lock);
+ }
+
+ devfreq_monitor_start(df);
+
+ return IRQ_HANDLED;
+}
+
+static int start_monitoring(struct devfreq *df)
+{
+ int ret, mbyte;
+
+ ret = request_threaded_irq(l2pm_irq, NULL, mon_intr_handler,
+ IRQF_ONESHOT | IRQF_SHARED,
+ "cpubw_hwmon", df);
+ if (ret) {
+ pr_err("Unable to register interrupt handler\n");
+ return ret;
+ }
+
+ mon_init();
+ mon_disable(RD_MON);
+ mon_disable(WR_MON);
+
+ mbyte = (df->previous_freq * io_percent) / (2 * 100);
+ prev_r_start_val = mon_set_limit_mbyte(RD_MON, mbyte);
+ prev_w_start_val = mon_set_limit_mbyte(WR_MON, mbyte);
+ prev_ts = ktime_get();
+ prev_ab = 0;
+
+ mon_irq_enable(RD_MON, true);
+ mon_irq_enable(WR_MON, true);
+ mon_enable(RD_MON);
+ mon_enable(WR_MON);
+ global_mon_enable(true);
+
+ return 0;
+}
+
+static void stop_monitoring(struct devfreq *df)
+{
+ global_mon_enable(false);
+ mon_disable(RD_MON);
+ mon_disable(WR_MON);
+ mon_irq_enable(RD_MON, false);
+ mon_irq_enable(WR_MON, false);
+
+ disable_irq(l2pm_irq);
+ free_irq(l2pm_irq, df);
+}
+
+static int devfreq_cpubw_hwmon_get_freq(struct devfreq *df,
+ unsigned long *freq,
+ u32 *flag)
+{
+ unsigned long mbps;
+
+ mbps = measure_bw_and_set_irq();
+ compute_bw(mbps, freq, df->data);
+ prev_ab = *(unsigned long *) df->data;
+
+ return 0;
+}
+
+gov_attr(sample_ms, 10U, 500U);
+gov_attr(tolerance_percent, 0U, 30U);
+gov_attr(guard_band_mbps, 0U, 2000U);
+gov_attr(decay_rate, 0U, 100U);
+gov_attr(io_percent, 1U, 100U);
+gov_attr(bw_step, 50U, 1000U);
+
+static struct attribute *dev_attr[] = {
+ &dev_attr_sample_ms.attr,
+ &dev_attr_tolerance_percent.attr,
+ &dev_attr_guard_band_mbps.attr,
+ &dev_attr_decay_rate.attr,
+ &dev_attr_io_percent.attr,
+ &dev_attr_bw_step.attr,
+ NULL,
+};
+
+static struct attribute_group dev_attr_group = {
+ .name = "cpubw_hwmon",
+ .attrs = dev_attr,
+};
+
+static int devfreq_cpubw_hwmon_ev_handler(struct devfreq *df,
+ unsigned int event, void *data)
+{
+ int ret;
+
+ switch (event) {
+ case DEVFREQ_GOV_START:
+ ret = start_monitoring(df);
+ if (ret)
+ return ret;
+ ret = sysfs_create_group(&df->dev.kobj, &dev_attr_group);
+ if (ret)
+ return ret;
+ devfreq_monitor_start(df);
+ pr_debug("Enabled CPU BW HW monitor governor\n");
+ break;
+
+ case DEVFREQ_GOV_STOP:
+ sysfs_remove_group(&df->dev.kobj, &dev_attr_group);
+ devfreq_monitor_stop(df);
+ *(unsigned long *)df->data = 0;
+ stop_monitoring(df);
+ pr_debug("Disabled CPU BW HW monitor governor\n");
+ break;
+
+ case DEVFREQ_GOV_INTERVAL:
+ devfreq_interval_update(df, (unsigned int *)data);
+ break;
+ }
+
+ return 0;
+}
+
+static struct devfreq_governor devfreq_cpubw_hwmon = {
+ .name = "cpubw_hwmon",
+ .get_target_freq = devfreq_cpubw_hwmon_get_freq,
+ .event_handler = devfreq_cpubw_hwmon_ev_handler,
+};
+
+static int cpubw_hwmon_driver_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ int ret;
+
+ l2pm_irq = platform_get_irq(pdev, 0);
+ if (l2pm_irq < 0) {
+ pr_err("Unable to get IRQ number\n");
+ return l2pm_irq;
+ }
+
+ ret = of_property_read_u32(dev->of_node, "qcom,bytes-per-beat",
+ &bytes_per_beat);
+ if (ret) {
+ pr_err("Unable to read bytes per beat\n");
+ return ret;
+ }
+
+ ret = devfreq_add_governor(&devfreq_cpubw_hwmon);
+ if (ret) {
+ pr_err("devfreq governor registration failed\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static struct of_device_id match_table[] = {
+ { .compatible = "qcom,kraitbw-l2pm" },
+ {}
+};
+
+static struct platform_driver cpubw_hwmon_driver = {
+ .probe = cpubw_hwmon_driver_probe,
+ .driver = {
+ .name = "kraitbw-l2pm",
+ .of_match_table = match_table,
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init cpubw_hwmon_init(void)
+{
+ return platform_driver_register(&cpubw_hwmon_driver);
+}
+module_init(cpubw_hwmon_init);
+
+static void __exit cpubw_hwmon_exit(void)
+{
+ platform_driver_unregister(&cpubw_hwmon_driver);
+}
+module_exit(cpubw_hwmon_exit);
+
+MODULE_DESCRIPTION("HW monitor based CPU DDR bandwidth voting driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/devfreq/governor_msm_cpufreq.c b/drivers/devfreq/governor_msm_cpufreq.c
new file mode 100644
index 0000000..9b13e26
--- /dev/null
+++ b/drivers/devfreq/governor_msm_cpufreq.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/devfreq.h>
+#include <mach/cpufreq.h>
+#include "governor.h"
+
+DEFINE_MUTEX(df_lock);
+static struct devfreq *df;
+
+static int devfreq_msm_cpufreq_get_freq(struct devfreq *df,
+ unsigned long *freq,
+ u32 *flag)
+{
+ *freq = msm_cpufreq_get_bw();
+ return 0;
+}
+
+int devfreq_msm_cpufreq_update_bw(void)
+{
+ int ret = 0;
+
+ mutex_lock(&df_lock);
+ if (df) {
+ mutex_lock(&df->lock);
+ ret = update_devfreq(df);
+ mutex_unlock(&df->lock);
+ }
+ mutex_unlock(&df_lock);
+ return ret;
+}
+
+static int devfreq_msm_cpufreq_ev_handler(struct devfreq *devfreq,
+ unsigned int event, void *data)
+{
+ int ret;
+
+ switch (event) {
+ case DEVFREQ_GOV_START:
+ mutex_lock(&df_lock);
+ df = devfreq;
+ mutex_unlock(&df_lock);
+
+ ret = devfreq_msm_cpufreq_update_bw();
+ if (ret) {
+ pr_err("Unable to update BW! Gov start failed!\n");
+ return ret;
+ }
+
+ devfreq_monitor_stop(df);
+ pr_debug("Enabled MSM CPUfreq governor\n");
+ break;
+
+ case DEVFREQ_GOV_STOP:
+ mutex_lock(&df_lock);
+ df = NULL;
+ mutex_unlock(&df_lock);
+
+ pr_debug("Disabled MSM CPUfreq governor\n");
+ break;
+ }
+
+ return 0;
+}
+
+static struct devfreq_governor devfreq_msm_cpufreq = {
+ .name = "msm_cpufreq",
+ .get_target_freq = devfreq_msm_cpufreq_get_freq,
+ .event_handler = devfreq_msm_cpufreq_ev_handler,
+};
+
+int register_devfreq_msm_cpufreq(void)
+{
+ return devfreq_add_governor(&devfreq_msm_cpufreq);
+}
diff --git a/drivers/gpu/ion/ion_heap.c b/drivers/gpu/ion/ion_heap.c
index 9d33bf4..73dd868 100644
--- a/drivers/gpu/ion/ion_heap.c
+++ b/drivers/gpu/ion/ion_heap.c
@@ -108,8 +108,7 @@
*
* Note that the `pages' array should be composed of all 4K pages.
*/
-int ion_heap_pages_zero(struct page **pages, int num_pages,
- bool should_invalidate)
+int ion_heap_pages_zero(struct page **pages, int num_pages)
{
int i, j, k, npages_to_vmap;
void *ptr = NULL;
@@ -143,19 +142,17 @@
return -ENOMEM;
memset(ptr, 0, npages_to_vmap * PAGE_SIZE);
- if (should_invalidate) {
- /*
- * invalidate the cache to pick up the zeroing
- */
- for (k = 0; k < npages_to_vmap; k++) {
- void *p = kmap_atomic(pages[i + k]);
- phys_addr_t phys = page_to_phys(
- pages[i + k]);
+ /*
+ * invalidate the cache to pick up the zeroing
+ */
+ for (k = 0; k < npages_to_vmap; k++) {
+ void *p = kmap_atomic(pages[i + k]);
+ phys_addr_t phys = page_to_phys(
+ pages[i + k]);
- dmac_inv_range(p, p + PAGE_SIZE);
- outer_inv_range(phys, phys + PAGE_SIZE);
- kunmap_atomic(p);
- }
+ dmac_inv_range(p, p + PAGE_SIZE);
+ outer_inv_range(phys, phys + PAGE_SIZE);
+ kunmap_atomic(p);
}
vunmap(ptr);
}
@@ -196,8 +193,7 @@
pages_mem->free_fn(pages_mem->pages);
}
-int ion_heap_high_order_page_zero(struct page *page,
- int order, bool should_invalidate)
+int ion_heap_high_order_page_zero(struct page *page, int order)
{
int i, ret;
struct pages_mem pages_mem;
@@ -210,8 +206,7 @@
for (i = 0; i < (1 << order); ++i)
pages_mem.pages[i] = page + i;
- ret = ion_heap_pages_zero(pages_mem.pages, npages,
- should_invalidate);
+ ret = ion_heap_pages_zero(pages_mem.pages, npages);
ion_heap_free_pages_mem(&pages_mem);
return ret;
}
@@ -240,8 +235,7 @@
pages_mem.pages[npages++] = page + j;
}
- ret = ion_heap_pages_zero(pages_mem.pages, npages,
- ion_buffer_cached(buffer));
+ ret = ion_heap_pages_zero(pages_mem.pages, npages);
ion_heap_free_pages_mem(&pages_mem);
return ret;
}
diff --git a/drivers/gpu/ion/ion_page_pool.c b/drivers/gpu/ion/ion_page_pool.c
index 94f9445..cc2a36d 100644
--- a/drivers/gpu/ion/ion_page_pool.c
+++ b/drivers/gpu/ion/ion_page_pool.c
@@ -40,8 +40,7 @@
return NULL;
if (pool->gfp_mask & __GFP_ZERO)
- if (ion_heap_high_order_page_zero(
- page, pool->order, pool->should_invalidate))
+ if (ion_heap_high_order_page_zero(page, pool->order))
goto error_free_pages;
sg_init_table(&sg, 1);
@@ -175,8 +174,7 @@
return nr_freed;
}
-struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order,
- bool should_invalidate)
+struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order)
{
struct ion_page_pool *pool = kmalloc(sizeof(struct ion_page_pool),
GFP_KERNEL);
@@ -188,7 +186,6 @@
INIT_LIST_HEAD(&pool->high_items);
pool->gfp_mask = gfp_mask;
pool->order = order;
- pool->should_invalidate = should_invalidate;
mutex_init(&pool->mutex);
plist_node_init(&pool->list, order);
diff --git a/drivers/gpu/ion/ion_priv.h b/drivers/gpu/ion/ion_priv.h
index aa0a9e2..c57efc1 100644
--- a/drivers/gpu/ion/ion_priv.h
+++ b/drivers/gpu/ion/ion_priv.h
@@ -234,11 +234,9 @@
void ion_heap_unmap_kernel(struct ion_heap *, struct ion_buffer *);
int ion_heap_map_user(struct ion_heap *, struct ion_buffer *,
struct vm_area_struct *);
-int ion_heap_pages_zero(struct page **pages, int num_pages,
- bool should_invalidate);
+int ion_heap_pages_zero(struct page **pages, int num_pages);
int ion_heap_buffer_zero(struct ion_buffer *buffer);
-int ion_heap_high_order_page_zero(struct page *page,
- int order, bool should_invalidate);
+int ion_heap_high_order_page_zero(struct page *page, int order);
/**
* ion_heap_init_deferred_free -- initialize deferred free functionality
@@ -357,8 +355,6 @@
* @gfp_mask: gfp_mask to use from alloc
* @order: order of pages in the pool
* @list: plist node for list of pools
- * @should_invalidate: whether or not the cache needs to be invalidated at
- * page allocation time.
*
* Allows you to keep a pool of pre allocated pages to use from your heap.
* Keeping a pool of pages that is ready for dma, ie any cached mapping have
@@ -374,11 +370,9 @@
gfp_t gfp_mask;
unsigned int order;
struct plist_node list;
- bool should_invalidate;
};
-struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order,
- bool should_invalidate);
+struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order);
void ion_page_pool_destroy(struct ion_page_pool *);
void *ion_page_pool_alloc(struct ion_page_pool *);
void ion_page_pool_free(struct ion_page_pool *, struct page *);
diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c
index 8e885b2..be1a89c 100644
--- a/drivers/gpu/ion/ion_system_heap.c
+++ b/drivers/gpu/ion/ion_system_heap.c
@@ -355,8 +355,7 @@
* nothing. If it succeeds you'll eventually need to use
* ion_system_heap_destroy_pools to destroy the pools.
*/
-static int ion_system_heap_create_pools(struct ion_page_pool **pools,
- bool should_invalidate)
+static int ion_system_heap_create_pools(struct ion_page_pool **pools)
{
int i;
for (i = 0; i < num_orders; i++) {
@@ -365,8 +364,7 @@
if (orders[i] > 4)
gfp_flags = high_order_gfp_flags;
- pool = ion_page_pool_create(gfp_flags, orders[i],
- should_invalidate);
+ pool = ion_page_pool_create(gfp_flags, orders[i]);
if (!pool)
goto err_create_pool;
pools[i] = pool;
@@ -397,10 +395,10 @@
if (!heap->cached_pools)
goto err_alloc_cached_pools;
- if (ion_system_heap_create_pools(heap->uncached_pools, false))
+ if (ion_system_heap_create_pools(heap->uncached_pools))
goto err_create_uncached_pools;
- if (ion_system_heap_create_pools(heap->cached_pools, true))
+ if (ion_system_heap_create_pools(heap->cached_pools))
goto err_create_cached_pools;
heap->heap.shrinker.shrink = ion_system_heap_shrink;
diff --git a/drivers/gpu/ion/msm/msm_ion.c b/drivers/gpu/ion/msm/msm_ion.c
index cdd31e1..a6fc3d5 100644
--- a/drivers/gpu/ion/msm/msm_ion.c
+++ b/drivers/gpu/ion/msm/msm_ion.c
@@ -973,7 +973,7 @@
sizeof(struct ion_flush_data)))
return -EFAULT;
- if (data.handle >= 0) {
+ if (data.handle > 0) {
handle = ion_handle_get_by_id(client, (int)data.handle);
if (IS_ERR(handle)) {
pr_info("%s: Could not find handle: %d\n",
diff --git a/drivers/gpu/msm/adreno_coresight.c b/drivers/gpu/msm/adreno_coresight.c
index 1b827ff..d0ba145 100644
--- a/drivers/gpu/msm/adreno_coresight.c
+++ b/drivers/gpu/msm/adreno_coresight.c
@@ -55,7 +55,12 @@
int adreno_coresight_enable(struct coresight_device *csdev)
{
struct kgsl_device *device = dev_get_drvdata(csdev->dev.parent);
- struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
+ struct adreno_device *adreno_dev;
+
+ if (device == NULL)
+ return -ENODEV;
+
+ adreno_dev = ADRENO_DEVICE(device);
/* Check if coresight compatible device, return error otherwise */
if (adreno_dev->gpudev->coresight_enable)
@@ -80,7 +85,12 @@
void adreno_coresight_disable(struct coresight_device *csdev)
{
struct kgsl_device *device = dev_get_drvdata(csdev->dev.parent);
- struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
+ struct adreno_device *adreno_dev;
+
+ if (device == NULL)
+ return;
+
+ adreno_dev = ADRENO_DEVICE(device);
/* Check if coresight compatible device, bail otherwise */
if (adreno_dev->gpudev->coresight_disable)
@@ -134,6 +144,10 @@
struct kgsl_device *device = dev_get_drvdata(dev->parent);
struct coresight_attr *csight_attr = container_of(attr,
struct coresight_attr, attr);
+
+ if (device == NULL)
+ return -ENODEV;
+
return coresight_read_reg(device, csight_attr->regname, buf);
}
@@ -142,11 +156,16 @@
const char *buf, size_t size)
{
struct kgsl_device *device = dev_get_drvdata(dev->parent);
- struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
+ struct adreno_device *adreno_dev;
struct coresight_attr *csight_attr = container_of(attr,
struct coresight_attr, attr);
unsigned int regval = 0;
+ if (device == NULL)
+ return -ENODEV;
+
+ adreno_dev = ADRENO_DEVICE(device);
+
regval = coresight_convert_reg(buf);
if (adreno_dev->gpudev->coresight_config_debug_reg)
diff --git a/drivers/gpu/msm/adreno_dispatch.c b/drivers/gpu/msm/adreno_dispatch.c
index 2da36b6..a39ceef 100644
--- a/drivers/gpu/msm/adreno_dispatch.c
+++ b/drivers/gpu/msm/adreno_dispatch.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1515,8 +1515,14 @@
*/
void adreno_dispatcher_start(struct kgsl_device *device)
{
+ struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
+
complete_all(&device->cmdbatch_gate);
+ /* a305b & a305c GPUs are slower than a330 and needs a larger timer */
+ if (adreno_is_a305b(adreno_dev) || adreno_is_a305c(adreno_dev))
+ _fault_timer_interval = 200;
+
/* Schedule the work loop to get things going */
adreno_dispatcher_schedule(device);
}
diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c
index 3e15580..96ff1b8 100644
--- a/drivers/gpu/msm/kgsl_pwrctrl.c
+++ b/drivers/gpu/msm/kgsl_pwrctrl.c
@@ -132,6 +132,9 @@
int buslevel = 0;
if (!pwr->pcl)
return;
+ /* the bus should be ON to update the active frequency */
+ if (on && !(test_bit(KGSL_PWRFLAGS_AXI_ON, &pwr->power_flags)))
+ return;
/*
* If the bus should remain on calculate our request and submit it,
* otherwise request bus level 0, off.
@@ -175,11 +178,10 @@
pwr->bus_mod = 0;
pwrlevel = &pwr->pwrlevels[pwr->active_pwrlevel];
- if (test_bit(KGSL_PWRFLAGS_AXI_ON, &pwr->power_flags)) {
- kgsl_pwrctrl_buslevel_update(device, true);
+ kgsl_pwrctrl_buslevel_update(device, true);
+ if (test_bit(KGSL_PWRFLAGS_AXI_ON, &pwr->power_flags))
if (pwr->ebi1_clk)
clk_set_rate(pwr->ebi1_clk, pwrlevel->bus_freq);
- }
if (test_bit(KGSL_PWRFLAGS_CLK_ON, &pwr->power_flags) ||
(device->state == KGSL_STATE_NAP)) {
diff --git a/drivers/gpu/msm/kgsl_sharedmem.c b/drivers/gpu/msm/kgsl_sharedmem.c
index d031d5e..d3adf84 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
@@ -591,7 +591,6 @@
sglen_alloc = PAGE_ALIGN(size) >> PAGE_SHIFT;
- memdesc->size = size;
memdesc->pagetable = pagetable;
memdesc->ops = &kgsl_page_alloc_ops;
@@ -654,6 +653,14 @@
continue;
}
+ /*
+ * Update sglen and memdesc size,as requested allocation
+ * not served fully. So that they can be correctly freed
+ * in kgsl_sharedmem_free().
+ */
+ memdesc->sglen = sglen;
+ memdesc->size = (size - len);
+
KGSL_CORE_ERR(
"Out of memory: only allocated %dKB of %dKB requested\n",
(size - len) >> 10, size >> 10);
@@ -670,6 +677,7 @@
}
memdesc->sglen = sglen;
+ memdesc->size = size;
/*
* All memory that goes to the user has to be zeroed out before it gets
@@ -716,15 +724,15 @@
outer_cache_range_op_sg(memdesc->sg, memdesc->sglen,
KGSL_CACHE_OP_FLUSH);
- KGSL_STATS_ADD(size, kgsl_driver.stats.page_alloc,
- kgsl_driver.stats.page_alloc_max);
-
order = get_order(size);
if (order < 16)
kgsl_driver.stats.histogram[order]++;
done:
+ KGSL_STATS_ADD(memdesc->size, kgsl_driver.stats.page_alloc,
+ kgsl_driver.stats.page_alloc_max);
+
if ((memdesc->sglen_alloc * sizeof(struct page *)) > PAGE_SIZE)
vfree(pages);
else
diff --git a/drivers/gpu/msm/kgsl_sharedmem.h b/drivers/gpu/msm/kgsl_sharedmem.h
index 505be69..f0114ad 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.h
+++ b/drivers/gpu/msm/kgsl_sharedmem.h
@@ -141,7 +141,7 @@
static inline void *kgsl_sg_alloc(unsigned int sglen)
{
- if (sglen >= ULONG_MAX / sizeof(struct scatterlist))
+ if ((sglen == 0) || (sglen >= ULONG_MAX / sizeof(struct scatterlist)))
return NULL;
if ((sglen * sizeof(struct scatterlist)) < PAGE_SIZE)
diff --git a/drivers/hwmon/epm_adc.c b/drivers/hwmon/epm_adc.c
index f7cf2df..2f5ed9d 100644
--- a/drivers/hwmon/epm_adc.c
+++ b/drivers/hwmon/epm_adc.c
@@ -888,6 +888,12 @@
init_resp->num_dev = rx_buf[6];
init_resp->num_channel = rx_buf[7];
+ pr_debug("EPM PSOC response for hello command: resp_cmd:0x%x\n",
+ rx_buf[0]);
+ pr_debug("EPM PSOC version:0x%x\n", rx_buf[1]);
+ pr_debug("EPM PSOC firmware version:0x%x\n",
+ rx_buf[6] | rx_buf[5] | rx_buf[4] | rx_buf[3]);
+
return rc;
}
diff --git a/drivers/hwmon/qpnp-adc-common.c b/drivers/hwmon/qpnp-adc-common.c
index 9e0be59..6a52aa3 100644
--- a/drivers/hwmon/qpnp-adc-common.c
+++ b/drivers/hwmon/qpnp-adc-common.c
@@ -238,6 +238,60 @@
{800, 549},
};
+static const struct qpnp_vadc_map_pt adcmap_qrd_skug_btm_threshold[] = {
+ {-200, 1338},
+ {-180, 1307},
+ {-160, 1276},
+ {-140, 1244},
+ {-120, 1213},
+ {-100, 1182},
+ {-80, 1151},
+ {-60, 1121},
+ {-40, 1092},
+ {-20, 1063},
+ {0, 1035},
+ {20, 1008},
+ {40, 982},
+ {60, 957},
+ {80, 933},
+ {100, 910},
+ {120, 889},
+ {140, 868},
+ {160, 848},
+ {180, 830},
+ {200, 812},
+ {220, 795},
+ {240, 780},
+ {260, 765},
+ {280, 751},
+ {300, 738},
+ {320, 726},
+ {340, 714},
+ {360, 704},
+ {380, 694},
+ {400, 684},
+ {420, 675},
+ {440, 667},
+ {460, 659},
+ {480, 652},
+ {500, 645},
+ {520, 639},
+ {540, 633},
+ {560, 627},
+ {580, 622},
+ {600, 617},
+ {620, 613},
+ {640, 608},
+ {660, 604},
+ {680, 600},
+ {700, 597},
+ {720, 593},
+ {740, 590},
+ {760, 587},
+ {780, 585},
+ {800, 582},
+};
+
/* Voltage to temperature */
static const struct qpnp_vadc_map_pt adcmap_100k_104ef_104fb[] = {
{1758, -40},
@@ -612,6 +666,24 @@
}
EXPORT_SYMBOL(qpnp_adc_scale_qrd_skuaa_batt_therm);
+int32_t qpnp_adc_scale_qrd_skug_batt_therm(struct qpnp_vadc_chip *chip,
+ int32_t adc_code,
+ const struct qpnp_adc_properties *adc_properties,
+ const struct qpnp_vadc_chan_properties *chan_properties,
+ struct qpnp_vadc_result *adc_chan_result)
+{
+ int64_t bat_voltage = 0;
+
+ bat_voltage = qpnp_adc_scale_ratiometric_calib(adc_code,
+ adc_properties, chan_properties);
+
+ return qpnp_adc_map_temp_voltage(
+ adcmap_qrd_skug_btm_threshold,
+ ARRAY_SIZE(adcmap_qrd_skug_btm_threshold),
+ bat_voltage,
+ &adc_chan_result->physical);
+}
+EXPORT_SYMBOL(qpnp_adc_scale_qrd_skug_batt_therm);
int32_t qpnp_adc_scale_therm_pu1(struct qpnp_vadc_chip *chip,
int32_t adc_code,
const struct qpnp_adc_properties *adc_properties,
diff --git a/drivers/hwmon/qpnp-adc-voltage.c b/drivers/hwmon/qpnp-adc-voltage.c
index b2b846a..fb882b3 100644
--- a/drivers/hwmon/qpnp-adc-voltage.c
+++ b/drivers/hwmon/qpnp-adc-voltage.c
@@ -129,6 +129,7 @@
[SCALE_THERM_150K_PULLUP] = {qpnp_adc_scale_therm_pu1},
[SCALE_QRD_BATT_THERM] = {qpnp_adc_scale_qrd_batt_therm},
[SCALE_QRD_SKUAA_BATT_THERM] = {qpnp_adc_scale_qrd_skuaa_batt_therm},
+ [SCALE_QRD_SKUG_BATT_THERM] = {qpnp_adc_scale_qrd_skug_batt_therm},
};
static int32_t qpnp_vadc_read_reg(struct qpnp_vadc_chip *vadc, int16_t reg,
diff --git a/drivers/input/misc/bmp18x-core.c b/drivers/input/misc/bmp18x-core.c
index 001a804..ae98469 100644
--- a/drivers/input/misc/bmp18x-core.c
+++ b/drivers/input/misc/bmp18x-core.c
@@ -88,6 +88,7 @@
struct device *dev;
struct mutex lock;
struct bmp18x_calibration_data calibration;
+ struct sensors_classdev cdev;
u8 oversampling_setting;
u8 sw_oversampling_setting;
u32 raw_temperature;
@@ -113,9 +114,13 @@
.max_range = "1100.0",
.resolution = "0.01",
.sensor_power = "0.67",
- .min_delay = 20000,
+ .min_delay = 20000, /* microsecond */
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = 200, /* millisecond */
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
#ifdef CONFIG_HAS_EARLYSUSPEND
@@ -403,6 +408,19 @@
static DEVICE_ATTR(sw_oversampling, S_IWUSR | S_IRUGO,
show_sw_oversampling, set_sw_oversampling);
+static ssize_t bmp18x_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct bmp18x_data *data = container_of(sensors_cdev,
+ struct bmp18x_data, cdev);
+ mutex_lock(&data->lock);
+ data->delay = delay_msec;
+ mutex_unlock(&data->lock);
+
+ return 0;
+}
+
+
static ssize_t show_delay(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -416,17 +434,43 @@
{
struct bmp18x_data *data = dev_get_drvdata(dev);
unsigned long delay;
- int success = kstrtoul(buf, 10, &delay);
- if (success == 0) {
- mutex_lock(&data->lock);
- data->delay = delay;
- mutex_unlock(&data->lock);
- }
- return success;
+ int err = kstrtoul(buf, 10, &delay);
+ if (err < 0)
+ return err;
+
+ err = bmp18x_poll_delay_set(&data->cdev, delay);
+ if (err < 0)
+ return err;
+
+ return count;
}
-static DEVICE_ATTR(delay, S_IWUSR | S_IRUGO,
+
+static DEVICE_ATTR(poll_delay, S_IWUSR | S_IRUGO,
show_delay, set_delay);
+static ssize_t bmp18x_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled)
+{
+ struct bmp18x_data *data = container_of(sensors_cdev,
+ struct bmp18x_data, cdev);
+ struct device *dev = data->dev;
+
+ mutex_lock(&data->lock);
+ data->enable = enabled ? 1 : 0;
+
+ if (data->enable) {
+ bmp18x_enable(dev);
+ schedule_delayed_work(&data->work,
+ msecs_to_jiffies(data->delay));
+ } else {
+ cancel_delayed_work_sync(&data->work);
+ bmp18x_disable(dev);
+ }
+ mutex_unlock(&data->lock);
+
+ return 0;
+}
+
static ssize_t show_enable(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -440,24 +484,17 @@
{
struct bmp18x_data *data = dev_get_drvdata(dev);
unsigned long enable;
- int success = kstrtoul(buf, 10, &enable);
- if (success == 0) {
- mutex_lock(&data->lock);
- data->enable = enable ? 1 : 0;
+ int err = kstrtoul(buf, 10, &enable);
+ if (err < 0)
+ return err;
- if (data->enable) {
- bmp18x_enable(dev);
- schedule_delayed_work(&data->work,
- msecs_to_jiffies(data->delay));
- } else {
- cancel_delayed_work_sync(&data->work);
- bmp18x_disable(dev);
- }
- mutex_unlock(&data->lock);
+ err = bmp18x_enable_set(&data->cdev, enable);
+ if (err < 0)
+ return err;
- }
return count;
}
+
static DEVICE_ATTR(enable, S_IWUSR | S_IRUGO,
show_enable, set_enable);
@@ -499,7 +536,7 @@
&dev_attr_pressure0_input.attr,
&dev_attr_oversampling.attr,
&dev_attr_sw_oversampling.attr,
- &dev_attr_delay.attr,
+ &dev_attr_poll_delay.attr,
&dev_attr_enable.attr,
NULL
};
@@ -628,7 +665,10 @@
if (err)
goto error_sysfs;
- err = sensors_classdev_register(&data->input->dev, &sensors_cdev);
+ data->cdev = sensors_cdev;
+ data->cdev.sensors_enable = bmp18x_enable_set;
+ data->cdev.sensors_poll_delay = bmp18x_poll_delay_set;
+ err = sensors_classdev_register(&data->input->dev, &data->cdev);
if (err) {
pr_err("class device create failed: %d\n", err);
goto error_class_sysfs;
diff --git a/drivers/input/misc/cm36283.c b/drivers/input/misc/cm36283.c
index 5c89c0c..a7b4735 100644
--- a/drivers/input/misc/cm36283.c
+++ b/drivers/input/misc/cm36283.c
@@ -3,7 +3,7 @@
* Copyright (C) 2012 Capella Microsystems Inc.
* Author: Frank Hsieh <pengyueh@gmail.com>
*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -75,6 +75,10 @@
.min_delay = 0,
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = CM36283_LS_DEFAULT_POLL_DELAY,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
static struct sensors_classdev sensors_proximity_cdev = {
@@ -89,6 +93,10 @@
.min_delay = 0,
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = CM36283_PS_DEFAULT_POLL_DELAY,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
@@ -159,6 +167,8 @@
struct regulator *vio;
struct delayed_work ldwork;
struct delayed_work pdwork;
+ struct sensors_classdev als_cdev;
+ struct sensors_classdev ps_cdev;
};
struct cm36283_info *lp_info;
int fLevel=-1;
@@ -640,12 +650,6 @@
.unlocked_ioctl = psensor_ioctl
};
-struct miscdevice psensor_misc = {
- .minor = MISC_DYNAMIC_MINOR,
- .name = "proximity",
- .fops = &psensor_fops
-};
-
void lightsensor_set_kvalue(struct cm36283_info *lpi)
{
if (!lpi) {
@@ -793,13 +797,6 @@
.unlocked_ioctl = lightsensor_ioctl
};
-static struct miscdevice lightsensor_misc = {
- .minor = MISC_DYNAMIC_MINOR,
- .name = "lightsensor",
- .fops = &lightsensor_fops
-};
-
-
static ssize_t ps_adc_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -819,6 +816,21 @@
return ret;
}
+static int ps_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enable)
+{
+ struct cm36283_info *lpi = container_of(sensors_cdev,
+ struct cm36283_info, ps_cdev);
+ int ret;
+
+ if (enable)
+ ret = psensor_enable(lpi);
+ else
+ ret = psensor_disable(lpi);
+
+ return ret;
+}
+
static ssize_t ps_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
@@ -844,7 +856,6 @@
return count;
}
-static DEVICE_ATTR(ps_adc, 0664, ps_adc_show, ps_enable_store);
static ssize_t ps_parameters_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -888,10 +899,6 @@
return count;
}
-static DEVICE_ATTR(ps_parameters, 0664,
- ps_parameters_show, ps_parameters_store);
-
-
static ssize_t ps_conf_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -917,7 +924,6 @@
return count;
}
-static DEVICE_ATTR(ps_conf, 0664, ps_conf_show, ps_conf_store);
static ssize_t ps_thd_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -946,7 +952,6 @@
return count;
}
-static DEVICE_ATTR(ps_thd, 0664, ps_thd_show, ps_thd_store);
static ssize_t ps_hw_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -969,7 +974,6 @@
return count;
}
-static DEVICE_ATTR(ps_hw, 0664, ps_hw_show, ps_hw_store);
static ssize_t ls_adc_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -983,7 +987,26 @@
return ret;
}
-static DEVICE_ATTR(ls_adc, 0664, ls_adc_show, NULL);
+static int ls_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enable)
+{
+ struct cm36283_info *lpi = container_of(sensors_cdev,
+ struct cm36283_info, als_cdev);
+ int ret;
+
+ if (enable)
+ ret = lightsensor_enable(lpi);
+ else
+ ret = lightsensor_disable(lpi);
+
+ if (ret < 0) {
+ dev_err(&lpi->i2c_client->dev, "%s: set auto light sensor fail\n",
+ __func__);
+ return -EIO;
+ }
+
+ return 0;
+}
static ssize_t ls_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1026,15 +1049,15 @@
lpi->ls_calibrate);
dev_dbg(&lpi->i2c_client->dev, "ls_auto:0x%x\n", ls_auto);
- if (ret < 0)
+ if (ret < 0) {
dev_err(&lpi->i2c_client->dev, "%s: set auto light sensor fail\n",
__func__);
+ return ret;
+ }
return count;
}
-static DEVICE_ATTR(ls_auto, 0664,
- ls_enable_show, ls_enable_store);
static ssize_t ls_kadc_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1077,7 +1100,6 @@
return count;
}
-static DEVICE_ATTR(ls_kadc, 0664, ls_kadc_show, ls_kadc_store);
static ssize_t ls_gadc_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1117,7 +1139,6 @@
return count;
}
-static DEVICE_ATTR(ls_gadc, 0664, ls_gadc_show, ls_gadc_store);
static ssize_t ls_adc_table_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1168,9 +1189,6 @@
return count;
}
-static DEVICE_ATTR(ls_adc_table, 0664,
- ls_adc_table_show, ls_adc_table_store);
-
static ssize_t ls_conf_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -1192,7 +1210,6 @@
_cm36283_I2C_Write_Word(lpi->slave_addr, ALS_CONF, lpi->ls_cmd);
return count;
}
-static DEVICE_ATTR(ls_conf, 0664, ls_conf_show, ls_conf_store);
static ssize_t ls_poll_delay_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1219,8 +1236,20 @@
return count;
}
-static DEVICE_ATTR(ls_poll_delay, 0664, ls_poll_delay_show,
- ls_poll_delay_store);
+static int ls_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct cm36283_info *lpi = container_of(sensors_cdev,
+ struct cm36283_info, als_cdev);
+
+ if ((delay_msec < CM36283_LS_MIN_POLL_DELAY) ||
+ (delay_msec > CM36283_LS_MAX_POLL_DELAY))
+ return -EINVAL;
+
+ atomic_set(&lpi->ls_poll_delay, delay_msec);
+
+ return 0;
+}
static ssize_t ps_poll_delay_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1247,8 +1276,19 @@
return count;
}
-static DEVICE_ATTR(ps_poll_delay, 0664, ps_poll_delay_show,
- ps_poll_delay_store);
+static int ps_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct cm36283_info *lpi = container_of(sensors_cdev,
+ struct cm36283_info, als_cdev);
+
+ if ((delay_msec < CM36283_PS_MIN_POLL_DELAY) ||
+ (delay_msec > CM36283_PS_MAX_POLL_DELAY))
+ return -EINVAL;
+
+ atomic_set(&lpi->ps_poll_delay, delay_msec);
+ return 0;
+}
static ssize_t ls_fLevel_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -1271,7 +1311,6 @@
fLevel=-1;
return count;
}
-static DEVICE_ATTR(ls_flevel, 0664, ls_fLevel_show, ls_fLevel_store);
static int lightsensor_setup(struct cm36283_info *lpi)
{
@@ -1286,6 +1325,7 @@
return -ENOMEM;
}
lpi->ls_input_dev->name = "cm36283-ls";
+ lpi->ls_input_dev->id.bustype = BUS_I2C;
set_bit(EV_ABS, lpi->ls_input_dev->evbit);
range = get_als_range();
@@ -1298,17 +1338,8 @@
goto err_free_ls_input_device;
}
- ret = misc_register(&lightsensor_misc);
- if (ret < 0) {
- pr_err("[LS][CM36283 error]%s: can not register ls misc device\n",
- __func__);
- goto err_unregister_ls_input_device;
- }
-
return ret;
-err_unregister_ls_input_device:
- input_unregister_device(lpi->ls_input_dev);
err_free_ls_input_device:
input_free_device(lpi->ls_input_dev);
return ret;
@@ -1326,6 +1357,7 @@
return -ENOMEM;
}
lpi->ps_input_dev->name = "cm36283-ps";
+ lpi->ps_input_dev->id.bustype = BUS_I2C;
set_bit(EV_ABS, lpi->ps_input_dev->evbit);
input_set_abs_params(lpi->ps_input_dev, ABS_DISTANCE, 0, 1, 0, 0);
@@ -1337,18 +1369,8 @@
goto err_free_ps_input_device;
}
- ret = misc_register(&psensor_misc);
- if (ret < 0) {
- pr_err(
- "[PS][CM36283 error]%s: could not register ps misc device\n",
- __func__);
- goto err_unregister_ps_input_device;
- }
-
return ret;
-err_unregister_ps_input_device:
- input_unregister_device(lpi->ps_input_dev);
err_free_ps_input_device:
input_free_device(lpi->ps_input_dev);
return ret;
@@ -1496,6 +1518,59 @@
return 0;
}
+static int create_sysfs_interfaces(struct device *dev,
+ struct device_attribute *attributes, int len)
+{
+ int i;
+ int err;
+ for (i = 0; i < len; i++) {
+ err = device_create_file(dev, attributes + i);
+ if (err)
+ goto error;
+ }
+ return 0;
+
+error:
+ for (; i >= 0; i--)
+ device_remove_file(dev, attributes + i);
+ dev_err(dev, "%s:Unable to create interface\n", __func__);
+ return err;
+}
+
+static int remove_sysfs_interfaces(struct device *dev,
+ struct device_attribute *attributes, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ device_remove_file(dev, attributes + i);
+ return 0;
+}
+
+static struct device_attribute light_attr[] = {
+ __ATTR(ls_adc, 0664, ls_adc_show, NULL),
+ __ATTR(ls_kadc, 0664, ls_kadc_show, ls_kadc_store),
+ __ATTR(ls_gadc, 0664, ls_gadc_show, ls_gadc_store),
+ __ATTR(ls_conf, 0664, ls_conf_show, ls_conf_store),
+ __ATTR(ls_adc_table, 0664,
+ ls_adc_table_show, ls_adc_table_store),
+ __ATTR(poll_delay, 0664, ls_poll_delay_show,
+ ls_poll_delay_store),
+ __ATTR(enable, 0664,
+ ls_enable_show, ls_enable_store),
+};
+
+static struct device_attribute proximity_attr[] = {
+ __ATTR(enable, 0664, ps_adc_show, ps_enable_store),
+ __ATTR(ps_parameters, 0664,
+ ps_parameters_show, ps_parameters_store),
+ __ATTR(ps_conf, 0664, ps_conf_show, ps_conf_store),
+ __ATTR(ps_hw, 0664, ps_hw_show, ps_hw_store),
+ __ATTR(ps_thd, 0664, ps_thd_show, ps_thd_store),
+ __ATTR(poll_delay, 0664, ps_poll_delay_show,
+ ps_poll_delay_store),
+ __ATTR(ls_flevel, 0664, ls_fLevel_show, ls_fLevel_store),
+};
+
static int cm36283_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -1633,97 +1708,35 @@
goto err_psensor_setup;
}
- lpi->cm36283_class = class_create(THIS_MODULE, "optical_sensors");
- if (IS_ERR(lpi->cm36283_class)) {
- ret = PTR_ERR(lpi->cm36283_class);
- lpi->cm36283_class = NULL;
- goto err_create_class;
+ ret = create_sysfs_interfaces(&lpi->ls_input_dev->dev, light_attr,
+ ARRAY_SIZE(light_attr));
+ if (ret < 0) {
+ dev_err(&client->dev, "failed to create sysfs\n");
+ goto err_input_cleanup;
}
- lpi->ls_dev = device_create(lpi->cm36283_class,
- NULL, 0, "%s", "lightsensor");
- if (unlikely(IS_ERR(lpi->ls_dev))) {
- ret = PTR_ERR(lpi->ls_dev);
- lpi->ls_dev = NULL;
- goto err_create_ls_device;
+ ret = create_sysfs_interfaces(&lpi->ps_input_dev->dev, proximity_attr,
+ ARRAY_SIZE(proximity_attr));
+ if (ret < 0) {
+ dev_err(&client->dev, "failed to create sysfs\n");
+ goto err_light_sysfs_cleanup;
}
- /* register the attributes */
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_adc);
+ lpi->als_cdev = sensors_light_cdev;
+ lpi->als_cdev.sensors_enable = ls_enable_set;
+ lpi->als_cdev.sensors_poll_delay = ls_poll_delay_set;
+ lpi->als_cdev.min_delay = CM36283_LS_MIN_POLL_DELAY * 1000;
+
+ lpi->ps_cdev = sensors_proximity_cdev;
+ lpi->ps_cdev.sensors_enable = ps_enable_set;
+ lpi->ps_cdev.sensors_poll_delay = ps_poll_delay_set;
+ lpi->ps_cdev.min_delay = CM36283_PS_MIN_POLL_DELAY * 1000;
+
+ ret = sensors_classdev_register(&client->dev, &lpi->als_cdev);
if (ret)
- goto err_create_ls_device_file;
+ goto err_proximity_sysfs_cleanup;
- /* register the attributes */
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_auto);
- if (ret)
- goto err_create_ls_device_file;
-
- /* register the attributes */
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_kadc);
- if (ret)
- goto err_create_ls_device_file;
-
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_gadc);
- if (ret)
- goto err_create_ls_device_file;
-
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_adc_table);
- if (ret)
- goto err_create_ls_device_file;
-
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_conf);
- if (ret)
- goto err_create_ls_device_file;
-
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_flevel);
- if (ret)
- goto err_create_ls_device_file;
-
- ret = device_create_file(lpi->ls_dev, &dev_attr_ls_poll_delay);
- if (ret)
- goto err_create_ls_device_file;
-
- lpi->ps_dev = device_create(lpi->cm36283_class,
- NULL, 0, "%s", "proximity");
- if (unlikely(IS_ERR(lpi->ps_dev))) {
- ret = PTR_ERR(lpi->ps_dev);
- lpi->ps_dev = NULL;
- goto err_create_ps_device;
- }
-
- /* register the attributes */
- ret = device_create_file(lpi->ps_dev, &dev_attr_ps_adc);
- if (ret)
- goto err_create_ps_device_file;
-
- ret = device_create_file(lpi->ps_dev,
- &dev_attr_ps_parameters);
- if (ret)
- goto err_create_ps_device_file;
-
- /* register the attributes */
- ret = device_create_file(lpi->ps_dev, &dev_attr_ps_conf);
- if (ret)
- goto err_create_ps_device_file;
-
- /* register the attributes */
- ret = device_create_file(lpi->ps_dev, &dev_attr_ps_thd);
- if (ret)
- goto err_create_ps_device_file;
-
- ret = device_create_file(lpi->ps_dev, &dev_attr_ps_hw);
- if (ret)
- goto err_create_ps_device_file;
-
- ret = device_create_file(lpi->ps_dev, &dev_attr_ps_poll_delay);
- if (ret)
- goto err_create_ps_device_file;
-
- ret = sensors_classdev_register(&client->dev, &sensors_light_cdev);
- if (ret)
- goto err_create_ps_device_file;
-
- ret = sensors_classdev_register(&client->dev, &sensors_proximity_cdev);
+ ret = sensors_classdev_register(&client->dev, &lpi->ps_cdev);
if (ret)
goto err_create_class_sysfs;
@@ -1734,20 +1747,17 @@
return ret;
err_create_class_sysfs:
- sensors_classdev_unregister(&sensors_light_cdev);
-err_create_ps_device_file:
- device_unregister(lpi->ps_dev);
-err_create_ps_device:
-err_create_ls_device_file:
- device_unregister(lpi->ls_dev);
-err_create_ls_device:
- class_destroy(lpi->cm36283_class);
-err_create_class:
- misc_deregister(&psensor_misc);
+ sensors_classdev_unregister(&lpi->als_cdev);
+err_proximity_sysfs_cleanup:
+ remove_sysfs_interfaces(&lpi->ps_input_dev->dev, proximity_attr,
+ ARRAY_SIZE(proximity_attr));
+err_light_sysfs_cleanup:
+ remove_sysfs_interfaces(&lpi->ls_input_dev->dev, light_attr,
+ ARRAY_SIZE(light_attr));
+err_input_cleanup:
input_unregister_device(lpi->ps_input_dev);
input_free_device(lpi->ps_input_dev);
err_psensor_setup:
- misc_deregister(&lightsensor_misc);
input_unregister_device(lpi->ls_input_dev);
input_free_device(lpi->ls_input_dev);
err_lightsensor_setup:
diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index f5d8441..0883ac5 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -90,9 +90,13 @@
.max_range = "19.6",
.resolution = "0.01",
.sensor_power = "0.2",
- .min_delay = 2000,
+ .min_delay = 2000, /* microsecond */
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = 200, /* millisecond */
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
static const struct {
@@ -124,6 +128,7 @@
bool power_enabled;
struct regulator *vdd;
struct regulator *vio;
+ struct sensors_classdev cdev;
};
static int kxtj9_i2c_read(struct kxtj9_data *tj9, u8 addr, u8 *data, int len)
@@ -486,6 +491,36 @@
return 0;
}
+static int kxtj9_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled)
+{
+ struct kxtj9_data *tj9 = container_of(sensors_cdev,
+ struct kxtj9_data, cdev);
+ struct input_dev *input_dev = tj9->input_dev;
+
+ mutex_lock(&input_dev->mutex);
+
+ if (enabled == 0) {
+ disable_irq(tj9->client->irq);
+ kxtj9_disable(tj9);
+ tj9->enable = false;
+ } else if (enabled == 1) {
+ if (!kxtj9_enable(tj9)) {
+ enable_irq(tj9->client->irq);
+ tj9->enable = true;
+ }
+ } else {
+ dev_err(&tj9->client->dev,
+ "Invalid value of input, input=%d\n", enabled);
+ mutex_unlock(&input_dev->mutex);
+ return -EINVAL;
+ }
+
+ mutex_unlock(&input_dev->mutex);
+
+ return 0;
+}
+
static ssize_t kxtj9_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -501,31 +536,16 @@
{
struct i2c_client *client = to_i2c_client(dev);
struct kxtj9_data *tj9 = i2c_get_clientdata(client);
- struct input_dev *input_dev = tj9->input_dev;
unsigned long data;
int error;
error = kstrtoul(buf, 10, &data);
- if (error)
+ if (error < 0)
return error;
- mutex_lock(&input_dev->mutex);
- if (data == 0) {
- disable_irq(client->irq);
- kxtj9_disable(tj9);
- tj9->enable = false;
- } else if (data == 1) {
- if (!kxtj9_enable(tj9)) {
- enable_irq(client->irq);
- tj9->enable = true;
- }
- } else {
- dev_err(&tj9->client->dev,
- "Invalid value of input, input=%ld\n", data);
- }
-
- mutex_unlock(&input_dev->mutex);
-
+ error = kxtj9_enable_set(&tj9->cdev, data);
+ if (error < 0)
+ return error;
return count;
}
@@ -542,6 +562,29 @@
* will be responsible for retrieving data from the input node at the desired
* interval.
*/
+static int kxtj9_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct kxtj9_data *tj9 = container_of(sensors_cdev,
+ struct kxtj9_data, cdev);
+ struct input_dev *input_dev = tj9->input_dev;
+
+ /* Lock the device to prevent races with open/close (and itself) */
+ mutex_lock(&input_dev->mutex);
+
+ if (tj9->enable)
+ disable_irq(tj9->client->irq);
+
+ tj9->last_poll_interval = max(delay_msec, tj9->pdata.min_interval);
+
+ if (tj9->enable) {
+ kxtj9_update_odr(tj9, tj9->last_poll_interval);
+ enable_irq(tj9->client->irq);
+ }
+ mutex_unlock(&input_dev->mutex);
+
+ return 0;
+}
/* Returns currently selected poll interval (in ms) */
static ssize_t kxtj9_get_poll_delay(struct device *dev,
@@ -560,7 +603,6 @@
{
struct i2c_client *client = to_i2c_client(dev);
struct kxtj9_data *tj9 = i2c_get_clientdata(client);
- struct input_dev *input_dev = tj9->input_dev;
unsigned int interval;
int error;
@@ -568,24 +610,9 @@
if (error < 0)
return error;
- /* Lock the device to prevent races with open/close (and itself) */
- mutex_lock(&input_dev->mutex);
-
- if (tj9->enable)
- disable_irq(client->irq);
-
- /*
- * Set current interval to the greater of the minimum interval or
- * the requested interval
- */
- tj9->last_poll_interval = max(interval, tj9->pdata.min_interval);
-
- if (tj9->enable) {
- kxtj9_update_odr(tj9, tj9->last_poll_interval);
- enable_irq(client->irq);
- }
- mutex_unlock(&input_dev->mutex);
-
+ error = kxtj9_poll_delay_set(&tj9->cdev, interval);
+ if (error < 0)
+ return error;
return count;
}
@@ -602,7 +629,6 @@
.attrs = kxtj9_attributes
};
-
#ifdef CONFIG_INPUT_KXTJ9_POLLED_MODE
static void kxtj9_poll(struct input_polled_dev *dev)
{
@@ -858,7 +884,13 @@
tj9->ctrl_reg1 = tj9->pdata.res_ctl | tj9->pdata.g_range;
tj9->last_poll_interval = tj9->pdata.init_interval;
- err = sensors_classdev_register(&client->dev, &sensors_cdev);
+ tj9->cdev = sensors_cdev;
+ /* The min_delay is used by userspace and the unit is microsecond. */
+ tj9->cdev.min_delay = tj9->pdata.min_interval * 1000;
+ tj9->cdev.delay_msec = tj9->pdata.init_interval;
+ tj9->cdev.sensors_enable = kxtj9_enable_set;
+ tj9->cdev.sensors_poll_delay = kxtj9_poll_delay_set;
+ err = sensors_classdev_register(&client->dev, &tj9->cdev);
if (err) {
dev_err(&client->dev, "class device create failed: %d\n", err);
goto err_power_off;
@@ -871,7 +903,7 @@
err = kxtj9_setup_input_device(tj9);
if (err)
- goto err_power_off;
+ goto err_class_sysfs;
err = request_threaded_irq(client->irq, NULL, kxtj9_isr,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
@@ -892,7 +924,7 @@
} else {
err = kxtj9_setup_polled_device(tj9);
if (err)
- goto err_power_off;
+ goto err_class_sysfs;
}
dev_dbg(&client->dev, "%s: kxtj9_probe OK.\n", __func__);
@@ -903,6 +935,8 @@
free_irq(client->irq, tj9);
err_destroy_input:
input_unregister_device(tj9->input_dev);
+err_class_sysfs:
+ sensors_classdev_unregister(&tj9->cdev);
err_power_off:
kxtj9_device_power_off(tj9);
err_power_deinit:
diff --git a/drivers/input/misc/mma8x5x.c b/drivers/input/misc/mma8x5x.c
index d5053eb..0fc5693 100644
--- a/drivers/input/misc/mma8x5x.c
+++ b/drivers/input/misc/mma8x5x.c
@@ -2,7 +2,7 @@
* mma8x5x.c - Linux kernel modules for 3-Axis Orientation/Motion
* Detection Sensor MMA8451/MMA8452/MMA8453
*
- * Copyright (c) 2013, The Linux Foundation. All Rights Reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All Rights Reserved.
* Linux Foundation chooses to take subject only to the GPLv2 license
* terms, and distributes only under these terms.
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
@@ -38,10 +38,10 @@
#define MMA8652_ID 0x4A
#define MMA8653_ID 0x5A
-
+/* Polling delay in msecs */
#define POLL_INTERVAL_MIN 1
-#define POLL_INTERVAL_MAX 500
-#define POLL_INTERVAL 100 /* msecs */
+#define POLL_INTERVAL_MAX 10000
+#define POLL_INTERVAL 100
/* if sensor is standby ,set POLL_STOP_TIME to slow down the poll */
#define POLL_STOP_TIME 10000
@@ -68,6 +68,10 @@
.min_delay = 2000,
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = POLL_INTERVAL,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
struct sensor_regulator {
@@ -162,12 +166,14 @@
struct i2c_client *client;
struct input_polled_dev *poll_dev;
struct mutex data_lock;
+ struct sensors_classdev cdev;
int active;
int position;
u8 chip_id;
int mode;
int int_pin;
u32 int_flags;
+ int poll_delay;
};
/* Addresses scanned */
static const unsigned short normal_i2c[] = {0x1c, 0x1d, I2C_CLIENT_END};
@@ -371,7 +377,7 @@
goto out;
} else {
if (poll_dev->poll_interval == POLL_STOP_TIME)
- poll_dev->poll_interval = POLL_INTERVAL;
+ poll_dev->poll_interval = pdata->poll_delay;
}
if (mma8x5x_read_data(pdata->client, &data) != 0)
goto out;
@@ -390,6 +396,79 @@
mma8x5x_report_data(pdata);
}
+static int mma8x5x_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enable)
+{
+ struct mma8x5x_data *pdata = container_of(sensors_cdev,
+ struct mma8x5x_data, cdev);
+ struct i2c_client *client = pdata->client;
+ int ret;
+ u8 val = 0;
+
+ mutex_lock(&pdata->data_lock);
+ if (enable) {
+ if (pdata->active & MMA_SHUTTEDDOWN) {
+ ret = mma8x5x_config_regulator(client, 1);
+ if (ret)
+ goto err_failed;
+
+ ret = mma8x5x_device_start(client);
+ if (ret)
+ goto err_failed;
+
+ pdata->active &= ~MMA_SHUTTEDDOWN;
+ }
+ if (pdata->active == MMA_STANDBY) {
+ val = i2c_smbus_read_byte_data(client,
+ MMA8X5X_CTRL_REG1);
+ if (val < 0) {
+ dev_err(&client->dev, "read device state failed!");
+ ret = val;
+ goto err_failed;
+ }
+
+ ret = i2c_smbus_write_byte_data(client,
+ MMA8X5X_CTRL_REG1, val | 0x01);
+ if (ret) {
+ dev_err(&client->dev, "change device state failed!");
+ goto err_failed;
+ }
+ pdata->active = MMA_ACTIVED;
+ dev_dbg(&client->dev, "%s:mma enable setting active.\n",
+ __func__);
+ }
+ } else if (enable == 0) {
+ if (pdata->active == MMA_ACTIVED) {
+ val = i2c_smbus_read_byte_data(client,
+ MMA8X5X_CTRL_REG1);
+ if (val < 0) {
+ dev_err(&client->dev, "read device state failed!");
+ ret = val;
+ goto err_failed;
+ }
+
+ ret = i2c_smbus_write_byte_data(client,
+ MMA8X5X_CTRL_REG1, val & 0xFE);
+ if (ret) {
+ dev_err(&client->dev, "change device state failed!");
+ goto err_failed;
+ }
+
+ pdata->active = MMA_STANDBY;
+ dev_dbg(&client->dev, "%s:mma enable setting inactive.\n",
+ __func__);
+ }
+ if (!mma8x5x_config_regulator(client, 0))
+ pdata->active |= MMA_SHUTTEDDOWN;
+ }
+ mutex_unlock(&pdata->data_lock);
+ return 0;
+
+err_failed:
+ mutex_unlock(&pdata->data_lock);
+ return ret;
+}
+
static ssize_t mma8x5x_enable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -415,77 +494,17 @@
{
struct input_polled_dev *poll_dev = dev_get_drvdata(dev);
struct mma8x5x_data *pdata = (struct mma8x5x_data *)(poll_dev->private);
- struct i2c_client *client = pdata->client;
int ret;
unsigned long enable;
- u8 val = 0;
ret = kstrtoul(buf, 10, &enable);
if (ret)
return ret;
- mutex_lock(&pdata->data_lock);
enable = (enable > 0) ? 1 : 0;
- if (enable) {
- if (pdata->active & MMA_SHUTTEDDOWN) {
- ret = mma8x5x_config_regulator(client, 1);
- if (ret)
- goto err_failed;
-
- ret = mma8x5x_device_start(client);
- if (ret)
- goto err_failed;
-
- pdata->active &= ~MMA_SHUTTEDDOWN;
- }
- if (pdata->active == MMA_STANDBY) {
- val = i2c_smbus_read_byte_data(client,
- MMA8X5X_CTRL_REG1);
- if (val < 0) {
- dev_err(dev, "read device state failed!");
- ret = val;
- goto err_failed;
- }
-
- ret = i2c_smbus_write_byte_data(client,
- MMA8X5X_CTRL_REG1, val | 0x01);
- if (ret) {
- dev_err(dev, "change device state failed!");
- goto err_failed;
- }
- pdata->active = MMA_ACTIVED;
- dev_dbg(dev, "%s:mma enable setting active.\n",
- __func__);
- }
- } else if (enable == 0) {
- if (pdata->active == MMA_ACTIVED) {
- val = i2c_smbus_read_byte_data(client,
- MMA8X5X_CTRL_REG1);
- if (val < 0) {
- dev_err(dev, "read device state failed!");
- ret = val;
- goto err_failed;
- }
-
- ret = i2c_smbus_write_byte_data(client,
- MMA8X5X_CTRL_REG1, val & 0xFE);
- if (ret) {
- dev_err(dev, "change device state failed!");
- goto err_failed;
- }
-
- pdata->active = MMA_STANDBY;
- dev_dbg(dev, "%s:mma enable setting inactive.\n",
- __func__);
- }
- if (!mma8x5x_config_regulator(client, 0))
- pdata->active |= MMA_SHUTTEDDOWN;
- }
- mutex_unlock(&pdata->data_lock);
+ ret = mma8x5x_enable_set(&pdata->cdev, enable);
+ if (ret < 0)
+ return ret;
return count;
-
-err_failed:
- mutex_unlock(&pdata->data_lock);
- return ret;
}
static ssize_t mma8x5x_position_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -516,14 +535,60 @@
return count;
}
+static int mma8x5x_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_ms)
+{
+ struct mma8x5x_data *pdata = container_of(sensors_cdev,
+ struct mma8x5x_data, cdev);
+
+ mutex_lock(&pdata->data_lock);
+ pdata->poll_delay = delay_ms;
+ pdata->poll_dev->poll_interval = pdata->poll_delay;
+ mutex_unlock(&pdata->data_lock);
+
+ return 0;
+}
+
+static ssize_t mma8x5x_poll_delay_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct input_polled_dev *poll_dev = dev_get_drvdata(dev);
+ struct mma8x5x_data *pdata = (struct mma8x5x_data *)(poll_dev->private);
+ return snprintf(buf, PAGE_SIZE, "%d\n", pdata->poll_delay);
+}
+
+static ssize_t mma8x5x_poll_delay_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct input_polled_dev *poll_dev = dev_get_drvdata(dev);
+ struct mma8x5x_data *pdata = (struct mma8x5x_data *)(poll_dev->private);
+ int interval;
+ int ret;
+ ret = kstrtoint(buf, 10, &interval);
+ if (ret)
+ return ret;
+ if (interval <= POLL_INTERVAL_MIN)
+ interval = POLL_INTERVAL_MIN;
+ if (interval > POLL_INTERVAL_MAX)
+ interval = POLL_INTERVAL_MAX;
+
+ mma8x5x_poll_delay_set(&pdata->cdev, interval);
+
+ return count;
+}
+
static DEVICE_ATTR(enable, S_IWUSR | S_IRUGO,
mma8x5x_enable_show, mma8x5x_enable_store);
static DEVICE_ATTR(position, S_IWUSR | S_IRUGO,
mma8x5x_position_show, mma8x5x_position_store);
+static DEVICE_ATTR(poll_delay, S_IWUSR | S_IRUGO,
+ mma8x5x_poll_delay_show, mma8x5x_poll_delay_store);
static struct attribute *mma8x5x_attributes[] = {
&dev_attr_enable.attr,
&dev_attr_position.attr,
+ &dev_attr_poll_delay.attr,
NULL
};
@@ -622,6 +687,7 @@
pdata->client = client;
pdata->chip_id = chip_id;
pdata->mode = MODE_2G;
+ pdata->poll_delay = POLL_INTERVAL;
mutex_init(&pdata->data_lock);
i2c_set_clientdata(client, pdata);
@@ -659,7 +725,12 @@
result = -EINVAL;
goto err_create_sysfs;
}
- result = sensors_classdev_register(&client->dev, &sensors_cdev);
+ pdata->cdev = sensors_cdev;
+ pdata->cdev.min_delay = POLL_INTERVAL_MIN * 1000;
+ pdata->cdev.delay_msec = poll_dev->poll_interval;
+ pdata->cdev.sensors_enable = mma8x5x_enable_set;
+ pdata->cdev.sensors_poll_delay = mma8x5x_poll_delay_set;
+ result = sensors_classdev_register(&client->dev, &pdata->cdev);
if (result) {
dev_err(&client->dev, "create class device file failed!\n");
result = -EINVAL;
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index fab209e..039e078 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -122,6 +122,7 @@
struct input_dev *idev;
struct mpu3050_gyro_platform_data *platform_data;
struct delayed_work input_work;
+ struct sensors_classdev cdev;
u32 use_poll;
u32 poll_interval;
u32 dlpf_index;
@@ -141,6 +142,10 @@
.min_delay = 2000,
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = MPU3050_DEFAULT_POLL_INTERVAL,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
struct sensor_regulator {
@@ -258,6 +263,40 @@
return rc;
}
+static int mpu3050_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct mpu3050_sensor *sensor = container_of(sensors_cdev,
+ struct mpu3050_sensor, cdev);
+ unsigned int dlpf_index;
+ u8 divider, reg;
+ int ret;
+
+ dlpf_index = interval_to_dlpf_cfg(delay_msec);
+ divider = delay_msec * dlpf_table[dlpf_index].sample_rate - 1;
+
+ if (sensor->dlpf_index != dlpf_index) {
+ /* Set low pass filter and full scale */
+ reg = dlpf_table[dlpf_index].cfg;
+ reg |= MPU3050_DEFAULT_FS_RANGE << 3;
+ reg |= MPU3050_EXT_SYNC_NONE << 5;
+ ret = i2c_smbus_write_byte_data(sensor->client,
+ MPU3050_DLPF_FS_SYNC, reg);
+ if (!ret)
+ sensor->dlpf_index = dlpf_index;
+ }
+
+ if (sensor->poll_interval != delay_msec) {
+ /* Output frequency divider. The poll interval */
+ ret = i2c_smbus_write_byte_data(sensor->client,
+ MPU3050_SMPLRT_DIV, divider);
+ if (!ret)
+ sensor->poll_interval = delay_msec;
+ }
+
+ return 0;
+}
+
/**
* mpu3050_attr_get_polling_rate - get the sampling rate
*/
@@ -280,8 +319,6 @@
{
struct mpu3050_sensor *sensor = dev_get_drvdata(dev);
unsigned long interval_ms;
- unsigned int dlpf_index;
- u8 divider, reg;
int ret;
if (kstrtoul(buf, 10, &interval_ms))
@@ -290,29 +327,39 @@
(interval_ms > MPU3050_MAX_POLL_INTERVAL))
return -EINVAL;
- dlpf_index = interval_to_dlpf_cfg(interval_ms);
- divider = interval_ms * dlpf_table[dlpf_index].sample_rate - 1;
+ ret = mpu3050_poll_delay_set(&sensor->cdev, interval_ms);
- if (sensor->dlpf_index != dlpf_index) {
- /* Set low pass filter and full scale */
- reg = dlpf_table[dlpf_index].cfg;
- reg |= MPU3050_DEFAULT_FS_RANGE << 3;
- reg |= MPU3050_EXT_SYNC_NONE << 5;
- ret = i2c_smbus_write_byte_data(sensor->client,
- MPU3050_DLPF_FS_SYNC, reg);
- if (ret == 0)
- sensor->dlpf_index = dlpf_index;
+ return ret < 0 ? ret : size;
+}
+static int mpu3050_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled)
+{
+ struct mpu3050_sensor *sensor = container_of(sensors_cdev,
+ struct mpu3050_sensor, cdev);
+
+
+ if (enabled && (!sensor->enable)) {
+ sensor->enable = enabled;
+ pm_runtime_get_sync(sensor->dev);
+ if (sensor->use_poll)
+ schedule_delayed_work(&sensor->input_work,
+ msecs_to_jiffies(sensor->poll_interval));
+ else
+ enable_irq(sensor->client->irq);
+ } else if (!enabled && sensor->enable) {
+ if (sensor->use_poll)
+ cancel_delayed_work_sync(&sensor->input_work);
+ else
+ disable_irq(sensor->client->irq);
+ pm_runtime_put_sync(sensor->dev);
+ sensor->enable = enabled;
+ } else {
+ dev_warn(&sensor->client->dev,
+ "ignore enable state change from %d to %d\n",
+ sensor->enable, enabled);
}
- if (sensor->poll_interval != interval_ms) {
- /* Output frequency divider. The poll interval */
- ret = i2c_smbus_write_byte_data(sensor->client,
- MPU3050_SMPLRT_DIV, divider);
- if (ret == 0)
- sensor->poll_interval = interval_ms;
- }
-
- return size;
+ return 0;
}
/**
@@ -325,31 +372,13 @@
{
struct mpu3050_sensor *sensor = dev_get_drvdata(dev);
unsigned long val;
- u32 enable;
+ int err;
if (kstrtoul(buf, 10, &val))
return -EINVAL;
- enable = (u32)val == 0 ? 0 : 1;
- if (enable && (!sensor->enable)) {
- sensor->enable = enable;
- pm_runtime_get_sync(sensor->dev);
- if (sensor->use_poll)
- schedule_delayed_work(&sensor->input_work,
- msecs_to_jiffies(sensor->poll_interval));
- else
- enable_irq(sensor->client->irq);
- } else if (!enable && sensor->enable) {
- if (sensor->use_poll)
- cancel_delayed_work_sync(&sensor->input_work);
- else
- disable_irq(sensor->client->irq);
- pm_runtime_put_sync(sensor->dev);
- sensor->enable = enable;
- } else {
- dev_warn(&sensor->client->dev,
- "ignore enable state change from %d to %d\n",
- sensor->enable, enable);
- }
+ err = mpu3050_enable_set(&sensor->cdev, val);
+ if (err < 0)
+ return err;
return count;
}
@@ -679,6 +708,19 @@
sensor->enable_gpio = -EINVAL;
}
+ sensor->cdev = sensors_cdev;
+ sensor->cdev.min_delay = MPU3050_MIN_POLL_INTERVAL;
+ sensor->cdev.delay_msec = sensor->poll_interval;
+ sensor->cdev.sensors_enable = mpu3050_enable_set;
+ sensor->cdev.sensors_poll_delay = mpu3050_poll_delay_set;
+ ret = sensors_classdev_register(&client->dev, &sensor->cdev);
+
+ if (ret) {
+ dev_err(&client->dev, "class device create failed: %d\n", ret);
+ error = -EINVAL;
+ goto err_free_mem;
+ }
+
if (gpio_is_valid(sensor->enable_gpio)) {
ret = gpio_request(sensor->enable_gpio, "GYRO_EN_PM");
gpio_direction_output(sensor->enable_gpio, 1);
@@ -690,7 +732,7 @@
if (ret < 0) {
dev_err(&client->dev, "failed to detect device\n");
error = -ENXIO;
- goto err_free_mem;
+ goto err_class_sysfs;
}
for (i = 0; i < ARRAY_SIZE(mpu3050_chip_ids); i++)
@@ -700,7 +742,7 @@
if (i == ARRAY_SIZE(mpu3050_chip_ids)) {
dev_err(&client->dev, "unsupported chip id\n");
error = -ENXIO;
- goto err_free_mem;
+ goto err_class_sysfs;
}
idev->name = "MPU3050";
@@ -775,16 +817,10 @@
goto err_free_irq;
}
- error = sensors_classdev_register(&client->dev, &sensors_cdev);
- if (error < 0) {
- dev_err(&client->dev, "failed to create class device\n");
- goto err_input_cleanup;
- }
-
error = create_sysfs_interfaces(&idev->dev);
if (error < 0) {
dev_err(&client->dev, "failed to create sysfs\n");
- goto err_class_sysfs;
+ goto err_input_cleanup;
}
pm_runtime_enable(&client->dev);
@@ -792,8 +828,6 @@
return 0;
-err_class_sysfs:
- sensors_classdev_unregister(&sensors_cdev);
err_input_cleanup:
input_unregister_device(idev);
err_free_irq:
@@ -805,6 +839,8 @@
gpio_free(sensor->platform_data->gpio_int);
err_pm_set_suspended:
pm_runtime_set_suspended(&client->dev);
+err_class_sysfs:
+ sensors_classdev_unregister(&sensor->cdev);
err_free_mem:
input_free_device(idev);
kfree(sensor);
diff --git a/drivers/input/misc/stk3x1x.c b/drivers/input/misc/stk3x1x.c
index f1b060e..f9d3478 100644
--- a/drivers/input/misc/stk3x1x.c
+++ b/drivers/input/misc/stk3x1x.c
@@ -64,8 +64,6 @@
#define STK_POLL_PS
#define STK_POLL_ALS /* ALS interrupt is valid only when STK_PS_INT_MODE = 1 or 4*/
-#define STK_DEBUG_PRINTF
-
/* Define Register Map */
#define STK_STATE_REG 0x00
#define STK_PSCTRL_REG 0x01
@@ -192,9 +190,13 @@
.max_range = "6500",
.resolution = "0.0625",
.sensor_power = "0.09",
- .min_delay = 0,
+ .min_delay = (MIN_ALS_POLL_DELAY_NS / 1000), /* us */
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = 200,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
static struct sensors_classdev sensors_proximity_cdev = {
@@ -209,6 +211,10 @@
.min_delay = 0,
.fifo_reserved_event_count = 0,
.fifo_max_event_count = 0,
+ .enabled = 0,
+ .delay_msec = 200,
+ .sensors_enable = NULL,
+ .sensors_poll_delay = NULL,
};
struct data_filter {
@@ -221,6 +227,8 @@
struct stk3x1x_data {
struct i2c_client *client;
struct stk3x1x_platform_data *pdata;
+ struct sensors_classdev als_cdev;
+ struct sensors_classdev ps_cdev;
#if (!defined(STK_POLL_PS) || !defined(STK_POLL_ALS))
int32_t irq;
struct work_struct stk_work;
@@ -238,7 +246,7 @@
int32_t ps_distance_last;
bool ps_enabled;
struct wake_lock ps_wakelock;
- struct work_struct stk_ps_work;
+ struct work_struct stk_ps_work;
struct workqueue_struct *stk_ps_wq;
#ifdef STK_POLL_PS
struct wake_lock ps_nosuspend_wl;
@@ -321,11 +329,11 @@
for (i=1,j=0;i<LUX_THD_TABLE_SIZE;i++,j++)
{
alscode = stk_lux2alscode(ps_data, lux_threshold_table[j]);
- printk(KERN_INFO "alscode[%d]=%d\n",i,alscode);
+ dev_dbg(&ps_data->client->dev, "alscode[%d]=%d\n", i, alscode);
code_threshold_table[i] = (uint16_t)(alscode);
}
code_threshold_table[i] = 0xffff;
- printk(KERN_INFO "alscode[%d]=%d\n",i,alscode);
+ dev_dbg(&ps_data->client->dev, "alscode[%d]=%d\n", i, alscode);
}
static uint32_t stk_get_lux_interval_index(uint16_t alscode)
@@ -458,7 +466,6 @@
printk(KERN_ERR "%s: read i2c error, err=%d\n", __func__, err2);
return -1;
}
- printk(KERN_INFO "%s: PID=0x%x, RID=0x%x\n", __func__, err1, err2);
if(err2 == 0xC0)
printk(KERN_INFO "%s: RID=0xC0!!!!!!!!!!!!!\n", __func__);
@@ -685,7 +692,9 @@
input_sync(ps_data->ps_input_dev);
wake_lock_timeout(&ps_data->ps_wakelock, 3*HZ);
reading = stk3x1x_get_ps_reading(ps_data);
- printk(KERN_INFO "%s: ps input event=%d, ps code = %d\n",__func__, near_far_state, reading);
+ dev_dbg(&ps_data->client->dev,
+ "%s: ps input event=%d, ps code = %d\n",
+ __func__, near_far_state, reading);
#endif /* #ifndef STK_POLL_PS */
}
else
@@ -904,6 +913,21 @@
return scnprintf(buf, PAGE_SIZE, "%d\n", reading);
}
+static ssize_t stk_als_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled)
+{
+ struct stk3x1x_data *als_data = container_of(sensors_cdev,
+ struct stk3x1x_data, als_cdev);
+ int err;
+
+ mutex_lock(&als_data->io_lock);
+ err = stk3x1x_enable_als(als_data, enabled);
+ mutex_unlock(&als_data->io_lock);
+
+ if (err < 0)
+ return err;
+ return 0;
+}
static ssize_t stk_als_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
{
@@ -935,7 +959,7 @@
printk(KERN_ERR "%s, invalid value %d\n", __func__, *buf);
return -EINVAL;
}
- printk(KERN_INFO "%s: Enable ALS : %d\n", __func__, en);
+ dev_dbg(dev, "%s: Enable ALS : %d\n", __func__, en);
mutex_lock(&ps_data->io_lock);
stk3x1x_enable_als(ps_data, en);
mutex_unlock(&ps_data->io_lock);
@@ -971,7 +995,7 @@
input_report_abs(ps_data->als_input_dev, ABS_MISC, value);
input_sync(ps_data->als_input_dev);
mutex_unlock(&ps_data->io_lock);
- printk(KERN_INFO "%s: als input event %ld lux\n",__func__, value);
+ dev_dbg(dev, "%s: als input event %ld lux\n", __func__, value);
return size;
}
@@ -1009,7 +1033,8 @@
static ssize_t stk_als_delay_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct stk3x1x_data *ps_data = dev_get_drvdata(dev);
- return scnprintf(buf, PAGE_SIZE, "%lld\n", ktime_to_ns(ps_data->als_poll_delay));
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ (u32)ktime_to_ms(ps_data->als_poll_delay));
}
static inline void stk_als_delay_store_fir(struct stk3x1x_data *ps_data)
@@ -1018,34 +1043,48 @@
ps_data->fir.idx = 0;
ps_data->fir.sum = 0;
}
+
+static ssize_t stk_als_poll_delay_set(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec)
+{
+ struct stk3x1x_data *als_data = container_of(sensors_cdev,
+ struct stk3x1x_data, als_cdev);
+ uint64_t value = 0;
+
+ value = delay_msec * 1000000;
+
+ if (value < MIN_ALS_POLL_DELAY_NS)
+ value = MIN_ALS_POLL_DELAY_NS;
+
+ mutex_lock(&als_data->io_lock);
+ if (value != ktime_to_ns(als_data->als_poll_delay))
+ als_data->als_poll_delay = ns_to_ktime(value);
+
+ if (als_data->use_fir)
+ stk_als_delay_store_fir(als_data);
+
+ mutex_unlock(&als_data->io_lock);
+
+ return 0;
+}
+
static ssize_t stk_als_delay_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
{
uint64_t value = 0;
int ret;
- struct stk3x1x_data *ps_data = dev_get_drvdata(dev);
+ struct stk3x1x_data *als_data = dev_get_drvdata(dev);
ret = kstrtoull(buf, 10, &value);
if(ret < 0)
{
- printk(KERN_ERR "%s:kstrtoull failed, ret=0x%x\n",
- __func__, ret);
+ dev_err(dev, "%s:kstrtoull failed, ret=0x%x\n", __func__, ret);
return ret;
}
#ifdef STK_DEBUG_PRINTF
- printk(KERN_INFO "%s: set als poll delay=%lld\n", __func__, value);
+ dev_dbg(dev, "%s: set als poll delay=%lld\n", __func__, value);
#endif
- if(value < MIN_ALS_POLL_DELAY_NS)
- {
- printk(KERN_ERR "%s: delay is too small\n", __func__);
- value = MIN_ALS_POLL_DELAY_NS;
- }
- mutex_lock(&ps_data->io_lock);
- if(value != ktime_to_ns(ps_data->als_poll_delay))
- ps_data->als_poll_delay = ns_to_ktime(value);
-
- if (ps_data->use_fir)
- stk_als_delay_store_fir(ps_data);
-
- mutex_unlock(&ps_data->io_lock);
+ ret = stk_als_poll_delay_set(&als_data->als_cdev, value);
+ if (ret < 0)
+ return ret;
return size;
}
@@ -1136,6 +1175,22 @@
return scnprintf(buf, PAGE_SIZE, "%d\n", reading);
}
+static ssize_t stk_ps_enable_set(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled)
+{
+ struct stk3x1x_data *ps_data = container_of(sensors_cdev,
+ struct stk3x1x_data, ps_cdev);
+ int err;
+
+ mutex_lock(&ps_data->io_lock);
+ err = stk3x1x_enable_ps(ps_data, enabled);
+ mutex_unlock(&ps_data->io_lock);
+
+ if (err < 0)
+ return err;
+ return 0;
+}
+
static ssize_t stk_ps_enable_show(struct device *dev, struct device_attribute *attr, char *buf)
{
int32_t enable, ret;
@@ -1166,7 +1221,7 @@
printk(KERN_ERR "%s, invalid value %d\n", __func__, *buf);
return -EINVAL;
}
- printk(KERN_INFO "%s: Enable PS : %d\n", __func__, en);
+ dev_dbg(dev, "%s: Enable PS : %d\n", __func__, en);
mutex_lock(&ps_data->io_lock);
stk3x1x_enable_ps(ps_data, en);
mutex_unlock(&ps_data->io_lock);
@@ -1200,7 +1255,7 @@
printk(KERN_ERR "%s, invalid value %d\n", __func__, *buf);
return -EINVAL;
}
- printk(KERN_INFO "%s: Enable PS ASO : %d\n", __func__, en);
+ dev_dbg(dev, "%s: Enable PS ASO : %d\n", __func__, en);
ret = i2c_smbus_read_byte_data(ps_data->client, STK_STATE_REG);
if (ret < 0)
@@ -1288,7 +1343,7 @@
input_sync(ps_data->ps_input_dev);
mutex_unlock(&ps_data->io_lock);
wake_lock_timeout(&ps_data->ps_wakelock, 3*HZ);
- printk(KERN_INFO "%s: ps input event %d cm\n",__func__, dist);
+ dev_dbg(dev, "%s: ps input event %d cm\n", __func__, dist);
return scnprintf(buf, PAGE_SIZE, "%d\n", dist);
}
@@ -1311,7 +1366,7 @@
input_sync(ps_data->ps_input_dev);
mutex_unlock(&ps_data->io_lock);
wake_lock_timeout(&ps_data->ps_wakelock, 3*HZ);
- printk(KERN_INFO "%s: ps input event %ld cm\n",__func__, value);
+ dev_dbg(dev, "%s: ps input event %ld cm\n", __func__, value);
return size;
}
@@ -1507,7 +1562,7 @@
}
else
{
- printk(KERN_INFO "reg[0x%2X]=0x%2X\n", cnt, ps_reg[cnt]);
+ dev_dbg(dev, "reg[0x%2X]=0x%2X\n", cnt, ps_reg[cnt]);
}
}
ps_reg[cnt] = i2c_smbus_read_byte_data(ps_data->client, STK_PDT_ID_REG);
@@ -1517,7 +1572,7 @@
printk( KERN_ERR "all_reg_show:i2c_smbus_read_byte_data fail, ret=%d", ps_reg[cnt]);
return -EINVAL;
}
- printk( KERN_INFO "reg[0x%x]=0x%2X\n", STK_PDT_ID_REG, ps_reg[cnt]);
+ dev_dbg(dev, "reg[0x%x]=0x%2X\n", STK_PDT_ID_REG, ps_reg[cnt]);
cnt++;
ps_reg[cnt] = i2c_smbus_read_byte_data(ps_data->client, STK_RSRVD_REG);
if(ps_reg[cnt] < 0)
@@ -1526,7 +1581,7 @@
printk( KERN_ERR "all_reg_show:i2c_smbus_read_byte_data fail, ret=%d", ps_reg[cnt]);
return -EINVAL;
}
- printk( KERN_INFO "reg[0x%x]=0x%2X\n", STK_RSRVD_REG, ps_reg[cnt]);
+ dev_dbg(dev, "reg[0x%x]=0x%2X\n", STK_RSRVD_REG, ps_reg[cnt]);
mutex_unlock(&ps_data->io_lock);
return scnprintf(buf, PAGE_SIZE, "%2X %2X %2X %2X %2X,%2X %2X %2X %2X %2X,%2X %2X %2X %2X %2X,%2X %2X %2X %2X %2X,%2X %2X %2X %2X %2X,%2X %2X\n",
@@ -1589,8 +1644,7 @@
__func__, ret);
return ret;
}
- printk(KERN_INFO "%s: write reg 0x%x=0x%x\n", __func__, addr, cmd);
-
+ dev_dbg(dev, "%s: write reg 0x%x=0x%x\n", __func__, addr, cmd);
addr_u8 = (u8) addr;
cmd_u8 = (u8) cmd;
//mutex_lock(&ps_data->io_lock);
@@ -1688,7 +1742,6 @@
input_report_abs(ps_data->als_input_dev, ABS_MISC, ps_data->als_lux_last);
input_sync(ps_data->als_input_dev);
mutex_unlock(&ps_data->io_lock);
- //printk(KERN_INFO "%s: als input event %d lux\n",__func__, ps_data->als_lux_last);
}
#endif
@@ -1948,7 +2001,6 @@
int err;
#endif
- printk(KERN_INFO "%s", __func__);
mutex_lock(&ps_data->io_lock);
if(ps_data->als_enabled)
{
@@ -1976,7 +2028,6 @@
int err;
#endif
- printk(KERN_INFO "%s", __func__);
mutex_lock(&ps_data->io_lock);
if(ps_data->als_enabled)
stk3x1x_enable_als(ps_data, 1);
@@ -2394,10 +2445,16 @@
register_early_suspend(&ps_data->stk_early_suspend);
#endif
/* make sure everything is ok before registering the class device */
- err = sensors_classdev_register(&client->dev, &sensors_light_cdev);
+ ps_data->als_cdev = sensors_light_cdev;
+ ps_data->als_cdev.sensors_enable = stk_als_enable_set;
+ ps_data->als_cdev.sensors_poll_delay = stk_als_poll_delay_set;
+ err = sensors_classdev_register(&client->dev, &ps_data->als_cdev);
if (err)
goto err_power_on;
- err = sensors_classdev_register(&client->dev, &sensors_proximity_cdev);
+
+ ps_data->ps_cdev = sensors_proximity_cdev;
+ ps_data->ps_cdev.sensors_enable = stk_ps_enable_set;
+ err = sensors_classdev_register(&client->dev, &ps_data->ps_cdev);
if (err)
goto err_class_sysfs;
@@ -2411,9 +2468,9 @@
err_init_all_setting:
stk3x1x_power_ctl(ps_data, false);
- sensors_classdev_unregister(&sensors_proximity_cdev);
+ sensors_classdev_unregister(&ps_data->ps_cdev);
err_class_sysfs:
- sensors_classdev_unregister(&sensors_light_cdev);
+ sensors_classdev_unregister(&ps_data->als_cdev);
err_power_on:
stk3x1x_power_init(ps_data, false);
err_power_init:
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 9b0c5c7..1e08169 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -110,6 +110,18 @@
To compile this driver as a module, choose M here: the
module will be called atmel_mxt_ts.
+config TOUCHSCREEN_ATMEL_MAXTOUCH_TS
+ tristate "Atmel Maxtouch Touchscreen Family"
+ depends on I2C
+ help
+ Say Y here if you have Atmel MaXTouch Touchscreen
+ using i2c connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called atmel_maxtouch_ts.
+
config TOUCHSCREEN_AUO_PIXCIR
tristate "AUO in-cell touchscreen using Pixcir ICs"
depends on I2C
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 3acc612..2b98145 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -14,6 +14,7 @@
obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_MAXTOUCH) += atmel_maxtouch.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o
+obj-$(CONFIG_TOUCHSCREEN_ATMEL_MAXTOUCH_TS) += atmel_maxtouch_ts.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o
obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 3731561..b79ab7a 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -2049,14 +2049,17 @@
return scnprintf(buf, PAGE_SIZE, "%u", val);
}
-static DEVICE_ATTR(secure_touch_enable, 0666, mxt_secure_touch_enable_show,
- mxt_secure_touch_enable_store);
-static DEVICE_ATTR(secure_touch, 0444, mxt_secure_touch_show, NULL);
+static DEVICE_ATTR(secure_touch_enable, S_IRUGO | S_IWUSR | S_IWGRP ,
+ mxt_secure_touch_enable_show,
+ mxt_secure_touch_enable_store);
+static DEVICE_ATTR(secure_touch, S_IRUGO, mxt_secure_touch_show, NULL);
#endif
-static DEVICE_ATTR(object, 0444, mxt_object_show, NULL);
-static DEVICE_ATTR(update_fw, 0664, NULL, mxt_update_fw_store);
-static DEVICE_ATTR(force_cfg_update, 0664, NULL, mxt_force_cfg_update_store);
+static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL);
+static DEVICE_ATTR(update_fw, S_IWUSR | S_IWGRP , NULL, mxt_update_fw_store);
+static DEVICE_ATTR(force_cfg_update, S_IWUSR | S_IWGRP ,
+ NULL,
+ mxt_force_cfg_update_store);
static struct attribute *mxt_attrs[] = {
&dev_attr_object.attr,
diff --git a/drivers/input/touchscreen/ft5x06_ts.c b/drivers/input/touchscreen/ft5x06_ts.c
index 9a4301e..4b8a3d4 100644
--- a/drivers/input/touchscreen/ft5x06_ts.c
+++ b/drivers/input/touchscreen/ft5x06_ts.c
@@ -1546,8 +1546,9 @@
data->family_id = pdata->family_id;
err = request_threaded_irq(client->irq, NULL,
- ft5x06_ts_interrupt, pdata->irqflags,
- client->dev.driver->name, data);
+ ft5x06_ts_interrupt,
+ pdata->irqflags | IRQF_ONESHOT,
+ client->dev.driver->name, data);
if (err) {
dev_err(&client->dev, "request irq failed\n");
goto free_reset_gpio;
diff --git a/drivers/input/touchscreen/gt9xx/goodix_tool.c b/drivers/input/touchscreen/gt9xx/goodix_tool.c
index aa8159f..521599a 100644
--- a/drivers/input/touchscreen/gt9xx/goodix_tool.c
+++ b/drivers/input/touchscreen/gt9xx/goodix_tool.c
@@ -23,16 +23,15 @@
#include "gt9xx.h"
#include <linux/mutex.h>
+#include <linux/proc_fs.h>
+#include <linux/debugfs.h>
#define DATA_LENGTH_UINT 512
-#define CMD_HEAD_LENGTH (sizeof(st_cmd_head) - sizeof(u8 *))
+#define CMD_HEAD_LENGTH (sizeof(struct st_cmd_head) - sizeof(u8 *))
static char procname[20] = {0};
-#define UPDATE_FUNCTIONS
-
-#pragma pack(1)
-struct {
- u8 wr; /* write read flag£¬0:R 1:W 2:PID 3: */
+struct st_cmd_head {
+ u8 wr; /* write read flag 0:R 1:W 2:PID 3: */
u8 flag; /* 0:no need flag/int 1: need flag 2:need int */
u8 flag_addr[2];/* flag address */
u8 flag_val; /* flag val */
@@ -46,9 +45,9 @@
u8 addr[2]; /* address */
u8 res[3]; /* reserved */
u8 *data; /* data pointer */
-} st_cmd_head;
-#pragma pack()
-st_cmd_head cmd_head;
+} __packed;
+
+static struct st_cmd_head cmd_head;
static struct i2c_client *gt_client;
@@ -56,15 +55,11 @@
static struct mutex lock;
-static s32 goodix_tool_write(struct file *filp, const char __user *buff,
- unsigned long len, void *data);
-static s32 goodix_tool_read(char *page, char **start, off_t off, int count,
- int *eof, void *data);
static s32 (*tool_i2c_read)(u8 *, u16);
static s32 (*tool_i2c_write)(u8 *, u16);
-s32 DATA_LENGTH;
-s8 IC_TYPE[16] = {0};
+s32 data_length;
+s8 ic_type[16] = {0};
static void tool_set_proc_name(char *procname)
{
@@ -75,7 +70,7 @@
int i = 0, n_month = 1, n_day = 0, n_year = 0;
snprintf(date, 20, "%s", __DATE__);
- /* GTP_DEBUG("compile date: %s", date); */
+ /* pr_debug("compile date: %s", date); */
sscanf(date, "%s %d %d", month, &n_day, &n_year);
@@ -87,24 +82,27 @@
}
snprintf(procname, 20, "gmnode%04d%02d%02d", n_year, n_month, n_day);
- /* GTP_DEBUG("procname = %s", procname); */
+ /* pr_debug("procname = %s", procname); */
}
static s32 tool_i2c_read_no_extra(u8 *buf, u16 len)
{
s32 ret = -1;
- s32 i = 0;
- struct i2c_msg msgs[2];
-
- msgs[0].flags = !I2C_M_RD;
- msgs[0].addr = gt_client->addr;
- msgs[0].len = cmd_head.addr_len;
- msgs[0].buf = &buf[0];
-
- msgs[1].flags = I2C_M_RD;
- msgs[1].addr = gt_client->addr;
- msgs[1].len = len;
- msgs[1].buf = &buf[GTP_ADDR_LENGTH];
+ u8 i = 0;
+ struct i2c_msg msgs[2] = {
+ {
+ .flags = !I2C_M_RD,
+ .addr = gt_client->addr,
+ .len = cmd_head.addr_len,
+ .buf = &buf[0],
+ },
+ {
+ .flags = I2C_M_RD,
+ .addr = gt_client->addr,
+ .len = len,
+ .buf = &buf[GTP_ADDR_LENGTH],
+ },
+ };
for (i = 0; i < cmd_head.retry; i++) {
ret = i2c_transfer(gt_client->adapter, msgs, 2);
@@ -112,25 +110,35 @@
break;
}
+ if (i == cmd_head.retry) {
+ dev_err(>_client->dev, "I2C read retry limit over.\n");
+ ret = -EIO;
+ }
+
return ret;
}
static s32 tool_i2c_write_no_extra(u8 *buf, u16 len)
{
s32 ret = -1;
- s32 i = 0;
- struct i2c_msg msg;
-
- msg.flags = !I2C_M_RD;
- msg.addr = gt_client->addr;
- msg.len = len;
- msg.buf = buf;
+ u8 i = 0;
+ struct i2c_msg msg = {
+ .flags = !I2C_M_RD,
+ .addr = gt_client->addr,
+ .len = len,
+ .buf = buf,
+ };
for (i = 0; i < cmd_head.retry; i++) {
ret = i2c_transfer(gt_client->adapter, &msg, 1);
if (ret > 0)
break;
- }
+ }
+
+ if (i == cmd_head.retry) {
+ dev_err(>_client->dev, "I2C write retry limit over.\n");
+ ret = -EIO;
+ }
return ret;
}
@@ -163,22 +171,17 @@
static void register_i2c_func(void)
{
- /* if (!strncmp(IC_TYPE, "GT818", 5) || !strncmp(IC_TYPE, "GT816", 5)
- || !strncmp(IC_TYPE, "GT811", 5) || !strncmp(IC_TYPE, "GT818F", 6)
- || !strncmp(IC_TYPE, "GT827", 5) || !strncmp(IC_TYPE,"GT828", 5)
- || !strncmp(IC_TYPE, "GT813", 5)) */
-
- if (strncmp(IC_TYPE, "GT8110", 6) && strncmp(IC_TYPE, "GT8105", 6)
- && strncmp(IC_TYPE, "GT801", 5) && strncmp(IC_TYPE, "GT800", 5)
- && strncmp(IC_TYPE, "GT801PLUS", 9) && strncmp(IC_TYPE, "GT811", 5)
- && strncmp(IC_TYPE, "GTxxx", 5)) {
+ if (strcmp(ic_type, "GT8110") && strcmp(ic_type, "GT8105")
+ && strcmp(ic_type, "GT801") && strcmp(ic_type, "GT800")
+ && strcmp(ic_type, "GT801PLUS") && strcmp(ic_type, "GT811")
+ && strcmp(ic_type, "GTxxx")) {
tool_i2c_read = tool_i2c_read_with_extra;
tool_i2c_write = tool_i2c_write_with_extra;
- GTP_DEBUG("I2C function: with pre and end cmd!");
+ pr_debug("I2C function: with pre and end cmd!");
} else {
tool_i2c_read = tool_i2c_read_no_extra;
tool_i2c_write = tool_i2c_write_no_extra;
- GTP_INFO("I2C function: without pre and end cmd!");
+ pr_info("I2C function: without pre and end cmd!");
}
}
@@ -186,55 +189,11 @@
{
tool_i2c_read = NULL;
tool_i2c_write = NULL;
- GTP_INFO("I2C function: unregister i2c transfer function!");
-}
-
-s32 init_wr_node(struct i2c_client *client)
-{
- u8 i;
-
- gt_client = client;
- memset(&cmd_head, 0, sizeof(cmd_head));
- cmd_head.data = NULL;
-
- i = 5;
- while ((!cmd_head.data) && i) {
- cmd_head.data = kzalloc(i * DATA_LENGTH_UINT, GFP_KERNEL);
- if (NULL != cmd_head.data)
- break;
- i--;
- }
- if (i) {
- DATA_LENGTH = i * DATA_LENGTH_UINT;
- dev_dbg(&client->dev, "Applied memory size:%d.", DATA_LENGTH);
- } else {
- GTP_ERROR("Apply for memory failed.");
- return FAIL;
- }
-
- cmd_head.addr_len = 2;
- cmd_head.retry = 5;
-
- register_i2c_func();
-
- mutex_init(&lock);
- tool_set_proc_name(procname);
- goodix_proc_entry = create_proc_entry(procname, 0660, NULL);
- if (goodix_proc_entry == NULL) {
- GTP_ERROR("Couldn't create proc entry!");
- return FAIL;
- } else {
- GTP_INFO("Create proc entry success!");
- goodix_proc_entry->write_proc = goodix_tool_write;
- dix_proc_entry->read_proc = goodix_tool_read;
- }
-
- return SUCCESS;
+ pr_info("I2C function: unregister i2c transfer function!");
}
void uninit_wr_node(void)
{
- kfree(cmd_head.data);
cmd_head.data = NULL;
unregister_i2c_func();
remove_proc_entry(procname, NULL);
@@ -252,7 +211,7 @@
case 1:
ret = (src == dst) ? true : false;
- GTP_DEBUG("equal:src:0x%02x dst:0x%02x ret:%d.",
+ pr_debug("equal:src:0x%02x dst:0x%02x ret:%d.",
src, dst, (s32)ret);
break;
@@ -293,22 +252,18 @@
s32 i = 0;
u8 buf[32];
-/* memcpy(&buf[GTP_ADDR_LENGTH - cmd_head.addr_len],
- &cmd_head.flag_addr, cmd_head.addr_len);
- memcpy(buf, &cmd_head.flag_addr, cmd_head.addr_len);
- //Modified by Scott, 2012-02-17 */
memcpy(buf, cmd_head.flag_addr, cmd_head.addr_len);
for (i = 0; i < cmd_head.times; i++) {
if (tool_i2c_read(buf, 1) <= 0) {
- GTP_ERROR("Read flag data failed!");
+ dev_err(>_client->dev, "Read flag data failed!");
return FAIL;
}
if (true == relation(buf[GTP_ADDR_LENGTH], cmd_head.flag_val,
cmd_head.flag_relation)) {
- GTP_DEBUG("value at flag addr:0x%02x.",
+ pr_debug("value at flag addr:0x%02x.",
buf[GTP_ADDR_LENGTH]);
- GTP_DEBUG("flag value:0x%02x.", cmd_head.flag_val);
+ pr_debug("flag value:0x%02x.", cmd_head.flag_val);
break;
}
@@ -316,13 +271,34 @@
}
if (i >= cmd_head.times) {
- GTP_ERROR("Didn't get the flag to continue!");
+ dev_err(>_client->dev, "Didn't get the flag to continue!");
return FAIL;
}
return SUCCESS;
}
+#ifdef CONFIG_GT9XX_TOUCHPANEL_UPDATE
+static s32 fill_update_info(char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ u8 buf[4];
+
+ buf[0] = show_len >> 8;
+ buf[1] = show_len & 0xff;
+ buf[2] = total_len >> 8;
+ buf[3] = total_len & 0xff;
+ return simple_read_from_buffer(user_buf, count, ppos,
+ buf, sizeof(buf));
+}
+#else
+static s32 fill_update_info(char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ return -ENODEV;
+}
+#endif
+
/********************************************************
Function:
Goodix tool write function.
@@ -331,117 +307,99 @@
Output:
Return write length.
********************************************************/
-static s32 goodix_tool_write(struct file *filp, const char __user *buff,
- unsigned long len, void *data)
+static s32 goodix_tool_write(struct file *filp, const char __user *userbuf,
+ size_t count, loff_t *ppos)
{
s32 ret = 0;
- GTP_DEBUG_FUNC();
- GTP_DEBUG_ARRAY((u8 *)buff, len);
mutex_lock(&lock);
- ret = copy_from_user(&cmd_head, buff, CMD_HEAD_LENGTH);
+ ret = copy_from_user(&cmd_head, userbuf, CMD_HEAD_LENGTH);
if (ret) {
- GTP_ERROR("copy_from_user failed.");
+ dev_err(>_client->dev, "copy_from_user failed.");
ret = -EACCES;
goto exit;
}
- GTP_DEBUG("wr :0x%02x.", cmd_head.wr);
- GTP_DEBUG("flag:0x%02x.", cmd_head.flag);
- GTP_DEBUG("flag addr:0x%02x%02x.", cmd_head.flag_addr[0],
- cmd_head.flag_addr[1]);
- GTP_DEBUG("flag val:0x%02x.", cmd_head.flag_val);
- GTP_DEBUG("flag rel:0x%02x.", cmd_head.flag_relation);
- GTP_DEBUG("circle :%d.", (s32)cmd_head.circle);
- GTP_DEBUG("times :%d.", (s32)cmd_head.times);
- GTP_DEBUG("retry :%d.", (s32)cmd_head.retry);
- GTP_DEBUG("delay :%d.", (s32)cmd_head.delay);
- GTP_DEBUG("data len:%d.", (s32)cmd_head.data_len);
- GTP_DEBUG("addr len:%d.", (s32)cmd_head.addr_len);
- GTP_DEBUG("addr:0x%02x%02x.", cmd_head.addr[0], cmd_head.addr[1]);
- GTP_DEBUG("len:%d.", (s32)len);
- GTP_DEBUG("buf[20]:0x%02x.", buff[CMD_HEAD_LENGTH]);
+ dev_dbg(>_client->dev, "wr:0x%02x, flag:0x%02x, flag addr:0x%02x%02x, flag val:0x%02x, flag rel:0x%02x, circle:%d, times:%d, retry:%d, delay:%d, data len:%d, addr len:%d, addr:0x%02x%02x, write len: %d.",
+ cmd_head.wr, cmd_head.flag, cmd_head.flag_addr[0],
+ cmd_head.flag_addr[1], cmd_head.flag_val,
+ cmd_head.flag_relation, (s32)cmd_head.circle,
+ (s32)cmd_head.times, (s32)cmd_head.retry, (s32)cmd_head.delay,
+ (s32)cmd_head.data_len, (s32)cmd_head.addr_len,
+ cmd_head.addr[0], cmd_head.addr[1], (s32)count);
- if (cmd_head.data_len > (DATA_LENGTH - GTP_ADDR_LENGTH)) {
- pr_err("data len %d > data buff %d, rejected!\n",
- cmd_head.data_len, (DATA_LENGTH - GTP_ADDR_LENGTH));
+ if (cmd_head.data_len > (data_length - GTP_ADDR_LENGTH)) {
+ dev_err(>_client->dev, "data len %d > data buff %d, rejected!\n",
+ cmd_head.data_len, (data_length - GTP_ADDR_LENGTH));
ret = -EINVAL;
goto exit;
}
if (cmd_head.addr_len > GTP_ADDR_LENGTH) {
- pr_err(" addr len %d > data buff %d, rejected!\n",
+ dev_err(>_client->dev, "addr len %d > data buff %d, rejected!\n",
cmd_head.addr_len, GTP_ADDR_LENGTH);
ret = -EINVAL;
goto exit;
}
- if (cmd_head.wr == 1) {
- /* copy_from_user(&cmd_head.data[cmd_head.addr_len],
- &buff[CMD_HEAD_LENGTH], cmd_head.data_len); */
+ if (cmd_head.wr == GTP_RW_WRITE) {
ret = copy_from_user(&cmd_head.data[GTP_ADDR_LENGTH],
- &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
- if (ret)
- GTP_ERROR("copy_from_user failed.");
+ &userbuf[CMD_HEAD_LENGTH], cmd_head.data_len);
+ if (ret) {
+ dev_err(>_client->dev, "copy_from_user failed.");
+ goto exit;
+ }
memcpy(&cmd_head.data[GTP_ADDR_LENGTH - cmd_head.addr_len],
cmd_head.addr, cmd_head.addr_len);
- GTP_DEBUG_ARRAY(cmd_head.data,
- cmd_head.data_len + cmd_head.addr_len);
- GTP_DEBUG_ARRAY((u8 *)&buff[CMD_HEAD_LENGTH],
- cmd_head.data_len);
-
- if (cmd_head.flag == 1) {
- if (FAIL == comfirm()) {
- GTP_ERROR("[WRITE]Comfirm fail!");
+ if (cmd_head.flag == GTP_NEED_FLAG) {
+ if (comfirm() == FAIL) {
+ dev_err(>_client->dev, "Comfirm fail!");
ret = -EINVAL;
goto exit;
}
- } else if (cmd_head.flag == 2) {
+ } else if (cmd_head.flag == GTP_NEED_INTERRUPT) {
/* Need interrupt! */
}
if (tool_i2c_write(
&cmd_head.data[GTP_ADDR_LENGTH - cmd_head.addr_len],
cmd_head.data_len + cmd_head.addr_len) <= 0) {
- GTP_ERROR("[WRITE]Write data failed!");
+ dev_err(>_client->dev, "Write data failed!");
ret = -EIO;
goto exit;
}
- GTP_DEBUG_ARRAY(
- &cmd_head.data[GTP_ADDR_LENGTH - cmd_head.addr_len],
- cmd_head.data_len + cmd_head.addr_len);
if (cmd_head.delay)
msleep(cmd_head.delay);
ret = cmd_head.data_len + CMD_HEAD_LENGTH;
goto exit;
- } else if (cmd_head.wr == 3) { /* Write ic type */
-
- ret = copy_from_user(&cmd_head.data[0], &buff[CMD_HEAD_LENGTH],
+ } else if (cmd_head.wr == GTP_RW_WRITE_IC_TYPE) { /* Write ic type */
+ ret = copy_from_user(&cmd_head.data[0],
+ &userbuf[CMD_HEAD_LENGTH],
cmd_head.data_len);
- if (ret)
- GTP_ERROR("copy_from_user failed.");
+ if (ret) {
+ dev_err(>_client->dev, "copy_from_user failed.");
+ goto exit;
+ }
- if (cmd_head.data_len > sizeof(IC_TYPE)) {
- pr_err("<<-GTP->> data len %d > data buff %d, rejected!\n",
- cmd_head.data_len, sizeof(IC_TYPE));
+ if (cmd_head.data_len > sizeof(ic_type)) {
+ dev_err(>_client->dev,
+ "data len %d > data buff %d, rejected!\n",
+ cmd_head.data_len, sizeof(ic_type));
ret = -EINVAL;
goto exit;
}
- memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len);
+ memcpy(ic_type, cmd_head.data, cmd_head.data_len);
register_i2c_func();
ret = cmd_head.data_len + CMD_HEAD_LENGTH;
goto exit;
- } else if (cmd_head.wr == 5) {
-
- /* memcpy(IC_TYPE, cmd_head.data, cmd_head.data_len); */
-
+ } else if (cmd_head.wr == GTP_RW_NO_WRITE) {
ret = cmd_head.data_len + CMD_HEAD_LENGTH;
goto exit;
- } else if (cmd_head.wr == 7) { /* disable irq! */
+ } else if (cmd_head.wr == GTP_RW_DISABLE_IRQ) { /* disable irq! */
gtp_irq_disable(i2c_get_clientdata(gt_client));
#if GTP_ESD_PROTECT
@@ -449,7 +407,7 @@
#endif
ret = CMD_HEAD_LENGTH;
goto exit;
- } else if (cmd_head.wr == 9) { /* enable irq! */
+ } else if (cmd_head.wr == GTP_RW_ENABLE_IRQ) { /* enable irq! */
gtp_irq_enable(i2c_get_clientdata(gt_client));
#if GTP_ESD_PROTECT
@@ -457,49 +415,51 @@
#endif
ret = CMD_HEAD_LENGTH;
goto exit;
- } else if (cmd_head.wr == 17) {
+ } else if (cmd_head.wr == GTP_RW_CHECK_RAWDIFF_MODE) {
struct goodix_ts_data *ts = i2c_get_clientdata(gt_client);
ret = copy_from_user(&cmd_head.data[GTP_ADDR_LENGTH],
- &buff[CMD_HEAD_LENGTH], cmd_head.data_len);
- if (ret)
- GTP_DEBUG("copy_from_user failed.");
+ &userbuf[CMD_HEAD_LENGTH], cmd_head.data_len);
+ if (ret) {
+ pr_debug("copy_from_user failed.");
+ goto exit;
+ }
if (cmd_head.data[GTP_ADDR_LENGTH]) {
- GTP_DEBUG("gtp enter rawdiff.");
+ pr_debug("gtp enter rawdiff.");
ts->gtp_rawdiff_mode = true;
} else {
ts->gtp_rawdiff_mode = false;
- GTP_DEBUG("gtp leave rawdiff.");
+ pr_debug("gtp leave rawdiff.");
}
ret = CMD_HEAD_LENGTH;
goto exit;
- }
-#ifdef UPDATE_FUNCTIONS
- else if (cmd_head.wr == 11) { /* Enter update mode! */
- if (FAIL == gup_enter_update_mode(gt_client)) {
+ } else if (cmd_head.wr == GTP_RW_ENTER_UPDATE_MODE) {
+ /* Enter update mode! */
+ if (gup_enter_update_mode(gt_client) == FAIL) {
ret = -EBUSY;
goto exit;
}
- } else if (cmd_head.wr == 13) { /* Leave update mode! */
- gup_leave_update_mode();
- } else if (cmd_head.wr == 15) { /* Update firmware! */
+ } else if (cmd_head.wr == GTP_RW_LEAVE_UPDATE_MODE) {
+ /* Leave update mode! */
+ gup_leave_update_mode(gt_client);
+ } else if (cmd_head.wr == GTP_RW_UPDATE_FW) {
+ /* Update firmware! */
show_len = 0;
total_len = 0;
- if (cmd_head.data_len + 1 > DATA_LENGTH) {
- pr_err("<<-GTP->> data len %d > data buff %d, rejected!\n",
- cmd_head.data_len + 1, DATA_LENGTH);
+ if (cmd_head.data_len + 1 > data_length) {
+ dev_err(>_client->dev, "data len %d > data buff %d, rejected!\n",
+ cmd_head.data_len + 1, data_length);
ret = -EINVAL;
goto exit;
}
memset(cmd_head.data, 0, cmd_head.data_len + 1);
- memcpy(cmd_head.data, &buff[CMD_HEAD_LENGTH],
+ memcpy(cmd_head.data, &userbuf[CMD_HEAD_LENGTH],
cmd_head.data_len);
- if (FAIL == gup_update_proc((void *)cmd_head.data)) {
+ if (gup_update_proc((void *)cmd_head.data) == FAIL) {
ret = -EBUSY;
goto exit;
}
}
-#endif
ret = CMD_HEAD_LENGTH;
exit:
@@ -511,95 +471,130 @@
Function:
Goodix tool read function.
Input:
- standard proc read function param.
+ standard seq file read function param.
Output:
Return read length.
********************************************************/
-static s32 goodix_tool_read(char *page, char **start, off_t off, int count,
- int *eof, void *data)
+static s32 goodix_tool_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
{
+ u16 data_len = 0;
s32 ret;
- GTP_DEBUG_FUNC();
+ u8 buf[32];
mutex_lock(&lock);
- if (cmd_head.wr % 2) {
- pr_err("<< [READ]command head wrong\n");
+ if (cmd_head.wr & 0x1) {
+ dev_err(>_client->dev, "command head wrong\n");
ret = -EINVAL;
goto exit;
- } else if (!cmd_head.wr) {
- u16 len = 0;
- s16 data_len = 0;
- u16 loc = 0;
+ }
- if (cmd_head.flag == 1) {
- if (FAIL == comfirm()) {
- GTP_ERROR("[READ]Comfirm fail!");
+ switch (cmd_head.wr) {
+ case GTP_RW_READ:
+ if (cmd_head.flag == GTP_NEED_FLAG) {
+ if (comfirm() == FAIL) {
+ dev_err(>_client->dev, "Comfirm fail!");
ret = -EINVAL;
goto exit;
}
- } else if (cmd_head.flag == 2) {
+ } else if (cmd_head.flag == GTP_NEED_INTERRUPT) {
/* Need interrupt! */
}
memcpy(cmd_head.data, cmd_head.addr, cmd_head.addr_len);
- GTP_DEBUG("[CMD HEAD DATA] ADDR:0x%02x%02x.", cmd_head.data[0],
+ pr_debug("[CMD HEAD DATA] ADDR:0x%02x%02x.", cmd_head.data[0],
cmd_head.data[1]);
- GTP_DEBUG("[CMD HEAD ADDR] ADDR:0x%02x%02x.", cmd_head.addr[0],
+ pr_debug("[CMD HEAD ADDR] ADDR:0x%02x%02x.", cmd_head.addr[0],
cmd_head.addr[1]);
if (cmd_head.delay)
msleep(cmd_head.delay);
data_len = cmd_head.data_len;
- while (data_len > 0) {
- if (data_len > DATA_LENGTH)
- len = DATA_LENGTH;
- else
- len = data_len;
-
- data_len -= len;
-
- if (tool_i2c_read(cmd_head.data, len) <= 0) {
- GTP_ERROR("[READ]Read data failed!");
- ret = -EINVAL;
- goto exit;
- }
- memcpy(&page[loc], &cmd_head.data[GTP_ADDR_LENGTH],
- len);
- loc += len;
-
- GTP_DEBUG_ARRAY(&cmd_head.data[GTP_ADDR_LENGTH], len);
- GTP_DEBUG_ARRAY(page, len);
+ if (data_len <= 0 || (data_len > data_length)) {
+ dev_err(>_client->dev, "Invalid data length %d\n",
+ data_len);
+ ret = -EINVAL;
+ goto exit;
}
- } else if (cmd_head.wr == 2) {
- /* memcpy(page, "gt8", cmd_head.data_len);
- memcpy(page, "GT818", 5);
- page[5] = 0; */
+ if (data_len > count)
+ data_len = count;
- GTP_DEBUG("Return ic type:%s len:%d.", page,
- (s32)cmd_head.data_len);
- ret = cmd_head.data_len;
- goto exit;
- /* return sizeof(IC_TYPE_NAME); */
- } else if (cmd_head.wr == 4) {
- page[0] = show_len >> 8;
- page[1] = show_len & 0xff;
- page[2] = total_len >> 8;
- page[3] = total_len & 0xff;
- } else if (6 == cmd_head.wr) {
- /* Read error code! */
- } else if (8 == cmd_head.wr) { /*Read driver version */
- /* memcpy(page, GTP_DRIVER_VERSION,
- strlen(GTP_DRIVER_VERSION)); */
- s32 tmp_len;
- tmp_len = strlen(GTP_DRIVER_VERSION);
- memcpy(page, GTP_DRIVER_VERSION, tmp_len);
- page[tmp_len] = 0;
+ if (tool_i2c_read(cmd_head.data, data_len) <= 0) {
+ dev_err(>_client->dev, "Read data failed!\n");
+ ret = -EIO;
+ goto exit;
+ }
+ ret = simple_read_from_buffer(user_buf, count, ppos,
+ &cmd_head.data[GTP_ADDR_LENGTH], data_len);
+ break;
+ case GTP_RW_FILL_INFO:
+ ret = fill_update_info(user_buf, count, ppos);
+ break;
+ case GTP_RW_READ_VERSION:
+ /* Read driver version */
+ data_len = scnprintf(buf, sizeof(buf), "%s\n",
+ GTP_DRIVER_VERSION);
+ ret = simple_read_from_buffer(user_buf, count, ppos,
+ buf, data_len);
+ break;
+ default:
+ ret = -EINVAL;
+ break;
}
- ret = cmd_head.data_len;
exit:
mutex_unlock(&lock);
return ret;
}
+
+static const struct file_operations goodix_proc_fops = {
+ .write = goodix_tool_write,
+ .read = goodix_tool_read,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+};
+
+s32 init_wr_node(struct i2c_client *client)
+{
+ u8 i;
+
+ gt_client = client;
+ memset(&cmd_head, 0, sizeof(cmd_head));
+ cmd_head.data = NULL;
+
+ i = GTP_I2C_RETRY_5;
+ while ((!cmd_head.data) && i) {
+ cmd_head.data = devm_kzalloc(&client->dev,
+ i * DATA_LENGTH_UINT, GFP_KERNEL);
+ if (cmd_head.data)
+ break;
+ i--;
+ }
+ if (i) {
+ data_length = i * DATA_LENGTH_UINT;
+ dev_dbg(&client->dev, "Applied memory size:%d.", data_length);
+ } else {
+ dev_err(&client->dev, "Apply for memory failed.");
+ return FAIL;
+ }
+
+ cmd_head.addr_len = 2;
+ cmd_head.retry = GTP_I2C_RETRY_5;
+
+ register_i2c_func();
+
+ mutex_init(&lock);
+ tool_set_proc_name(procname);
+ goodix_proc_entry = proc_create(procname,
+ S_IWUSR | S_IWGRP | S_IRUSR | S_IRGRP,
+ goodix_proc_entry,
+ &goodix_proc_fops);
+ if (goodix_proc_entry == NULL) {
+ dev_err(&client->dev, "Couldn't create proc entry!");
+ return FAIL;
+ }
+
+ return SUCCESS;
+}
diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c
index b39cb0d..f24684a 100644
--- a/drivers/input/touchscreen/gt9xx/gt9xx.c
+++ b/drivers/input/touchscreen/gt9xx/gt9xx.c
@@ -47,7 +47,8 @@
#include "gt9xx.h"
#include <linux/of_gpio.h>
-
+#include <linux/irq.h>
+#include <linux/module.h>
#include <linux/input/mt.h>
#define GOODIX_DEV_NAME "Goodix-CTP"
@@ -55,9 +56,6 @@
#define GOODIX_COORDS_ARR_SIZE 4
#define MAX_BUTTONS 4
-/* HIGH: 0x28/0x29, LOW: 0xBA/0xBB */
-#define GTP_I2C_ADDRESS_HIGH 0x14
-#define GTP_I2C_ADDRESS_LOW 0x5D
#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))
#define GOODIX_VTG_MIN_UV 2600000
@@ -82,17 +80,8 @@
static const u16 touch_key_array[] = {KEY_MENU, KEY_HOMEPAGE, KEY_BACK};
#define GTP_MAX_KEY_NUM (sizeof(touch_key_array)/sizeof(touch_key_array[0]))
-#if GTP_DEBUG_ON
-static const int key_codes[] = {
- KEY_HOME, KEY_BACK, KEY_MENU, KEY_SEARCH
-};
-static const char *const key_names[] = {
- "Key_Home", "Key_Back", "Key_Menu", "Key_Search"
-};
-#endif
#endif
-static void gtp_reset_guitar(struct goodix_ts_data *ts, int ms);
static void gtp_int_sync(struct goodix_ts_data *ts, int ms);
static int gtp_i2c_test(struct i2c_client *client);
static int goodix_power_off(struct goodix_ts_data *ts);
@@ -111,7 +100,6 @@
static struct workqueue_struct *gtp_esd_check_workqueue;
static void gtp_esd_check_func(struct work_struct *work);
static int gtp_init_ext_watchdog(struct i2c_client *client);
-struct i2c_client *i2c_connect_client;
#endif
#if GTP_SLIDE_WAKEUP
@@ -126,6 +114,7 @@
bool init_done;
static u8 chip_gt9xxs; /* true if ic is gt9xxs, like gt915s */
u8 grp_cfg_version;
+struct i2c_client *i2c_connect_client;
/*******************************************************
Function:
@@ -142,27 +131,30 @@
int gtp_i2c_read(struct i2c_client *client, u8 *buf, int len)
{
struct goodix_ts_data *ts = i2c_get_clientdata(client);
- struct i2c_msg msgs[2];
int ret = -EIO;
- int retries = 0;
+ u8 retries;
+ struct i2c_msg msgs[2] = {
+ {
+ .flags = !I2C_M_RD,
+ .addr = client->addr,
+ .len = GTP_ADDR_LENGTH,
+ .buf = &buf[0],
+ },
+ {
+ .flags = I2C_M_RD,
+ .addr = client->addr,
+ .len = len - GTP_ADDR_LENGTH,
+ .buf = &buf[GTP_ADDR_LENGTH],
+ },
+ };
- msgs[0].flags = !I2C_M_RD;
- msgs[0].addr = client->addr;
- msgs[0].len = GTP_ADDR_LENGTH;
- msgs[0].buf = &buf[0];
-
- msgs[1].flags = I2C_M_RD;
- msgs[1].addr = client->addr;
- msgs[1].len = len - GTP_ADDR_LENGTH;
- msgs[1].buf = &buf[GTP_ADDR_LENGTH];
-
- while (retries < 5) {
+ for (retries = 0; retries < GTP_I2C_RETRY_5; retries++) {
ret = i2c_transfer(client->adapter, msgs, 2);
if (ret == 2)
break;
- retries++;
+ dev_err(&client->dev, "I2C retry: %d\n", retries + 1);
}
- if (retries >= 5) {
+ if (retries == GTP_I2C_RETRY_5) {
#if GTP_SLIDE_WAKEUP
/* reset chip would quit doze mode */
if (DOZE_ENABLED == doze_status)
@@ -172,7 +164,7 @@
gtp_reset_guitar(ts, 10);
else
dev_warn(&client->dev,
- "<GTP> gtp_reset_guitar exit init_done=%d:\n",
+ "gtp_reset_guitar exit init_done=%d:\n",
init_done);
}
return ret;
@@ -193,22 +185,22 @@
int gtp_i2c_write(struct i2c_client *client, u8 *buf, int len)
{
struct goodix_ts_data *ts = i2c_get_clientdata(client);
- struct i2c_msg msg;
int ret = -EIO;
- int retries = 0;
+ u8 retries;
+ struct i2c_msg msg = {
+ .flags = !I2C_M_RD,
+ .addr = client->addr,
+ .len = len,
+ .buf = buf,
+ };
- msg.flags = !I2C_M_RD;
- msg.addr = client->addr;
- msg.len = len;
- msg.buf = buf;
-
- while (retries < 5) {
+ for (retries = 0; retries < GTP_I2C_RETRY_5; retries++) {
ret = i2c_transfer(client->adapter, &msg, 1);
if (ret == 1)
break;
- retries++;
+ dev_err(&client->dev, "I2C retry: %d\n", retries + 1);
}
- if ((retries >= 5)) {
+ if ((retries == GTP_I2C_RETRY_5)) {
#if GTP_SLIDE_WAKEUP
if (DOZE_ENABLED == doze_status)
return ret;
@@ -217,11 +209,12 @@
gtp_reset_guitar(ts, 10);
else
dev_warn(&client->dev,
- "<GTP> gtp_reset_guitar exit init_done=%d:\n",
+ "gtp_reset_guitar exit init_done=%d:\n",
init_done);
}
return ret;
}
+
/*******************************************************
Function:
i2c read twice, compare the results
@@ -241,7 +234,7 @@
u8 confirm_buf[16] = {0};
u8 retry = 0;
- while (retry++ < 3) {
+ while (retry++ < GTP_I2C_RETRY_3) {
memset(buf, 0xAA, 16);
buf[0] = (u8)(addr >> 8);
buf[1] = (u8)(addr & 0xFF);
@@ -255,7 +248,7 @@
if (!memcmp(buf, confirm_buf, len + 2))
break;
}
- if (retry < 3) {
+ if (retry < GTP_I2C_RETRY_3) {
memcpy(rxbuf, confirm_buf + 2, len);
return SUCCESS;
} else {
@@ -275,7 +268,7 @@
result of i2c write operation.
> 0: succeed, otherwise: failed
*********************************************************/
-static int gtp_send_cfg(struct goodix_ts_data *ts)
+int gtp_send_cfg(struct goodix_ts_data *ts)
{
int ret;
#if GTP_DRIVER_SEND_CFG
@@ -286,7 +279,7 @@
"Ic fixed config, no config sent!");
ret = 2;
} else {
- for (retry = 0; retry < 5; retry++) {
+ for (retry = 0; retry < GTP_I2C_RETRY_5; retry++) {
ret = gtp_i2c_write(ts->client,
ts->config_data,
GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH);
@@ -498,31 +491,19 @@
memcpy(&point_data[12], &buf[2], 8 * (touch_num - 1));
}
-#if GTP_HAVE_TOUCH_KEY
+
key_value = point_data[3 + 8 * touch_num];
if (key_value || pre_key) {
- for (i = 0; i < GTP_MAX_KEY_NUM; i++) {
-
-#if GTP_DEBUG_ON
- for (ret = 0; ret < 4; ++ret) {
- if (key_codes[ret] == touch_key_array[i]) {
- GTP_DEBUG("Key: %s %s",
- key_names[ret],
- (key_value & (0x01 << i))
- ? "Down" : "Up");
- break;
- }
- }
-#endif
-
+ for (i = 0; i < ts->pdata->num_button; i++) {
input_report_key(ts->input_dev,
- touch_key_array[i], key_value & (0x01<<i));
+ ts->pdata->button_map[i],
+ key_value & (0x01<<i));
}
touch_num = 0;
pre_touch = 0;
}
-#endif
+
pre_key = key_value;
#if GTP_WITH_PEN
@@ -679,7 +660,7 @@
Output:
None.
*******************************************************/
-static void gtp_reset_guitar(struct goodix_ts_data *ts, int ms)
+void gtp_reset_guitar(struct goodix_ts_data *ts, int ms)
{
/* This reset sequence will selcet I2C slave address */
gpio_direction_output(ts->pdata->reset_gpio, 0);
@@ -726,7 +707,7 @@
#endif
gtp_irq_disable(ts);
- while (retry++ < 5) {
+ while (retry++ < GTP_I2C_RETRY_3) {
i2c_control_buf[0] = 0x80;
i2c_control_buf[1] = 0x46;
ret = gtp_i2c_write(ts->client, i2c_control_buf, 3);
@@ -753,16 +734,13 @@
return ret;
}
#else
-/*******************************************************
-Function:
- Enter sleep mode.
-Input:
- ts: private data.
-Output:
- Executive outcomes.
- >0: succeed, otherwise failed.
-*******************************************************/
-static s8 gtp_enter_sleep(struct goodix_ts_data *ts)
+/**
+ * gtp_enter_sleep - Enter sleep mode
+ * @ts: driver private data
+ *
+ * Returns zero on success, else an error.
+ */
+static u8 gtp_enter_sleep(struct goodix_ts_data *ts)
{
int ret = -1;
s8 retry = 0;
@@ -784,16 +762,16 @@
ret = goodix_power_off(ts);
if (ret) {
dev_err(&ts->client->dev, "GTP power off failed.\n");
- return 0;
+ return ret;
}
- return 1;
+ return 0;
} else {
usleep(5000);
- while (retry++ < 5) {
+ while (retry++ < GTP_I2C_RETRY_5) {
ret = gtp_i2c_write(ts->client, i2c_control_buf, 3);
if (ret == 1) {
dev_dbg(&ts->client->dev, "GTP enter sleep!");
- return ret;
+ return 0;
}
msleep(20);
}
@@ -1077,7 +1055,7 @@
ret = gtp_i2c_read(client, buf, sizeof(buf));
if (ret < 0) {
- dev_err(&client->dev, "GTP read version failed.\n");
+ dev_err(&client->dev, "GTP read product_id failed.\n");
return -EIO;
}
@@ -1112,7 +1090,7 @@
static int gtp_i2c_test(struct i2c_client *client)
{
u8 buf[3] = { GTP_REG_CONFIG_DATA >> 8, GTP_REG_CONFIG_DATA & 0xff };
- int retry = 5;
+ int retry = GTP_I2C_RETRY_5;
int ret = -EIO;
while (retry--) {
@@ -1220,7 +1198,8 @@
int ret;
const u8 irq_table[] = GTP_IRQ_TAB;
- ret = request_irq(ts->client->irq, goodix_ts_irq_handler,
+ ret = request_threaded_irq(ts->client->irq, NULL,
+ goodix_ts_irq_handler,
irq_table[ts->int_trigger_type],
ts->client->name, ts);
if (ret) {
@@ -1272,12 +1251,12 @@
__set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit);
input_mt_init_slots(ts->input_dev, 10);/* in case of "out of memory" */
-#if GTP_HAVE_TOUCH_KEY
- for (index = 0; index < GTP_MAX_KEY_NUM; index++) {
+
+ for (index = 0; index < ts->pdata->num_button; index++) {
input_set_capability(ts->input_dev,
- EV_KEY, touch_key_array[index]);
+ EV_KEY, ts->pdata->button_map[index]);
}
-#endif
+
#if GTP_SLIDE_WAKEUP
input_set_capability(ts->input_dev, EV_KEY, KEY_POWER);
@@ -1689,6 +1668,9 @@
dev_err(dev, "Unable to read key codes\n");
return rc;
}
+ pdata->num_button = num_buttons;
+ memcpy(pdata->button_map, button_map,
+ pdata->num_button * sizeof(u32));
}
read_cfg_num = 0;
@@ -1771,7 +1753,7 @@
return -ENODEV;
}
- ts = kzalloc(sizeof(*ts), GFP_KERNEL);
+ ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL);
if (!ts) {
dev_err(&client->dev, "GTP not enough memory for ts\n");
return -ENOMEM;
@@ -1818,7 +1800,7 @@
strlcpy(ts->fw_name, pdata->fw_name,
strlen(pdata->fw_name) + 1);
-#if GTP_AUTO_UPDATE
+#ifdef CONFIG_GT9XX_TOUCHPANEL_UPDATE
ret = gup_init_update_proc(ts);
if (ret < 0) {
dev_err(&client->dev,
@@ -1867,7 +1849,7 @@
dev_info(&client->dev, "GTP works in interrupt mode.\n");
ret = gtp_read_fw_version(client, &version_info);
- if (ret != 0)
+ if (ret != 2)
dev_err(&client->dev, "GTP firmware version read failed.\n");
ret = gtp_check_product_id(client);
@@ -1878,7 +1860,7 @@
if (ts->use_irq)
gtp_irq_enable(ts);
-#if GTP_CREATE_WR_NODE
+#ifdef CONFIG_GT9XX_TOUCHPANEL_DEBUG
init_wr_node(client);
#endif
@@ -1928,7 +1910,6 @@
gpio_free(pdata->irq_gpio);
exit_free_client_data:
i2c_set_clientdata(client, NULL);
- kfree(ts);
return ret;
}
@@ -1955,7 +1936,7 @@
#endif
mutex_destroy(&ts->lock);
-#if GTP_CREATE_WR_NODE
+#ifdef CONFIG_GT9XX_TOUCHPANEL_DEBUG
uninit_wr_node();
#endif
@@ -1980,7 +1961,6 @@
input_free_device(ts->input_dev);
ts->input_dev = NULL;
}
- kfree(ts->config_data);
if (gpio_is_valid(ts->pdata->reset_gpio))
gpio_free(ts->pdata->reset_gpio);
@@ -1990,7 +1970,6 @@
goodix_power_off(ts);
goodix_power_deinit(ts);
i2c_set_clientdata(client, NULL);
- kfree(ts);
}
return 0;
@@ -2031,7 +2010,7 @@
ret = gtp_enter_sleep(ts);
#endif
- if (ret <= 0)
+ if (ret < 0)
dev_err(&ts->client->dev, "GTP early suspend failed.\n");
/* to avoid waking up while not sleeping,
* delay 48 + 10ms to ensure reliability
@@ -2192,13 +2171,13 @@
msg.len = 4;
msg.buf = opr_buffer;
- while (retries < 5) {
+ while (retries < GTP_I2C_RETRY_5) {
ret = i2c_transfer(client->adapter, &msg, 1);
if (ret == 1)
return 1;
retries++;
}
- if (retries >= 5)
+ if (retries == GTP_I2C_RETRY_5)
dev_err(&client->dev, "init external watchdog failed!");
return 0;
}
@@ -2214,7 +2193,7 @@
*******************************************************/
static void gtp_esd_check_func(struct work_struct *work)
{
- s32 i;
+ s32 retry;
s32 ret = -1;
struct goodix_ts_data *ts = NULL;
u8 test[4] = {0x80, 0x40};
@@ -2231,7 +2210,7 @@
return;
#endif
- for (i = 0; i < 3; i++) {
+ for (retry = 0; retry < GTP_I2C_RETRY_3; retry++) {
ret = gtp_i2c_read(ts->client, test, 4);
if ((ret < 0)) {
@@ -2240,7 +2219,7 @@
} else {
if ((test[2] == 0xAA) || (test[3] != 0xAA)) {
/* IC works abnormally..*/
- i = 3;
+ retry = GTP_I2C_RETRY_3;
break;
} else {
/* IC works normally, Write 0x8040 0xAA*/
@@ -2250,7 +2229,7 @@
}
}
}
- if (i >= 3) {
+ if (retry == GTP_I2C_RETRY_3) {
dev_err(&ts->client->dev,
"IC Working ABNORMALLY, Resetting Guitar...\n");
gtp_reset_guitar(ts, 50);
@@ -2268,8 +2247,15 @@
}
#endif
-static SIMPLE_DEV_PM_OPS(goodix_ts_dev_pm_ops, goodix_ts_suspend,
- goodix_ts_resume);
+#if (!defined(CONFIG_FB) && !defined(CONFIG_HAS_EARLYSUSPEND))
+static const struct dev_pm_ops goodix_ts_dev_pm_ops = {
+ .suspend = goodix_ts_suspend,
+ .resume = goodix_ts_resume,
+};
+#else
+static const struct dev_pm_ops goodix_ts_dev_pm_ops = {
+};
+#endif
static const struct i2c_device_id goodix_ts_id[] = {
{ GTP_I2C_NAME, 0 },
diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.h b/drivers/input/touchscreen/gt9xx/gt9xx.h
index 1d31f2a..dbc70c2 100644
--- a/drivers/input/touchscreen/gt9xx/gt9xx.h
+++ b/drivers/input/touchscreen/gt9xx/gt9xx.h
@@ -25,18 +25,9 @@
#include <linux/kernel.h>
#include <linux/i2c.h>
-#include <linux/irq.h>
-#include <linux/input.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
#include <linux/gpio.h>
-#include <linux/regulator/consumer.h>
-#include <linux/firmware.h>
-#include <linux/debugfs.h>
-#include <linux/mutex.h>
+#include <linux/uaccess.h>
#if defined(CONFIG_FB)
#include <linux/notifier.h>
@@ -46,6 +37,7 @@
#define GOODIX_SUSPEND_LEVEL 1
#endif
+#define MAX_BUTTONS 4
#define GOODIX_MAX_CFG_GROUP 6
#define GTP_FW_NAME_MAXSIZE 50
@@ -69,6 +61,8 @@
bool enable_power_off;
size_t config_data_len[GOODIX_MAX_CFG_GROUP];
u8 *config_data[GOODIX_MAX_CFG_GROUP];
+ u32 button_map[MAX_BUTTONS];
+ u8 num_button;
};
struct goodix_ts_data {
spinlock_t irq_lock;
@@ -79,6 +73,7 @@
struct workqueue_struct *goodix_wq;
struct work_struct work;
char fw_name[GTP_FW_NAME_MAXSIZE];
+ struct delayed_work goodix_update_work;
s32 irq_is_disabled;
s32 use_irq;
u16 abs_x_max;
@@ -116,13 +111,10 @@
#define GTP_DRIVER_SEND_CFG 1
#define GTP_HAVE_TOUCH_KEY 1
-/* auto updated by .bin file as default */
-#define GTP_AUTO_UPDATE 0
/* auto updated by head_fw_array in gt9xx_firmware.h,
- * function together with GTP_AUTO_UPDATE */
+ * function together with CONFIG_GT9XX_TOUCHPANEL_UPDATE */
#define GTP_HEADER_FW_UPDATE 0
-#define GTP_CREATE_WR_NODE 0
#define GTP_ESD_PROTECT 0
#define GTP_WITH_PEN 0
@@ -131,30 +123,14 @@
/* double-click wakeup, function together with GTP_SLIDE_WAKEUP */
#define GTP_DBL_CLK_WAKEUP 0
-#define GTP_DEBUG_ON 0
-#define GTP_DEBUG_ARRAY_ON 0
-#define GTP_DEBUG_FUNC_ON 0
-
-/*************************** PART2:TODO define *******************************/
-/* STEP_1(REQUIRED): Define Configuration Information Group(s) */
-/* Sensor_ID Map: */
-/* sensor_opt1 sensor_opt2 Sensor_ID
- * GND GND 0
- * VDDIO GND 1
- * NC GND 2
- * GND NC/300K 3
- * VDDIO NC/300K 4
- * NC NC/300K 5
-*/
-
-#define GTP_IRQ_TAB {\
+#define GTP_IRQ_TAB {\
IRQ_TYPE_EDGE_RISING,\
IRQ_TYPE_EDGE_FALLING,\
IRQ_TYPE_LEVEL_LOW,\
IRQ_TYPE_LEVEL_HIGH\
}
-/* STEP_3(optional): Specify your special config info if needed */
+
#define GTP_IRQ_TAB_RISING 0
#define GTP_IRQ_TAB_FALLING 1
#if GTP_CUSTOM_CFG
@@ -193,53 +169,61 @@
#define GTP_REG_FW_VERSION 0x8144
#define GTP_REG_PRODUCT_ID 0x8140
+#define GTP_I2C_RETRY_3 3
+#define GTP_I2C_RETRY_5 5
+#define GTP_I2C_RETRY_10 10
+
#define RESOLUTION_LOC 3
#define TRIGGER_LOC 8
+/* HIGH: 0x28/0x29, LOW: 0xBA/0xBB */
+#define GTP_I2C_ADDRESS_HIGH 0x14
+#define GTP_I2C_ADDRESS_LOW 0x5D
+
#define CFG_GROUP_LEN(p_cfg_grp) (sizeof(p_cfg_grp) / sizeof(p_cfg_grp[0]))
-/* Log define */
-#define GTP_DEBUG(fmt, arg...) do {\
- if (GTP_DEBUG_ON) {\
- pr_debug("<<-GTP-DEBUG->> [%d]"fmt"\n",\
- __LINE__, ##arg); } \
- } while (0)
-#define GTP_DEBUG_ARRAY(array, num) do {\
- s32 i; \
- u8 *a = array; \
- if (GTP_DEBUG_ARRAY_ON) {\
- pr_debug("<<-GTP-DEBUG-ARRAY->>\n");\
- for (i = 0; i < (num); i++) { \
- pr_debug("%02x ", (a)[i]);\
- if ((i + 1) % 10 == 0) { \
- pr_debug("\n");\
- } \
- } \
- pr_debug("\n");\
- } \
- } while (0)
+/* GTP CM_HEAD RW flags */
+#define GTP_RW_READ 0
+#define GTP_RW_WRITE 1
+#define GTP_RW_READ_IC_TYPE 2
+#define GTP_RW_WRITE_IC_TYPE 3
+#define GTP_RW_FILL_INFO 4
+#define GTP_RW_NO_WRITE 5
+#define GTP_RW_READ_ERROR 6
+#define GTP_RW_DISABLE_IRQ 7
+#define GTP_RW_READ_VERSION 8
+#define GTP_RW_ENABLE_IRQ 9
+#define GTP_RW_ENTER_UPDATE_MODE 11
+#define GTP_RW_LEAVE_UPDATE_MODE 13
+#define GTP_RW_UPDATE_FW 15
+#define GTP_RW_CHECK_RAWDIFF_MODE 17
-#define GTP_DEBUG_FUNC() do {\
- if (GTP_DEBUG_FUNC_ON)\
- pr_debug("<<-GTP-FUNC->> Func:%s@Line:%d\n",\
- __func__, __LINE__);\
- } while (0)
+/* GTP need flag or interrupt */
+#define GTP_NO_NEED 0
+#define GTP_NEED_FLAG 1
+#define GTP_NEED_INTERRUPT 2
-#define GTP_SWAP(x, y) do {\
- typeof(x) z = x;\
- x = y;\
- y = z;\
- } while (0)
/*****************************End of Part III********************************/
void gtp_esd_switch(struct i2c_client *client, int on);
-#if GTP_CREATE_WR_NODE
-extern s32 init_wr_node(struct i2c_client *client);
-extern void uninit_wr_node(void);
+int gtp_i2c_read_dbl_check(struct i2c_client *client, u16 addr,
+ u8 *rxbuf, int len);
+int gtp_send_cfg(struct goodix_ts_data *ts);
+void gtp_reset_guitar(struct goodix_ts_data *ts, int ms);
+void gtp_irq_disable(struct goodix_ts_data *ts);
+void gtp_irq_enable(struct goodix_ts_data *ts);
+
+#ifdef CONFIG_GT9XX_TOUCHPANEL_DEBUG
+s32 init_wr_node(struct i2c_client *client);
+void uninit_wr_node(void);
#endif
-#if GTP_AUTO_UPDATE
+#ifdef CONFIG_GT9XX_TOUCHPANEL_UPDATE
extern u8 gup_init_update_proc(struct goodix_ts_data *ts);
+s32 gup_enter_update_mode(struct i2c_client *client);
+void gup_leave_update_mode(struct i2c_client *client);
+s32 gup_update_proc(void *dir);
+extern struct i2c_client *i2c_connect_client;
#endif
#endif /* _GOODIX_GT9XX_H_ */
diff --git a/drivers/input/touchscreen/gt9xx/gt9xx_update.c b/drivers/input/touchscreen/gt9xx/gt9xx_update.c
index cf83154..6d30f0c 100644
--- a/drivers/input/touchscreen/gt9xx/gt9xx_update.c
+++ b/drivers/input/touchscreen/gt9xx/gt9xx_update.c
@@ -31,8 +31,10 @@
* 2. support firmware header array update.
* By Meta, 2013/03/11
*/
-#include <linux/kthread.h>
#include "gt9xx.h"
+#include <linux/firmware.h>
+#include <linux/workqueue.h>
+#include <linux/kernel.h>
#if GTP_HEADER_FW_UPDATE
#include <linux/namei.h>
@@ -40,16 +42,14 @@
#include "gt9xx_firmware.h"
#endif
+#define FIRMWARE_NAME_LEN_MAX 256
+
#define GUP_REG_HW_INFO 0x4220
#define GUP_REG_FW_MSG 0x41E4
#define GUP_REG_PID_VID 0x8140
-#define GUP_SEARCH_FILE_TIMES 50
-#define UPDATE_FILE_PATH_2 "/data/_goodix_update_.bin"
-#define UPDATE_FILE_PATH_1 "/sdcard/_goodix_update_.bin"
-
-#define CONFIG_FILE_PATH_1 "/data/_goodix_config_.cfg"
-#define CONFIG_FILE_PATH_2 "/sdcard/_goodix_config_.cfg"
+#define GOODIX_FIRMWARE_FILE_NAME "_goodix_update_.bin"
+#define GOODIX_CONFIG_FILE_NAME "_goodix_config_.cfg"
#define FW_HEAD_LENGTH 14
#define FW_SECTION_LENGTH 0x2000
@@ -73,24 +73,22 @@
#define FAIL 0
#define SUCCESS 1
-#pragma pack(1)
-struct {
+struct st_fw_head {
u8 hw_info[4]; /* hardware info */
u8 pid[8]; /* product id */
u16 vid; /* version id */
-} st_fw_head;
-#pragma pack()
+} __packed;
-struct {
+struct st_update_msg {
u8 force_update;
u8 fw_flag;
- struct file *file;
- struct file *cfg_file;
- st_fw_head ic_fw_msg;
- mm_segment_t old_fs;
-} st_update_msg;
+ bool need_free;
+ u8 *fw_data;
+ u32 fw_len;
+ struct st_fw_head ic_fw_msg;
+};
-st_update_msg update_msg;
+static struct st_update_msg update_msg;
u16 show_len;
u16 total_len;
u8 got_file_flag;
@@ -107,25 +105,24 @@
numbers of i2c_msgs to transfer:
2: succeed, otherwise: failed
*********************************************************/
-s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
+static s32 gup_i2c_read(struct i2c_client *client, u8 *buf, s32 len)
{
- struct i2c_msg msgs[2];
s32 ret = -1;
- s32 retries = 0;
-
- GTP_DEBUG_FUNC();
-
- msgs[0].flags = !I2C_M_RD;
- msgs[0].addr = client->addr;
- msgs[0].len = GTP_ADDR_LENGTH;
- msgs[0].buf = &buf[0];
- /* msgs[0].scl_rate = 300 * 1000; (for Rockchip) */
-
- msgs[1].flags = I2C_M_RD;
- msgs[1].addr = client->addr;
- msgs[1].len = len - GTP_ADDR_LENGTH;
- msgs[1].buf = &buf[GTP_ADDR_LENGTH];
- /* msgs[1].scl_rate = 300 * 1000; */
+ u8 retries = 0;
+ struct i2c_msg msgs[2] = {
+ {
+ .flags = !I2C_M_RD,
+ .addr = client->addr,
+ .len = GTP_ADDR_LENGTH,
+ .buf = &buf[0],
+ },
+ {
+ .flags = I2C_M_RD,
+ .addr = client->addr,
+ .len = len - GTP_ADDR_LENGTH,
+ .buf = &buf[GTP_ADDR_LENGTH],
+ },
+ };
while (retries < 5) {
ret = i2c_transfer(client->adapter, msgs, 2);
@@ -134,6 +131,11 @@
retries++;
}
+ if (retries == 5) {
+ dev_err(&client->dev, "I2C read retry limit over.\n");
+ ret = -EIO;
+ }
+
return ret;
}
@@ -151,17 +153,14 @@
*********************************************************/
s32 gup_i2c_write(struct i2c_client *client, u8 *buf, s32 len)
{
- struct i2c_msg msg;
s32 ret = -1;
- s32 retries = 0;
-
- GTP_DEBUG_FUNC();
-
- msg.flags = !I2C_M_RD;
- msg.addr = client->addr;
- msg.len = len;
- msg.buf = buf;
- /* msg.scl_rate = 300 * 1000; (for Rockchip) */
+ u8 retries = 0;
+ struct i2c_msg msg = {
+ .flags = !I2C_M_RD,
+ .addr = client->addr,
+ .len = len,
+ .buf = buf,
+ };
while (retries < 5) {
ret = i2c_transfer(client->adapter, &msg, 1);
@@ -170,123 +169,105 @@
retries++;
}
+ if (retries == 5) {
+ dev_err(&client->dev, "I2C write retry limit over.\n");
+ ret = -EIO;
+ }
+
return ret;
}
static s32 gup_init_panel(struct goodix_ts_data *ts)
{
+ struct i2c_client *client = ts->client;
+ u8 *config_data;
s32 ret = 0;
s32 i = 0;
u8 check_sum = 0;
u8 opr_buf[16];
u8 sensor_id = 0;
- u8 cfg_info_group1[] = CTP_CFG_GROUP1;
- u8 cfg_info_group2[] = CTP_CFG_GROUP2;
- u8 cfg_info_group3[] = CTP_CFG_GROUP3;
- u8 cfg_info_group4[] = CTP_CFG_GROUP4;
- u8 cfg_info_group5[] = CTP_CFG_GROUP5;
- u8 cfg_info_group6[] = CTP_CFG_GROUP6;
- u8 *send_cfg_buf[] = {cfg_info_group1, cfg_info_group2, cfg_info_group3,
- cfg_info_group4, cfg_info_group5, cfg_info_group6};
- u8 cfg_info_len[] = { CFG_GROUP_LEN(cfg_info_group1),
- CFG_GROUP_LEN(cfg_info_group2),
- CFG_GROUP_LEN(cfg_info_group3),
- CFG_GROUP_LEN(cfg_info_group4),
- CFG_GROUP_LEN(cfg_info_group5),
- CFG_GROUP_LEN(cfg_info_group6)};
+ for (i = 0; i < GOODIX_MAX_CFG_GROUP; i++)
+ if (ts->pdata->config_data_len[i])
+ break;
- if ((!cfg_info_len[1]) && (!cfg_info_len[2]) &&
- (!cfg_info_len[3]) && (!cfg_info_len[4]) &&
- (!cfg_info_len[5])) {
+ if (i == GOODIX_MAX_CFG_GROUP) {
sensor_id = 0;
} else {
- ret = gtp_i2c_read_dbl_check(ts->client, GTP_REG_SENSOR_ID,
+ ret = gtp_i2c_read_dbl_check(client, GTP_REG_SENSOR_ID,
&sensor_id, 1);
if (SUCCESS == ret) {
- if (sensor_id >= 0x06) {
- GTP_ERROR("Invalid sensor_id(0x%02X), " \
- "No Config Sent!", sensor_id);
+ if (sensor_id >= GOODIX_MAX_CFG_GROUP) {
+ pr_err("Invalid sensor_id(0x%02X), No Config Sent!",
+ sensor_id);
return -EINVAL;
}
} else {
- GTP_ERROR("Failed to get sensor_id, No config sent!");
+ pr_err("Failed to get sensor_id, No config sent!");
return -EINVAL;
}
}
- GTP_DEBUG("Sensor_ID: %d", sensor_id);
+ pr_debug("Sensor ID selected: %d", sensor_id);
- ts->gtp_cfg_len = cfg_info_len[sensor_id];
-
- if (ts->gtp_cfg_len < GTP_CONFIG_MIN_LENGTH) {
- GTP_ERROR("Sensor_ID(%d) matches with NULL or INVALID CONFIG" \
- " GROUP! NO Config Sent! You need to check you header" \
- " file CFG_GROUP section!", sensor_id);
+ if (ts->pdata->config_data_len[sensor_id] < GTP_CONFIG_MIN_LENGTH ||
+ !ts->pdata->config_data_len[sensor_id]) {
+ pr_err("Sensor_ID(%d) matches with NULL or INVALID CONFIG GROUP!",
+ sensor_id);
return -EINVAL;
}
- ret = gtp_i2c_read_dbl_check(ts->client, GTP_REG_CONFIG_DATA,
+ ret = gtp_i2c_read_dbl_check(client, GTP_REG_CONFIG_DATA,
&opr_buf[0], 1);
-
if (ret == SUCCESS) {
- GTP_DEBUG("CFG_GROUP%d Config Version: %d, IC Config Version:" \
- " %d", sensor_id+1, send_cfg_buf[sensor_id][0], opr_buf[0]);
+ pr_debug("CFG_GROUP%d Config Version: %d, IC Config Version: %d",
+ sensor_id + 1,
+ ts->pdata->config_data[sensor_id][0],
+ opr_buf[0]);
- send_cfg_buf[sensor_id][0] = opr_buf[0];
+ ts->pdata->config_data[sensor_id][0] = opr_buf[0];
ts->fixed_cfg = 0;
- /*
- if (opr_buf[0] < 90) {
- grp_cfg_version = send_cfg_buf[sensor_id][0];
- *** backup group config version ***
- send_cfg_buf[sensor_id][0] = 0x00;
- ts->fixed_cfg = 0;
- } else { *** treated as fixed config, not send config ***
- GTP_INFO("Ic fixed config with config version(%d)",
- opr_buf[0]);
- ts->fixed_cfg = 1;
- }*/
} else {
- GTP_ERROR("Failed to get ic config version!No config sent!");
+ pr_err("Failed to get ic config version!No config sent!");
return -EINVAL;
}
- memset(&config[GTP_ADDR_LENGTH], 0, GTP_CONFIG_MAX_LENGTH);
- memcpy(&config[GTP_ADDR_LENGTH], send_cfg_buf[sensor_id],
- ts->gtp_cfg_len);
+ config_data = ts->pdata->config_data[sensor_id];
+ ts->config_data = ts->pdata->config_data[sensor_id];
+ ts->gtp_cfg_len = ts->pdata->config_data_len[sensor_id];
- GTP_DEBUG("X_MAX = %d, Y_MAX = %d, TRIGGER = 0x%02x",
+ pr_debug("X_MAX = %d, Y_MAX = %d, TRIGGER = 0x%02x",
ts->abs_x_max, ts->abs_y_max, ts->int_trigger_type);
- config[RESOLUTION_LOC] = (u8)GTP_MAX_WIDTH;
- config[RESOLUTION_LOC + 1] = (u8)(GTP_MAX_WIDTH>>8);
- config[RESOLUTION_LOC + 2] = (u8)GTP_MAX_HEIGHT;
- config[RESOLUTION_LOC + 3] = (u8)(GTP_MAX_HEIGHT>>8);
+ config_data[RESOLUTION_LOC] = (u8)GTP_MAX_WIDTH;
+ config_data[RESOLUTION_LOC + 1] = (u8)(GTP_MAX_WIDTH>>8);
+ config_data[RESOLUTION_LOC + 2] = (u8)GTP_MAX_HEIGHT;
+ config_data[RESOLUTION_LOC + 3] = (u8)(GTP_MAX_HEIGHT>>8);
if (GTP_INT_TRIGGER == 0) /* RISING */
- config[TRIGGER_LOC] &= 0xfe;
+ config_data[TRIGGER_LOC] &= 0xfe;
else if (GTP_INT_TRIGGER == 1) /* FALLING */
- config[TRIGGER_LOC] |= 0x01;
+ config_data[TRIGGER_LOC] |= 0x01;
check_sum = 0;
for (i = GTP_ADDR_LENGTH; i < ts->gtp_cfg_len; i++)
- check_sum += config[i];
+ check_sum += config_data[i];
- config[ts->gtp_cfg_len] = (~check_sum) + 1;
+ config_data[ts->gtp_cfg_len] = (~check_sum) + 1;
- GTP_DEBUG_FUNC();
- ret = gtp_send_cfg(ts->client);
+ ret = gtp_send_cfg(ts);
if (ret < 0)
- GTP_ERROR("Send config error.");
+ pr_err("Send config error.");
+ ts->config_data = NULL;
+ ts->gtp_cfg_len = 0;
msleep(20);
return 0;
}
-
static u8 gup_get_ic_msg(struct i2c_client *client, u16 addr, u8 *msg, s32 len)
{
- s32 i = 0;
+ u8 i = 0;
msg[0] = (addr >> 8) & 0xff;
msg[1] = addr & 0xff;
@@ -296,7 +277,7 @@
break;
if (i >= 5) {
- GTP_ERROR("Read data from 0x%02x%02x failed!", msg[0], msg[1]);
+ pr_err("Read data from 0x%02x%02x failed!", msg[0], msg[1]);
return FAIL;
}
@@ -305,19 +286,19 @@
static u8 gup_set_ic_msg(struct i2c_client *client, u16 addr, u8 val)
{
- s32 i = 0;
- u8 msg[3];
-
- msg[0] = (addr >> 8) & 0xff;
- msg[1] = addr & 0xff;
- msg[2] = val;
+ u8 i = 0;
+ u8 msg[3] = {
+ (addr >> 8) & 0xff,
+ addr & 0xff,
+ val,
+ };
for (i = 0; i < 5; i++)
if (gup_i2c_write(client, msg, GTP_ADDR_LENGTH + 1) > 0)
break;
if (i >= 5) {
- GTP_ERROR("Set data to 0x%02x%02x failed!", msg[0], msg[1]);
+ pr_err("Set data to 0x%02x%02x failed!", msg[0], msg[1]);
return FAIL;
}
@@ -335,7 +316,7 @@
ret = gtp_i2c_read_dbl_check(client, GUP_REG_HW_INFO,
&buf[GTP_ADDR_LENGTH], 4);
if (ret == FAIL) {
- GTP_ERROR("[get_ic_fw_msg]get hw_info failed,exit");
+ pr_err("get hw_info failed,exit");
return FAIL;
}
@@ -344,7 +325,7 @@
for (i = 0; i < 4; i++)
update_msg.ic_fw_msg.hw_info[i] = buf[GTP_ADDR_LENGTH + 3 - i];
- GTP_DEBUG("IC Hardware info:%02x%02x%02x%02x",
+ pr_debug("IC Hardware info:%02x%02x%02x%02x",
update_msg.ic_fw_msg.hw_info[0],
update_msg.ic_fw_msg.hw_info[1],
update_msg.ic_fw_msg.hw_info[2],
@@ -354,31 +335,31 @@
for (retry = 0; retry < 2; retry++) {
ret = gup_get_ic_msg(client, GUP_REG_FW_MSG, buf, 1);
if (ret == FAIL) {
- GTP_ERROR("Read firmware message fail.");
+ pr_err("Read firmware message fail.");
return ret;
}
update_msg.force_update = buf[GTP_ADDR_LENGTH];
if ((0xBE != update_msg.force_update) && (!retry)) {
- GTP_INFO("The check sum in ic is error.");
- GTP_INFO("The IC will be updated by force.");
+ pr_info("The check sum in ic is error.");
+ pr_info("The IC will be updated by force.");
continue;
}
break;
}
- GTP_DEBUG("IC force update flag:0x%x", update_msg.force_update);
+ pr_debug("IC force update flag:0x%x", update_msg.force_update);
/* step3:get pid & vid */
ret = gtp_i2c_read_dbl_check(client, GUP_REG_PID_VID,
&buf[GTP_ADDR_LENGTH], 6);
- if (FAIL == ret) {
- GTP_ERROR("[get_ic_fw_msg]get pid & vid failed,exit");
+ if (ret == FAIL) {
+ pr_err("get pid & vid failed,exit");
return FAIL;
}
memset(update_msg.ic_fw_msg.pid, 0, sizeof(update_msg.ic_fw_msg.pid));
memcpy(update_msg.ic_fw_msg.pid, &buf[GTP_ADDR_LENGTH], 4);
- GTP_DEBUG("IC Product id:%s", update_msg.ic_fw_msg.pid);
+ pr_debug("IC Product id:%s", update_msg.ic_fw_msg.pid);
/* GT9XX PID MAPPING
|-----FLASH-----RAM-----|
@@ -392,7 +373,7 @@
|------9110P----9111----|*/
if (update_msg.ic_fw_msg.pid[0] != 0) {
if (!memcmp(update_msg.ic_fw_msg.pid, "9111", 4)) {
- GTP_DEBUG("IC Mapping Product id:%s",
+ pr_debug("IC Mapping Product id:%s",
update_msg.ic_fw_msg.pid);
memcpy(update_msg.ic_fw_msg.pid, "9110P", 5);
}
@@ -400,7 +381,7 @@
update_msg.ic_fw_msg.vid = buf[GTP_ADDR_LENGTH + 4] +
(buf[GTP_ADDR_LENGTH + 5] << 8);
- GTP_DEBUG("IC version id:%04x", update_msg.ic_fw_msg.vid);
+ pr_debug("IC version id:%04x", update_msg.ic_fw_msg.vid);
return SUCCESS;
}
@@ -408,19 +389,21 @@
s32 gup_enter_update_mode(struct i2c_client *client)
{
s32 ret = -1;
- s32 retry = 0;
+ u8 retry = 0;
u8 rd_buf[3];
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);
/* step1:RST output low last at least 2ms */
- GTP_GPIO_OUTPUT(GTP_RST_PORT, 0);
- msleep(20);
+ gpio_direction_output(ts->pdata->reset_gpio, 0);
+ usleep(20000);
/* step2:select I2C slave addr,INT:0--0xBA;1--0x28. */
- GTP_GPIO_OUTPUT(GTP_INT_PORT, (client->addr == 0x14));
+ gpio_direction_output(ts->pdata->irq_gpio,
+ (client->addr == GTP_I2C_ADDRESS_HIGH));
msleep(20);
/* step3:RST output high reset guitar */
- GTP_GPIO_OUTPUT(GTP_RST_PORT, 1);
+ gpio_direction_output(ts->pdata->reset_gpio, 1);
/* 20121211 modify start */
msleep(20);
@@ -428,25 +411,25 @@
/* step4:Hold ss51 & dsp */
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C);
if (ret <= 0) {
- GTP_DEBUG("Hold ss51 & dsp I2C error,retry:%d", retry);
+ pr_debug("Hold ss51 & dsp I2C error,retry:%d", retry);
continue;
}
/* step5:Confirm hold */
ret = gup_get_ic_msg(client, _rRW_MISCTL__SWRST_B0_, rd_buf, 1);
if (ret <= 0) {
- GTP_DEBUG("Hold ss51 & dsp I2C error,retry:%d", retry);
+ pr_debug("Hold ss51 & dsp I2C error,retry:%d", retry);
continue;
}
if (rd_buf[GTP_ADDR_LENGTH] == 0x0C) {
- GTP_DEBUG("Hold ss51 & dsp confirm SUCCESS");
+ pr_debug("Hold ss51 & dsp confirm SUCCESS");
break;
}
- GTP_DEBUG("Hold ss51 & dsp confirm 0x4180 failed,value:%d",
+ pr_debug("Hold ss51 & dsp confirm 0x4180 failed,value:%d",
rd_buf[GTP_ADDR_LENGTH]);
}
if (retry >= 200) {
- GTP_ERROR("Enter update Hold ss51 failed.");
+ pr_err("Enter update Hold ss51 failed.");
return FAIL;
}
@@ -457,12 +440,13 @@
return ret;
}
-void gup_leave_update_mode(void)
+void gup_leave_update_mode(struct i2c_client *client)
{
- GTP_GPIO_AS_INT(GTP_INT_PORT);
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);
- GTP_DEBUG("[leave_update_mode]reset chip.");
- gtp_reset_guitar(i2c_connect_client, 20);
+ gpio_direction_input(ts->pdata->irq_gpio);
+ pr_debug("reset chip.");
+ gtp_reset_guitar(ts, 20);
}
/* Get the correct nvram data
@@ -483,7 +467,8 @@
3. IC PID == 91XX || File PID == 91XX
*/
-static u8 gup_enter_update_judge(st_fw_head *fw_head)
+static u8 gup_enter_update_judge(struct i2c_client *client,
+ struct st_fw_head *fw_head)
{
u16 u16_tmp;
s32 i = 0;
@@ -491,38 +476,37 @@
u16_tmp = fw_head->vid;
fw_head->vid = (u16)(u16_tmp>>8) + (u16)(u16_tmp<<8);
- GTP_DEBUG("FILE HARDWARE INFO:%02x%02x%02x%02x", fw_head->hw_info[0],
+ pr_debug("FILE HARDWARE INFO:%02x%02x%02x%02x", fw_head->hw_info[0],
fw_head->hw_info[1], fw_head->hw_info[2], fw_head->hw_info[3]);
- TP_DEBUG("FILE PID:%s", fw_head->pid);
- TP_DEBUG("FILE VID:%04x", fw_head->vid);
+ pr_debug("FILE PID:%s", fw_head->pid);
+ pr_debug("FILE VID:%04x", fw_head->vid);
- TP_DEBUG("IC HARDWARE INFO:%02x%02x%02x%02x",
+ pr_debug("IC HARDWARE INFO:%02x%02x%02x%02x",
update_msg.ic_fw_msg.hw_info[0],
update_msg.ic_fw_msg.hw_info[1],
update_msg.ic_fw_msg.hw_info[2],
update_msg.ic_fw_msg.hw_info[3]);
- TP_DEBUG("IC PID:%s", update_msg.ic_fw_msg.pid);
- TP_DEBUG("IC VID:%04x", update_msg.ic_fw_msg.vid);
+ pr_debug("IC PID:%s", update_msg.ic_fw_msg.pid);
+ pr_debug("IC VID:%04x", update_msg.ic_fw_msg.vid);
/* First two conditions */
if (!memcmp(fw_head->hw_info, update_msg.ic_fw_msg.hw_info,
sizeof(update_msg.ic_fw_msg.hw_info))) {
- GTP_DEBUG("Get the same hardware info.");
+ pr_debug("Get the same hardware info.");
if (update_msg.force_update != 0xBE) {
- GTP_INFO("FW chksum error,need enter update.");
+ pr_info("FW chksum error,need enter update.");
return SUCCESS;
}
/* 20130523 start */
if (strlen(update_msg.ic_fw_msg.pid) < 3) {
- GTP_INFO("Illegal IC pid, need enter update");
+ pr_info("Illegal IC pid, need enter update");
return SUCCESS;
} else {
for (i = 0; i < 3; i++) {
if ((update_msg.ic_fw_msg.pid[i] < 0x30) ||
(update_msg.ic_fw_msg.pid[i] > 0x39)) {
- GTP_INFO("Illegal IC pid, out of " \
- "bound, need enter update");
+ pr_info("Illegal IC pid, out of bound, need enter update");
return SUCCESS;
}
}
@@ -534,398 +518,264 @@
(!memcmp(update_msg.ic_fw_msg.pid, "91XX", 4)) ||
(!memcmp(fw_head->pid, "91XX", 4))) {
if (!memcmp(fw_head->pid, "91XX", 4))
- GTP_DEBUG("Force none same pid update mode.");
+ pr_debug("Force none same pid update mode.");
else
- GTP_DEBUG("Get the same pid.");
+ pr_debug("Get the same pid.");
/* The third condition */
if (fw_head->vid > update_msg.ic_fw_msg.vid) {
- GTP_INFO("Need enter update.");
+ pr_info("Need enter update.");
return SUCCESS;
}
- GTP_ERROR("Don't meet the third condition.");
- GTP_ERROR("File VID <= Ic VID, update aborted!");
+ pr_err("Don't meet the third condition.");
+ pr_err("File VID <= Ic VID, update aborted!");
} else {
- GTP_ERROR("File PID != Ic PID, update aborted!");
+ pr_err("File PID != Ic PID, update aborted!");
}
} else {
- GTP_ERROR("Different Hardware, update aborted!");
+ pr_err("Different Hardware, update aborted!");
}
return FAIL;
}
-static u8 ascii2hex(u8 a)
+static s8 gup_update_config(struct i2c_client *client,
+ const struct firmware *cfg)
{
- s8 value = 0;
-
- if (a >= '0' && a <= '9')
- value = a - '0';
- else if (a >= 'A' && a <= 'F')
- value = a - 'A' + 0x0A;
- else if (a >= 'a' && a <= 'f')
- value = a - 'a' + 0x0A;
- else
- value = 0xff;
-
- return value;
-}
-
-static s8 gup_update_config(struct i2c_client *client)
-{
- s32 file_len = 0;
s32 ret = 0;
s32 i = 0;
s32 file_cfg_len = 0;
- s32 chip_cfg_len = 0;
+ u32 chip_cfg_len = 0;
s32 count = 0;
u8 *buf;
- u8 *pre_buf;
u8 *file_config;
- /* u8 checksum = 0; */
u8 pid[8];
+ u8 high, low;
- if (update_msg.cfg_file == NULL) {
- GTP_ERROR("[update_cfg]No need to upgrade config!");
+ if (!cfg || !cfg->data) {
+ pr_err("No need to upgrade config!");
return FAIL;
}
- file_len = update_msg.cfg_file->f_op->llseek(update_msg.cfg_file,
- 0, SEEK_END);
ret = gup_get_ic_msg(client, GUP_REG_PID_VID, pid, 6);
if (ret == FAIL) {
- GTP_ERROR("[update_cfg]Read product id & version id fail.");
+ pr_err("Read product id & version id fail.");
return FAIL;
}
pid[5] = '\0';
- GTP_DEBUG("update cfg get pid:%s", &pid[GTP_ADDR_LENGTH]);
+ pr_debug("update cfg get pid:%s", &pid[GTP_ADDR_LENGTH]);
chip_cfg_len = 186;
if (!memcmp(&pid[GTP_ADDR_LENGTH], "968", 3) ||
- !memcmp(&pid[GTP_ADDR_LENGTH], "910", 3) ||
- !memcmp(&pid[GTP_ADDR_LENGTH], "960", 3)) {
+ !memcmp(&pid[GTP_ADDR_LENGTH], "910", 3) ||
+ !memcmp(&pid[GTP_ADDR_LENGTH], "960", 3)) {
chip_cfg_len = 228;
}
- GTP_DEBUG("[update_cfg]config file len:%d", file_len);
- GTP_DEBUG("[update_cfg]need config len:%d", chip_cfg_len);
- if ((file_len+5) < chip_cfg_len*5) {
- GTP_ERROR("Config length error");
+ pr_debug("config file ASCII len:%d", cfg->size);
+ pr_debug("need config binary len:%d", chip_cfg_len);
+ if ((cfg->size + 5) < chip_cfg_len * 5) {
+ pr_err("Config length error");
return -EINVAL;
}
- buf = kzalloc(file_len, GFP_KERNEL);
- pre_buf = kzalloc(file_len, GFP_KERNEL);
- file_config = kzalloc(chip_cfg_len + GTP_ADDR_LENGTH, GFP_KERNEL);
- update_msg.cfg_file->f_op->llseek(update_msg.cfg_file, 0, SEEK_SET);
-
- GTP_DEBUG("[update_cfg]Read config from file.");
- ret = update_msg.cfg_file->f_op->read(update_msg.cfg_file,
- (char *)pre_buf, file_len, &update_msg.cfg_file->f_pos);
- if (ret < 0) {
- GTP_ERROR("[update_cfg]Read config file failed.");
- goto update_cfg_file_failed;
+ buf = devm_kzalloc(&client->dev, cfg->size, GFP_KERNEL);
+ if (!buf) {
+ dev_err(&client->dev, "Memory allocation failed for buf.");
+ return -ENOMEM;
}
- GTP_DEBUG("[update_cfg]Delete illgal charactor.");
- for (i = 0, count = 0; i < file_len; i++) {
- if (pre_buf[i] == ' ' || pre_buf[i] == '\r'
- || pre_buf[i] == '\n')
+ file_config = devm_kzalloc(&client->dev, chip_cfg_len + GTP_ADDR_LENGTH,
+ GFP_KERNEL);
+ if (!file_config) {
+ dev_err(&client->dev, "Memory allocation failed.");
+ return -ENOMEM;
+ }
+
+ pr_debug("Delete illgal charactor.");
+ for (i = 0, count = 0; i < cfg->size; i++) {
+ if (cfg->data[i] == ' ' || cfg->data[i] == '\r'
+ || cfg->data[i] == '\n')
continue;
- buf[count++] = pre_buf[i];
+ buf[count++] = cfg->data[i];
}
- GTP_DEBUG("[update_cfg]Ascii to hex.");
+ pr_debug("Ascii to hex.");
file_config[0] = GTP_REG_CONFIG_DATA >> 8;
file_config[1] = GTP_REG_CONFIG_DATA & 0xff;
- for (i = 0, file_cfg_len = GTP_ADDR_LENGTH; i < count; i + = 5) {
- if ((buf[i] == '0') && ((buf[i+1] == 'x') ||
- (buf[i+1] == 'X'))) {
- u8 high, low;
- high = ascii2hex(buf[i+2]);
- low = ascii2hex(buf[i+3]);
+ for (i = 0, file_cfg_len = GTP_ADDR_LENGTH; i < count; i = i + 5) {
+ if ((buf[i] == '0') && ((buf[i + 1] == 'x') ||
+ (buf[i + 1] == 'X'))) {
+ ret = hex2bin(&high, &buf[i + 2], 1);
+ if (ret) {
+ pr_err("Failed to convert high address from hex2bin");
+ return ret;
+ }
+ ret = hex2bin(&low, &buf[i + 3], 1);
+ if (ret) {
+ pr_err("Failed to convert low address from hex2bin");
+ return ret;
+ }
if ((high == 0xFF) || (low == 0xFF)) {
ret = 0;
- GTP_ERROR("[update_cfg]Illegal config file.");
- goto update_cfg_file_failed;
+ pr_err("Illegal config file.");
+ return ret;
}
file_config[file_cfg_len++] = (high<<4) + low;
} else {
ret = 0;
- GTP_ERROR("[update_cfg]Illegal config file.");
- goto update_cfg_file_failed;
+ pr_err("Illegal config file.");
+ return ret;
}
}
- /* cal checksum */
- /* for(i=GTP_ADDR_LENGTH; i<chip_cfg_len; i++)
- checksum += file_config[i];
- file_config[chip_cfg_len] = (~checksum) + 1;
- file_config[chip_cfg_len+1] = 0x01; */
-
- GTP_DEBUG("config:");
- GTP_DEBUG_ARRAY(file_config+2, file_cfg_len);
-
i = 0;
while (i++ < 5) {
ret = gup_i2c_write(client, file_config, file_cfg_len);
if (ret > 0) {
- GTP_INFO("[update_cfg]Send config SUCCESS.");
+ pr_info("Send config SUCCESS.");
break;
}
- GTP_ERROR("[update_cfg]Send config i2c error.");
+ pr_err("Send config i2c error.");
}
-update_cfg_file_failed:
- kfree(pre_buf);
- kfree(buf);
- kfree(file_config);
return ret;
}
#if GTP_HEADER_FW_UPDATE
-static u8 gup_check_fs_mounted(char *path_name)
+static u32 gup_get firmware_file(struct i2c_client,
+ struct st_update_msg *msg, u8 *path)
{
- struct path root_path;
- struct path path;
- int err;
- err = kern_path("/", LOOKUP_FOLLOW, &root_path);
-
- if (err) {
- GTP_DEBUG("\"/\" NOT Mounted: %d", err);
- return FAIL;
+ if (sizeiof(header_fw_array) < (FW_HEAD_LENGTH +
+ FW_SECTION_LENGTH * 4 +
+ FW_DSP_ISP_LENGTH +
+ FW_DSP_LENGTH +
+ FW_BOOT_LENGTH)) {
+ dev_err(&client->dev,
+ "INVALID header_fw_array!");
+ return -EINVAL;
}
- err = kern_path(path_name, LOOKUP_FOLLOW, &path);
+ msg->fw_data = (u8 *)header_fw_array;
+ msg->fw_len = sizeof(header_fw_array);
+ dev_dbg(&client->dev, "Found firmware from header file, len=%d",
+ msg->fw_len);
+ return 0;
+}
+#else
+static s32 gup_get_firmware_file(struct i2c_client *client,
+ struct st_update_msg *msg, u8 *path)
+{
+ s32 ret;
+ const struct firmware *fw = NULL;
- if (err) {
- GTP_DEBUG("/data/ NOT Mounted: %d", err);
- return FAIL;
+ ret = request_firmware(&fw, path, &client->dev);
+ if (ret < 0) {
+ dev_info(&client->dev, "Cannot get firmware - %s (%d)\n",
+ path, ret);
+ return -EEXIST;
}
- return SUCCESS;
+ dev_dbg(&client->dev, "Config File: %s size=%d", path, fw->size);
+ msg->fw_data =
+ devm_kzalloc(&client->dev, fw->size, GFP_KERNEL);
+ if (!msg->fw_data) {
+ dev_err(&client->dev,
+ "Not enough memory for firmware data.");
+ release_firmware(fw);
+ return -ENOMEM;
+ }
- /* if (path.mnt->mnt_sb == root_path.mnt->mnt_sb)
- return FAIL;
- else
- return SUCCESS; */
+ memcpy(msg->fw_data, fw->data, fw->size);
+ msg->fw_len = fw->size;
+ msg->need_free = true;
+ release_firmware(fw);
+ return 0;
}
#endif
-static u8 gup_check_update_file(struct i2c_client *client, st_fw_head *fw_head,
- u8 *path)
+static u8 gup_check_firmware_name(struct i2c_client *client,
+ u8 **path_p)
+{
+ u8 len;
+ u8 *fname;
+
+ if (!(*path_p)) {
+ *path_p = GOODIX_FIRMWARE_FILE_NAME;
+ return 0;
+ }
+
+ len = strnlen(*path_p, FIRMWARE_NAME_LEN_MAX);
+ if (len >= FIRMWARE_NAME_LEN_MAX) {
+ dev_err(&client->dev, "firmware name too long!");
+ return -EINVAL;
+ }
+
+ fname = strrchr(*path_p, '/');
+ if (fname) {
+ fname = fname + 1;
+ *path_p = fname;
+ }
+ return 0;
+}
+
+static u8 gup_check_update_file(struct i2c_client *client,
+ struct st_fw_head *fw_head, u8 *path)
{
s32 ret = 0;
s32 i = 0;
s32 fw_checksum = 0;
- u8 buf[FW_HEAD_LENGTH];
+ u16 temp;
+ const struct firmware *fw = NULL;
- if (path) {
- GTP_DEBUG("Update File path:%s, %d", path, strlen(path));
- update_msg.file = file_open(path, O_RDONLY, 0);
-
- if (IS_ERR(update_msg.file)) {
- GTP_ERROR("Open update file(%s) error!", path);
- return FAIL;
- }
- } else {
-#if GTP_HEADER_FW_UPDATE
- for (i = 0; i < (GUP_SEARCH_FILE_TIMES); i++) {
- GTP_DEBUG("Waiting for /data mounted [%d]", i);
-
- if (gup_check_fs_mounted("/data") == SUCCESS) {
- GTP_DEBUG("/data Mounted!");
- break;
- }
- msleep(3000);
- }
- if (i >= (GUP_SEARCH_FILE_TIMES)) {
- GTP_ERROR("Wait for /data mounted timeout!");
- return FAIL;
- }
-
- /* update config */
- update_msg.cfg_file = file_open(CONFIG_FILE_PATH_1,
- O_RDONLY, 0);
-
- if (IS_ERR(update_msg.cfg_file)) {
- GTP_DEBUG("%s is unavailable", CONFIG_FILE_PATH_1);
- } else {
- GTP_INFO("Update Config File: %s", CONFIG_FILE_PATH_1);
- ret = gup_update_config(client);
- if (ret <= 0)
- GTP_ERROR("Update config failed.");
- filp_close(update_msg.cfg_file, NULL);
- }
-
- if (sizeof(header_fw_array) < (FW_HEAD_LENGTH+FW_SECTION_LENGTH
- *4 + FW_DSP_ISP_LENGTH+FW_DSP_LENGTH + FW_BOOT_LENGTH)) {
- GTP_ERROR("INVALID header_fw_array, check your " \
- "gt9xx_firmware.h file!");
- return FAIL;
- }
- update_msg.file = file_open(UPDATE_FILE_PATH_2, O_CREAT |
- O_RDWR, 0666);
- if ((IS_ERR(update_msg.file))) {
- GTP_ERROR("Failed to Create file: %s for fw_header!",
- UPDATE_FILE_PATH_2);
- return FAIL;
- }
- update_msg.file->f_op->llseek(update_msg.file, 0, SEEK_SET);
- update_msg.file->f_op->write(update_msg.file,
- (char *)header_fw_array, sizeof(header_fw_array),
- &update_msg.file->f_pos);
- file_close(update_msg.file, NULL);
- update_msg.file = file_open(UPDATE_FILE_PATH_2, O_RDONLY, 0);
-#else
- u8 fp_len = max(sizeof(UPDATE_FILE_PATH_1),
- sizeof(UPDATE_FILE_PATH_2));
- u8 cfp_len = max(sizeof(CONFIG_FILE_PATH_1),
- sizeof(CONFIG_FILE_PATH_2));
- u8 *search_update_path = kzalloc(fp_len, GFP_KERNEL);
- u8 *search_cfg_path = kzalloc(cfp_len, GFP_KERNEL);
- /* Begin to search update file,the config file & firmware
- file must be in the same path,single or double. */
- searching_file = 1;
- for (i = 0; i < GUP_SEARCH_FILE_TIMES; i++) {
- if (searching_file == 0) {
- kfree(search_update_path);
- kfree(search_cfg_path);
- GTP_INFO(".bin/.cfg update file search " \
- "forcely terminated!");
- return FAIL;
- }
- if (i % 2) {
- memcpy(search_update_path, UPDATE_FILE_PATH_1,
- sizeof(UPDATE_FILE_PATH_1));
- memcpy(search_cfg_path, CONFIG_FILE_PATH_1,
- sizeof(CONFIG_FILE_PATH_1));
- } else {
- memcpy(search_update_path, UPDATE_FILE_PATH_2,
- sizeof(UPDATE_FILE_PATH_2));
- memcpy(search_cfg_path, CONFIG_FILE_PATH_2,
- sizeof(CONFIG_FILE_PATH_2));
- }
-
- if (!(got_file_flag&0x0F)) {
- update_msg.file = file_open(search_update_path,
- O_RDONLY, 0);
- if (!IS_ERR(update_msg.file)) {
- GTP_DEBUG("Find the bin file");
- got_file_flag |= 0x0F;
- }
- }
- if (!(got_file_flag & 0xF0)) {
- update_msg.cfg_file = file_open(search_cfg_path,
- O_RDONLY, 0);
- if (!IS_ERR(update_msg.cfg_file)) {
- GTP_DEBUG("Find the cfg file");
- got_file_flag |= 0xF0;
- }
- }
-
- if (got_file_flag) {
- if (got_file_flag == 0xFF)
- break;
- else
- i += 4;
- }
- GTP_DEBUG("%3d:Searching %s %s file...", i,
- (got_file_flag & 0x0F) ? "" : "bin",
- (got_file_flag & 0xF0) ? "" : "cfg");
-
- msleep(3000);
- }
-
- searching_file = 0;
- kfree(search_update_path);
- kfree(search_cfg_path);
-
- if (!got_file_flag) {
- GTP_ERROR("Can't find update file.");
- goto load_failed;
- }
-
- if (got_file_flag & 0xF0) {
- GTP_DEBUG("Got the update config file.");
- ret = gup_update_config(client);
- if (ret <= 0)
- GTP_ERROR("Update config failed.");
- filp_close(update_msg.cfg_file, NULL);
- msleep(500); /* waiting config to be stored in FLASH. */
- }
- if (got_file_flag & 0x0F) {
- GTP_DEBUG("Got the update firmware file.");
- } else {
- GTP_ERROR("No need to upgrade firmware.");
- goto load_failed;
- }
-#endif
- }
-
- update_msg.old_fs = get_fs();
- set_fs(KERNEL_DS);
-
- update_msg.file->f_op->llseek(update_msg.file, 0, SEEK_SET);
- /* update_msg.file->f_pos = 0; */
-
- ret = update_msg.file->f_op->read(update_msg.file, (char *)buf,
- FW_HEAD_LENGTH, &update_msg.file->f_pos);
+ ret = request_firmware(&fw, GOODIX_CONFIG_FILE_NAME, &client->dev);
if (ret < 0) {
- GTP_ERROR("Read firmware head in update file error.");
- goto load_failed;
+ dev_info(&client->dev, "Cannot get config file - %s (%d)\n",
+ GOODIX_CONFIG_FILE_NAME, ret);
+ } else {
+ dev_dbg(&client->dev,
+ "Update config File: %s", GOODIX_CONFIG_FILE_NAME);
+ ret = gup_update_config(client, fw);
+ if (ret <= 0)
+ dev_err(&client->dev, "Update config failed.");
+ release_firmware(fw);
}
- memcpy(fw_head, buf, FW_HEAD_LENGTH);
+
+ update_msg.need_free = false;
+ update_msg.fw_len = 0;
+
+ if (gup_check_firmware_name(client, &path))
+ goto load_failed;
+
+ if (gup_get_firmware_file(client, &update_msg, path))
+ goto load_failed;
+
+ memcpy(fw_head, update_msg.fw_data, FW_HEAD_LENGTH);
/* check firmware legality */
fw_checksum = 0;
for (i = 0; i < FW_SECTION_LENGTH * 4 + FW_DSP_ISP_LENGTH +
- FW_DSP_LENGTH + FW_BOOT_LENGTH; i + = 2) {
- u16 temp;
- ret = update_msg.file->f_op->read(update_msg.file, (char *)buf,
- 2, &update_msg.file->f_pos);
- if (ret < 0) {
- GTP_ERROR("Read firmware file error.");
- goto load_failed;
- }
- /* GTP_DEBUG("BUF[0]:%x", buf[0]); */
- temp = (buf[0]<<8) + buf[1];
+ FW_DSP_LENGTH + FW_BOOT_LENGTH; i += 2) {
+ temp = (update_msg.fw_data[FW_HEAD_LENGTH + i] << 8) +
+ update_msg.fw_data[FW_HEAD_LENGTH + i + 1];
fw_checksum += temp;
}
- GTP_DEBUG("firmware checksum:%x", fw_checksum&0xFFFF);
+ pr_debug("firmware checksum:%x", fw_checksum & 0xFFFF);
if (fw_checksum & 0xFFFF) {
- GTP_ERROR("Illegal firmware file.");
+ dev_err(&client->dev, "Illegal firmware file.");
goto load_failed;
}
return SUCCESS;
load_failed:
- set_fs(update_msg.old_fs);
+ if (update_msg.need_free) {
+ devm_kfree(&client->dev, update_msg.fw_data);
+ update_msg.need_free = false;
+ }
return FAIL;
}
-#if 0
-static u8 gup_check_update_header(struct i2c_client *client,
- st_fw_head *fw_head)
-{
- const u8 *pos;
- int i = 0;
- u8 mask_num = 0;
- s32 ret = 0;
-
- pos = HEADER_UPDATE_DATA;
-
- memcpy(fw_head, pos, FW_HEAD_LENGTH);
- pos += FW_HEAD_LENGTH;
-
- ret = gup_enter_update_judge(fw_head);
- if (SUCCESS == ret)
- return SUCCESS;
- return FAIL;
-}
-#endif
-
static u8 gup_burn_proc(struct i2c_client *client, u8 *burn_buf, u16 start_addr,
u16 total_length)
{
@@ -937,10 +787,10 @@
u8 rd_buf[PACK_SIZE + GTP_ADDR_LENGTH];
u8 retry = 0;
- GTP_DEBUG("Begin burn %dk data to addr 0x%x", (total_length/1024),
+ pr_debug("Begin burn %dk data to addr 0x%x", (total_length / 1024),
start_addr);
while (burn_length < total_length) {
- GTP_DEBUG("B/T:%04d/%04d", burn_length, total_length);
+ pr_debug("B/T:%04d/%04d", burn_length, total_length);
frame_length = ((total_length - burn_length) > PACK_SIZE)
? PACK_SIZE : (total_length - burn_length);
wr_buf[0] = (u8)(burn_addr>>8);
@@ -954,33 +804,26 @@
ret = gup_i2c_write(client, wr_buf,
GTP_ADDR_LENGTH + frame_length);
if (ret <= 0) {
- GTP_ERROR("Write frame data i2c error.");
+ pr_err("Write frame data i2c error.");
continue;
}
ret = gup_i2c_read(client, rd_buf, GTP_ADDR_LENGTH +
frame_length);
if (ret <= 0) {
- GTP_ERROR("Read back frame data i2c error.");
+ pr_err("Read back frame data i2c error.");
continue;
}
if (memcmp(&wr_buf[GTP_ADDR_LENGTH],
&rd_buf[GTP_ADDR_LENGTH], frame_length)) {
- GTP_ERROR("Check frame data fail,not equal.");
- GTP_DEBUG("write array:");
- GTP_DEBUG_ARRAY(&wr_buf[GTP_ADDR_LENGTH],
- frame_length);
- GTP_DEBUG("read array:");
- GTP_DEBUG_ARRAY(&rd_buf[GTP_ADDR_LENGTH],
- frame_length);
+ pr_err("Check frame data fail,not equal.");
continue;
} else {
- /* GTP_DEBUG("Check frame data success."); */
break;
}
}
if (retry >= MAX_FRAME_CHECK_TIME) {
- GTP_ERROR("Burn frame data time out,exit.");
+ pr_err("Burn frame data time out,exit.");
return FAIL;
}
burn_length += frame_length;
@@ -991,20 +834,15 @@
static u8 gup_load_section_file(u8 *buf, u16 offset, u16 length)
{
- s32 ret = 0;
-
- if (update_msg.file == NULL) {
- GTP_ERROR("cannot find update file,load section file fail.");
+ if (!update_msg.fw_data ||
+ update_msg.fw_len < FW_HEAD_LENGTH + offset + length) {
+ pr_err(
+ "<<-GTP->> cannot load section data. fw_len=%d read end=%d\n",
+ update_msg.fw_len ,
+ FW_HEAD_LENGTH + offset + length);
return FAIL;
}
- update_msg.file->f_pos = FW_HEAD_LENGTH + offset;
-
- ret = update_msg.file->f_op->read(update_msg.file, (char *)buf, length,
- &update_msg.file->f_pos);
- if (ret < 0) {
- GTP_ERROR("Read update file fail.");
- return FAIL;
- }
+ memcpy(buf, &update_msg.fw_data[FW_HEAD_LENGTH + offset], length);
return SUCCESS;
}
@@ -1023,30 +861,26 @@
? PACK_SIZE : (chk_length - recall_length);
ret = gup_get_ic_msg(client, recall_addr, rd_buf, frame_length);
if (ret <= 0) {
- GTP_ERROR("recall i2c error,exit");
+ pr_err("recall i2c error,exit");
return FAIL;
}
if (memcmp(&rd_buf[GTP_ADDR_LENGTH], &chk_src[recall_length],
frame_length)) {
- GTP_ERROR("Recall frame data fail,not equal.");
- GTP_DEBUG("chk_src array:");
- GTP_DEBUG_ARRAY(&chk_src[recall_length], frame_length);
- GTP_DEBUG("recall array:");
- GTP_DEBUG_ARRAY(&rd_buf[GTP_ADDR_LENGTH], frame_length);
+ pr_err("Recall frame data fail,not equal.");
return FAIL;
}
recall_length += frame_length;
recall_addr += frame_length;
}
- GTP_DEBUG("Recall check %dk firmware success.", (chk_length/1024));
+ pr_debug("Recall check %dk firmware success.", (chk_length/1024));
return SUCCESS;
}
static u8 gup_burn_fw_section(struct i2c_client *client, u8 *fw_section,
- u16 start_addr, u8 bank_cmdi)
+ u16 start_addr, u8 bank_cmd)
{
s32 ret = 0;
u8 rd_buf[5];
@@ -1054,14 +888,14 @@
/* step1:hold ss51 & dsp */
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]hold ss51 & dsp fail.");
+ pr_err("hold ss51 & dsp fail.");
return FAIL;
}
/* step2:set scramble */
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]set scramble fail.");
+ pr_err("set scramble fail.");
return FAIL;
}
@@ -1069,7 +903,7 @@
ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK,
(bank_cmd >> 4)&0x0F);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]select bank %d fail.",
+ pr_err("select bank %d fail.",
(bank_cmd >> 4)&0x0F);
return FAIL;
}
@@ -1077,21 +911,21 @@
/* step4:enable accessing code */
ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x01);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]enable accessing code fail.");
+ pr_err("enable accessing code fail.");
return FAIL;
}
/* step5:burn 8k fw section */
ret = gup_burn_proc(client, fw_section, start_addr, FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_section]burn fw_section fail.");
+ pr_err("burn fw_section fail.");
return FAIL;
}
/* step6:hold ss51 & release dsp */
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]hold ss51 & release dsp fail.");
+ pr_err("hold ss51 & release dsp fail.");
return FAIL;
}
/* must delay */
@@ -1100,26 +934,24 @@
/* step7:send burn cmd to move data to flash from sram */
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, bank_cmd&0x0f);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]send burn cmd fail.");
+ pr_err("send burn cmd fail.");
return FAIL;
}
- GTP_DEBUG("[burn_fw_section]Wait for the burn is complete......");
+ pr_debug("Wait for the burn is complete.");
do {
ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]Get burn state fail");
+ pr_err("Get burn state fail");
return FAIL;
}
msleep(20);
- /* GTP_DEBUG("[burn_fw_section]Get burn state:%d.",
- rd_buf[GTP_ADDR_LENGTH]); */
} while (rd_buf[GTP_ADDR_LENGTH]);
/* step8:select bank */
ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK,
(bank_cmd >> 4)&0x0F);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]select bank %d fail.",
+ pr_err("select bank %d fail.",
(bank_cmd >> 4)&0x0F);
return FAIL;
}
@@ -1127,7 +959,7 @@
/* step9:enable accessing code */
ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x01);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]enable accessing code fail.");
+ pr_err("enable accessing code fail.");
return FAIL;
}
@@ -1135,14 +967,14 @@
ret = gup_recall_check(client, fw_section, start_addr,
FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_section]recall check 8k firmware fail.");
+ pr_err("recall check 8k firmware fail.");
return FAIL;
}
/* step11:disable accessing code */
ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_section]disable accessing code fail.");
+ pr_err("disable accessing code fail.");
return FAIL;
}
@@ -1155,115 +987,105 @@
u8 *fw_dsp_isp = NULL;
u8 retry = 0;
- GTP_DEBUG("[burn_dsp_isp]Begin burn dsp isp---->>");
+ pr_debug("Begin burn dsp isp.");
/* step1:alloc memory */
- GTP_DEBUG("[burn_dsp_isp]step1:alloc memory");
+ pr_debug("step1:alloc memory");
while (retry++ < 5) {
- fw_dsp_isp = kzalloc(FW_DSP_ISP_LENGTH, GFP_KERNEL);
+ fw_dsp_isp = devm_kzalloc(&client->dev, FW_DSP_ISP_LENGTH,
+ GFP_KERNEL);
if (fw_dsp_isp == NULL) {
continue;
} else {
- GTP_INFO("[burn_dsp_isp]Alloc %dk byte memory success.",
+ pr_info("Alloc %dk byte memory success.",
(FW_DSP_ISP_LENGTH/1024));
break;
}
}
- if (retry >= 5) {
- GTP_ERROR("[burn_dsp_isp]Alloc memory fail,exit.");
+ if (retry == 5) {
+ pr_err("Alloc memory fail,exit.");
return FAIL;
}
/* step2:load dsp isp file data */
- GTP_DEBUG("[burn_dsp_isp]step2:load dsp isp file data");
+ pr_debug("step2:load dsp isp file data");
ret = gup_load_section_file(fw_dsp_isp, (4 * FW_SECTION_LENGTH +
FW_DSP_LENGTH + FW_BOOT_LENGTH), FW_DSP_ISP_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_dsp_isp]load firmware dsp_isp fail.");
- goto exit_burn_dsp_isp;
+ pr_err("load firmware dsp_isp fail.");
+ return FAIL;
}
/* step3:disable wdt,clear cache enable */
- GTP_DEBUG("[burn_dsp_isp]step3:disable wdt,clear cache enable");
+ pr_debug("step3:disable wdt,clear cache enable");
ret = gup_set_ic_msg(client, _bRW_MISCTL__TMR0_EN, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]disable wdt fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("disable wdt fail.");
+ return FAIL;
}
ret = gup_set_ic_msg(client, _bRW_MISCTL__CACHE_EN, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]clear cache enable fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("clear cache enable fail.");
+ return FAIL;
}
/* step4:hold ss51 & dsp */
- GTP_DEBUG("[burn_dsp_isp]step4:hold ss51 & dsp");
+ pr_debug("step4:hold ss51 & dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]hold ss51 & dsp fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("hold ss51 & dsp fail.");
+ return FAIL;
}
/* step5:set boot from sram */
- GTP_DEBUG("[burn_dsp_isp]step5:set boot from sram");
+ pr_debug("step5:set boot from sram");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOTCTL_B0_, 0x02);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]set boot from sram fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("set boot from sram fail.");
+ return FAIL;
}
/* step6:software reboot */
- GTP_DEBUG("[burn_dsp_isp]step6:software reboot");
+ pr_debug("step6:software reboot");
ret = gup_set_ic_msg(client, _bWO_MISCTL__CPU_SWRST_PULSE, 0x01);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]software reboot fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("software reboot fail.");
+ return FAIL;
}
/* step7:select bank2 */
- GTP_DEBUG("[burn_dsp_isp]step7:select bank2");
+ pr_debug("step7:select bank2");
ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x02);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]select bank2 fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("select bank2 fail.");
+ return FAIL;
}
/* step8:enable accessing code */
- GTP_DEBUG("[burn_dsp_isp]step8:enable accessing code");
+ pr_debug("step8:enable accessing code");
ret = gup_set_ic_msg(client, _bRW_MISCTL__MEM_CD_EN, 0x01);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]enable accessing code fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("enable accessing code fail.");
+ return FAIL;
}
/* step9:burn 4k dsp_isp */
- GTP_DEBUG("[burn_dsp_isp]step9:burn 4k dsp_isp");
+ pr_debug("step9:burn 4k dsp_isp");
ret = gup_burn_proc(client, fw_dsp_isp, 0xC000, FW_DSP_ISP_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_dsp_isp]burn dsp_isp fail.");
- goto exit_burn_dsp_isp;
+ pr_err("burn dsp_isp fail.");
+ return FAIL;
}
/* step10:set scramble */
- GTP_DEBUG("[burn_dsp_isp]step10:set scramble");
+ pr_debug("step10:set scramble");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_dsp_isp]set scramble fail.");
- ret = FAIL;
- goto exit_burn_dsp_isp;
+ pr_err("set scramble fail.");
+ return FAIL;
}
- ret = SUCCESS;
-exit_burn_dsp_isp:
- kfree(fw_dsp_isp);
- return ret;
+ return SUCCESS;
}
static u8 gup_burn_fw_ss51(struct i2c_client *client)
@@ -1272,106 +1094,102 @@
u8 retry = 0;
s32 ret = 0;
- GTP_DEBUG("[burn_fw_ss51]Begin burn ss51 firmware---->>");
+ pr_debug("Begin burn ss51 firmware.");
/* step1:alloc memory */
- GTP_DEBUG("[burn_fw_ss51]step1:alloc memory");
+ pr_debug("step1:alloc memory");
while (retry++ < 5) {
- fw_ss51 = kzalloc(FW_SECTION_LENGTH, GFP_KERNEL);
+ fw_ss51 = devm_kzalloc(&client->dev, FW_SECTION_LENGTH,
+ GFP_KERNEL);
if (fw_ss51 == NULL) {
continue;
} else {
- GTP_INFO("[burn_fw_ss51]Alloc %dk byte memory success.",
+ pr_info("Alloc %dk byte memory success.",
(FW_SECTION_LENGTH/1024));
break;
}
}
- if (retry >= 5) {
- GTP_ERROR("[burn_fw_ss51]Alloc memory fail,exit.");
+ if (retry == 5) {
+ pr_err("Alloc memory fail,exit.");
return FAIL;
}
/* step2:load ss51 firmware section 1 file data */
- GTP_DEBUG("[burn_fw_ss51]step2:load ss51 firmware section 1 file data");
+ pr_debug("step2:load ss51 firmware section 1 file data");
ret = gup_load_section_file(fw_ss51, 0, FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 1 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("load ss51 firmware section 1 fail.");
+ return FAIL;
}
/* step3:clear control flag */
- GTP_DEBUG("[burn_fw_ss51]step3:clear control flag");
+ pr_debug("step3:clear control flag");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_ss51]clear control flag fail.");
- ret = FAIL;
- goto exit_burn_fw_ss51;
+ pr_err("clear control flag fail.");
+ return FAIL;
}
/* step4:burn ss51 firmware section 1 */
- GTP_DEBUG("[burn_fw_ss51]step4:burn ss51 firmware section 1");
+ pr_debug("step4:burn ss51 firmware section 1");
ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x01);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 1 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("burn ss51 firmware section 1 fail.");
+ return FAIL;
}
/* step5:load ss51 firmware section 2 file data */
- GTP_DEBUG("[burn_fw_ss51]step5:load ss51 firmware section 2 file data");
+ pr_debug("step5:load ss51 firmware section 2 file data");
ret = gup_load_section_file(fw_ss51, FW_SECTION_LENGTH,
FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 2 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("[burn_fw_ss51]load ss51 firmware section 2 fail.");
+ return FAIL;
}
/* step6:burn ss51 firmware section 2 */
- GTP_DEBUG("[burn_fw_ss51]step6:burn ss51 firmware section 2");
+ pr_debug("step6:burn ss51 firmware section 2");
ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x02);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 2 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("burn ss51 firmware section 2 fail.");
+ return FAIL;
}
/* step7:load ss51 firmware section 3 file data */
- GTP_DEBUG("[burn_fw_ss51]step7:load ss51 firmware section 3 file data");
+ pr_debug("step7:load ss51 firmware section 3 file data");
ret = gup_load_section_file(fw_ss51, 2*FW_SECTION_LENGTH,
FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 3 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("load ss51 firmware section 3 fail.");
+ return FAIL;
}
/* step8:burn ss51 firmware section 3 */
- GTP_DEBUG("[burn_fw_ss51]step8:burn ss51 firmware section 3");
+ pr_debug("step8:burn ss51 firmware section 3");
ret = gup_burn_fw_section(client, fw_ss51, 0xC000, 0x13);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 3 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("burn ss51 firmware section 3 fail.");
+ return FAIL;
}
/* step9:load ss51 firmware section 4 file data */
- GTP_DEBUG("[burn_fw_ss51]step9:load ss51 firmware section 4 file data");
+ pr_debug("step9:load ss51 firmware section 4 file data");
ret = gup_load_section_file(fw_ss51, 3*FW_SECTION_LENGTH,
FW_SECTION_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]load ss51 firmware section 4 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("load ss51 firmware section 4 fail.");
+ return FAIL;
}
/* step10:burn ss51 firmware section 4 */
- GTP_DEBUG("[burn_fw_ss51]step10:burn ss51 firmware section 4");
+ pr_debug("step10:burn ss51 firmware section 4");
ret = gup_burn_fw_section(client, fw_ss51, 0xE000, 0x14);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_ss51]burn ss51 firmware section 4 fail.");
- goto exit_burn_fw_ss51;
+ pr_err("burn ss51 firmware section 4 fail.");
+ return FAIL;
}
- ret = SUCCESS;
-
-exit_burn_fw_ss51:
- kfree(fw_ss51);
- return ret;
+ return SUCCESS;
}
static u8 gup_burn_fw_dsp(struct i2c_client *client)
@@ -1381,111 +1199,101 @@
u8 retry = 0;
u8 rd_buf[5];
- GTP_DEBUG("[burn_fw_dsp]Begin burn dsp firmware---->>");
+ pr_debug("Begin burn dsp firmware.");
/* step1:alloc memory */
- GTP_DEBUG("[burn_fw_dsp]step1:alloc memory");
+ pr_debug("step1:alloc memory");
while (retry++ < 5) {
- fw_dsp = kzalloc(FW_DSP_LENGTH, GFP_KERNEL);
+ fw_dsp = devm_kzalloc(&client->dev, FW_DSP_LENGTH,
+ GFP_KERNEL);
if (fw_dsp == NULL) {
continue;
} else {
- GTP_INFO("[burn_fw_dsp]Alloc %dk byte memory success.",
+ pr_info("Alloc %dk byte memory success.",
(FW_SECTION_LENGTH/1024));
break;
}
}
- if (retry >= 5) {
- GTP_ERROR("[burn_fw_dsp]Alloc memory fail,exit.");
+ if (retry == 5) {
+ pr_err("Alloc memory fail,exit.");
return FAIL;
}
/* step2:load firmware dsp */
- GTP_DEBUG("[burn_fw_dsp]step2:load firmware dsp");
+ pr_debug("step2:load firmware dsp");
ret = gup_load_section_file(fw_dsp, 4*FW_SECTION_LENGTH, FW_DSP_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_dsp]load firmware dsp fail.");
- goto exit_burn_fw_dsp;
+ pr_err("load firmware dsp fail.");
+ return ret;
}
/* step3:select bank3 */
- GTP_DEBUG("[burn_fw_dsp]step3:select bank3");
+ pr_debug("step3:select bank3");
ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]select bank3 fail.");
- ret = FAIL;
- goto exit_burn_fw_dsp;
+ pr_err("select bank3 fail.");
+ return FAIL;
}
/* Step4:hold ss51 & dsp */
- GTP_DEBUG("[burn_fw_dsp]step4:hold ss51 & dsp");
+ pr_debug("step4:hold ss51 & dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]hold ss51 & dsp fail.");
- ret = FAIL;
- goto exit_burn_fw_dsp;
+ pr_err("hold ss51 & dsp fail.");
+ return FAIL;
}
/* step5:set scramble */
- GTP_DEBUG("[burn_fw_dsp]step5:set scramble");
+ pr_debug("step5:set scramble");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]set scramble fail.");
- ret = FAIL;
- goto exit_burn_fw_dsp;
+ pr_err("set scramble fail.");
+ return FAIL;
}
/* step6:release ss51 & dsp */
- GTP_DEBUG("[burn_fw_dsp]step6:release ss51 & dsp");
+ pr_debug("step6:release ss51 & dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]release ss51 & dsp fail.");
- ret = FAIL;
- goto exit_burn_fw_dsp;
+ pr_err("release ss51 & dsp fail.");
+ return FAIL;
}
/* must delay */
msleep(20);
/* step7:burn 4k dsp firmware */
- GTP_DEBUG("[burn_fw_dsp]step7:burn 4k dsp firmware");
+ pr_debug("step7:burn 4k dsp firmware");
ret = gup_burn_proc(client, fw_dsp, 0x9000, FW_DSP_LENGTH);
- if (FAIL == ret) {
- GTP_ERROR("[burn_fw_dsp]burn fw_section fail.");
- goto exit_burn_fw_dsp;
+ if (ret == FAIL) {
+ pr_err("[burn_fw_dsp]burn fw_section fail.");
+ return ret;
}
/* step8:send burn cmd to move data to flash from sram */
- GTP_DEBUG("[burn_fw_dsp]step8:send burn cmd to move data to flash" \
- "from sram");
+ pr_debug("step8:send burn cmd to move data to flash from sram");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x05);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]send burn cmd fail.");
- goto exit_burn_fw_dsp;
+ pr_err("send burn cmd fail.");
+ return ret;
}
- GTP_DEBUG("[burn_fw_dsp]Wait for the burn is complete......");
+ pr_debug("Wait for the burn is complete.");
do {
ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_dsp]Get burn state fail");
- goto exit_burn_fw_dsp;
+ pr_err("Get burn state fail");
+ return ret;
}
msleep(20);
- /* GTP_DEBUG("[burn_fw_dsp]Get burn state:%d.",
- rd_buf[GTP_ADDR_LENGTH]); */
} while (rd_buf[GTP_ADDR_LENGTH]);
/* step9:recall check 4k dsp firmware */
- GTP_DEBUG("[burn_fw_dsp]step9:recall check 4k dsp firmware");
+ pr_debug("step9:recall check 4k dsp firmware");
ret = gup_recall_check(client, fw_dsp, 0x9000, FW_DSP_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_dsp]recall check 4k dsp firmware fail.");
- goto exit_burn_fw_dsp;
+ pr_err("recall check 4k dsp firmware fail.");
+ return ret;
}
- ret = SUCCESS;
-
-exit_burn_fw_dsp:
- kfree(fw_dsp);
- return ret;
+ return SUCCESS;
}
static u8 gup_burn_fw_boot(struct i2c_client *client)
@@ -1495,176 +1303,165 @@
u8 retry = 0;
u8 rd_buf[5];
- GTP_DEBUG("[burn_fw_boot]Begin burn bootloader firmware---->>");
+ pr_debug("Begin burn bootloader firmware.");
/* step1:Alloc memory */
- GTP_DEBUG("[burn_fw_boot]step1:Alloc memory");
+ pr_debug("step1:Alloc memory");
while (retry++ < 5) {
- fw_boot = kzalloc(FW_BOOT_LENGTH, GFP_KERNEL);
+ fw_boot = devm_kzalloc(&client->dev, FW_BOOT_LENGTH,
+ GFP_KERNEL);
if (fw_boot == NULL) {
continue;
} else {
- GTP_INFO("[burn_fw_boot]Alloc %dk byte memory success.",
+ pr_info("Alloc %dk byte memory success.",
(FW_BOOT_LENGTH/1024));
break;
}
}
- if (retry >= 5) {
- GTP_ERROR("[burn_fw_boot]Alloc memory fail,exit.");
+ if (retry == 5) {
+ pr_err("Alloc memory fail,exit.");
return FAIL;
}
/* step2:load firmware bootloader */
- GTP_DEBUG("[burn_fw_boot]step2:load firmware bootloader");
+ pr_debug("step2:load firmware bootloader");
ret = gup_load_section_file(fw_boot, (4 * FW_SECTION_LENGTH +
FW_DSP_LENGTH), FW_BOOT_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_boot]load firmware dsp fail.");
- goto exit_burn_fw_boot;
+ pr_err("load firmware dsp fail.");
+ return ret;
}
/* step3:hold ss51 & dsp */
- GTP_DEBUG("[burn_fw_boot]step3:hold ss51 & dsp");
+ pr_debug("step3:hold ss51 & dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x0C);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]hold ss51 & dsp fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("hold ss51 & dsp fail.");
+ return FAIL;
}
/* step4:set scramble */
- GTP_DEBUG("[burn_fw_boot]step4:set scramble");
+ pr_debug("step4:set scramble");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_OPT_B0_, 0x00);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]set scramble fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("set scramble fail.");
+ return FAIL;
}
/* step5:release ss51 & dsp */
- GTP_DEBUG("[burn_fw_boot]step5:release ss51 & dsp");
+ pr_debug("step5:release ss51 & dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x04);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]release ss51 & dsp fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("release ss51 & dsp fail.");
+ return FAIL;
}
/* must delay */
msleep(20);
/* step6:select bank3 */
- GTP_DEBUG("[burn_fw_boot]step6:select bank3");
+ pr_debug("step6:select bank3");
ret = gup_set_ic_msg(client, _bRW_MISCTL__SRAM_BANK, 0x03);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]select bank3 fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("select bank3 fail.");
+ return FAIL;
}
/* step7:burn 2k bootloader firmware */
- GTP_DEBUG("[burn_fw_boot]step7:burn 2k bootloader firmware");
+ pr_debug("step7:burn 2k bootloader firmware");
ret = gup_burn_proc(client, fw_boot, 0x9000, FW_BOOT_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_boot]burn fw_section fail.");
- goto exit_burn_fw_boot;
+ pr_err("burn fw_section fail.");
+ return ret;
}
/* step7:send burn cmd to move data to flash from sram */
- GTP_DEBUG("[burn_fw_boot]step7:send burn cmd to move data to" \
- "flash from sram");
+ pr_debug("step7:send burn cmd to flash data from sram");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x06);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]send burn cmd fail.");
- goto exit_burn_fw_boot;
+ pr_err("send burn cmd fail.");
+ return ret;
}
- GTP_DEBUG("[burn_fw_boot]Wait for the burn is complete......");
+ pr_debug("Wait for the burn is complete.");
do {
ret = gup_get_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, rd_buf, 1);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]Get burn state fail");
- goto exit_burn_fw_boot;
+ pr_err("Get burn state fail");
+ return ret;
}
msleep(20);
- /* GTP_DEBUG("[burn_fw_boot]Get burn state:%d.",
- rd_buf[GTP_ADDR_LENGTH]); */
} while (rd_buf[GTP_ADDR_LENGTH]);
/* step8:recall check 2k bootloader firmware */
- GTP_DEBUG("[burn_fw_boot]step8:recall check 2k bootloader firmware");
+ pr_debug("step8:recall check 2k bootloader firmware");
ret = gup_recall_check(client, fw_boot, 0x9000, FW_BOOT_LENGTH);
if (ret == FAIL) {
- GTP_ERROR("[burn_fw_boot]recall check 4k dsp firmware fail.");
- goto exit_burn_fw_boot;
+ pr_err("recall check 4k dsp firmware fail.");
+ return ret;
}
/* step9:enable download DSP code */
- GTP_DEBUG("[burn_fw_boot]step9:enable download DSP code ");
+ pr_debug("step9:enable download DSP code ");
ret = gup_set_ic_msg(client, _rRW_MISCTL__BOOT_CTL_, 0x99);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]enable download DSP code fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("enable download DSP code fail.");
+ return FAIL;
}
/* step10:release ss51 & hold dsp */
- GTP_DEBUG("[burn_fw_boot]step10:release ss51 & hold dsp");
+ pr_debug("step10:release ss51 & hold dsp");
ret = gup_set_ic_msg(client, _rRW_MISCTL__SWRST_B0_, 0x08);
if (ret <= 0) {
- GTP_ERROR("[burn_fw_boot]release ss51 & hold dsp fail.");
- ret = FAIL;
- goto exit_burn_fw_boot;
+ pr_err("release ss51 & hold dsp fail.");
+ return FAIL;
}
- ret = SUCCESS;
-
-exit_burn_fw_boot:
- kfree(fw_boot);
- return ret;
+ return SUCCESS;
}
s32 gup_update_proc(void *dir)
{
s32 ret = 0;
- u8 retry = 0;
- st_fw_head fw_head;
+ u8 retry = 0;
+ struct st_fw_head fw_head;
struct goodix_ts_data *ts = NULL;
- GTP_DEBUG("[update_proc]Begin update ......");
+ pr_debug("Begin update.");
+
+ if (!i2c_connect_client) {
+ pr_err("No i2c connect client for %s\n", __func__);
+ return -EIO;
+ }
show_len = 1;
total_len = 100;
- if (dir == NULL)
- /* wait main thread to be completed */
- msleep(3000);
ts = i2c_get_clientdata(i2c_connect_client);
if (searching_file) {
/* exit .bin update file searching */
searching_file = 0;
- GTP_INFO("Exiting searching .bin update file...");
+ pr_info("Exiting searching .bin update file.");
/* wait for auto update quitted completely */
while ((show_len != 200) && (show_len != 100))
msleep(100);
}
- update_msg.file = NULL;
ret = gup_check_update_file(i2c_connect_client, &fw_head, (u8 *)dir);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]check update file fail.");
+ pr_err("check update file fail.");
goto file_fail;
}
/* gtp_reset_guitar(i2c_connect_client, 20); */
ret = gup_get_ic_fw_msg(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]get ic message fail.");
+ pr_err("get ic message fail.");
goto file_fail;
}
- ret = gup_enter_update_judge(&fw_head);
+ ret = gup_enter_update_judge(ts->client, &fw_head);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]Check *.bin file fail.");
+ pr_err("Check *.bin file fail.");
goto file_fail;
}
@@ -1675,7 +1472,7 @@
#endif
ret = gup_enter_update_mode(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]enter update mode fail.");
+ pr_err("enter update mode fail.");
goto update_fail;
}
@@ -1684,52 +1481,46 @@
total_len = 100;
ret = gup_burn_dsp_isp(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]burn dsp isp fail.");
+ pr_err("burn dsp isp fail.");
continue;
}
show_len += 10;
ret = gup_burn_fw_ss51(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]burn ss51 firmware fail.");
+ pr_err("burn ss51 firmware fail.");
continue;
}
show_len += 40;
ret = gup_burn_fw_dsp(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]burn dsp firmware fail.");
+ pr_err("burn dsp firmware fail.");
continue;
}
show_len += 20;
ret = gup_burn_fw_boot(i2c_connect_client);
if (ret == FAIL) {
- GTP_ERROR("[update_proc]burn bootloader fw fail.");
+ pr_err("burn bootloader fw fail.");
continue;
}
show_len += 10;
- GTP_INFO("[update_proc]UPDATE SUCCESS.");
+ pr_info("UPDATE SUCCESS.");
break;
}
if (retry >= 5) {
- GTP_ERROR("[update_proc]retry timeout,UPDATE FAIL.");
+ pr_err("retry timeout,UPDATE FAIL.");
goto update_fail;
}
- GTP_DEBUG("[update_proc]leave update mode.");
- gup_leave_update_mode();
+ pr_debug("leave update mode.");
+ gup_leave_update_mode(i2c_connect_client);
msleep(100);
- /* GTP_DEBUG("[update_proc]send config.");
- ret = gtp_send_cfg(i2c_connect_client);
- if(ret < 0) {
- GTP_ERROR("[update_proc]send config fail.");
- } */
-
if (ts->fw_error) {
- GTP_INFO("firmware error auto update, resent config!");
+ pr_info("firmware error auto update, resent config!");
gup_init_panel(ts);
}
show_len = 100;
@@ -1740,7 +1531,11 @@
#if GTP_ESD_PROTECT
gtp_esd_switch(ts->client, SWITCH_ON);
#endif
- filp_close(update_msg.file, NULL);
+ if (update_msg.need_free) {
+ devm_kfree(&ts->client->dev, update_msg.fw_data);
+ update_msg.need_free = false;
+ }
+
return SUCCESS;
update_fail:
@@ -1752,26 +1547,28 @@
#endif
file_fail:
- if (update_msg.file && !IS_ERR(update_msg.file))
- filp_close(update_msg.file, NULL);
-
show_len = 200;
total_len = 100;
+ if (update_msg.need_free) {
+ devm_kfree(&ts->client->dev, update_msg.fw_data);
+ update_msg.need_free = false;
+ }
return FAIL;
}
-#if GTP_AUTO_UPDATE
+static void gup_update_work(struct work_struct *work)
+{
+ if (gup_update_proc(NULL) == FAIL)
+ pr_err("Goodix update work fail!\n");
+}
+
u8 gup_init_update_proc(struct goodix_ts_data *ts)
{
- struct task_struct *thread = NULL;
+ dev_dbg(&ts->client->dev, "Ready to run update work.");
- GTP_INFO("Ready to run update thread.");
- thread = kthread_run(gup_update_proc, (void *)NULL, "guitar_update");
- if (IS_ERR(thread)) {
- GTP_ERROR("Failed to create update thread.\n");
- return -EINVAL;
- }
+ INIT_DELAYED_WORK(&ts->goodix_update_work, gup_update_work);
+ schedule_delayed_work(&ts->goodix_update_work,
+ msecs_to_jiffies(3000));
return 0;
}
-#endif
diff --git a/drivers/input/touchscreen/synaptics_i2c_rmi4.c b/drivers/input/touchscreen/synaptics_i2c_rmi4.c
index 755084c..7152ec8 100644
--- a/drivers/input/touchscreen/synaptics_i2c_rmi4.c
+++ b/drivers/input/touchscreen/synaptics_i2c_rmi4.c
@@ -2424,6 +2424,8 @@
}
}
+ INIT_LIST_HEAD(&rmi->support_fn_list);
+
retval = synaptics_rmi4_query_device(rmi4_data);
if (retval < 0) {
dev_err(&rmi4_data->i2c_client->dev,
diff --git a/drivers/leds/leds-qpnp.c b/drivers/leds/leds-qpnp.c
index e776dbb..da90440 100644
--- a/drivers/leds/leds-qpnp.c
+++ b/drivers/leds/leds-qpnp.c
@@ -255,7 +255,7 @@
WLED_OVP_35V,
WLED_OVP_32V,
WLED_OVP_29V,
- WLED_OVP_37V,
+ WLED_OVP_27V,
};
enum flash_headroom {
@@ -1496,7 +1496,7 @@
num_wled_strings = led->wled_cfg->num_strings;
/* verify ranges */
- if (led->wled_cfg->ovp_val > WLED_OVP_37V) {
+ if (led->wled_cfg->ovp_val > WLED_OVP_27V) {
dev_err(&led->spmi_dev->dev, "Invalid ovp value\n");
return -EINVAL;
}
@@ -3440,10 +3440,15 @@
return 0;
}
+
+#ifdef CONFIG_OF
static struct of_device_id spmi_match_table[] = {
- { .compatible = "qcom,leds-qpnp",
- }
+ { .compatible = "qcom,leds-qpnp",},
+ { },
};
+#else
+#define spmi_match_table NULL
+#endif
static struct spmi_driver qpnp_leds_driver = {
.driver = {
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
index 59b648d..a85f853 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_buf_mgr.c
@@ -374,11 +374,14 @@
if (bufq->buf_type == ISP_SHARE_BUF) {
temp_buf_info = kzalloc(
sizeof(struct msm_isp_buffer), GFP_ATOMIC);
- temp_buf_info->buf_reuse_flag = 1;
- temp_buf_info->buf_used[id] = 1;
- temp_buf_info->buf_get_count = 1;
- list_add_tail(&temp_buf_info->share_list,
- &bufq->share_head);
+ if (temp_buf_info) {
+ temp_buf_info->buf_reuse_flag = 1;
+ temp_buf_info->buf_used[id] = 1;
+ temp_buf_info->buf_get_count = 1;
+ list_add_tail(&temp_buf_info->share_list,
+ &bufq->share_head);
+ } else
+ rc = -ENOMEM;
}
} else {
(*buf_info)->state = MSM_ISP_BUFFER_STATE_DEQUEUED;
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
index ad4b75f..8c7890d 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
@@ -461,54 +461,62 @@
{
uint32_t error_status1 = vfe_dev->error_info.error_mask1;
if (error_status1 & (1 << 0))
- pr_err("%s: camif error status: 0x%x\n",
+ pr_err_ratelimited("%s: camif error status: 0x%x\n",
__func__, vfe_dev->error_info.camif_status);
if (error_status1 & (1 << 1))
- pr_err("%s: stats bhist overwrite\n", __func__);
+ pr_err_ratelimited("%s: stats bhist overwrite\n", __func__);
if (error_status1 & (1 << 2))
- pr_err("%s: stats cs overwrite\n", __func__);
+ pr_err_ratelimited("%s: stats cs overwrite\n", __func__);
if (error_status1 & (1 << 3))
- pr_err("%s: stats ihist overwrite\n", __func__);
+ pr_err_ratelimited("%s: stats ihist overwrite\n", __func__);
if (error_status1 & (1 << 4))
- pr_err("%s: realign buf y overflow\n", __func__);
+ pr_err_ratelimited("%s: realign buf y overflow\n", __func__);
if (error_status1 & (1 << 5))
- pr_err("%s: realign buf cb overflow\n", __func__);
+ pr_err_ratelimited("%s: realign buf cb overflow\n", __func__);
if (error_status1 & (1 << 6))
- pr_err("%s: realign buf cr overflow\n", __func__);
+ pr_err_ratelimited("%s: realign buf cr overflow\n", __func__);
if (error_status1 & (1 << 7)) {
- pr_err("%s: violation\n", __func__);
+ pr_err_ratelimited("%s: violation\n", __func__);
msm_vfe40_process_violation_status(vfe_dev);
}
if (error_status1 & (1 << 9))
- pr_err("%s: image master 0 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 0 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 10))
- pr_err("%s: image master 1 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 1 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 11))
- pr_err("%s: image master 2 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 2 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 12))
- pr_err("%s: image master 3 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 3 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 13))
- pr_err("%s: image master 4 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 4 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 14))
- pr_err("%s: image master 5 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 5 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 15))
- pr_err("%s: image master 6 bus overflow\n", __func__);
+ pr_err_ratelimited("%s: image master 6 bus overflow\n",
+ __func__);
if (error_status1 & (1 << 16))
- pr_err("%s: status be bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status be bus overflow\n", __func__);
if (error_status1 & (1 << 17))
- pr_err("%s: status bg bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status bg bus overflow\n", __func__);
if (error_status1 & (1 << 18))
- pr_err("%s: status bf bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status bf bus overflow\n", __func__);
if (error_status1 & (1 << 19))
- pr_err("%s: status awb bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status awb bus overflow\n", __func__);
if (error_status1 & (1 << 20))
- pr_err("%s: status rs bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status rs bus overflow\n", __func__);
if (error_status1 & (1 << 21))
- pr_err("%s: status cs bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status cs bus overflow\n", __func__);
if (error_status1 & (1 << 22))
- pr_err("%s: status ihist bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status ihist bus overflow\n", __func__);
if (error_status1 & (1 << 23))
- pr_err("%s: status skin bhist bus overflow\n", __func__);
+ pr_err_ratelimited("%s: status skin bhist bus overflow\n",
+ __func__);
}
static void msm_vfe40_read_irq_status(struct vfe_device *vfe_dev,
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index 3cb48d1..a12c692 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -277,6 +277,43 @@
return rc;
}
+static int msm_isp_get_max_clk_rate(struct vfe_device *vfe_dev, long *rate)
+{
+ int clk_idx = 0;
+ unsigned long max_value = ~0;
+ long round_rate = 0;
+
+ if (!vfe_dev || !rate) {
+ pr_err("%s:%d failed: vfe_dev %p rate %p\n", __func__, __LINE__,
+ vfe_dev, rate);
+ return -EINVAL;
+ }
+
+ *rate = 0;
+ if (!vfe_dev->hw_info) {
+ pr_err("%s:%d failed: vfe_dev->hw_info %p\n", __func__,
+ __LINE__, vfe_dev->hw_info);
+ return -EINVAL;
+ }
+
+ clk_idx = vfe_dev->hw_info->vfe_clk_idx;
+ if (clk_idx >= ARRAY_SIZE(vfe_dev->vfe_clk)) {
+ pr_err("%s:%d failed: clk_idx %d max array size %d\n",
+ __func__, __LINE__, clk_idx,
+ ARRAY_SIZE(vfe_dev->vfe_clk));
+ return -EINVAL;
+ }
+
+ round_rate = clk_round_rate(vfe_dev->vfe_clk[clk_idx], max_value);
+ if (round_rate < 0) {
+ pr_err("%s: Invalid vfe clock rate\n", __func__);
+ return -EINVAL;
+ }
+
+ *rate = round_rate;
+ return 0;
+}
+
static int msm_isp_set_clk_rate(struct vfe_device *vfe_dev, long *rate)
{
int rc = 0;
@@ -618,6 +655,23 @@
case GET_SOC_HW_VER:
*cfg_data = vfe_dev->soc_hw_version;
break;
+ case GET_MAX_CLK_RATE: {
+ int rc = 0;
+
+ if (cmd_len < sizeof(unsigned long)) {
+ pr_err("%s:%d failed: invalid cmd len %d exp %d\n",
+ __func__, __LINE__, cmd_len,
+ sizeof(unsigned long));
+ return -EINVAL;
+ }
+ rc = msm_isp_get_max_clk_rate(vfe_dev,
+ (unsigned long *)cfg_data);
+ if (rc < 0) {
+ pr_err("%s:%d failed: rc %d\n", __func__, __LINE__, rc);
+ return -EINVAL;
+ }
+ break;
+ }
}
return 0;
}
diff --git a/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c b/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
index de098c9..c4a23ca 100755
--- a/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
+++ b/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
@@ -200,7 +200,7 @@
ispif->base + ISPIF_VFE_m_INTF_CMD_0(i));
msm_camera_io_w(ISPIF_STOP_INTF_IMMEDIATELY,
ispif->base + ISPIF_VFE_m_INTF_CMD_1(i));
- pr_debug("%s: base %x", __func__, (unsigned int)ispif->base);
+ pr_debug("%s: base %lx", __func__, (unsigned long)ispif->base);
msm_camera_io_w(0, ispif->base +
ISPIF_VFE_m_PIX_INTF_n_CID_MASK(i, 0));
msm_camera_io_w(0, ispif->base +
diff --git a/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.c b/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.c
index 7520ce5..cb8fcdd 100644
--- a/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.c
+++ b/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.c
@@ -109,8 +109,9 @@
if (!list_empty(&buf_mngr_dev->buf_qhead)) {
list_for_each_entry_safe(bufs,
save, &buf_mngr_dev->buf_qhead, entry) {
- pr_err("%s: Delete invalid bufs =%x\n", __func__,
- (unsigned int)bufs);
+ pr_err("%s: Error delete invalid bufs =%x, ses_id=%d, str_id=%d, idx=%d\n",
+ __func__, (unsigned int)bufs, bufs->session_id,
+ bufs->stream_id, bufs->vb2_buf->v4l2_buf.index);
list_del_init(&bufs->entry);
kfree(bufs);
}
@@ -118,6 +119,36 @@
spin_unlock_irqrestore(&buf_mngr_dev->buf_q_spinlock, flags);
}
+static int msm_generic_buf_mngr_open(struct v4l2_subdev *sd,
+ struct v4l2_subdev_fh *fh)
+{
+ int rc = 0;
+ struct msm_buf_mngr_device *buf_mngr_dev = v4l2_get_subdevdata(sd);
+ if (!buf_mngr_dev) {
+ pr_err("%s buf manager device NULL\n", __func__);
+ rc = -ENODEV;
+ return rc;
+ }
+ buf_mngr_dev->msm_buf_mngr_open_cnt++;
+ return rc;
+}
+
+static int msm_generic_buf_mngr_close(struct v4l2_subdev *sd,
+ struct v4l2_subdev_fh *fh)
+{
+ int rc = 0;
+ struct msm_buf_mngr_device *buf_mngr_dev = v4l2_get_subdevdata(sd);
+ if (!buf_mngr_dev) {
+ pr_err("%s buf manager device NULL\n", __func__);
+ rc = -ENODEV;
+ return rc;
+ }
+ buf_mngr_dev->msm_buf_mngr_open_cnt--;
+ if (buf_mngr_dev->msm_buf_mngr_open_cnt == 0)
+ msm_buf_mngr_sd_shutdown(buf_mngr_dev);
+ return rc;
+}
+
static long msm_buf_mngr_subdev_ioctl(struct v4l2_subdev *sd,
unsigned int cmd, void *arg)
{
@@ -141,6 +172,12 @@
case VIDIOC_MSM_BUF_MNGR_PUT_BUF:
rc = msm_buf_mngr_put_buf(buf_mngr_dev, argp);
break;
+ case VIDIOC_MSM_BUF_MNGR_INIT:
+ rc = msm_generic_buf_mngr_open(sd, NULL);
+ break;
+ case VIDIOC_MSM_BUF_MNGR_DEINIT:
+ rc = msm_generic_buf_mngr_close(sd, NULL);
+ break;
case MSM_SD_SHUTDOWN:
msm_buf_mngr_sd_shutdown(buf_mngr_dev);
break;
@@ -154,6 +191,12 @@
.ioctl = msm_buf_mngr_subdev_ioctl,
};
+static const struct v4l2_subdev_internal_ops
+ msm_generic_buf_mngr_subdev_internal_ops = {
+ .open = msm_generic_buf_mngr_open,
+ .close = msm_generic_buf_mngr_close,
+};
+
static const struct v4l2_subdev_ops msm_buf_mngr_subdev_ops = {
.core = &msm_buf_mngr_subdev_core_ops,
};
@@ -183,6 +226,8 @@
msm_buf_mngr_dev->subdev.sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
msm_buf_mngr_dev->subdev.sd.entity.group_id =
MSM_CAMERA_SUBDEV_BUF_MNGR;
+ msm_buf_mngr_dev->subdev.sd.internal_ops =
+ &msm_generic_buf_mngr_subdev_internal_ops;
msm_buf_mngr_dev->subdev.close_seq = MSM_SD_CLOSE_4TH_CATEGORY;
rc = msm_sd_register(&msm_buf_mngr_dev->subdev);
if (rc != 0) {
diff --git a/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.h b/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.h
index 56886cd..49fad22 100644
--- a/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.h
+++ b/drivers/media/platform/msm/camera_v2/msm_buf_mgr/msm_generic_buf_mgr.h
@@ -36,5 +36,6 @@
spinlock_t buf_q_spinlock;
struct msm_sd_subdev subdev;
struct msm_sd_req_vb2_q vb2_ops;
+ uint32_t msm_buf_mngr_open_cnt;
};
#endif
diff --git a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
index 532bebc..10a0085 100644
--- a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
+++ b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
@@ -67,6 +67,9 @@
/* dump the frame command before writing to the hardware */
#define MSM_CPP_DUMP_FRM_CMD 0
+static int msm_cpp_buffer_ops(struct cpp_device *cpp_dev,
+ uint32_t buff_mgr_ops, struct msm_buf_mngr_info *buff_mgr_info);
+
#if CONFIG_MSM_CPP_DBG
#define CPP_DBG(fmt, args...) pr_err(fmt, ##args)
#else
@@ -714,6 +717,14 @@
goto req_irq_fail;
}
cpp_dev->buf_mgr_subdev = msm_buf_mngr_get_subdev();
+
+ rc = msm_cpp_buffer_ops(cpp_dev,
+ VIDIOC_MSM_BUF_MNGR_INIT, NULL);
+ if (rc < 0) {
+ pr_err("buf mngr init failed\n");
+ free_irq(cpp_dev->irq->start, cpp_dev);
+ goto req_irq_fail;
+ }
}
cpp_dev->hw_info.cpp_hw_version =
@@ -757,7 +768,12 @@
static void cpp_release_hardware(struct cpp_device *cpp_dev)
{
+ int32_t rc;
if (cpp_dev->state != CPP_STATE_BOOT) {
+ rc = msm_cpp_buffer_ops(cpp_dev,
+ VIDIOC_MSM_BUF_MNGR_DEINIT, NULL);
+ if (rc < 0)
+ pr_err("error in buf mngr deinit rc=%d\n", rc);
free_irq(cpp_dev->irq->start, cpp_dev);
tasklet_kill(&cpp_dev->cpp_tasklet);
atomic_set(&cpp_dev->irq_cnt, 0);
@@ -807,7 +823,7 @@
/*Start firmware loading*/
msm_cpp_write(MSM_CPP_CMD_FW_LOAD, cpp_dev->base);
- msm_cpp_write(MSM_CPP_END_ADDRESS, cpp_dev->base);
+ msm_cpp_write(fw->size, cpp_dev->base);
msm_cpp_write(MSM_CPP_START_ADDRESS, cpp_dev->base);
if (ptr_bin) {
@@ -1192,7 +1208,7 @@
uint32_t *cpp_frame_msg;
unsigned long in_phyaddr, out_phyaddr0, out_phyaddr1;
uint16_t num_stripes = 0;
- struct msm_buf_mngr_info buff_mgr_info;
+ struct msm_buf_mngr_info buff_mgr_info, dup_buff_mgr_info;
struct msm_cpp_frame_info_t *u_frame_info =
(struct msm_cpp_frame_info_t *)ioctl_ptr->ioctl_ptr;
int32_t status = 0;
@@ -1279,19 +1295,20 @@
new_frame->duplicate_identity);
memset(&new_frame->output_buffer_info[1], 0,
sizeof(struct msm_cpp_buffer_info_t));
- memset(&buff_mgr_info, 0, sizeof(struct msm_buf_mngr_info));
- buff_mgr_info.session_id =
+ memset(&dup_buff_mgr_info, 0, sizeof(struct msm_buf_mngr_info));
+ dup_buff_mgr_info.session_id =
((new_frame->duplicate_identity >> 16) & 0xFFFF);
- buff_mgr_info.stream_id =
+ dup_buff_mgr_info.stream_id =
(new_frame->duplicate_identity & 0xFFFF);
rc = msm_cpp_buffer_ops(cpp_dev, VIDIOC_MSM_BUF_MNGR_GET_BUF,
- &buff_mgr_info);
+ &dup_buff_mgr_info);
if (rc < 0) {
rc = -EAGAIN;
pr_debug("error getting buffer rc:%d\n", rc);
- goto ERROR2;
+ goto ERROR3;
}
- new_frame->output_buffer_info[1].index = buff_mgr_info.index;
+ new_frame->output_buffer_info[1].index =
+ dup_buff_mgr_info.index;
out_phyaddr1 = msm_cpp_fetch_buffer_info(cpp_dev,
&new_frame->output_buffer_info[1],
((new_frame->duplicate_identity >> 16) & 0xFFFF),
@@ -1300,6 +1317,8 @@
if (!out_phyaddr1) {
pr_err("error gettting output physical address\n");
rc = -EINVAL;
+ msm_cpp_buffer_ops(cpp_dev, VIDIOC_MSM_BUF_MNGR_PUT_BUF,
+ &dup_buff_mgr_info);
goto ERROR3;
}
/* set duplicate enable bit */
diff --git a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
index bb2b074..ea16ebd 100644
--- a/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
+++ b/drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
@@ -254,6 +254,9 @@
int32_t num_steps = move_params->num_steps;
struct msm_camera_i2c_reg_setting reg_setting;
+ curr_lens_pos = a_ctrl->step_position_table[a_ctrl->curr_step_pos];
+ move_params->curr_lens_pos = curr_lens_pos;
+
if (copy_from_user(&ringing_params_kernel,
&(move_params->ringing_params[a_ctrl->curr_region_index]),
sizeof(struct damping_params_t))) {
@@ -267,7 +270,6 @@
if (dest_step_pos == a_ctrl->curr_step_pos)
return rc;
- curr_lens_pos = a_ctrl->step_position_table[a_ctrl->curr_step_pos];
a_ctrl->i2c_tbl_index = 0;
CDBG("curr_step_pos =%d dest_step_pos =%d curr_lens_pos=%d\n",
a_ctrl->curr_step_pos, dest_step_pos, curr_lens_pos);
@@ -305,6 +307,7 @@
a_ctrl->curr_step_pos = target_step_pos;
}
+ move_params->curr_lens_pos = curr_lens_pos;
reg_setting.reg_setting = a_ctrl->i2c_reg_tbl;
reg_setting.data_type = a_ctrl->i2c_data_type;
reg_setting.size = a_ctrl->i2c_tbl_index;
diff --git a/drivers/media/platform/msm/vidc/hfi_response_handler.c b/drivers/media/platform/msm/vidc/hfi_response_handler.c
index 3fd5d3a..189fca0 100644
--- a/drivers/media/platform/msm/vidc/hfi_response_handler.c
+++ b/drivers/media/platform/msm/vidc/hfi_response_handler.c
@@ -263,7 +263,9 @@
break;
case HFI_EVENT_RELEASE_BUFFER_REFERENCE:
dprintk(VIDC_INFO, "HFI_EVENT_RELEASE_BUFFER_REFERENCE\n");
- hfi_process_evt_release_buffer_ref(callback, device_id, pkt);
+ if (!validate_session_pkt(sessions, sess, session_lock))
+ hfi_process_evt_release_buffer_ref(callback,
+ device_id, pkt);
break;
default:
dprintk(VIDC_WARN, "hal_process_event_notify:unkown_event_id");
diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c
index 9dd4e93..7e24510 100644
--- a/drivers/media/platform/msm/vidc/msm_vdec.c
+++ b/drivers/media/platform/msm/vidc/msm_vdec.c
@@ -22,7 +22,7 @@
#define MSM_VDEC_DVC_NAME "msm_vdec_8974"
#define MIN_NUM_OUTPUT_BUFFERS 4
#define MAX_NUM_OUTPUT_BUFFERS 6
-#define DEFAULT_CONCEAL_COLOR 0x0
+#define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8080
#define TZ_INFO_GET_FEATURE_VERSION_ID 0x3
#define TZ_DYNAMIC_BUFFER_FEATURE_ID 12
@@ -323,6 +323,16 @@
.qmenu = NULL,
.cluster = 0,
},
+ {
+ .id = V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR,
+ .name = "Picture concealed color",
+ .type = V4L2_CTRL_TYPE_INTEGER,
+ .minimum = 0x0,
+ .maximum = 0xffffff,
+ .default_value = DEFAULT_VIDEO_CONCEAL_COLOR_BLACK,
+ .step = 1,
+ .cluster = 0,
+ },
};
#define NUM_CTRLS ARRAY_SIZE(msm_vdec_ctrls)
@@ -971,11 +981,17 @@
rc = -EINVAL;
goto err_invalid_fmt;
}
+ rc = msm_comm_try_state(inst, MSM_VIDC_CORE_INIT_DONE);
+ if (rc) {
+ dprintk(VIDC_ERR, "Failed to initialize instance\n");
+ goto err_invalid_fmt;
+ }
if (!(get_hal_codec_type(fmt->fourcc) &
inst->core->dec_codec_supported)) {
dprintk(VIDC_ERR,
- "Codec(0x%x) not supported\n",
- get_hal_codec_type(fmt->fourcc));
+ "Codec(0x%x) is not present in the supported codecs list(0x%x)\n",
+ get_hal_codec_type(fmt->fourcc),
+ inst->core->dec_codec_supported);
rc = -EINVAL;
goto err_invalid_fmt;
}
@@ -1319,7 +1335,6 @@
{
struct msm_vidc_inst *inst;
int rc = 0;
- int pdata = DEFAULT_CONCEAL_COLOR;
struct hfi_device *hdev;
if (!q || !q->drv_priv) {
dprintk(VIDC_ERR, "Invalid input, q = %p\n", q);
@@ -1337,10 +1352,6 @@
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
if (inst->bufq[CAPTURE_PORT].vb2_bufq.streaming)
rc = start_streaming(inst);
- rc = call_hfi_op(hdev, session_set_property,
- (void *) inst->session,
- HAL_PARAM_VDEC_CONCEAL_COLOR,
- (void *) &pdata);
break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (inst->bufq[OUTPUT_PORT].vb2_bufq.streaming)
@@ -1410,7 +1421,19 @@
}
switch (dec->cmd) {
case V4L2_DEC_QCOM_CMD_FLUSH:
+ if (core->state != VIDC_CORE_INVALID &&
+ inst->state == MSM_VIDC_CORE_INVALID) {
+ rc = msm_comm_recover_from_session_error(inst);
+ if (rc)
+ dprintk(VIDC_ERR,
+ "Failed to recover from session_error: %d\n",
+ rc);
+ }
rc = msm_comm_flush(inst, dec->flags);
+ if (rc) {
+ dprintk(VIDC_ERR,
+ "Failed to flush buffers: %d\n", rc);
+ }
break;
case V4L2_DEC_CMD_STOP:
if (core->state != VIDC_CORE_INVALID &&
@@ -1732,6 +1755,11 @@
break;
}
break;
+ case V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR:
+ property_id = HAL_PARAM_VDEC_CONCEAL_COLOR;
+ property_val = ctrl->val;
+ pdata = &property_val;
+ break;
default:
break;
}
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index 9da1220..a9521a1 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -717,6 +717,8 @@
return -EINVAL;
list_for_each_safe(ptr, next, &inst->registered_bufs) {
+ bool release_buf = false;
+ mutex_lock(&inst->lock);
bi = list_entry(ptr, struct buffer_info, list);
if (bi->type == buffer_type) {
buffer_info.type = bi->type;
@@ -734,19 +736,28 @@
buffer_info.m.planes[i].length);
}
buffer_info.length = bi->num_planes;
- if (inst->session_type == MSM_VIDC_DECODER)
- rc = msm_vdec_release_buf(instance,
- &buffer_info);
- if (inst->session_type == MSM_VIDC_ENCODER)
- rc = msm_venc_release_buf(instance,
- &buffer_info);
- if (rc)
- dprintk(VIDC_ERR,
- "Failed Release buffer: %d, %d, %d\n",
- buffer_info.m.planes[0].reserved[0],
- buffer_info.m.planes[0].reserved[1],
- buffer_info.m.planes[0].length);
-
+ release_buf = true;
+ }
+ mutex_unlock(&inst->lock);
+ if (!release_buf)
+ continue;
+ if (inst->session_type == MSM_VIDC_DECODER)
+ rc = msm_vdec_release_buf(instance,
+ &buffer_info);
+ if (inst->session_type == MSM_VIDC_ENCODER)
+ rc = msm_venc_release_buf(instance,
+ &buffer_info);
+ if (rc)
+ dprintk(VIDC_ERR,
+ "Failed Release buffer: %d, %d, %d\n",
+ buffer_info.m.planes[0].reserved[0],
+ buffer_info.m.planes[0].reserved[1],
+ buffer_info.m.planes[0].length);
+ }
+ mutex_lock(&inst->lock);
+ list_for_each_safe(ptr, next, &inst->registered_bufs) {
+ bi = list_entry(ptr, struct buffer_info, list);
+ if (bi->type == buffer_type) {
list_del(&bi->list);
for (i = 0; i < bi->num_planes; i++) {
if (bi->handle[i] && bi->mapped[i]) {
@@ -762,6 +773,7 @@
kfree(bi);
}
}
+ mutex_unlock(&inst->lock);
return rc;
}
@@ -1076,8 +1088,6 @@
{
int rc = 0;
struct msm_vidc_inst *vidc_inst = (struct msm_vidc_inst *)inst;
- spin_lock_init(&pvdev->fh_lock);
- INIT_LIST_HEAD(&pvdev->fh_list);
v4l2_fh_init(&vidc_inst->event_handler, pvdev);
v4l2_fh_add(&vidc_inst->event_handler);
@@ -1302,6 +1312,7 @@
if (!inst)
return -EINVAL;
+ v4l2_fh_del(&inst->event_handler);
list_for_each_safe(ptr, next, &inst->registered_bufs) {
bi = list_entry(ptr, struct buffer_info, list);
if (bi->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index 7588994..8921b13 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -519,6 +519,14 @@
event_notify->packet_buffer,
event_notify->exra_data_buffer);
+ if (inst->state == MSM_VIDC_CORE_INVALID ||
+ inst->core->state ==
+ VIDC_CORE_INVALID) {
+ dprintk(VIDC_DBG,
+ "Event release buf ref received in invalid state - discard\n");
+ return;
+ }
+
/*
* Get the buffer_info entry for the
* device address.
@@ -2999,6 +3007,9 @@
dprintk(VIDC_INFO, "Input only flush not supported\n");
return 0;
}
+ mutex_lock(&inst->sync_lock);
+ msm_comm_flush_dynamic_buffers(inst);
+ mutex_unlock(&inst->sync_lock);
if (inst->state == MSM_VIDC_CORE_INVALID ||
core->state == VIDC_CORE_INVALID) {
dprintk(VIDC_ERR,
@@ -3009,7 +3020,6 @@
}
mutex_lock(&inst->sync_lock);
- msm_comm_flush_dynamic_buffers(inst);
if (inst->in_reconfig && !ip_flush && op_flush) {
if (!list_empty(&inst->pendingq)) {
/*Execution can never reach here since port reconfig
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index 2596a30..7f09b24 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1635,15 +1635,23 @@
return 0;
}
-static int venus_hfi_is_cmd_pending(struct venus_hfi_device *dev)
+static int venus_hfi_get_q_size(struct venus_hfi_device *dev,
+ unsigned int q_index)
{
struct hfi_queue_header *queue;
struct vidc_iface_q_info *q_info;
u32 write_ptr, read_ptr;
u32 rc = 0;
- q_info = &dev->iface_queues[VIDC_IFACEQ_CMDQ_IDX];
- if (!q_info)
+ if (q_index >= VIDC_IFACEQ_NUMQ) {
+ dprintk(VIDC_ERR, "Invalid q index: %d\n", q_index);
+ return -ENOENT;
+ }
+
+ q_info = &dev->iface_queues[q_index];
+ if (!q_info) {
dprintk(VIDC_ERR, "cannot read shared Q's");
+ return -ENOENT;
+ }
queue = (struct hfi_queue_header *) q_info->q_hdr;
if (!queue) {
dprintk(VIDC_ERR, "queue not present");
@@ -1667,9 +1675,12 @@
}
/*SYS Idle should be last message so mask any further interrupts
* until clocks are enabled again.*/
- venus_hfi_write_register(device,
- VIDC_WRAPPER_INTR_MASK,
- VIDC_WRAPPER_INTR_MASK_A2HVCODEC_BMSK | VIDC_WRAPPER_INTR_MASK_A2HCPU_BMSK, 0);
+ if (!venus_hfi_get_q_size(device, VIDC_IFACEQ_MSGQ_IDX)) {
+ venus_hfi_write_register(device,
+ VIDC_WRAPPER_INTR_MASK,
+ VIDC_WRAPPER_INTR_MASK_A2HVCODEC_BMSK |
+ VIDC_WRAPPER_INTR_MASK_A2HCPU_BMSK, 0);
+ }
venus_hfi_clk_disable(device);
if (!queue_delayed_work(device->venus_pm_workq, &venus_hfi_pm_work,
msecs_to_jiffies(msm_vidc_pwr_collapse_delay)))
@@ -2512,7 +2523,7 @@
}
mutex_lock(&device->write_lock);
mutex_lock(&device->clk_pwr_lock);
- rc = venus_hfi_is_cmd_pending(device);
+ rc = venus_hfi_get_q_size(device, VIDC_IFACEQ_CMDQ_IDX);
ctrl_status = venus_hfi_read_register(
device,
VIDC_CPU_CS_SCIACMDARG0);
diff --git a/drivers/media/platform/msm/wfd/vsg-subdev.c b/drivers/media/platform/msm/wfd/vsg-subdev.c
index c20250e..1f827bb 100644
--- a/drivers/media/platform/msm/wfd/vsg-subdev.c
+++ b/drivers/media/platform/msm/wfd/vsg-subdev.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -23,6 +23,8 @@
#define DEFAULT_MAX_FRAME_INTERVAL (1*NSEC_PER_SEC)
#define DEFAULT_MODE ((enum vsg_modes)VSG_MODE_CFR)
#define MAX_BUFS_BUSY_WITH_ENC 5
+#define TICKS_PER_TIMEOUT 2
+
static void vsg_reset_timer(struct hrtimer *timer, ktime_t time)
{
@@ -120,9 +122,10 @@
INIT_LIST_HEAD(&buf_info->node);
ktime_get_ts(&buf_info->time);
- vsg_reset_timer(&context->threshold_timer, ns_to_ktime(
- context->max_frame_interval));
-
+ if (work->work_delayed) {
+ buf_info->time = timespec_sub(buf_info->time,
+ context->delayed_frame_interval);
+ }
temp = NULL;
list_for_each_entry(temp, &context->busy_queue.node, node) {
if (mdp_buf_info_equals(&temp->mdp_buf_info,
@@ -233,6 +236,7 @@
INIT_WORK(&new_work->work, vsg_work_func);
new_work->context = context;
+ new_work->work_delayed = work->work_delayed;
queue_work(context->work_queue, &new_work->work);
}
@@ -245,25 +249,43 @@
{
struct vsg_context *context = NULL;
struct vsg_work *task = NULL;
-
- task = kzalloc(sizeof(*task), GFP_ATOMIC);
+ int64_t max_frame_interval = 0;
context = container_of(timer, struct vsg_context,
threshold_timer);
+
+ if (!context) {
+ WFD_MSG_ERR("Context not proper in %s", __func__);
+ goto threshold_err_no_context;
+ }
+ max_frame_interval = context->max_frame_interval;
+ if (list_empty(&context->free_queue.node) && !context->vsync_wait) {
+ context->vsync_wait = true;
+ max_frame_interval = context->max_frame_interval /
+ TICKS_PER_TIMEOUT;
+ goto restart_timer;
+ } else if (context->vsync_wait) {
+ max_frame_interval = context->max_frame_interval /
+ TICKS_PER_TIMEOUT;
+ context->vsync_wait = false;
+ }
+
+ task = kzalloc(sizeof(*task), GFP_ATOMIC);
if (!task) {
WFD_MSG_ERR("Out of memory in %s", __func__);
goto threshold_err_bad_param;
- } else if (!context) {
- WFD_MSG_ERR("Context not proper in %s", __func__);
- goto threshold_err_no_context;
}
INIT_WORK(&task->work, vsg_timer_helper_func);
task->context = context;
+ task->work_delayed = false;
+ if (max_frame_interval < context->max_frame_interval)
+ task->work_delayed = true;
queue_work(context->work_queue, &task->work);
+restart_timer:
threshold_err_bad_param:
hrtimer_forward_now(&context->threshold_timer, ns_to_ktime(
- context->max_frame_interval));
+ max_frame_interval));
return HRTIMER_RESTART;
threshold_err_no_context:
return HRTIMER_NORESTART;
@@ -298,6 +320,7 @@
context->last_buffer = NULL;
context->mode = DEFAULT_MODE;
context->state = VSG_STATE_NONE;
+ context->vsync_wait = false;
mutex_init(&context->mutex);
sd->dev_priv = context;
@@ -568,7 +591,8 @@
context->max_frame_interval, interval);
context->max_frame_interval = interval;
}
-
+ context->delayed_frame_interval =
+ ns_to_timespec(context->frame_interval / TICKS_PER_TIMEOUT);
mutex_unlock(&context->mutex);
return 0;
}
diff --git a/drivers/media/platform/msm/wfd/vsg-subdev.h b/drivers/media/platform/msm/wfd/vsg-subdev.h
index 3347e5b..bbaced1 100644
--- a/drivers/media/platform/msm/wfd/vsg-subdev.h
+++ b/drivers/media/platform/msm/wfd/vsg-subdev.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -56,7 +56,7 @@
};
struct vsg_context {
- struct vsg_buf_info free_queue, busy_queue;
+ struct vsg_buf_info free_queue, busy_queue;
struct vsg_msg_ops vmops;
/* All time related values below in nanosecs */
int64_t frame_interval, max_frame_interval, frame_interval_variance;
@@ -66,11 +66,14 @@
struct vsg_buf_info *last_buffer;
int mode;
int state;
+ bool vsync_wait;
+ struct timespec delayed_frame_interval;
};
struct vsg_work {
struct vsg_context *context;
struct work_struct work;
+ bool work_delayed;
};
struct vsg_encode_work {
diff --git a/drivers/media/radio/radio-iris.c b/drivers/media/radio/radio-iris.c
index 5dde469..9f18508 100644
--- a/drivers/media/radio/radio-iris.c
+++ b/drivers/media/radio/radio-iris.c
@@ -499,7 +499,7 @@
struct kfifo *data_b;
unsigned char evt = event;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
@@ -511,9 +511,14 @@
static int hci_send_frame(struct sk_buff *skb)
{
- struct radio_hci_dev *hdev = (struct radio_hci_dev *) skb->dev;
+ struct radio_hci_dev *hdev;
- if (!hdev) {
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return -EINVAL;
+ }
+ hdev = (struct radio_hci_dev *) skb->dev;
+ if (unlikely(!hdev)) {
kfree_skb(skb);
return -ENODEV;
}
@@ -528,6 +533,11 @@
{
struct radio_hci_dev *hdev = (struct radio_hci_dev *) arg;
struct sk_buff *skb;
+
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, HCI Device is null\n", __func__);
+ return;
+ }
if (!(atomic_read(&hdev->cmd_cnt))
&& time_after(jiffies, hdev->cmd_last_tx + HZ)) {
FMDERR("%s command tx timeout", hdev->name);
@@ -555,6 +565,10 @@
struct radio_hci_dev *hdev = (struct radio_hci_dev *) arg;
struct sk_buff *skb;
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, HCI Device is null\n", __func__);
+ return;
+ }
read_lock(&hci_task_lock);
skb = skb_dequeue(&hdev->rx_q);
@@ -618,8 +632,14 @@
int radio_hci_recv_frame(struct sk_buff *skb)
{
- struct radio_hci_dev *hdev = (struct radio_hci_dev *) skb->dev;
- if (!hdev) {
+ struct radio_hci_dev *hdev;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return -EINVAL;
+ }
+ hdev = (struct radio_hci_dev *) skb->dev;
+ if (unlikely(!hdev)) {
FMDERR("%s hdev is null while receiving frame", hdev->name);
kfree_skb(skb);
return -ENXIO;
@@ -641,6 +661,10 @@
struct sk_buff *skb;
int ret = 0;
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, hci device is null\n", __func__);
+ return -EINVAL;
+ }
skb = alloc_skb(len, GFP_ATOMIC);
if (!skb) {
FMDERR("%s no memory for command", hdev->name);
@@ -679,7 +703,7 @@
struct iris_device *radio = video_get_drvdata(video_get_dev());
__u16 opcode = 0;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -746,6 +770,10 @@
struct hci_fm_recv_conf_req *recv_conf_req =
(struct hci_fm_recv_conf_req *) param;
+ if (recv_conf_req == NULL) {
+ FMDERR("%s, recv conf is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SET_RECV_CONF_REQ);
return radio_hci_send_cmd(hdev, opcode, sizeof((*recv_conf_req)),
@@ -760,6 +788,11 @@
struct hci_fm_trans_conf_req_struct *trans_conf_req =
(struct hci_fm_trans_conf_req_struct *) param;
+ if (trans_conf_req == NULL) {
+ FMDERR("%s, tx conf is null\n", __func__);
+ return -EINVAL;
+ }
+
opcode = hci_opcode_pack(HCI_OGF_FM_TRANS_CTRL_CMD_REQ,
HCI_OCF_FM_SET_TRANS_CONF_REQ);
return radio_hci_send_cmd(hdev, opcode, sizeof((*trans_conf_req)),
@@ -783,6 +816,10 @@
struct hci_fm_mute_mode_req *mute_mode_req =
(struct hci_fm_mute_mode_req *) param;
+ if (mute_mode_req == NULL) {
+ FMDERR("%s, mute mode is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SET_MUTE_MODE_REQ);
return radio_hci_send_cmd(hdev, opcode, sizeof((*mute_mode_req)),
@@ -797,6 +834,10 @@
struct hci_fm_tx_ps *tx_ps_req =
(struct hci_fm_tx_ps *) param;
+ if (tx_ps_req == NULL) {
+ FMDERR("%s, tx ps req is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_TRANS_CTRL_CMD_REQ,
HCI_OCF_FM_RDS_PS_REQ);
@@ -811,6 +852,10 @@
struct hci_fm_tx_rt *tx_rt_req =
(struct hci_fm_tx_rt *) param;
+ if (tx_rt_req == NULL) {
+ FMDERR("%s, tx rt req is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_TRANS_CTRL_CMD_REQ,
HCI_OCF_FM_RDS_RT_REQ);
@@ -824,6 +869,11 @@
__u16 opcode = 0;
struct hci_fm_stereo_mode_req *stereo_mode_req =
(struct hci_fm_stereo_mode_req *) param;
+
+ if (stereo_mode_req == NULL) {
+ FMDERR("%s, stere mode req is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SET_STEREO_MODE_REQ);
return radio_hci_send_cmd(hdev, opcode, sizeof((*stereo_mode_req)),
@@ -913,6 +963,10 @@
struct hci_fm_search_station_req *srch_stations =
(struct hci_fm_search_station_req *) param;
+ if (srch_stations == NULL) {
+ FMDERR("%s, search station param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SEARCH_STATIONS);
return radio_hci_send_cmd(hdev, opcode, sizeof((*srch_stations)),
@@ -926,6 +980,10 @@
struct hci_fm_search_rds_station_req *srch_stations =
(struct hci_fm_search_rds_station_req *) param;
+ if (srch_stations == NULL) {
+ FMDERR("%s, rds stations param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SEARCH_RDS_STATIONS);
return radio_hci_send_cmd(hdev, opcode, sizeof((*srch_stations)),
@@ -939,6 +997,10 @@
struct hci_fm_search_station_list_req *srch_list =
(struct hci_fm_search_station_list_req *) param;
+ if (srch_list == NULL) {
+ FMDERR("%s, search list param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SEARCH_STATIONS_LIST);
return radio_hci_send_cmd(hdev, opcode, sizeof((*srch_list)),
@@ -963,6 +1025,10 @@
struct hci_fm_rds_grp_req *fm_grp_mask =
(struct hci_fm_rds_grp_req *)param;
+ if (fm_grp_mask == NULL) {
+ FMDERR("%s, grp mask param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_RDS_GRP);
return radio_hci_send_cmd(hdev, opcode, sizeof(*fm_grp_mask),
@@ -1001,6 +1067,10 @@
struct hci_fm_def_data_rd_req *def_data_rd =
(struct hci_fm_def_data_rd_req *) param;
+ if (def_data_rd == NULL) {
+ FMDERR("%s, def data read param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_COMMON_CTRL_CMD_REQ,
HCI_OCF_FM_DEFAULT_DATA_READ);
return radio_hci_send_cmd(hdev, opcode, sizeof((*def_data_rd)),
@@ -1014,6 +1084,10 @@
struct hci_fm_def_data_wr_req *def_data_wr =
(struct hci_fm_def_data_wr_req *) param;
+ if (def_data_wr == NULL) {
+ FMDERR("%s, def data write param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_COMMON_CTRL_CMD_REQ,
HCI_OCF_FM_DEFAULT_DATA_WRITE);
@@ -1083,6 +1157,10 @@
__u16 opcode = 0;
struct hci_fm_riva_data *peek_data = (struct hci_fm_riva_data *)param;
+ if (peek_data == NULL) {
+ FMDERR("%s, peek data param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_DIAGNOSTIC_CMD_REQ,
HCI_OCF_FM_PEEK_DATA);
return radio_hci_send_cmd(hdev, opcode, sizeof((*peek_data)),
@@ -1094,6 +1172,10 @@
__u16 opcode = 0;
struct hci_fm_riva_poke *poke_data = (struct hci_fm_riva_poke *) param;
+ if (poke_data == NULL) {
+ FMDERR("%s, poke data param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_DIAGNOSTIC_CMD_REQ,
HCI_OCF_FM_POKE_DATA);
return radio_hci_send_cmd(hdev, opcode, sizeof((*poke_data)),
@@ -1106,6 +1188,10 @@
__u16 opcode = 0;
struct hci_fm_ssbi_peek *ssbi_peek = (struct hci_fm_ssbi_peek *) param;
+ if (ssbi_peek == NULL) {
+ FMDERR("%s, ssbi peek param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_DIAGNOSTIC_CMD_REQ,
HCI_OCF_FM_SSBI_PEEK_REG);
return radio_hci_send_cmd(hdev, opcode, sizeof((*ssbi_peek)),
@@ -1118,6 +1204,10 @@
__u16 opcode = 0;
struct hci_fm_ssbi_req *ssbi_poke = (struct hci_fm_ssbi_req *) param;
+ if (ssbi_poke == NULL) {
+ FMDERR("%s, ssbi poke param is null\n", __func__);
+ return -EINVAL;
+ }
opcode = hci_opcode_pack(HCI_OGF_FM_DIAGNOSTIC_CMD_REQ,
HCI_OCF_FM_SSBI_POKE_REG);
return radio_hci_send_cmd(hdev, opcode, sizeof((*ssbi_poke)),
@@ -1139,7 +1229,13 @@
{
struct hci_fm_ch_det_threshold *ch_det_th =
(struct hci_fm_ch_det_threshold *) param;
- u16 opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
+ u16 opcode;
+
+ if (ch_det_th == NULL) {
+ FMDERR("%s, channel det thrshld is null\n", __func__);
+ return -EINVAL;
+ }
+ opcode = hci_opcode_pack(HCI_OGF_FM_RECV_CTRL_CMD_REQ,
HCI_OCF_FM_SET_CH_DET_THRESHOLD);
return radio_hci_send_cmd(hdev, opcode, sizeof((*ch_det_th)),
ch_det_th);
@@ -1183,9 +1279,13 @@
unsigned long param, __u32 timeout)
{
int err = 0;
-
DECLARE_WAITQUEUE(wait, current);
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, hci dev is null\n", __func__);
+ return -EINVAL;
+ }
+
mutex_lock(&iris_fm);
hdev->req_status = HCI_REQ_PEND;
@@ -1208,11 +1308,6 @@
case HCI_REQ_STATUS:
err = radio_hci_err(hdev->req_result);
break;
-
- case HCI_REQ_CANCELED:
- err = -hdev->req_result;
- break;
-
default:
err = -ETIMEDOUT;
break;
@@ -1239,7 +1334,13 @@
static inline int hci_conf_event_mask(__u8 *arg,
struct radio_hci_dev *hdev)
{
- u8 event_mask = *arg;
+ u8 event_mask;
+
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ event_mask = *arg;
return radio_hci_request(hdev, hci_fm_set_event_mask,
event_mask, RADIO_HCI_TIMEOUT);
}
@@ -1270,8 +1371,13 @@
static int hci_fm_tune_station(__u32 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u32 tune_freq = *arg;
+ __u32 tune_freq;
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ tune_freq = *arg;
ret = radio_hci_request(hdev, hci_fm_tune_station_req, tune_freq,
RADIO_HCI_TIMEOUT);
@@ -1305,8 +1411,13 @@
static int hci_fm_set_antenna(__u8 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u8 antenna = *arg;
+ __u8 antenna;
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ antenna = *arg;
ret = radio_hci_request(hdev, hci_fm_set_antenna_req, antenna,
RADIO_HCI_TIMEOUT);
@@ -1317,8 +1428,13 @@
struct radio_hci_dev *hdev)
{
int ret = 0;
- __u8 sig_threshold = *arg;
+ __u8 sig_threshold;
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ sig_threshold = *arg;
ret = radio_hci_request(hdev, hci_fm_set_sig_threshold_req,
sig_threshold, RADIO_HCI_TIMEOUT);
@@ -1377,8 +1493,13 @@
static int hci_fm_rds_grps_process(__u32 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u32 fm_grps_process = *arg;
+ __u32 fm_grps_process;
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ fm_grps_process = *arg;
ret = radio_hci_request(hdev, hci_fm_rds_grp_process_req,
fm_grps_process, RADIO_HCI_TIMEOUT);
@@ -1410,8 +1531,13 @@
int hci_fm_do_calibration(__u8 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u8 mode = *arg;
+ __u8 mode;
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ mode = *arg;
ret = radio_hci_request(hdev, hci_fm_do_calibration_req, mode,
RADIO_HCI_TIMEOUT);
@@ -1421,7 +1547,13 @@
static int hci_read_grp_counters(__u8 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u8 reset_counters = *arg;
+ __u8 reset_counters;
+
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+ reset_counters = *arg;
ret = radio_hci_request(hdev, hci_read_grp_counters_req,
reset_counters, RADIO_HCI_TIMEOUT);
@@ -1431,7 +1563,14 @@
static int hci_set_notch_filter(__u8 *arg, struct radio_hci_dev *hdev)
{
int ret = 0;
- __u8 notch_filter = *arg;
+ __u8 notch_filter;
+
+ if (arg == NULL) {
+ FMDERR("%s, arg is null\n", __func__);
+ return -EINVAL;
+ }
+
+ notch_filter = *arg;
ret = radio_hci_request(hdev, hci_set_notch_filter_req,
notch_filter, RADIO_HCI_TIMEOUT);
@@ -1505,8 +1644,8 @@
opcode = hci_opcode_pack(HCI_OGF_FM_COMMON_CTRL_CMD_REQ,
HCI_OCF_FM_SET_CALIBRATION);
- return radio_hci_send_cmd(hdev, opcode, sizeof(*cal_req),
- cal_req);
+ return radio_hci_send_cmd(hdev, opcode,
+ sizeof(hci_fm_set_cal_req_proc), cal_req);
}
static int hci_fm_do_cal_req(struct radio_hci_dev *hdev,
@@ -1623,6 +1762,11 @@
static void radio_hci_req_complete(struct radio_hci_dev *hdev, int result)
{
+
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, hci device is null\n", __func__);
+ return;
+ }
hdev->req_result = result;
hdev->req_status = HCI_REQ_DONE;
wake_up_interruptible(&hdev->req_wait_q);
@@ -1630,6 +1774,10 @@
static void radio_hci_status_complete(struct radio_hci_dev *hdev, int result)
{
+ if (unlikely(hdev == NULL)) {
+ FMDERR("%s, hci device is null\n", __func__);
+ return;
+ }
hdev->req_result = result;
hdev->req_status = HCI_REQ_STATUS;
wake_up_interruptible(&hdev->req_wait_q);
@@ -1637,10 +1785,13 @@
static void hci_cc_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
- if (status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
+ status = *((__u8 *) skb->data);
radio_hci_req_complete(hdev, status);
}
@@ -1648,14 +1799,20 @@
static void hci_cc_fm_disable_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
- FMDERR(":radio is null");
- return;
- }
+ if (unlikely(radio == NULL)) {
+ FMDERR(":radio is null");
+ return;
+ }
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
+ status = *((__u8 *) skb->data);
if ((radio->mode == FM_TURNING_OFF) && (status == 0)) {
iris_q_event(radio, IRIS_EVT_RADIO_DISABLED);
radio_hci_req_complete(hdev, status);
@@ -1665,54 +1822,71 @@
} else if ((radio->mode == FM_RECV) || (radio->mode == FM_TRANS)) {
iris_q_event(radio, IRIS_EVT_RADIO_DISABLED);
radio->mode = FM_OFF;
+ } else if ((radio->mode == FM_TURNING_OFF) && (status != 0)) {
+ radio_hci_req_complete(hdev, status);
}
}
static void hci_cc_conf_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_fm_conf_rsp *rsp = (void *)skb->data;
+ struct hci_fm_conf_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
-
- radio->recv_conf = rsp->recv_conf_rsp;
+ }
+ rsp = (struct hci_fm_conf_rsp *)skb->data;
+ if (!rsp->status)
+ radio->recv_conf = rsp->recv_conf_rsp;
radio_hci_req_complete(hdev, rsp->status);
}
static void hci_cc_fm_trans_get_conf_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- struct hci_fm_get_trans_conf_rsp *rsp = (void *)skb->data;
+ struct hci_fm_get_trans_conf_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
-
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
- memcpy((void *)&radio->trans_conf, (void*)&rsp->trans_conf_rsp,
+ }
+
+ rsp = (struct hci_fm_get_trans_conf_rsp *)skb->data;
+ if (!rsp->status)
+ memcpy((void *)&radio->trans_conf,
+ (void *)&rsp->trans_conf_rsp,
sizeof(rsp->trans_conf_rsp));
+
radio_hci_req_complete(hdev, rsp->status);
}
static void hci_cc_fm_enable_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- struct hci_fm_conf_rsp *rsp = (void *)skb->data;
+ struct hci_fm_conf_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
+ rsp = (struct hci_fm_conf_rsp *)skb->data;
if (rsp->status) {
radio_hci_req_complete(hdev, rsp->status);
return;
@@ -1732,18 +1906,21 @@
static void hci_cc_fm_trans_set_conf_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- struct hci_fm_conf_rsp *rsp = (void *)skb->data;
+ struct hci_fm_conf_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
-
- iris_q_event(radio, HCI_EV_CMD_COMPLETE);
+ }
+ rsp = (struct hci_fm_conf_rsp *)skb->data;
+ if (!rsp->status)
+ iris_q_event(radio, HCI_EV_CMD_COMPLETE);
radio_hci_req_complete(hdev, rsp->status);
}
@@ -1752,31 +1929,41 @@
static void hci_cc_sig_threshold_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- struct hci_fm_sig_threshold_rsp *rsp = (void *)skb->data;
+ struct hci_fm_sig_threshold_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
-
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
- memcpy(&radio->sig_th, rsp, sizeof(struct hci_fm_sig_threshold_rsp));
+ rsp = (struct hci_fm_sig_threshold_rsp *)skb->data;
+ if (!rsp->status)
+ memcpy(&radio->sig_th, rsp,
+ sizeof(struct hci_fm_sig_threshold_rsp));
+
radio_hci_req_complete(hdev, rsp->status);
}
static void hci_cc_station_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- struct hci_fm_station_rsp *rsp = (void *)skb->data;
+ struct hci_fm_station_rsp *rsp;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+ rsp = (struct hci_fm_station_rsp *)skb->data;
radio->fm_st_rsp = *(rsp);
/* Tune is always succesful */
@@ -1785,31 +1972,41 @@
static void hci_cc_prg_srv_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_fm_prgm_srv_rsp *rsp = (void *)skb->data;
+ struct hci_fm_prgm_srv_rsp *rsp;
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
+
+ rsp = (struct hci_fm_prgm_srv_rsp *)skb->data;
radio_hci_req_complete(hdev, rsp->status);
}
static void hci_cc_rd_txt_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_fm_radio_txt_rsp *rsp = (void *)skb->data;
+ struct hci_fm_radio_txt_rsp *rsp;
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
+ rsp = (struct hci_fm_radio_txt_rsp *)skb->data;
radio_hci_req_complete(hdev, rsp->status);
}
static void hci_cc_af_list_rsp(struct radio_hci_dev *hdev, struct sk_buff *skb)
{
- struct hci_fm_af_list_rsp *rsp = (void *)skb->data;
+ struct hci_fm_af_list_rsp *rsp;
- if (rsp->status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
+ rsp = (struct hci_fm_af_list_rsp *)skb->data;
radio_hci_req_complete(hdev, rsp->status);
}
@@ -1817,20 +2014,25 @@
struct sk_buff *skb)
{
struct v4l2_capability *v4l_cap;
- struct hci_fm_feature_list_rsp *rsp = (void *)skb->data;
+ struct hci_fm_feature_list_rsp *rsp;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
+ rsp = (struct hci_fm_feature_list_rsp *)skb->data;
v4l_cap = &radio->g_cap;
- if (rsp->status)
- return;
- v4l_cap->capabilities = (rsp->feature_mask & 0x000002) |
- (rsp->feature_mask & 0x000001);
+ if (!rsp->status)
+ v4l_cap->capabilities = (rsp->feature_mask & 0x000002) |
+ (rsp->feature_mask & 0x000001);
radio_hci_req_complete(hdev, rsp->status);
}
@@ -1839,17 +2041,20 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- struct hci_fm_dbg_param_rsp *rsp = (void *)skb->data;
+ struct hci_fm_dbg_param_rsp *rsp;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
- radio->st_dbg_param = *(rsp);
- if (radio->st_dbg_param.status)
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
+ }
+ rsp = (struct hci_fm_dbg_param_rsp *)skb->data;
+ radio->st_dbg_param = *(rsp);
radio_hci_req_complete(hdev, radio->st_dbg_param.status);
}
@@ -1858,7 +2063,7 @@
{
struct kfifo *data_b;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
@@ -1871,46 +2076,55 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
int len;
char *data;
- if (status)
- return;
- len = skb->data[RIVA_PEEK_LEN_OFSET] + RIVA_PEEK_PARAM;
- data = kmalloc(len, GFP_ATOMIC);
-
- if (!data) {
- FMDERR("Memory allocation failed");
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
}
+ status = *((__u8 *) skb->data);
+ if (!status) {
+ len = skb->data[RIVA_PEEK_LEN_OFSET] + RIVA_PEEK_PARAM;
+ data = kmalloc(len, GFP_ATOMIC);
- memcpy(data, &skb->data[PEEK_DATA_OFSET], len);
- iris_q_evt_data(radio, data, len, IRIS_BUF_PEEK);
+ if (data != NULL) {
+ memcpy(data, &skb->data[PEEK_DATA_OFSET], len);
+ iris_q_evt_data(radio, data, len, IRIS_BUF_PEEK);
+ kfree(data);
+ } else {
+ FMDERR("Memory allocation failed");
+ }
+ }
+
radio_hci_req_complete(hdev, status);
- kfree(data);
-
}
static void hci_cc_riva_read_default_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
__u8 len;
- if (radio == NULL) {
- FMDERR(":radio is null");
- return;
- }
-
- if (status)
+ if (unlikely(radio == NULL)) {
+ FMDERR(":radio is null");
return;
- len = skb->data[1];
-
- memset(&radio->default_data, 0 , sizeof(struct hci_fm_data_rd_rsp));
- memcpy(&radio->default_data, &skb->data[0], len+2);
- iris_q_evt_data(radio, &skb->data[0], len+2, IRIS_BUF_RD_DEFAULT);
+ }
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+ status = *((__u8 *) skb->data);
+ if (!status) {
+ len = skb->data[1];
+ memset(&radio->default_data, 0,
+ sizeof(struct hci_fm_data_rd_rsp));
+ memcpy(&radio->default_data, &skb->data[0], len+2);
+ iris_q_evt_data(radio, &skb->data[0], len+2,
+ IRIS_BUF_RD_DEFAULT);
+ }
radio_hci_req_complete(hdev, status);
}
@@ -1918,41 +2132,53 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
char *data;
- if (status)
- return;
- data = kmalloc(SSBI_PEEK_LEN, GFP_ATOMIC);
- if (!data) {
- FMDERR("Memory allocation failed");
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
}
+ status = *((__u8 *) skb->data);
+ if (!status) {
+ data = kmalloc(SSBI_PEEK_LEN, GFP_ATOMIC);
+ if (data != NULL) {
+ data[0] = skb->data[PEEK_DATA_OFSET];
+ iris_q_evt_data(radio, data, SSBI_PEEK_LEN,
+ IRIS_BUF_SSBI_PEEK);
+ kfree(data);
+ } else {
+ FMDERR("Memory allocation failed");
+ }
+ }
- data[0] = skb->data[PEEK_DATA_OFSET];
- iris_q_evt_data(radio, data, SSBI_PEEK_LEN, IRIS_BUF_SSBI_PEEK);
radio_hci_req_complete(hdev, status);
- kfree(data);
}
static void hci_cc_rds_grp_cntrs_rsp(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 status = *((__u8 *) skb->data);
+ __u8 status;
char *data;
- if (status)
- return;
- data = kmalloc(RDS_GRP_CNTR_LEN, GFP_ATOMIC);
- if (!data) {
- FMDERR("memory allocation failed");
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
}
- memcpy(data, &skb->data[1], RDS_GRP_CNTR_LEN);
- iris_q_evt_data(radio, data, RDS_GRP_CNTR_LEN, IRIS_BUF_RDS_CNTRS);
+ status = *((__u8 *) skb->data);
+ if (!status) {
+ data = kmalloc(RDS_GRP_CNTR_LEN, GFP_ATOMIC);
+ if (data != NULL) {
+ memcpy(data, &skb->data[1], RDS_GRP_CNTR_LEN);
+ iris_q_evt_data(radio, data, RDS_GRP_CNTR_LEN,
+ IRIS_BUF_RDS_CNTRS);
+ kfree(data);
+ } else {
+ FMDERR("memory allocation failed");
+ }
+ }
radio_hci_req_complete(hdev, status);
- kfree(data);
-
}
static void hci_cc_do_calibration_rsp(struct radio_hci_dev *hdev,
@@ -1960,22 +2186,23 @@
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
static struct hci_cc_do_calibration_rsp rsp ;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
rsp.status = skb->data[0];
rsp.mode = skb->data[CALIB_MODE_OFSET];
- if (rsp.status) {
- FMDERR("status = %d", rsp.status);
- return;
- }
- if (rsp.mode == PROCS_CALIB_MODE) {
- memcpy(&rsp.data[0], &skb->data[CALIB_DATA_OFSET],
+ if (!rsp.status) {
+ if (rsp.mode == PROCS_CALIB_MODE) {
+ memcpy(&rsp.data[0], &skb->data[CALIB_DATA_OFSET],
PROCS_CALIB_SIZE);
- iris_q_evt_data(radio, rsp.data, PROCS_CALIB_SIZE,
+ iris_q_evt_data(radio, rsp.data, PROCS_CALIB_SIZE,
IRIS_BUF_CAL_DATA);
- } else {
- return;
+ }
}
-
radio_hci_req_complete(hdev, rsp.status);
}
@@ -1983,27 +2210,37 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- u8 status = skb->data[0];
+ u8 status;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
- if (status) {
- FMDERR("status = %d", status);
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
return;
}
- memcpy(&radio->ch_det_threshold, &skb->data[1],
- sizeof(struct hci_fm_ch_det_threshold));
+ status = skb->data[0];
+ if (!status)
+ memcpy(&radio->ch_det_threshold, &skb->data[1],
+ sizeof(struct hci_fm_ch_det_threshold));
+
radio_hci_req_complete(hdev, status);
}
static inline void hci_cmd_complete_event(struct radio_hci_dev *hdev,
struct sk_buff *skb)
{
- struct hci_ev_cmd_complete *cmd_compl_ev = (void *) skb->data;
+ struct hci_ev_cmd_complete *cmd_compl_ev;
__u16 opcode;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
+ cmd_compl_ev = (struct hci_ev_cmd_complete *)skb->data;
skb_pull(skb, sizeof(*cmd_compl_ev));
opcode = __le16_to_cpu(cmd_compl_ev->cmd_opcode);
@@ -2122,7 +2359,7 @@
int i;
struct iris_device *radio = video_get_drvdata(video_get_dev());
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
@@ -2154,6 +2391,7 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
+ radio->search_on = 0;
iris_q_event(radio, IRIS_EVT_SEEK_COMPLETE);
}
@@ -2168,10 +2406,15 @@
int abs_freq;
int len;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
ev = kmalloc(sizeof(*ev), GFP_ATOMIC);
if (!ev) {
FMDERR("Memory allocation failed");
@@ -2210,7 +2453,13 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 st_status = *((__u8 *) skb->data);
+ __u8 st_status;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+ st_status = *((__u8 *) skb->data);
if (st_status)
iris_q_event(radio, IRIS_EVT_STEREO);
else
@@ -2230,10 +2479,16 @@
radio = video_get_drvdata(video_get_dev());
index = RDSGRP_DATA_OFFSET;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return;
}
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
for (blocknum = 0; blocknum < RDS_BLOCKS_NUM; blocknum++) {
temp.rdsBlk[blocknum].rdsLsb =
(skb->data[index]);
@@ -2304,6 +2559,10 @@
unsigned short int info_byte = 0;
unsigned short int byte_pair_index;
+ if (rds_buf == NULL) {
+ FMDERR("%s, rds buffer is null\n", __func__);
+ return;
+ }
byte_pair_index = AGT(rds_buf->rdsBlk[1].rdsLsb);
if (byte_pair_index == 0) {
c_byt_pair_index = 0;
@@ -2486,6 +2745,10 @@
int len = 0;
char *data;
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
iris_q_event(radio, IRIS_EVT_NEW_RT_RDS);
while ((skb->data[len+RDS_OFFSET] != 0x0d) && (len < MAX_RT_LENGTH))
@@ -2516,6 +2779,10 @@
struct iris_device *radio = video_get_drvdata(video_get_dev());
struct hci_ev_af_list ev;
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
ev.tune_freq = *((int *) &skb->data[0]);
ev.pi_code = *((__le16 *) &skb->data[PI_CODE_OFFSET]);
ev.af_size = skb->data[AF_SIZE_OFFSET];
@@ -2534,7 +2801,14 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- __u8 rds_status = skb->data[0];
+ __u8 rds_status;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+
+ rds_status = skb->data[0];
if (rds_status)
iris_q_event(radio, IRIS_EVT_RDS_AVAIL);
@@ -2546,7 +2820,13 @@
struct sk_buff *skb)
{
struct iris_device *radio = video_get_drvdata(video_get_dev());
- u8 serv_avble = skb->data[0];
+ u8 serv_avble;
+
+ if (unlikely(skb == NULL)) {
+ FMDERR("%s, socket buffer is null\n", __func__);
+ return;
+ }
+ serv_avble = skb->data[0];
if (serv_avble)
iris_q_event(radio, IRIS_EVT_ABOVE_TH);
else
@@ -2641,13 +2921,15 @@
{
int retval = 0;
enum search_t srch;
+ int saved_val;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
srch = radio->g_search_mode & SRCH_MODE;
+ saved_val = radio->search_on;
radio->search_on = on;
if (on) {
switch (srch) {
@@ -2682,6 +2964,8 @@
retval = hci_cmd(HCI_FM_CANCEL_SEARCH_CMD, radio->fm_hdev);
}
+ if (retval < 0)
+ radio->search_on = saved_val;
return retval;
}
@@ -2691,7 +2975,7 @@
int rds_grps_proc = 0x00;
int retval = 0;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -2734,18 +3018,22 @@
static int iris_recv_set_region(struct iris_device *radio, int req_region)
{
int retval;
+ int saved_val;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
-
+ saved_val = radio->region;
radio->region = req_region;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
+ if (retval < 0)
+ radio->region = saved_val;
+
return retval;
}
@@ -2753,16 +3041,22 @@
static int iris_trans_set_region(struct iris_device *radio, int req_region)
{
int retval;
+ int saved_val;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
+
+ saved_val = radio->region;
radio->region = req_region;
retval = hci_set_fm_trans_conf(
&radio->trans_conf,
radio->fm_hdev);
+
+ if (retval < 0)
+ radio->region = saved_val;
return retval;
}
@@ -2772,7 +3066,7 @@
int retval;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -2789,6 +3083,10 @@
unsigned char i;
int retval = -EINVAL;
+ if (unlikely(qc == NULL)) {
+ FMDERR("%s, query ctrl is null\n", __func__);
+ return retval;
+ }
for (i = 0; i < ARRAY_SIZE(iris_v4l2_queryctrl); i++) {
if (qc->id && qc->id == iris_v4l2_queryctrl[i].id) {
memcpy(qc, &(iris_v4l2_queryctrl[i]), sizeof(*qc));
@@ -2805,7 +3103,7 @@
char cal_mode = 0x00;
int retval = 0x00;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -2844,28 +3142,46 @@
struct hci_fm_def_data_rd_req rd;
int lsb, msb;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
- return -EINVAL;
+ retval = -EINVAL;
+ goto END;
}
+ if (unlikely(ctrl == NULL)) {
+ FMDERR("%s, v4l2 ctrl is null\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
switch (ctrl->id) {
case V4L2_CID_AUDIO_VOLUME:
break;
case V4L2_CID_AUDIO_MUTE:
- ctrl->value = radio->mute_mode.hard_mute;
+ if (is_valid_hard_mute(radio->mute_mode.hard_mute))
+ ctrl->value = radio->mute_mode.hard_mute;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SRCHMODE:
- ctrl->value = radio->g_search_mode;
+ if (is_valid_srch_mode(radio->g_search_mode))
+ ctrl->value = radio->g_search_mode;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SCANDWELL:
- ctrl->value = radio->g_scan_time;
+ if (is_valid_scan_dwell_prd(radio->g_scan_time))
+ ctrl->value = radio->g_scan_time;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SRCHON:
ctrl->value = radio->search_on;
break;
case V4L2_CID_PRIVATE_IRIS_STATE:
- ctrl->value = radio->mode;
+ if (is_valid_fm_state(radio->mode))
+ ctrl->value = radio->mode;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_IOVERC:
retval = hci_cmd(HCI_FM_STATION_DBG_PARAM_CMD, radio->fm_hdev);
@@ -2875,68 +3191,115 @@
break;
case V4L2_CID_PRIVATE_IRIS_INTDET:
retval = hci_cmd(HCI_FM_STATION_DBG_PARAM_CMD, radio->fm_hdev);
- if (retval < 0)
- return retval;
- ctrl->value = radio->st_dbg_param.in_det_out;
+ if (retval == 0)
+ ctrl->value = radio->st_dbg_param.in_det_out;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_REGION:
ctrl->value = radio->region;
break;
case V4L2_CID_PRIVATE_IRIS_SIGNAL_TH:
retval = hci_cmd(HCI_FM_GET_SIGNAL_TH_CMD, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Error in get signal threshold %d\n", retval);
- return retval;
- }
- ctrl->value = radio->sig_th.sig_threshold;
+ if ((retval == 0) &&
+ is_valid_sig_th(radio->sig_th.sig_threshold))
+ ctrl->value = radio->sig_th.sig_threshold;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_PTY:
- ctrl->value = radio->srch_rds.srch_pty;
+ if (is_valid_pty(radio->srch_rds.srch_pty))
+ ctrl->value = radio->srch_rds.srch_pty;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_PI:
- ctrl->value = radio->srch_rds.srch_pi;
+ if (is_valid_pi(radio->srch_rds.srch_pi))
+ ctrl->value = radio->srch_rds.srch_pi;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_CNT:
- ctrl->value = radio->srch_st_result.num_stations_found;
+ if (is_valid_srch_station_cnt(
+ radio->srch_st_result.num_stations_found))
+ ctrl->value = radio->srch_st_result.num_stations_found;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_EMPHASIS:
if (radio->mode == FM_RECV) {
- ctrl->value = radio->recv_conf.emphasis;
+ retval = hci_cmd(HCI_FM_GET_RECV_CONF_CMD,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_emphasis(radio->recv_conf.emphasis))
+ ctrl->value = radio->recv_conf.emphasis;
+ else
+ retval = -EINVAL;
} else if (radio->mode == FM_TRANS) {
- ctrl->value = radio->trans_conf.emphasis;
+ retval = hci_cmd(HCI_FM_GET_TX_CONFIG,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_emphasis(radio->trans_conf.emphasis))
+ ctrl->value = radio->trans_conf.emphasis;
+ else
+ retval = -EINVAL;
} else {
- FMDERR("Error in radio mode"
- " %d\n", retval);
- return -EINVAL;
+ retval = -EINVAL;
+ FMDERR("Error in radio mode"" %d\n", retval);
}
break;
case V4L2_CID_PRIVATE_IRIS_RDS_STD:
if (radio->mode == FM_RECV) {
- ctrl->value = radio->recv_conf.rds_std;
+ retval = hci_cmd(HCI_FM_GET_RECV_CONF_CMD,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_rds_std(radio->recv_conf.rds_std))
+ ctrl->value = radio->recv_conf.rds_std;
+ else
+ retval = -EINVAL;
} else if (radio->mode == FM_TRANS) {
- ctrl->value = radio->trans_conf.rds_std;
+ retval = hci_cmd(HCI_FM_GET_TX_CONFIG,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_rds_std(radio->trans_conf.rds_std))
+ ctrl->value = radio->trans_conf.rds_std;
+ else
+ retval = -EINVAL;
} else {
+ retval = -EINVAL;
FMDERR("Error in radio mode"
" %d\n", retval);
- return -EINVAL;
}
break;
case V4L2_CID_PRIVATE_IRIS_SPACING:
if (radio->mode == FM_RECV) {
- ctrl->value = radio->recv_conf.ch_spacing;
+ retval = hci_cmd(HCI_FM_GET_RECV_CONF_CMD,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_chan_spacing(
+ radio->recv_conf.ch_spacing))
+ ctrl->value = radio->recv_conf.ch_spacing;
+ else
+ retval = -EINVAL;
} else {
+ retval = -EINVAL;
FMDERR("Error in radio mode"
" %d\n", retval);
- return -EINVAL;
}
break;
case V4L2_CID_PRIVATE_IRIS_RDSON:
if (radio->mode == FM_RECV) {
- ctrl->value = radio->recv_conf.rds_std;
+ retval = hci_cmd(HCI_FM_GET_RECV_CONF_CMD,
+ radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_rds_std(radio->recv_conf.rds_std))
+ ctrl->value = radio->recv_conf.rds_std;
+ else
+ retval = -EINVAL;
} else {
+ retval = -EINVAL;
FMDERR("Error in radio mode"
" %d\n", retval);
- return -EINVAL;
}
break;
case V4L2_CID_PRIVATE_IRIS_RDSGROUP_MASK:
@@ -2956,7 +3319,12 @@
ctrl->value = radio->g_antenna;
break;
case V4L2_CID_PRIVATE_IRIS_SOFT_MUTE:
- ctrl->value = radio->mute_mode.soft_mute;
+ retval = hci_cmd(HCI_FM_STATION_DBG_PARAM_CMD, radio->fm_hdev);
+ if ((retval == 0) &&
+ is_valid_soft_mute(radio->mute_mode.soft_mute))
+ ctrl->value = radio->mute_mode.soft_mute;
+ else
+ retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_IRIS_DO_CALIBRATION:
retval = iris_do_calibration(radio);
@@ -2965,47 +3333,30 @@
if (radio->mode == FM_RECV) {
retval = hci_cmd(HCI_FM_GET_STATION_PARAM_CMD,
radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get SINR Failed");
- return retval;
- }
- ctrl->value = radio->fm_st_rsp.station_rsp.sinr;
-
+ if (retval == 0)
+ ctrl->value = radio->fm_st_rsp.station_rsp.sinr;
} else
retval = -EINVAL;
break;
case V4L2_CID_PRIVATE_INTF_HIGH_THRESHOLD:
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get High det threshold failed %x", retval);
- return retval;
- }
- ctrl->value = radio->ch_det_threshold.high_th;
+ if (retval == 0)
+ ctrl->value = radio->ch_det_threshold.high_th;
break;
case V4L2_CID_PRIVATE_INTF_LOW_THRESHOLD:
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get Low det threshold failed %x", retval);
- return retval;
- }
- ctrl->value = radio->ch_det_threshold.low_th;
+ if (retval == 0)
+ ctrl->value = radio->ch_det_threshold.low_th;
break;
case V4L2_CID_PRIVATE_SINR_THRESHOLD:
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get SINR threshold failed %x", retval);
- return retval;
- }
- ctrl->value = radio->ch_det_threshold.sinr;
+ if (retval == 0)
+ ctrl->value = radio->ch_det_threshold.sinr;
break;
case V4L2_CID_PRIVATE_SINR_SAMPLES:
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get SINR samples failed %x", retval);
- return retval;
- }
-
- ctrl->value = radio->ch_det_threshold.sinr_samples;
+ if (retval == 0)
+ ctrl->value = radio->ch_det_threshold.sinr_samples;
break;
case V4L2_CID_PRIVATE_VALID_CHANNEL:
ctrl->value = radio->is_station_valid;
@@ -3017,13 +3368,11 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get AF Jump Threshold failed %x", retval);
- return retval;
+ if (retval == 0) {
+ lsb = radio->default_data.data[AF_RMSSI_TH_LSB_OFFSET];
+ msb = radio->default_data.data[AF_RMSSI_TH_MSB_OFFSET];
+ ctrl->value = ((msb << 8) | lsb);
}
- lsb = radio->default_data.data[AF_RMSSI_TH_LSB_OFFSET];
- msb = radio->default_data.data[AF_RMSSI_TH_MSB_OFFSET];
- ctrl->value = ((msb << 8) | lsb);
break;
case V4L2_CID_PRIVATE_AF_RMSSI_SAMPLES:
rd.mode = FM_RDS_CNFG_MODE;
@@ -3032,11 +3381,9 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("Get AF jump rmssi samples failed %x", retval);
- return retval;
- }
- ctrl->value = radio->default_data.data[AF_RMSSI_SAMPLES_OFFSET];
+ if (retval == 0)
+ ctrl->value =
+ radio->default_data.data[AF_RMSSI_SAMPLES_OFFSET];
break;
case V4L2_CID_PRIVATE_GOOD_CH_RMSSI_TH:
rd.mode = FM_RX_CONFG_MODE;
@@ -3045,13 +3392,12 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("get good channel rmssi th failed %x", retval);
- return retval;
+ if (retval == 0) {
+ ctrl->value =
+ radio->default_data.data[GD_CH_RMSSI_TH_OFFSET];
+ if (ctrl->value > MAX_GD_CH_RMSSI_TH)
+ ctrl->value -= 256;
}
- ctrl->value = radio->default_data.data[GD_CH_RMSSI_TH_OFFSET];
- if (ctrl->value > MAX_GD_CH_RMSSI_TH)
- ctrl->value -= 256;
break;
case V4L2_CID_PRIVATE_SRCHALGOTYPE:
rd.mode = FM_RX_CONFG_MODE;
@@ -3060,11 +3406,9 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("get search algo type failed %x", retval);
- return retval;
- }
- ctrl->value = radio->default_data.data[SRCH_ALGO_TYPE_OFFSET];
+ if (retval == 0)
+ ctrl->value =
+ radio->default_data.data[SRCH_ALGO_TYPE_OFFSET];
break;
case V4L2_CID_PRIVATE_SINRFIRSTSTAGE:
rd.mode = FM_RX_CONFG_MODE;
@@ -3073,13 +3417,12 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("default data read failed %x", retval);
- return retval;
+ if (retval == 0) {
+ ctrl->value =
+ radio->default_data.data[SINRFIRSTSTAGE_OFFSET];
+ if (ctrl->value > MAX_SINR_FIRSTSTAGE)
+ ctrl->value -= 256;
}
- ctrl->value = radio->default_data.data[SINRFIRSTSTAGE_OFFSET];
- if (ctrl->value > MAX_SINR_FIRSTSTAGE)
- ctrl->value -= 256;
break;
case V4L2_CID_PRIVATE_RMSSIFIRSTSTAGE:
rd.mode = FM_RX_CONFG_MODE;
@@ -3088,13 +3431,12 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("default data read failed %x", retval);
- return retval;
+ if (retval == 0) {
+ ctrl->value =
+ radio->default_data.data[RMSSIFIRSTSTAGE_OFFSET];
+ if (ctrl->value > MAX_RMSSI_FIRSTSTAGE)
+ ctrl->value -= 256;
}
- ctrl->value = radio->default_data.data[RMSSIFIRSTSTAGE_OFFSET];
- if (ctrl->value > MAX_RMSSI_FIRSTSTAGE)
- ctrl->value -= 256;
break;
case V4L2_CID_PRIVATE_CF0TH12:
rd.mode = FM_RX_CONFG_MODE;
@@ -3103,26 +3445,31 @@
rd.param = 0;
retval = hci_def_data_read(&rd, radio->fm_hdev);
- if (retval < 0) {
- FMDERR("default data read failed %x", retval);
- return retval;
+ if (retval == 0) {
+ ctrl->value =
+ radio->default_data.data[CF0TH12_BYTE1_OFFSET];
+ cf0 = radio->default_data.data[CF0TH12_BYTE2_OFFSET];
+ ctrl->value |= (cf0 << 8);
+ cf0 = radio->default_data.data[CF0TH12_BYTE3_OFFSET];
+ ctrl->value |= (cf0 << 16);
+ cf0 = radio->default_data.data[CF0TH12_BYTE4_OFFSET];
+ if (cf0 > 127)
+ cf0 -= 256;
+ ctrl->value |= (cf0 << 24);
}
- ctrl->value = radio->default_data.data[CF0TH12_BYTE1_OFFSET];
- cf0 = radio->default_data.data[CF0TH12_BYTE2_OFFSET];
- ctrl->value |= (cf0 << 8);
- cf0 = radio->default_data.data[CF0TH12_BYTE3_OFFSET];
- ctrl->value |= (cf0 << 16);
- cf0 = radio->default_data.data[CF0TH12_BYTE4_OFFSET];
- if (cf0 > 127)
- cf0 -= 256;
- ctrl->value |= (cf0 << 24);
break;
default:
retval = -EINVAL;
+ break;
}
+
+END:
+ if (retval > 0)
+ retval = -EINVAL;
if (retval < 0)
FMDERR("get control failed with %d, id: %d\n",
retval, ctrl->id);
+
return retval;
}
@@ -3134,24 +3481,38 @@
struct iris_device *radio = video_get_drvdata(video_devdata(file));
struct hci_fm_def_data_rd_req default_data_rd;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
- return -EINVAL;
+ retval = -EINVAL;
+ goto END;
}
+ if (unlikely((ctrl == NULL)) || unlikely((ctrl->count == 0))
+ || unlikely((ctrl->controls == NULL))) {
+ FMDERR("%s, invalid v4l2 ctrl\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
switch ((ctrl->controls[0]).id) {
case V4L2_CID_PRIVATE_IRIS_READ_DEFAULT:
data = (ctrl->controls[0]).string;
memset(&default_data_rd, 0, sizeof(default_data_rd));
if (copy_from_user(&default_data_rd.mode, data,
- sizeof(default_data_rd)))
- return -EFAULT;
+ sizeof(default_data_rd))) {
+ retval = -EFAULT;
+ goto END;
+ }
retval = hci_def_data_read(&default_data_rd, radio->fm_hdev);
break;
default:
retval = -EINVAL;
+ break;
}
+END:
+ if (retval > 0)
+ retval = -EINVAL;
+
return retval;
}
@@ -3168,10 +3529,17 @@
struct iris_device *radio = video_get_drvdata(video_devdata(file));
char *data = NULL;
- if ((ctrl == NULL) || (ctrl->controls == NULL)
- || (ctrl->count == 0)) {
+ if (unlikely(radio == NULL)) {
+ FMDERR(":radio is null");
retval = -EINVAL;
- return retval;
+ goto END;
+ }
+
+ if (unlikely((ctrl == NULL)) || unlikely((ctrl->count == 0))
+ || unlikely((ctrl->controls == NULL))) {
+ FMDERR("%s, invalid v4l2 ctrl\n", __func__);
+ retval = -EINVAL;
+ goto END;
}
switch ((ctrl->controls[0]).id) {
@@ -3185,16 +3553,23 @@
data = (ctrl->controls[0]).string;
if (copy_from_user(tx_ps.ps_data,
- data, bytes_to_copy))
- return -EFAULT;
- tx_ps.ps_control = 0x01;
- tx_ps.pi = radio->pi;
- tx_ps.pty = radio->pty;
- tx_ps.ps_repeatcount = radio->ps_repeatcount;
- tx_ps.ps_num = (bytes_to_copy / PS_STRING_LEN);
+ data, bytes_to_copy)) {
+ FMDERR("%s: copy from user for tx ps name failed\n",
+ __func__);
+ retval = -EFAULT;
+ goto END;
+ } else {
+ tx_ps.ps_control = 0x01;
+ tx_ps.pi = radio->pi;
+ tx_ps.pty = radio->pty;
+ tx_ps.ps_repeatcount = radio->ps_repeatcount;
+ tx_ps.ps_num = (bytes_to_copy / PS_STRING_LEN);
- retval = radio_hci_request(radio->fm_hdev, hci_trans_ps_req,
- (unsigned long)&tx_ps, RADIO_HCI_TIMEOUT);
+ retval = radio_hci_request(radio->fm_hdev,
+ hci_trans_ps_req,
+ (unsigned long)&tx_ps,
+ RADIO_HCI_TIMEOUT);
+ }
break;
case V4L2_CID_RDS_TX_RADIO_TEXT:
bytes_to_copy =
@@ -3204,16 +3579,22 @@
memset(tx_rt.rt_data, 0, MAX_RT_LENGTH);
if (copy_from_user(tx_rt.rt_data,
- data, bytes_to_copy))
- return -EFAULT;
+ data, bytes_to_copy)) {
+ FMDERR("%s: copy from user for tx rt failed\n",
+ __func__);
+ retval = -EFAULT;
+ goto END;
+ } else {
+ tx_rt.rt_control = 0x01;
+ tx_rt.pi = radio->pi;
+ tx_rt.pty = radio->pty;
+ tx_rt.rt_len = bytes_to_copy;
- tx_rt.rt_control = 0x01;
- tx_rt.pi = radio->pi;
- tx_rt.pty = radio->pty;
- tx_rt.rt_len = bytes_to_copy;
-
- retval = radio_hci_request(radio->fm_hdev, hci_trans_rt_req,
- (unsigned long)&tx_rt, RADIO_HCI_TIMEOUT);
+ retval = radio_hci_request(radio->fm_hdev,
+ hci_trans_rt_req,
+ (unsigned long)&tx_rt,
+ RADIO_HCI_TIMEOUT);
+ }
break;
case V4L2_CID_PRIVATE_IRIS_WRITE_DEFAULT:
data = (ctrl->controls[0]).string;
@@ -3228,7 +3609,8 @@
*/
if (ctrl->controls[0].size > (DEFAULT_DATA_SIZE + 2)) {
pr_err("%s: Default data buffer overflow!\n", __func__);
- return -EINVAL;
+ retval = -EINVAL;
+ goto END;
}
/* copy only 'size' bytes of data as requested by user */
@@ -3237,7 +3619,8 @@
if (retval > 0) {
pr_err("%s: Failed to copy %d bytes of default data"
" passed by user\n", __func__, retval);
- return -EFAULT;
+ retval = -EFAULT;
+ goto END;
}
FMDBG("%s: XFR Mode\t: 0x%x\n", __func__, default_data.mode);
FMDBG("%s: XFR Data Length\t: %d\n", __func__,
@@ -3252,7 +3635,8 @@
if (default_data.length != (ctrl->controls[0].size - 2)) {
pr_err("%s: Invalid 'length' parameter passed for "
"actual xfr data\n", __func__);
- return -EINVAL;
+ retval = -EINVAL;
+ goto END;
}
retval = hci_def_data_write(&default_data, radio->fm_hdev);
break;
@@ -3261,24 +3645,32 @@
bytes_to_copy = (ctrl->controls[0]).size;
if (bytes_to_copy < PROCS_CALIB_SIZE) {
FMDERR("data is less than required size");
- return -EFAULT;
+ retval = -EFAULT;
+ goto END;
}
memset(proc_cal_req.data, 0, PROCS_CALIB_SIZE);
proc_cal_req.mode = PROCS_CALIB_MODE;
if (copy_from_user(&proc_cal_req.data[0],
- data, sizeof(proc_cal_req.data)))
- return -EFAULT;
+ data, sizeof(proc_cal_req.data))) {
+ retval = -EFAULT;
+ goto END;
+ }
retval = radio_hci_request(radio->fm_hdev,
hci_fm_set_cal_req_proc,
(unsigned long)&proc_cal_req,
RADIO_HCI_TIMEOUT);
- if (retval < 0)
- FMDERR("Set Process calibration failed %d", retval);
break;
default:
FMDBG("Shouldn't reach here\n");
retval = -1;
+ goto END;
+ break;
}
+
+END:
+ if (retval > 0)
+ retval = -EINVAL;
+
return retval;
}
@@ -3289,6 +3681,7 @@
int retval = 0;
unsigned int rds_grps_proc = 0;
__u8 temp_val = 0;
+ int saved_val;
unsigned long arg = 0;
struct hci_fm_tx_ps tx_ps = {0};
struct hci_fm_tx_rt tx_rt = {0};
@@ -3297,37 +3690,71 @@
char sinr_th, sinr;
__u8 intf_det_low_th, intf_det_high_th, intf_det_out;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
- return -EINVAL;
+ retval = -EINVAL;
+ goto END;
}
+ if (unlikely(ctrl == NULL)) {
+ FMDERR("%s, v4l2 ctrl is null\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
switch (ctrl->id) {
case V4L2_CID_PRIVATE_IRIS_TX_TONE:
+ if (!is_valid_tone(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: tone value is not valid\n", __func__);
+ goto END;
+ }
+ saved_val = radio->tone_freq;
radio->tone_freq = ctrl->value;
retval = radio_hci_request(radio->fm_hdev,
hci_fm_tone_generator, arg,
msecs_to_jiffies(RADIO_HCI_TIMEOUT));
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error while setting the tone %d", retval);
+ radio->tone_freq = saved_val;
+ }
break;
case V4L2_CID_AUDIO_VOLUME:
break;
case V4L2_CID_AUDIO_MUTE:
+ if (!is_valid_hard_mute(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: hard mute value is not valid\n", __func__);
+ goto END;
+ }
+ saved_val = radio->mute_mode.hard_mute;
radio->mute_mode.hard_mute = ctrl->value;
radio->mute_mode.soft_mute = IOC_SFT_MUTE;
retval = hci_set_fm_mute_mode(
&radio->mute_mode,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error while set FM hard mute"" %d\n",
- retval);
+ retval);
+ radio->mute_mode.hard_mute = saved_val;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SRCHMODE:
- radio->g_search_mode = ctrl->value;
+ if (is_valid_srch_mode(ctrl->value)) {
+ radio->g_search_mode = ctrl->value;
+ } else {
+ FMDERR("%s: srch mode is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SCANDWELL:
- radio->g_scan_time = ctrl->value;
+ if (is_valid_scan_dwell_prd(ctrl->value)) {
+ radio->g_scan_time = ctrl->value;
+ } else {
+ FMDERR("%s: scandwell period is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SRCHON:
iris_search(radio, ctrl->value, SRCH_DIR_UP);
@@ -3335,8 +3762,12 @@
case V4L2_CID_PRIVATE_IRIS_STATE:
switch (ctrl->value) {
case FM_RECV:
- if (is_enable_rx_possible(radio) != 0)
- return -EINVAL;
+ if (is_enable_rx_possible(radio) != 0) {
+ FMDERR("%s: fm is not in proper state\n",
+ __func__);
+ retval = -EINVAL;
+ goto END;
+ }
radio->mode = FM_RECV_TURNING_ON;
retval = hci_cmd(HCI_FM_ENABLE_RECV_CMD,
radio->fm_hdev);
@@ -3344,14 +3775,16 @@
FMDERR("Error while enabling RECV FM"
" %d\n", retval);
radio->mode = FM_OFF;
- return retval;
+ goto END;
} else {
initialise_recv(radio);
}
break;
case FM_TRANS:
- if (is_enable_tx_possible(radio) != 0)
- return -EINVAL;
+ if (is_enable_tx_possible(radio) != 0) {
+ retval = -EINVAL;
+ goto END;
+ }
radio->mode = FM_TRANS_TURNING_ON;
retval = hci_cmd(HCI_FM_ENABLE_TRANS_CMD,
radio->fm_hdev);
@@ -3359,7 +3792,7 @@
FMDERR("Error while enabling TRANS FM"
" %d\n", retval);
radio->mode = FM_OFF;
- return retval;
+ goto END;
} else {
initialise_trans(radio);
}
@@ -3375,7 +3808,7 @@
FMDERR("Err on disable recv FM"
" %d\n", retval);
radio->mode = FM_RECV;
- return retval;
+ goto END;
}
break;
case FM_TRANS:
@@ -3387,7 +3820,7 @@
FMDERR("Err disabling trans FM"
" %d\n", retval);
radio->mode = FM_TRANS;
- return retval;
+ goto END;
}
break;
default:
@@ -3402,136 +3835,236 @@
if (radio->mode == FM_RECV) {
retval = iris_recv_set_region(radio, ctrl->value);
} else {
- if (radio->mode == FM_TRANS)
+ if (radio->mode == FM_TRANS) {
retval = iris_trans_set_region(radio,
ctrl->value);
- else
+ } else {
+ FMDERR("%s: fm is not in proper state\n",
+ __func__);
retval = -EINVAL;
+ goto END;
+ }
}
break;
case V4L2_CID_PRIVATE_IRIS_SIGNAL_TH:
+ if (!is_valid_sig_th(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: sig threshold is not valid\n", __func__);
+ goto END;
+ }
temp_val = ctrl->value;
retval = hci_fm_set_signal_threshold(
&temp_val,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Error while setting signal threshold\n");
- break;
+ goto END;
}
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_PTY:
- radio->srch_rds.srch_pty = ctrl->value;
- radio->srch_st_list.srch_pty = ctrl->value;
+ if (is_valid_pty(ctrl->value)) {
+ radio->srch_rds.srch_pty = ctrl->value;
+ radio->srch_st_list.srch_pty = ctrl->value;
+ } else {
+ FMDERR("%s: pty is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_PI:
- radio->srch_rds.srch_pi = ctrl->value;
+ if (is_valid_pi(ctrl->value)) {
+ radio->srch_rds.srch_pi = ctrl->value;
+ } else {
+ retval = -EINVAL;
+ FMDERR("%s: Pi is not valid\n", __func__);
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SRCH_CNT:
- radio->srch_st_list.srch_list_max = ctrl->value;
+ if (is_valid_srch_station_cnt(ctrl->value)) {
+ radio->srch_st_list.srch_list_max = ctrl->value;
+ } else {
+ retval = -EINVAL;
+ FMDERR("%s: srch station count is not valid\n",
+ __func__);
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_SPACING:
+ if (!is_valid_chan_spacing(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: channel spacing is not valid\n", __func__);
+ goto END;
+ }
if (radio->mode == FM_RECV) {
+ saved_val = radio->recv_conf.ch_spacing;
radio->recv_conf.ch_spacing = ctrl->value;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in setting channel spacing");
+ radio->recv_conf.ch_spacing = saved_val;
+ goto END;
+ }
}
break;
case V4L2_CID_PRIVATE_IRIS_EMPHASIS:
+ if (!is_valid_emphasis(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s, emphasis is not valid\n", __func__);
+ goto END;
+ }
switch (radio->mode) {
case FM_RECV:
+ saved_val = radio->recv_conf.emphasis;
radio->recv_conf.emphasis = ctrl->value;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in setting emphasis");
+ radio->recv_conf.emphasis = saved_val;
+ goto END;
+ }
break;
case FM_TRANS:
+ saved_val = radio->trans_conf.emphasis;
radio->trans_conf.emphasis = ctrl->value;
retval = hci_set_fm_trans_conf(
&radio->trans_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in setting emphasis");
+ radio->trans_conf.emphasis = saved_val;
+ goto END;
+ }
break;
default:
retval = -EINVAL;
+ FMDERR("%s, FM is not in proper state\n", __func__);
+ goto END;
+ break;
}
break;
case V4L2_CID_PRIVATE_IRIS_RDS_STD:
+ if (!is_valid_rds_std(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: rds std is not valid\n", __func__);
+ goto END;
+ }
switch (radio->mode) {
case FM_RECV:
+ saved_val = radio->recv_conf.rds_std;
radio->recv_conf.rds_std = ctrl->value;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in rds_std");
+ radio->recv_conf.rds_std = saved_val;
+ goto END;
+ }
break;
case FM_TRANS:
+ saved_val = radio->trans_conf.rds_std;
radio->trans_conf.rds_std = ctrl->value;
retval = hci_set_fm_trans_conf(
&radio->trans_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in rds_Std");
+ radio->trans_conf.rds_std = saved_val;
+ goto END;
+ }
break;
default:
retval = -EINVAL;
+ FMDERR("%s: fm is not in proper state\n", __func__);
+ goto END;
+ break;
}
break;
case V4L2_CID_PRIVATE_IRIS_RDSON:
+ if (!is_valid_rds_std(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: rds std is not valid\n", __func__);
+ goto END;
+ }
switch (radio->mode) {
case FM_RECV:
+ saved_val = radio->recv_conf.rds_std;
radio->recv_conf.rds_std = ctrl->value;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in rds_std");
+ radio->recv_conf.rds_std = saved_val;
+ goto END;
+ }
break;
case FM_TRANS:
+ saved_val = radio->trans_conf.rds_std;
radio->trans_conf.rds_std = ctrl->value;
retval = hci_set_fm_trans_conf(
&radio->trans_conf,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error in rds_Std");
+ radio->trans_conf.rds_std = saved_val;
+ goto END;
+ }
break;
default:
retval = -EINVAL;
+ FMDERR("%s: fm is not in proper state\n", __func__);
+ goto END;
+ break;
}
break;
case V4L2_CID_PRIVATE_IRIS_RDSGROUP_MASK:
+ saved_val = radio->rds_grp.rds_grp_enable_mask;
grp_mask = (grp_mask | oda_agt | ctrl->value);
radio->rds_grp.rds_grp_enable_mask = grp_mask;
radio->rds_grp.rds_buf_size = 1;
radio->rds_grp.en_rds_change_filter = 0;
retval = hci_fm_rds_grp(&radio->rds_grp, radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("error in setting group mask\n");
+ radio->rds_grp.rds_grp_enable_mask = saved_val;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_RDSGROUP_PROC:
+ saved_val = radio->g_rds_grp_proc_ps;
rds_grps_proc = radio->g_rds_grp_proc_ps | ctrl->value;
radio->g_rds_grp_proc_ps = (rds_grps_proc >> RDS_CONFIG_OFFSET);
retval = hci_fm_rds_grps_process(
&radio->g_rds_grp_proc_ps,
radio->fm_hdev);
+ if (retval < 0) {
+ radio->g_rds_grp_proc_ps = saved_val;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_RDSD_BUF:
radio->rds_grp.rds_buf_size = ctrl->value;
break;
case V4L2_CID_PRIVATE_IRIS_PSALL:
+ saved_val = radio->g_rds_grp_proc_ps;
rds_grps_proc = (ctrl->value << RDS_CONFIG_OFFSET);
radio->g_rds_grp_proc_ps |= rds_grps_proc;
retval = hci_fm_rds_grps_process(
&radio->g_rds_grp_proc_ps,
radio->fm_hdev);
+ if (retval < 0) {
+ radio->g_rds_grp_proc_ps = saved_val;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_AF_JUMP:
+ saved_val = radio->g_rds_grp_proc_ps;
/*Clear the current AF jump settings*/
radio->g_rds_grp_proc_ps &= ~(1 << RDS_AF_JUMP_OFFSET);
radio->af_jump_bit = ctrl->value;
@@ -3541,24 +4074,45 @@
retval = hci_fm_rds_grps_process(
&radio->g_rds_grp_proc_ps,
radio->fm_hdev);
+ if (retval < 0) {
+ radio->g_rds_grp_proc_ps = saved_val;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_LP_MODE:
set_low_power_mode(radio, ctrl->value);
break;
case V4L2_CID_PRIVATE_IRIS_ANTENNA:
+ if (!is_valid_antenna(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: antenna type is not valid\n", __func__);
+ goto END;
+ }
temp_val = ctrl->value;
retval = hci_fm_set_antenna(&temp_val, radio->fm_hdev);
if (retval < 0) {
FMDERR("Set Antenna failed retval = %x", retval);
- return retval;
+ goto END;
}
radio->g_antenna = ctrl->value;
break;
case V4L2_CID_RDS_TX_PTY:
- radio->pty = ctrl->value;
+ if (is_valid_pty(ctrl->value)) {
+ radio->pty = ctrl->value;
+ } else {
+ retval = -EINVAL;
+ FMDERR("%s: pty is not valid\n", __func__);
+ goto END;
+ }
break;
case V4L2_CID_RDS_TX_PI:
- radio->pi = ctrl->value;
+ if (is_valid_pi(ctrl->value)) {
+ radio->pi = ctrl->value;
+ } else {
+ retval = -EINVAL;
+ FMDERR("%s: pi is not valid\n", __func__);
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_STOP_RDS_TX_PS_NAME:
tx_ps.ps_control = 0x00;
@@ -3571,7 +4125,13 @@
(unsigned long)&tx_rt, RADIO_HCI_TIMEOUT);
break;
case V4L2_CID_PRIVATE_IRIS_TX_SETPSREPEATCOUNT:
- radio->ps_repeatcount = ctrl->value;
+ if (is_valid_ps_repeat_cnt(ctrl->value)) {
+ radio->ps_repeatcount = ctrl->value;
+ } else {
+ retval = -EINVAL;
+ FMDERR("%s: ps repeat count is not valid\n", __func__);
+ goto END;
+ }
break;
case V4L2_CID_TUNE_POWER_LEVEL:
if (ctrl->value > FM_TX_PWR_LVL_MAX)
@@ -3586,8 +4146,8 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("Default data read failed for PHY_CFG %d\n",
- retval);
- break;
+ retval);
+ goto END;
}
memset(&wrd, 0, sizeof(wrd));
wrd.mode = FM_TX_PHY_CFG_MODE;
@@ -3599,40 +4159,58 @@
retval = hci_def_data_write(&wrd, radio->fm_hdev);
if (retval < 0)
FMDERR("Default write failed for PHY_TXGAIN %d\n",
- retval);
+ retval);
break;
case V4L2_CID_PRIVATE_IRIS_SOFT_MUTE:
+ if (!is_valid_soft_mute(ctrl->value)) {
+ retval = -EINVAL;
+ FMDERR("%s: soft mute is not valid\n", __func__);
+ goto END;
+ }
+ saved_val = radio->mute_mode.soft_mute;
radio->mute_mode.soft_mute = ctrl->value;
retval = hci_set_fm_mute_mode(
&radio->mute_mode,
radio->fm_hdev);
- if (retval < 0)
+ if (retval < 0) {
FMDERR("Error while setting FM soft mute"" %d\n",
- retval);
+ retval);
+ radio->mute_mode.soft_mute = saved_val;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_RIVA_ACCS_ADDR:
radio->riva_data_req.cmd_params.start_addr = ctrl->value;
break;
case V4L2_CID_PRIVATE_IRIS_RIVA_ACCS_LEN:
- if ((ctrl->value > 0) &&
- (ctrl->value <= MAX_RIVA_PEEK_RSP_SIZE)) {
+ if (is_valid_peek_len(ctrl->value)) {
radio->riva_data_req.cmd_params.length = ctrl->value;
} else {
- FMDERR("Length %d is more than the buffer size %d\n",
- ctrl->value, MAX_RIVA_PEEK_RSP_SIZE);
retval = -EINVAL;
+ FMDERR("%s: riva access len is not valid\n", __func__);
+ goto END;
}
break;
case V4L2_CID_PRIVATE_IRIS_RIVA_POKE:
- if (radio->riva_data_req.cmd_params.length <= MAX_RIVA_PEEK_RSP_SIZE) {
- memcpy(radio->riva_data_req.data, (void *)ctrl->value,
- radio->riva_data_req.cmd_params.length);
- radio->riva_data_req.cmd_params.subopcode = RIVA_POKE_OPCODE;
- retval = hci_poke_data(&radio->riva_data_req , radio->fm_hdev);
+ if (radio->riva_data_req.cmd_params.length <=
+ MAX_RIVA_PEEK_RSP_SIZE) {
+ retval = copy_from_user(
+ radio->riva_data_req.data,
+ (void *)ctrl->value,
+ radio->riva_data_req.cmd_params.length);
+ if (retval != 0) {
+ retval = -retval;
+ goto END;
+ }
+ radio->riva_data_req.cmd_params.subopcode =
+ RIVA_POKE_OPCODE;
+ retval = hci_poke_data(
+ &radio->riva_data_req,
+ radio->fm_hdev);
} else {
- FMDERR("Can not copy into driver's buffer. Length %d is more than"
- "the buffer size %d\n", ctrl->value, MAX_RIVA_PEEK_RSP_SIZE);
+ FMDERR("Can not copy into driver's buffer.\n");
retval = -EINVAL;
+ goto END;
}
break;
case V4L2_CID_PRIVATE_IRIS_SSBI_ACCS_ADDR:
@@ -3653,80 +4231,133 @@
hci_ssbi_peek_reg(&radio->ssbi_peek_reg, radio->fm_hdev);
break;
case V4L2_CID_PRIVATE_IRIS_RDS_GRP_COUNTERS:
- temp_val = ctrl->value;
- hci_read_grp_counters(&temp_val, radio->fm_hdev);
+ if (is_valid_reset_cntr(ctrl->value)) {
+ temp_val = ctrl->value;
+ hci_read_grp_counters(&temp_val, radio->fm_hdev);
+ } else {
+ FMDERR("%s: reset counter value is not valid\n",
+ __func__);
+ retval = -EINVAL;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_IRIS_HLSI:
+ if (!is_valid_hlsi(ctrl->value)) {
+ FMDERR("%s: hlsi value is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_RECV_CONF_CMD,
radio->fm_hdev);
if (retval)
- break;
+ goto END;
+ saved_val = radio->recv_conf.hlsi;
radio->recv_conf.hlsi = ctrl->value;
retval = hci_set_fm_recv_conf(
&radio->recv_conf,
radio->fm_hdev);
+ if (retval < 0)
+ radio->recv_conf.hlsi = saved_val;
break;
case V4L2_CID_PRIVATE_IRIS_SET_NOTCH_FILTER:
- temp_val = ctrl->value;
- retval = hci_set_notch_filter(&temp_val, radio->fm_hdev);
+ if (is_valid_notch_filter(ctrl->value)) {
+ temp_val = ctrl->value;
+ retval = hci_set_notch_filter(&temp_val,
+ radio->fm_hdev);
+ } else {
+ FMDERR("%s: notch filter is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
break;
case V4L2_CID_PRIVATE_INTF_HIGH_THRESHOLD:
+ if (!is_valid_intf_det_hgh_th(ctrl->value)) {
+ FMDERR("%s: intf high threshold is not valid\n",
+ __func__);
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to get chnl det thresholds %d", retval);
- return retval;
+ goto END;
}
+ saved_val = radio->ch_det_threshold.high_th;
radio->ch_det_threshold.high_th = ctrl->value;
retval = hci_set_ch_det_thresholds_req(&radio->ch_det_threshold,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to set High det threshold %d ", retval);
- return retval;
+ radio->ch_det_threshold.high_th = saved_val;
+ goto END;
}
break;
case V4L2_CID_PRIVATE_INTF_LOW_THRESHOLD:
+ if (!is_valid_intf_det_low_th(ctrl->value)) {
+ FMDERR("%s: intf det low threshold is not valid\n",
+ __func__);
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to get chnl det thresholds %d", retval);
- return retval;
+ goto END;
}
+ saved_val = radio->ch_det_threshold.low_th;
radio->ch_det_threshold.low_th = ctrl->value;
retval = hci_set_ch_det_thresholds_req(&radio->ch_det_threshold,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to Set Low det threshold %d", retval);
- return retval;
+ radio->ch_det_threshold.low_th = saved_val;
+ goto END;
}
break;
case V4L2_CID_PRIVATE_SINR_THRESHOLD:
+ if (!is_valid_sinr_th(ctrl->value)) {
+ FMDERR("%s: sinr threshold is not valid\n", __func__);
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to get chnl det thresholds %d", retval);
- return retval;
+ goto END;
}
+ saved_val = radio->ch_det_threshold.sinr;
radio->ch_det_threshold.sinr = ctrl->value;
retval = hci_set_ch_det_thresholds_req(&radio->ch_det_threshold,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to set SINR threshold %d", retval);
- return retval;
+ radio->ch_det_threshold.sinr = saved_val;
+ goto END;
}
break;
case V4L2_CID_PRIVATE_SINR_SAMPLES:
+ if (!is_valid_sinr_samples(ctrl->value)) {
+ FMDERR("%s: sinr samples count is not valid\n",
+ __func__);
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_DET_CH_TH_CMD, radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to get chnl det thresholds %d", retval);
- return retval;
+ goto END;
}
+ saved_val = radio->ch_det_threshold.sinr_samples;
radio->ch_det_threshold.sinr_samples = ctrl->value;
retval = hci_set_ch_det_thresholds_req(&radio->ch_det_threshold,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Failed to set SINR samples %d", retval);
- return retval;
+ radio->ch_det_threshold.sinr_samples = saved_val;
+ goto END;
}
break;
@@ -3773,18 +4404,23 @@
if (retval < 0) {
FMDERR("%s: Failed to determine channel's validity\n",
__func__);
- return retval;
+ goto END;
} else {
sinr_th = radio->ch_det_threshold.sinr;
intf_det_low_th = radio->ch_det_threshold.low_th;
intf_det_high_th = radio->ch_det_threshold.high_th;
}
-
+ if (!is_valid_sinr_th(sinr_th) ||
+ !is_valid_intf_det_low_th(intf_det_low_th) ||
+ !is_valid_intf_det_hgh_th(intf_det_high_th)) {
+ retval = -EINVAL;
+ goto END;
+ }
retval = hci_cmd(HCI_FM_GET_STATION_PARAM_CMD, radio->fm_hdev);
if (retval < 0) {
FMDERR("%s: Failed to determine channel's validity\n",
__func__);
- return retval;
+ goto END;
} else
sinr = radio->fm_st_rsp.station_rsp.sinr;
@@ -3792,7 +4428,7 @@
if (retval < 0) {
FMDERR("%s: Failed to determine channel's validity\n",
__func__);
- return retval;
+ goto END;
} else
intf_det_out = radio->st_dbg_param.in_det_out;
@@ -3811,7 +4447,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RDS_CNFG_MODE;
wrd.length = FM_RDS_CNFG_LEN;
@@ -3832,7 +4468,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RDS_CNFG_MODE;
wrd.length = FM_RDS_CNFG_LEN;
@@ -3852,7 +4488,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RX_CONFG_MODE;
wrd.length = FM_RX_CNFG_LEN;
@@ -3872,7 +4508,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RX_CONFG_MODE;
wrd.length = FM_RX_CNFG_LEN;
@@ -3892,7 +4528,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RX_CONFG_MODE;
wrd.length = FM_RX_CNFG_LEN;
@@ -3912,7 +4548,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RX_CONFG_MODE;
wrd.length = FM_RX_CNFG_LEN;
@@ -3932,7 +4568,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed %x", retval);
- return retval;
+ goto END;
}
wrd.mode = FM_RX_CONFG_MODE;
wrd.length = FM_RX_CNFG_LEN;
@@ -3955,7 +4591,7 @@
retval = hci_def_data_read(&rd, radio->fm_hdev);
if (retval < 0) {
FMDERR("default data read failed for PS0 %x", retval);
- return retval;
+ goto END;
}
wrd.mode = RDS_PS0_XFR_MODE;
wrd.length = RDS_PS0_LEN;
@@ -3969,7 +4605,13 @@
break;
default:
retval = -EINVAL;
+ break;
}
+
+END:
+ if (retval > 0)
+ retval = -EINVAL;
+
return retval;
}
@@ -3984,7 +4626,7 @@
/* Pass the mode of SPUR_CLK */
default_data.mode = CKK_SPUR;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -4058,10 +4700,14 @@
int retval;
struct iris_device *radio = video_get_drvdata(video_devdata(file));
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
+ if (unlikely(tuner == NULL)) {
+ FMDERR("%s, tuner is null\n", __func__);
+ return -EINVAL;
+ }
if (tuner->index > 0) {
FMDERR("Invalid Tuner Index");
return -EINVAL;
@@ -4106,11 +4752,16 @@
struct iris_device *radio = video_get_drvdata(video_devdata(file));
int retval = 0;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
+ if (unlikely(tuner == NULL)) {
+ FMDERR("%s, tuner is null\n", __func__);
+ return -EINVAL;
+ }
+
if (tuner->index > 0)
return -EINVAL;
@@ -4160,9 +4811,15 @@
{
struct iris_device *radio = video_get_drvdata(video_devdata(file));
int retval = -1;
- freq->frequency = freq->frequency / TUNE_PARAM;
+ u32 f;
- if (radio == NULL) {
+ if (unlikely(freq == NULL)) {
+ FMDERR("%s, v4l2 freq is null\n", __func__);
+ return -EINVAL;
+ }
+ f = (freq->frequency / TUNE_PARAM);
+
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -4182,7 +4839,7 @@
radio->fm_hdev);
}
- retval = iris_set_freq(radio, freq->frequency);
+ retval = iris_set_freq(radio, f);
if (radio->mode == FM_TRANS
&& radio->trans_conf.rds_std == 2
@@ -4281,6 +4938,11 @@
{
struct iris_device *radio = video_get_drvdata(video_devdata(file));
int dir;
+
+ if (unlikely(seek == NULL)) {
+ FMDERR("%s, v4l2_hw_freq_seek is null\n", __func__);
+ return -EINVAL;
+ }
if (seek->seek_upward)
dir = SRCH_DIR_UP;
else
@@ -4294,10 +4956,14 @@
struct iris_device *radio;
radio = video_get_drvdata(video_devdata(file));
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
+ if (unlikely(capability == NULL)) {
+ FMDERR("%s, capability struct is null\n", __func__);
+ return -EINVAL;
+ }
strlcpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
strlcpy(capability->card, DRIVER_CARD, sizeof(capability->card));
@@ -4313,7 +4979,7 @@
{
int retval;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -4357,7 +5023,7 @@
int retval;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
@@ -4373,7 +5039,7 @@
{
int retval = 1;
- if (radio == NULL) {
+ if (unlikely(radio == NULL)) {
FMDERR(":radio is null");
return -EINVAL;
}
diff --git a/drivers/mfd/wcd9xxx-core.c b/drivers/mfd/wcd9xxx-core.c
index 907ce7c..64053de 100644
--- a/drivers/mfd/wcd9xxx-core.c
+++ b/drivers/mfd/wcd9xxx-core.c
@@ -1673,10 +1673,8 @@
wcd9xxx->slim_device_bootup = false;
return 0;
}
- ret = wcd9xxx_reset(wcd9xxx);
- if (ret)
- pr_err("%s: Resetting Codec failed\n", __func__);
+ dev_info(wcd9xxx->dev, "%s: codec bring up\n", __func__);
wcd9xxx_bring_up(wcd9xxx);
ret = wcd9xxx_irq_init(wcd9xxx_res);
if (ret) {
@@ -1688,6 +1686,25 @@
return ret;
}
+static int wcd9xxx_slim_device_reset(struct slim_device *sldev)
+{
+ int ret;
+ struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev);
+ if (!wcd9xxx) {
+ pr_err("%s: wcd9xxx is NULL\n", __func__);
+ return -EINVAL;
+ }
+
+ dev_info(wcd9xxx->dev, "%s: device reset\n", __func__);
+ if (wcd9xxx->slim_device_bootup)
+ return 0;
+ ret = wcd9xxx_reset(wcd9xxx);
+ if (ret)
+ dev_err(wcd9xxx->dev, "%s: Resetting Codec failed\n", __func__);
+
+ return ret;
+}
+
static int wcd9xxx_slim_device_up(struct slim_device *sldev)
{
struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev);
@@ -1695,7 +1712,7 @@
pr_err("%s: wcd9xxx is NULL\n", __func__);
return -EINVAL;
}
- dev_dbg(wcd9xxx->dev, "%s: device up\n", __func__);
+ dev_info(wcd9xxx->dev, "%s: slim device up\n", __func__);
return wcd9xxx_device_up(wcd9xxx);
}
@@ -1703,6 +1720,7 @@
{
struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev);
+ dev_info(wcd9xxx->dev, "%s: device down\n", __func__);
if (!wcd9xxx) {
pr_err("%s: wcd9xxx is NULL\n", __func__);
return -EINVAL;
@@ -1826,6 +1844,7 @@
.resume = wcd9xxx_slim_resume,
.suspend = wcd9xxx_slim_suspend,
.device_up = wcd9xxx_slim_device_up,
+ .reset_device = wcd9xxx_slim_device_reset,
.device_down = wcd9xxx_slim_device_down,
};
@@ -1845,6 +1864,7 @@
.resume = wcd9xxx_slim_resume,
.suspend = wcd9xxx_slim_suspend,
.device_up = wcd9xxx_slim_device_up,
+ .reset_device = wcd9xxx_slim_device_reset,
.device_down = wcd9xxx_slim_device_down,
};
diff --git a/drivers/misc/qseecom.c b/drivers/misc/qseecom.c
index 0bc18fb..c5c0ce8 100644
--- a/drivers/misc/qseecom.c
+++ b/drivers/misc/qseecom.c
@@ -99,7 +99,7 @@
struct qseecom_registered_listener_list {
struct list_head list;
struct qseecom_register_listener_req svc;
- u8 *sb_reg_req;
+ uint32_t user_virt_sb_base;
u8 *sb_virt;
s32 sb_phys;
size_t sb_length;
@@ -319,6 +319,10 @@
pr_err("copy_from_user failed\n");
return ret;
}
+ if (!access_ok(VERIFY_WRITE, (void __user *)rcvd_lstnr.virt_sb_base,
+ rcvd_lstnr.sb_size))
+ return -EFAULT;
+
data->listener.id = 0;
if (!__qseecom_is_svc_unique(data, &rcvd_lstnr)) {
pr_err("Service is not unique and is already registered\n");
@@ -336,6 +340,7 @@
new_entry->svc.listener_id = rcvd_lstnr.listener_id;
new_entry->sb_length = rcvd_lstnr.sb_size;
+ new_entry->user_virt_sb_base = rcvd_lstnr.virt_sb_base;
if (__qseecom_set_sb_memory(new_entry, data, &rcvd_lstnr)) {
pr_err("qseecom_set_sb_memoryfailed\n");
kzfree(new_entry);
@@ -446,6 +451,10 @@
req.ifd_data_fd, req.sb_len, req.virt_sb_base);
return -EFAULT;
}
+ if (!access_ok(VERIFY_WRITE, (void __user *)req.virt_sb_base,
+ req.sb_len))
+ return -EFAULT;
+
/* Get the handle of the shared fd */
data->client.ihandle = ion_import_dma_buf(qseecom.ion_clnt,
req.ifd_data_fd);
@@ -861,6 +870,13 @@
return data->client.sb_phys + (virt - data->client.user_virt_sb_base);
}
+static uint32_t __qseecom_uvirt_to_kvirt(struct qseecom_dev_handle *data,
+ uint32_t virt)
+{
+ return (uint32_t)data->client.sb_virt +
+ (virt - data->client.user_virt_sb_base);
+}
+
int __qseecom_process_rpmb_svc_cmd(struct qseecom_dev_handle *data_ptr,
struct qseecom_send_svc_cmd_req *req_ptr,
struct qseecom_client_send_service_ireq *send_svc_ireq_ptr)
@@ -1269,6 +1285,24 @@
pr_err("copy_from_user failed\n");
return ret;
}
+
+ if (req.cmd_req_buf == NULL || req.resp_buf == NULL) {
+ pr_err("cmd buffer or response buffer is null\n");
+ return -EINVAL;
+ }
+ if (((uint32_t)req.cmd_req_buf < data->client.user_virt_sb_base) ||
+ ((uint32_t)req.cmd_req_buf >= (data->client.user_virt_sb_base +
+ data->client.sb_length))) {
+ pr_err("cmd buffer address not within shared bufffer\n");
+ return -EINVAL;
+ }
+
+ if (((uint32_t)req.resp_buf < data->client.user_virt_sb_base) ||
+ ((uint32_t)req.resp_buf >= (data->client.user_virt_sb_base +
+ data->client.sb_length))){
+ pr_err("response buffer address not within shared bufffer\n");
+ return -EINVAL;
+ }
send_cmd_req.cmd_req_buf = req.cmd_req_buf;
send_cmd_req.cmd_req_len = req.cmd_req_len;
send_cmd_req.resp_buf = req.resp_buf;
@@ -1282,6 +1316,11 @@
return -EINVAL;
}
}
+ req.cmd_req_buf = (void *)__qseecom_uvirt_to_kvirt(data,
+ (uint32_t)req.cmd_req_buf);
+ req.resp_buf = (void *)__qseecom_uvirt_to_kvirt(data,
+ (uint32_t)req.resp_buf);
+
ret = __qseecom_update_cmd_buf(&req, false, data, false);
if (ret)
return ret;
@@ -1877,11 +1916,20 @@
{
struct qseecom_send_modfd_listener_resp resp;
int i;
+ struct qseecom_registered_listener_list *this_lstnr = NULL;
if (copy_from_user(&resp, argp, sizeof(resp))) {
pr_err("copy_from_user failed");
return -EINVAL;
}
+ this_lstnr = __qseecom_find_svc(data->listener.id);
+ if (this_lstnr == NULL)
+ return -EINVAL;
+
+ if (resp.resp_buf_ptr == NULL) {
+ pr_err("Invalid resp_buf_ptr\n");
+ return -EINVAL;
+ }
/* validate offsets */
for (i = 0; i < MAX_ION_FD; i++) {
if (resp.ifd_data[i].cmd_buf_offset >= resp.resp_len) {
@@ -1890,6 +1938,17 @@
return -EINVAL;
}
}
+
+ if (((uint32_t)resp.resp_buf_ptr <
+ this_lstnr->user_virt_sb_base)
+ || ((uint32_t)resp.resp_buf_ptr >=
+ (this_lstnr->user_virt_sb_base +
+ this_lstnr->sb_length))) {
+ pr_err("resp_buf_ptr address not within shared buffer\n");
+ return -EINVAL;
+ }
+ resp.resp_buf_ptr = (uint32_t)this_lstnr->sb_virt +
+ (resp.resp_buf_ptr - this_lstnr->user_virt_sb_base);
__qseecom_update_cmd_buf(&resp, false, data, true);
qseecom.send_resp_flag = 1;
wake_up_interruptible(&qseecom.send_resp_wq);
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 743668b..ff3e4ac 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -3073,6 +3073,8 @@
MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
MMC_FIXUP("VZL00M", CID_MANFID_SAMSUNG, CID_OEMID_ANY, add_quirk_mmc,
MMC_QUIRK_SEC_ERASE_TRIM_BROKEN),
+ MMC_FIXUP(CID_NAME_ANY, CID_MANFID_HYNIX, CID_OEMID_ANY, add_quirk_mmc,
+ MMC_QUIRK_BROKEN_DATA_TIMEOUT),
END_FIXUP
};
diff --git a/drivers/mmc/card/mmc_block_test.c b/drivers/mmc/card/mmc_block_test.c
index 39296ef..5cc2806 100644
--- a/drivers/mmc/card/mmc_block_test.c
+++ b/drivers/mmc/card/mmc_block_test.c
@@ -2285,6 +2285,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2383,6 +2386,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2491,6 +2497,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2605,6 +2614,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2730,6 +2742,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2818,6 +2833,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -2978,6 +2996,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
@@ -3051,6 +3072,9 @@
size_t count,
loff_t *offset)
{
+ if (!access_ok(VERIFY_WRITE, buffer, count))
+ return count;
+
memset((void *)buffer, 0, count);
snprintf(buffer, count,
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a296e48..94a13f9 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -895,7 +895,9 @@
mmc_post_req(host, host->areq->mrq, 0);
host->areq = NULL;
if (areq) {
- if (!(areq->cmd_flags & REQ_URGENT)) {
+ if (!(areq->cmd_flags & (REQ_URGENT
+ | REQ_FUA
+ | REQ_FLUSH))) {
areq->reinsert_req(areq);
mmc_post_req(host, areq->mrq, 0);
} else {
@@ -1307,6 +1309,11 @@
data->timeout_ns = 4000000000u; /* 4s */
data->timeout_clks = 0;
}
+ /* Some emmc cards require a longer read/write time */
+ if (card->quirks & MMC_QUIRK_BROKEN_DATA_TIMEOUT) {
+ if (data->timeout_ns < 4000000000u)
+ data->timeout_ns = 4000000000u; /* 4s */
+ }
}
EXPORT_SYMBOL(mmc_set_data_timeout);
@@ -3141,6 +3148,7 @@
return;
mmc_bus_get(host);
+ mmc_rpm_hold(host, &host->class_dev);
/*
* if there is a _removable_ card registered, check whether it is
@@ -3173,10 +3181,13 @@
/* if there still is a card present, stop here */
if (host->bus_ops != NULL) {
+ mmc_rpm_release(host, &host->class_dev);
mmc_bus_put(host);
goto out;
}
+ mmc_rpm_release(host, &host->class_dev);
+
/*
* Only we can add a new handler, so it's safe to
* release the lock here.
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 903decf..4ec8941 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/fault-inject.h>
+#include <linux/uaccess.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
@@ -392,6 +393,9 @@
if (!card)
return cnt;
+ if (!access_ok(VERIFY_WRITE, ubuf, cnt))
+ return cnt;
+
if (!card->wr_pack_stats.print_in_read)
return 0;
@@ -532,6 +536,9 @@
if (!card)
return cnt;
+ if (!access_ok(VERIFY_READ, ubuf, cnt))
+ return cnt;
+
sscanf(ubuf, "%d", &value);
if (value) {
mmc_blk_init_packed_statistics(card);
@@ -571,6 +578,9 @@
if (!card)
return cnt;
+ if (!access_ok(VERIFY_WRITE, ubuf, cnt))
+ return cnt;
+
bkops_stats = &card->bkops_info.bkops_stats;
if (!bkops_stats->print_stats)
@@ -637,6 +647,9 @@
if (!card)
return cnt;
+ if (!access_ok(VERIFY_READ, ubuf, cnt))
+ return cnt;
+
bkops_stats = &card->bkops_info.bkops_stats;
sscanf(ubuf, "%d", &value);
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 830223d..453f2c6 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -746,12 +746,6 @@
if (host->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL)
return 0xE;
- /* During initialization, don't use max timeout as the clock is slow */
- if ((host->quirks2 & SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT) &&
- (host->clock > 400000)) {
- return 0xF;
- }
-
/* Unspecified timeout, assume max */
if (!data && !cmd->cmd_timeout_ms)
return 0xE;
@@ -1498,6 +1492,7 @@
struct sdhci_host *host;
bool present;
unsigned long flags;
+ u32 tuning_opcode;
host = mmc_priv(mmc);
@@ -1554,12 +1549,19 @@
*/
if ((host->flags & SDHCI_NEEDS_RETUNING) &&
!(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
- spin_unlock_irqrestore(&host->lock, flags);
- sdhci_execute_tuning(mmc, mrq->cmd->opcode);
- spin_lock_irqsave(&host->lock, flags);
+ if (mmc->card) {
+ /* eMMC uses cmd21 but sd and sdio use cmd19 */
+ tuning_opcode =
+ mmc->card->type == MMC_TYPE_MMC ?
+ MMC_SEND_TUNING_BLOCK_HS200 :
+ MMC_SEND_TUNING_BLOCK;
+ spin_unlock_irqrestore(&host->lock, flags);
+ sdhci_execute_tuning(mmc, tuning_opcode);
+ spin_lock_irqsave(&host->lock, flags);
- /* Restore original mmc_request structure */
- host->mrq = mrq;
+ /* Restore original mmc_request structure */
+ host->mrq = mrq;
+ }
}
if (mrq->sbc && !(host->flags & SDHCI_AUTO_CMD23))
diff --git a/drivers/mtd/devices/msm_qpic_nand.c b/drivers/mtd/devices/msm_qpic_nand.c
index 7f02187..2e06b42 100644
--- a/drivers/mtd/devices/msm_qpic_nand.c
+++ b/drivers/mtd/devices/msm_qpic_nand.c
@@ -1919,7 +1919,7 @@
buf = (uint8_t *)dma_buffer + sizeof(*dma_buffer);
cmd = dma_buffer->cmd;
- memset(&data, 0, sizeof(struct msm_nand_erase_reg_data));
+ memset(&data, 0, sizeof(struct msm_nand_blk_isbad_data));
data.cfg.cmd = MSM_NAND_CMD_PAGE_READ_ALL;
data.cfg.cfg0 = chip->cfg0_raw & ~(7U << CW_PER_PAGE);
data.cfg.cfg1 = chip->cfg1_raw;
diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c
index 12c5704..11800ac 100644
--- a/drivers/net/wireless/wcnss/wcnss_wlan.c
+++ b/drivers/net/wireless/wcnss/wcnss_wlan.c
@@ -45,6 +45,7 @@
#endif
#define DEVICE "wcnss_wlan"
+#define CTRL_DEVICE "wcnss_ctrl"
#define VERSION "1.01"
#define WCNSS_PIL_DEVICE "wcnss"
@@ -147,6 +148,9 @@
#define MSM_PRONTO_TXP_PHY_ABORT 0xfb080488
#define MSM_PRONTO_BRDG_ERR_SRC 0xfb080fb0
+#define MSM_PRONTO_ALARMS_TXCTL 0xfb0120a8
+#define MSM_PRONTO_ALARMS_TACTL 0xfb012448
+
#define WCNSS_DEF_WLAN_RX_BUFF_COUNT 1024
#define WCNSS_VBATT_THRESHOLD 3500000
#define WCNSS_VBATT_GUARD 200
@@ -157,6 +161,14 @@
#define WCNSS_MAX_FRAME_SIZE (4*1024)
#define WCNSS_VERSION_LEN 30
#define WCNSS_MAX_BUILD_VER_LEN 256
+#define WCNSS_MAX_CMD_LEN (128)
+#define WCNSS_MIN_CMD_LEN (3)
+#define WCNSS_MIN_SERIAL_LEN (6)
+
+/* control messages from userspace */
+#define WCNSS_USR_CTRL_MSG_START 0x00000000
+#define WCNSS_USR_SERIAL_NUM (WCNSS_USR_CTRL_MSG_START + 1)
+#define WCNSS_USR_HAS_CAL_DATA (WCNSS_USR_CTRL_MSG_START + 2)
/* message types */
#define WCNSS_CTRL_MSG_START 0x01000000
@@ -172,6 +184,8 @@
#define WCNSS_BUILD_VER_REQ (WCNSS_CTRL_MSG_START + 9)
#define WCNSS_BUILD_VER_RSP (WCNSS_CTRL_MSG_START + 10)
+/* max 20mhz channel count */
+#define WCNSS_MAX_CH_NUM 45
#define VALID_VERSION(version) \
((strncmp(version, "INVALID", WCNSS_VERSION_LEN)) ? 1 : 0)
@@ -347,6 +361,8 @@
void __iomem *wlan_tx_status;
void __iomem *wlan_tx_phy_aborts;
void __iomem *wlan_brdg_err_source;
+ void __iomem *alarms_txctl;
+ void __iomem *alarms_tactl;
void __iomem *fiq_reg;
int nv_downloaded;
unsigned char *fw_cal_data;
@@ -361,11 +377,15 @@
int device_opened;
int iris_xo_mode_set;
int fw_vbatt_state;
+ int ctrl_device_opened;
struct mutex dev_lock;
+ struct mutex ctrl_lock;
wait_queue_head_t read_wait;
struct qpnp_adc_tm_btm_param vbat_monitor_params;
struct qpnp_adc_tm_chip *adc_tm_dev;
struct mutex vbat_monitor_mutex;
+ u16 unsafe_ch_count;
+ u16 unsafe_ch_list[WCNSS_MAX_CH_NUM];
} *penv = NULL;
static ssize_t wcnss_serial_number_show(struct device *dev,
@@ -671,6 +691,12 @@
reg = readl_relaxed(penv->wlan_tx_status);
pr_info_ratelimited("%s: WLAN_TX_STATUS %08x\n", __func__, reg);
+
+ reg = readl_relaxed(penv->alarms_txctl);
+ pr_err("ALARMS_TXCTL %08x\n", reg);
+
+ reg = readl_relaxed(penv->alarms_tactl);
+ pr_err("ALARMS_TACTL %08x\n", reg);
}
EXPORT_SYMBOL(wcnss_pronto_log_debug_regs);
@@ -1166,6 +1192,35 @@
}
EXPORT_SYMBOL(wcnss_get_wlan_rx_buff_count);
+int wcnss_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count)
+{
+ if (penv && unsafe_ch_list &&
+ (ch_count <= WCNSS_MAX_CH_NUM)) {
+ memcpy((char *)penv->unsafe_ch_list,
+ (char *)unsafe_ch_list, ch_count * sizeof(u16));
+ penv->unsafe_ch_count = ch_count;
+ return 0;
+ } else
+ return -ENODEV;
+}
+EXPORT_SYMBOL(wcnss_set_wlan_unsafe_channel);
+
+int wcnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 buffer_size,
+ u16 *ch_count)
+{
+ if (penv) {
+ if (buffer_size < penv->unsafe_ch_count * sizeof(u16))
+ return -ENODEV;
+ memcpy((char *)unsafe_ch_list,
+ (char *)penv->unsafe_ch_list,
+ penv->unsafe_ch_count * sizeof(u16));
+ *ch_count = penv->unsafe_ch_count;
+ return 0;
+ } else
+ return -ENODEV;
+}
+EXPORT_SYMBOL(wcnss_get_wlan_unsafe_channel);
+
static int wcnss_smd_tx(void *data, int len)
{
int ret = 0;
@@ -1823,6 +1878,80 @@
.notifier_call = wcnss_pm_notify,
};
+static int wcnss_ctrl_open(struct inode *inode, struct file *file)
+{
+ int rc = 0;
+
+ if (!penv || penv->ctrl_device_opened)
+ return -EFAULT;
+
+ penv->ctrl_device_opened = 1;
+
+ return rc;
+}
+
+
+void process_usr_ctrl_cmd(u8 *buf, size_t len)
+{
+ u16 cmd = buf[0] << 8 | buf[1];
+
+ switch (cmd) {
+
+ case WCNSS_USR_SERIAL_NUM:
+ if (WCNSS_MIN_SERIAL_LEN > len) {
+ pr_err("%s: Invalid serial number\n", __func__);
+ return;
+ }
+ penv->serial_number = buf[2] << 24 | buf[3] << 16
+ | buf[4] << 8 | buf[5];
+ break;
+
+ case WCNSS_USR_HAS_CAL_DATA:
+ if (1 < buf[2])
+ pr_err("%s: Invalid data for cal %d\n", __func__,
+ buf[2]);
+ has_calibrated_data = buf[2];
+ break;
+
+ default:
+ pr_err("%s: Invalid command %d\n", __func__, cmd);
+ break;
+ }
+}
+
+static ssize_t wcnss_ctrl_write(struct file *fp, const char __user
+ *user_buffer, size_t count, loff_t *position)
+{
+ int rc = 0;
+ u8 buf[WCNSS_MAX_CMD_LEN];
+
+ if (!penv || !penv->ctrl_device_opened || WCNSS_MAX_CMD_LEN < count
+ || WCNSS_MIN_CMD_LEN > count)
+ return -EFAULT;
+
+ mutex_lock(&penv->ctrl_lock);
+ rc = copy_from_user(buf, user_buffer, count);
+ if (0 == rc)
+ process_usr_ctrl_cmd(buf, count);
+
+ mutex_unlock(&penv->ctrl_lock);
+
+ return rc;
+}
+
+
+static const struct file_operations wcnss_ctrl_fops = {
+ .owner = THIS_MODULE,
+ .open = wcnss_ctrl_open,
+ .write = wcnss_ctrl_write,
+};
+
+static struct miscdevice wcnss_usr_ctrl = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = CTRL_DEVICE,
+ .fops = &wcnss_ctrl_fops,
+};
+
static int
wcnss_trigger_config(struct platform_device *pdev)
{
@@ -2000,6 +2129,18 @@
pr_err("%s: ioremap wlan TX STATUS failed\n", __func__);
goto fail_ioremap9;
}
+ penv->alarms_txctl = ioremap(MSM_PRONTO_ALARMS_TXCTL, SZ_8);
+ if (!penv->alarms_txctl) {
+ ret = -ENOMEM;
+ pr_err("%s: ioremap alarms TXCTL failed\n", __func__);
+ goto fail_ioremap10;
+ }
+ penv->alarms_tactl = ioremap(MSM_PRONTO_ALARMS_TACTL, SZ_8);
+ if (!penv->alarms_tactl) {
+ ret = -ENOMEM;
+ pr_err("%s: ioremap alarms TACTL failed\n", __func__);
+ goto fail_ioremap11;
+ }
}
penv->adc_tm_dev = qpnp_get_adc_tm(&penv->pdev->dev, "wcnss");
if (IS_ERR(penv->adc_tm_dev)) {
@@ -2025,6 +2166,12 @@
fail_pil:
if (penv->riva_ccu_base)
iounmap(penv->riva_ccu_base);
+ if (penv->alarms_tactl)
+ iounmap(penv->alarms_tactl);
+fail_ioremap11:
+ if (penv->alarms_txctl)
+ iounmap(penv->alarms_txctl);
+fail_ioremap10:
if (penv->wlan_tx_status)
iounmap(penv->wlan_tx_status);
fail_ioremap9:
@@ -2225,6 +2372,7 @@
}
mutex_init(&penv->dev_lock);
+ mutex_init(&penv->ctrl_lock);
mutex_init(&penv->vbat_monitor_mutex);
init_waitqueue_head(&penv->read_wait);
@@ -2237,6 +2385,9 @@
* place
*/
pr_info(DEVICE " probed in built-in mode\n");
+
+ misc_register(&wcnss_usr_ctrl);
+
return misc_register(&wcnss_misc);
}
diff --git a/drivers/platform/msm/ipa/teth_bridge.c b/drivers/platform/msm/ipa/teth_bridge.c
index b3a6b17..79ec0c0 100644
--- a/drivers/platform/msm/ipa/teth_bridge.c
+++ b/drivers/platform/msm/ipa/teth_bridge.c
@@ -1780,7 +1780,7 @@
break;
}
- if (caps.num_protocols < teth_ctx->aggr_caps->num_protocols) {
+ if (caps.num_protocols != teth_ctx->aggr_caps->num_protocols) {
caps.num_protocols = teth_ctx->aggr_caps->num_protocols;
if (copy_to_user((struct teth_aggr_capabilities *)arg,
&caps,
diff --git a/drivers/platform/msm/qpnp-power-on.c b/drivers/platform/msm/qpnp-power-on.c
index b55b66b..507d02c 100644
--- a/drivers/platform/msm/qpnp-power-on.c
+++ b/drivers/platform/msm/qpnp-power-on.c
@@ -50,6 +50,8 @@
#define QPNP_PON_KPDPWR_RESIN_S2_CNTL2(base) (base + 0x4B)
#define QPNP_PON_PS_HOLD_RST_CTL(base) (base + 0x5A)
#define QPNP_PON_PS_HOLD_RST_CTL2(base) (base + 0x5B)
+#define QPNP_PON_WD_RST_S2_CTL(base) (base + 0x56)
+#define QPNP_PON_WD_RST_S2_CTL2(base) (base + 0x57)
#define QPNP_PON_TRIGGER_EN(base) (base + 0x80)
#define QPNP_PON_S3_DBC_CTL(base) (base + 0x75)
@@ -73,6 +75,7 @@
#define QPNP_PON_RESIN_BARK_N_SET BIT(4)
#define QPNP_PON_KPDPWR_RESIN_BARK_N_SET BIT(5)
+#define QPNP_PON_WD_EN BIT(7)
#define QPNP_PON_RESET_EN BIT(7)
#define QPNP_PON_POWER_OFF_MASK 0xF
@@ -270,6 +273,32 @@
EXPORT_SYMBOL(qpnp_pon_is_warm_reset);
/**
+ * qpnp_pon_wd_config - Disable the wd in a warm reset.
+ * @enable: to enable or disable the PON watch dog
+ *
+ * Returns = 0 for operate successfully, < 0 for errors
+ */
+int qpnp_pon_wd_config(bool enable)
+{
+ struct qpnp_pon *pon = sys_reset_dev;
+ int rc = 0;
+
+ if (!pon)
+ return -EPROBE_DEFER;
+
+ rc = qpnp_pon_masked_write(pon, QPNP_PON_WD_RST_S2_CTL2(pon->base),
+ QPNP_PON_WD_EN, enable ? QPNP_PON_WD_EN : 0);
+ if (rc)
+ dev_err(&pon->spmi->dev,
+ "Unable to write to addr=%x, rc(%d)\n",
+ QPNP_PON_WD_RST_S2_CTL2(pon->base), rc);
+
+ return rc;
+}
+EXPORT_SYMBOL(qpnp_pon_wd_config);
+
+
+/**
* qpnp_pon_trigger_config - Configures (enable/disable) the PON trigger source
* @pon_src: PON source to be configured
* @enable: to enable or disable the PON trigger
diff --git a/drivers/platform/msm/sps/sps.c b/drivers/platform/msm/sps/sps.c
index c621d2a..55a5a2d 100644
--- a/drivers/platform/msm/sps/sps.c
+++ b/drivers/platform/msm/sps/sps.c
@@ -184,6 +184,11 @@
return -EFAULT;
}
+ if (buf_size_kb > (INT_MAX/SZ_1K)) {
+ pr_err("sps:debugfs: buffer size is too large\n");
+ return -EFAULT;
+ }
+
new_buf_size = buf_size_kb * SZ_1K;
if (debugfs_record_enabled) {
@@ -2529,21 +2534,8 @@
goto device_create_err;
}
- sps->dfab_clk = clk_get(sps->dev, "dfab_clk");
- if (IS_ERR(sps->dfab_clk)) {
- if (PTR_ERR(sps->dfab_clk) == -EPROBE_DEFER)
- ret = -EPROBE_DEFER;
- else
- SPS_ERR("sps:fail to get dfab_clk.");
- goto clk_err;
- } else {
- ret = clk_set_rate(sps->dfab_clk, 64000000);
- if (ret) {
- SPS_ERR("sps:failed to set dfab_clk rate.");
- clk_put(sps->dfab_clk);
- goto clk_err;
- }
- }
+ if (pdev->dev.of_node)
+ sps->dev->of_node = pdev->dev.of_node;
if (!d_type) {
sps->pmem_clk = clk_get(sps->dev, "mem_clk");
@@ -2552,36 +2544,58 @@
ret = -EPROBE_DEFER;
else
SPS_ERR("sps:fail to get pmem_clk.");
- goto clk_err;
+ goto pmem_clk_err;
} else {
ret = clk_prepare_enable(sps->pmem_clk);
if (ret) {
SPS_ERR("sps:failed to enable pmem_clk.");
- goto clk_err;
+ goto pmem_clk_en_err;
}
}
}
#ifdef CONFIG_SPS_SUPPORT_BAMDMA
+ sps->dfab_clk = clk_get(sps->dev, "dfab_clk");
+ if (IS_ERR(sps->dfab_clk)) {
+ if (PTR_ERR(sps->dfab_clk) == -EPROBE_DEFER)
+ ret = -EPROBE_DEFER;
+ else
+ SPS_ERR("sps:fail to get dfab_clk.");
+ goto dfab_clk_err;
+ } else {
+ ret = clk_set_rate(sps->dfab_clk, 64000000);
+ if (ret) {
+ SPS_ERR("sps:failed to set dfab_clk rate.");
+ clk_put(sps->dfab_clk);
+ goto dfab_clk_err;
+ }
+ }
+
sps->bamdma_clk = clk_get(sps->dev, "dma_bam_pclk");
if (IS_ERR(sps->bamdma_clk)) {
if (PTR_ERR(sps->bamdma_clk) == -EPROBE_DEFER)
ret = -EPROBE_DEFER;
else
SPS_ERR("sps:fail to get bamdma_clk.");
- goto clk_err;
+ clk_put(sps->dfab_clk);
+ goto dfab_clk_err;
} else {
ret = clk_prepare_enable(sps->bamdma_clk);
if (ret) {
SPS_ERR("sps:failed to enable bamdma_clk. ret=%d", ret);
- goto clk_err;
+ clk_put(sps->bamdma_clk);
+ clk_put(sps->dfab_clk);
+ goto dfab_clk_err;
}
}
ret = clk_prepare_enable(sps->dfab_clk);
if (ret) {
SPS_ERR("sps:failed to enable dfab_clk. ret=%d", ret);
- goto clk_err;
+ clk_disable_unprepare(sps->bamdma_clk);
+ clk_put(sps->bamdma_clk);
+ clk_put(sps->dfab_clk);
+ goto dfab_clk_err;
}
#endif
ret = sps_device_init();
@@ -2590,8 +2604,10 @@
#ifdef CONFIG_SPS_SUPPORT_BAMDMA
clk_disable_unprepare(sps->dfab_clk);
clk_disable_unprepare(sps->bamdma_clk);
+ clk_put(sps->bamdma_clk);
+ clk_put(sps->dfab_clk);
#endif
- goto sps_device_init_err;
+ goto dfab_clk_err;
}
#ifdef CONFIG_SPS_SUPPORT_BAMDMA
clk_disable_unprepare(sps->dfab_clk);
@@ -2602,8 +2618,13 @@
SPS_INFO("sps:sps is ready.");
return 0;
-clk_err:
-sps_device_init_err:
+dfab_clk_err:
+ if (!d_type)
+ clk_disable_unprepare(sps->pmem_clk);
+pmem_clk_en_err:
+ if (!d_type)
+ clk_put(sps->pmem_clk);
+pmem_clk_err:
device_destroy(sps->dev_class, sps->dev_num);
device_create_err:
unregister_chrdev_region(sps->dev_num, 1);
diff --git a/drivers/power/qpnp-charger.c b/drivers/power/qpnp-charger.c
index 6ea4ea6..32623f4 100644
--- a/drivers/power/qpnp-charger.c
+++ b/drivers/power/qpnp-charger.c
@@ -832,13 +832,12 @@
int rc = 0;
u8 usb_reg = 0, temp = 8;
- if (mA < QPNP_CHG_I_MAX_MIN_100
- || mA > QPNP_CHG_I_MAX_MAX_MA) {
+ if (mA < 0 || mA > QPNP_CHG_I_MAX_MAX_MA) {
pr_err("bad mA=%d asked to set\n", mA);
return -EINVAL;
}
- if (mA == QPNP_CHG_I_MAX_MIN_100) {
+ if (mA <= QPNP_CHG_I_MAX_MIN_100) {
usb_reg = 0x00;
pr_debug("current=%d setting %02x\n", mA, usb_reg);
return qpnp_chg_write(chip, &usb_reg,
@@ -1476,6 +1475,7 @@
chip->chg_done = false;
}
qpnp_chg_usb_suspend_enable(chip, 0);
+ qpnp_chg_iusbmax_set(chip, QPNP_CHG_I_MAX_MIN_100);
chip->prev_usb_max_ma = -EINVAL;
chip->aicl_settled = false;
} else {
@@ -3641,7 +3641,8 @@
qpnp_batt_system_temp_level_set(chip, val->intval);
break;
case POWER_SUPPLY_PROP_INPUT_CURRENT_MAX:
- qpnp_chg_iusbmax_set(chip, val->intval / 1000);
+ if (qpnp_chg_is_usb_chg_plugged_in(chip))
+ qpnp_chg_iusbmax_set(chip, val->intval / 1000);
break;
case POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM:
qpnp_chg_iusb_trim_set(chip, val->intval);
diff --git a/drivers/rtc/alarm.c b/drivers/rtc/alarm.c
index 7d59e28..51e176f 100644
--- a/drivers/rtc/alarm.c
+++ b/drivers/rtc/alarm.c
@@ -553,8 +553,8 @@
return;
disable_alarm:
- rtc_alarm_irq_enable(alarm_rtc_dev, 0);
spin_unlock_irqrestore(&alarm_slock, flags);
+ rtc_alarm_irq_enable(alarm_rtc_dev, 0);
}
static struct rtc_task alarm_rtc_task = {
diff --git a/drivers/sensors/sensors_class.c b/drivers/sensors/sensors_class.c
index 74e0d8d..bbf168c 100644
--- a/drivers/sensors/sensors_class.c
+++ b/drivers/sensors/sensors_class.c
@@ -105,6 +105,78 @@
sensors_cdev->fifo_max_event_count);
}
+static ssize_t sensors_enable_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sensors_classdev *sensors_cdev = dev_get_drvdata(dev);
+ ssize_t ret = -EINVAL;
+ unsigned long data = 0;
+
+ ret = kstrtoul(buf, 10, &data);
+ if (ret)
+ return ret;
+ if (data > 1) {
+ dev_err(dev, "Invalid value of input, input=%ld\n", data);
+ return -EINVAL;
+ }
+
+ if (sensors_cdev->sensors_enable == NULL) {
+ dev_err(dev, "Invalid sensor class enable handle\n");
+ return -EINVAL;
+ }
+ ret = sensors_cdev->sensors_enable(sensors_cdev, data);
+ if (ret)
+ return ret;
+
+ sensors_cdev->enabled = data;
+ return size;
+}
+
+
+static ssize_t sensors_enable_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct sensors_classdev *sensors_cdev = dev_get_drvdata(dev);
+ return snprintf(buf, PAGE_SIZE, "%u\n",
+ sensors_cdev->enabled);
+}
+
+static ssize_t sensors_delay_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t size)
+{
+ struct sensors_classdev *sensors_cdev = dev_get_drvdata(dev);
+ ssize_t ret = -EINVAL;
+ unsigned long data = 0;
+
+ ret = kstrtoul(buf, 10, &data);
+ if (ret)
+ return ret;
+ /* The data unit is millisecond, the min_delay unit is microseconds. */
+ if ((data * 1000) < sensors_cdev->min_delay) {
+ dev_err(dev, "Invalid value of delay, delay=%ld\n", data);
+ return -EINVAL;
+ }
+ if (sensors_cdev->sensors_poll_delay == NULL) {
+ dev_err(dev, "Invalid sensor class delay handle\n");
+ return -EINVAL;
+ }
+ ret = sensors_cdev->sensors_poll_delay(sensors_cdev, data);
+ if (ret)
+ return ret;
+
+ sensors_cdev->delay_msec = data;
+ return size;
+}
+
+static ssize_t sensors_delay_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct sensors_classdev *sensors_cdev = dev_get_drvdata(dev);
+ return snprintf(buf, PAGE_SIZE, "%u\n",
+ sensors_cdev->delay_msec);
+}
+
+
static struct device_attribute sensors_class_attrs[] = {
__ATTR(name, 0444, sensors_name_show, NULL),
__ATTR(vendor, 0444, sensors_vendor_show, NULL),
@@ -117,6 +189,8 @@
__ATTR(min_delay, 0444, sensors_min_delay_show, NULL),
__ATTR(fifo_reserved_event_count, 0444, sensors_fifo_event_show, NULL),
__ATTR(fifo_max_event_count, 0444, sensors_fifo_max_show, NULL),
+ __ATTR(enable, 0664, sensors_enable_show, sensors_enable_store),
+ __ATTR(poll_delay, 0664, sensors_delay_show, sensors_delay_store),
__ATTR_NULL,
};
diff --git a/drivers/slimbus/slim-msm-ngd.c b/drivers/slimbus/slim-msm-ngd.c
index 67cf049..adca457 100644
--- a/drivers/slimbus/slim-msm-ngd.c
+++ b/drivers/slimbus/slim-msm-ngd.c
@@ -973,6 +973,7 @@
struct slim_controller *ctrl = &dev->ctrl;
struct slim_device *sbdev;
int i;
+ slim_framer_booted(ctrl);
mutex_lock(&ctrl->m_ctrl);
list_for_each_entry(sbdev, &ctrl->devs, dev_list) {
int ret = 0;
diff --git a/drivers/slimbus/slimbus.c b/drivers/slimbus/slimbus.c
index b074289..f6594c8 100644
--- a/drivers/slimbus/slimbus.c
+++ b/drivers/slimbus/slimbus.c
@@ -650,6 +650,36 @@
EXPORT_SYMBOL(slim_report_absent);
/*
+ * slim_framer_booted: This function is called by controller after the active
+ * framer has booted (using Bus Reset sequence, or after it has shutdown and has
+ * come back up). Components, devices on the bus may be in undefined state,
+ * and this function triggers their drivers to do the needful
+ * to bring them back in Reset state so that they can acquire sync, report
+ * present and be operational again.
+ */
+void slim_framer_booted(struct slim_controller *ctrl)
+{
+ struct slim_device *sbdev;
+ struct list_head *pos, *next;
+ if (!ctrl)
+ return;
+ mutex_lock(&ctrl->m_ctrl);
+ list_for_each_safe(pos, next, &ctrl->devs) {
+ struct slim_driver *sbdrv;
+ sbdev = list_entry(pos, struct slim_device, dev_list);
+ mutex_unlock(&ctrl->m_ctrl);
+ if (sbdev && sbdev->dev.driver) {
+ sbdrv = to_slim_driver(sbdev->dev.driver);
+ if (sbdrv->reset_device)
+ sbdrv->reset_device(sbdev);
+ }
+ mutex_lock(&ctrl->m_ctrl);
+ }
+ mutex_unlock(&ctrl->m_ctrl);
+}
+EXPORT_SYMBOL(slim_framer_booted);
+
+/*
* slim_msg_response: Deliver Message response received from a device to the
* framework.
* @ctrl: Controller handle
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index bc328e0..e3284d5 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -223,7 +223,9 @@
if (opc < SPMI_CMD_RESET || opc > SPMI_CMD_WAKEUP)
return -EINVAL;
- cmd = ((opc | 0x40) << 27) | ((sid & 0xf) << 20);
+ opc -= SPMI_CMD_RESET - PMIC_ARB_OP_RESET;
+
+ cmd = (opc << 27) | ((sid & 0xf) << 20);
spin_lock_irqsave(&pmic_arb->lock, flags);
pmic_arb_write(pmic_arb, PMIC_ARB_CMD(pmic_arb->channel), cmd);
diff --git a/drivers/usb/class/Kconfig b/drivers/usb/class/Kconfig
index 2519e32..f7321e5 100644
--- a/drivers/usb/class/Kconfig
+++ b/drivers/usb/class/Kconfig
@@ -50,3 +50,15 @@
To compile this driver as a module, choose M here: the
module will be called usbtmc.
+
+config USB_CCID_BRIDGE
+ tristate "USB Smart Card Class (CCID) support"
+ help
+ Say Y here if you want to connect a USB Smart Card device that
+ follows the USB.org specification for Integrated Circuit(s) Cards
+ Interface Devices to your computer's USB port. This module
+ provides a character device interface to exchange the messages.
+ Ioctls facilitate control transfers and interrupt transfers.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ccid_bridge.
diff --git a/drivers/usb/class/Makefile b/drivers/usb/class/Makefile
index 32e8527..c2ee6f3 100644
--- a/drivers/usb/class/Makefile
+++ b/drivers/usb/class/Makefile
@@ -7,3 +7,4 @@
obj-$(CONFIG_USB_PRINTER) += usblp.o
obj-$(CONFIG_USB_WDM) += cdc-wdm.o
obj-$(CONFIG_USB_TMC) += usbtmc.o
+obj-$(CONFIG_USB_CCID_BRIDGE) += ccid_bridge.o
diff --git a/drivers/usb/class/ccid_bridge.c b/drivers/usb/class/ccid_bridge.c
new file mode 100644
index 0000000..a3e100a
--- /dev/null
+++ b/drivers/usb/class/ccid_bridge.c
@@ -0,0 +1,885 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt) "%s: " fmt "\n", __func__
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/uaccess.h>
+#include <linux/usb.h>
+#include <linux/wait.h>
+#include <linux/cdev.h>
+
+#include <linux/usb/ccid_bridge.h>
+
+#define CCID_CLASS_DECRIPTOR_TYPE 0x21
+#define CCID_NOTIFY_SLOT_CHANGE 0x50
+#define CCID_NOTIFY_HARDWARE_ERROR 0x51
+#define CCID_ABORT_REQ 0x1
+#define CCID_GET_CLK_FREQ_REQ 0x2
+#define CCID_GET_DATA_RATES 0x3
+
+#define CCID_BRIDGE_MSG_SZ 512
+#define CCID_BRIDGE_OPEN_TIMEOUT 500 /* msec */
+#define CCID_CONTROL_TIMEOUT 500 /* msec */
+#define CCID_BRIDGE_MSG_TIMEOUT 500 /* msec */
+
+struct ccid_bridge {
+ struct usb_device *udev;
+ struct usb_interface *intf;
+ unsigned int in_pipe;
+ unsigned int out_pipe;
+ unsigned int int_pipe;
+ struct urb *inturb;
+ struct urb *readurb;
+ struct urb *writeurb;
+
+ bool opened;
+ bool events_supported;
+ bool is_suspended;
+ struct mutex open_mutex;
+ struct mutex write_mutex;
+ struct mutex read_mutex;
+ struct mutex event_mutex;
+ int write_result;
+ int read_result;
+ int event_result;
+ wait_queue_head_t open_wq;
+ wait_queue_head_t write_wq;
+ wait_queue_head_t read_wq;
+ wait_queue_head_t event_wq;
+ struct usb_ccid_event cur_event;
+ void *intbuf;
+
+ dev_t chrdev;
+ struct cdev cdev;
+ struct class *class;
+ struct device *device;
+};
+
+static struct ccid_bridge *__ccid_bridge_dev;
+
+static void ccid_bridge_out_cb(struct urb *urb)
+{
+ struct ccid_bridge *ccid = urb->context;
+
+ if (urb->dev->state == USB_STATE_NOTATTACHED)
+ ccid->write_result = -ENODEV;
+ else
+ ccid->write_result = urb->status ? : urb->actual_length;
+
+ pr_debug("write result = %d", ccid->write_result);
+ wake_up(&ccid->write_wq);
+}
+
+static void ccid_bridge_in_cb(struct urb *urb)
+{
+ struct ccid_bridge *ccid = urb->context;
+
+ if (urb->dev->state == USB_STATE_NOTATTACHED)
+ ccid->read_result = -ENODEV;
+ else
+ ccid->read_result = urb->status ? : urb->actual_length;
+
+ pr_debug("read result = %d", ccid->read_result);
+ wake_up(&ccid->read_wq);
+}
+
+static void ccid_bridge_int_cb(struct urb *urb)
+{
+ struct ccid_bridge *ccid = urb->context;
+ u8 *msg_type;
+ bool wakeup = true;
+
+ if (urb->dev->state == USB_STATE_NOTATTACHED || (urb->status &&
+ urb->status != -ENOENT)) {
+ ccid->event_result = -ENODEV;
+ wakeup = true;
+ goto out;
+ }
+
+ /*
+ * Don't wakeup the event ioctl process during suspend.
+ * The suspend state is not visible to user space.
+ * we wake up the process after resume to send RESUME
+ * event if the device supports remote wakeup.
+ */
+ if (urb->status == -ENOENT && !urb->actual_length) {
+ ccid->event_result = -ENOENT;
+ wakeup = false;
+ goto out;
+ }
+
+ ccid->event_result = 0;
+ msg_type = urb->transfer_buffer;
+ switch (*msg_type) {
+ case CCID_NOTIFY_SLOT_CHANGE:
+ pr_debug("NOTIFY_SLOT_CHANGE event arrived");
+ ccid->cur_event.event = USB_CCID_NOTIFY_SLOT_CHANGE_EVENT;
+ ccid->cur_event.u.notify.slot_icc_state = *(++msg_type);
+ break;
+ case CCID_NOTIFY_HARDWARE_ERROR:
+ pr_debug("NOTIFY_HARDWARE_ERROR event arrived");
+ ccid->cur_event.event = USB_CCID_HARDWARE_ERROR_EVENT;
+ ccid->cur_event.u.error.slot = *(++msg_type);
+ ccid->cur_event.u.error.seq = *(++msg_type);
+ ccid->cur_event.u.error.error_code = *(++msg_type);
+ break;
+ default:
+ pr_err("UNKNOWN event arrived\n");
+ ccid->event_result = -EINVAL;
+ }
+
+out:
+ pr_debug("returning %d", ccid->event_result);
+ if (wakeup)
+ wake_up(&ccid->event_wq);
+}
+
+static int ccid_bridge_submit_inturb(struct ccid_bridge *ccid)
+{
+ int ret = 0;
+
+ /*
+ * Don't resume the bus to submit an interrupt URB.
+ * We submit the URB in resume path. This is important.
+ * Because the device will be in suspend state during
+ * multiple system suspend/resume cycles. The user space
+ * process comes here during system resume after it is
+ * unfrozen.
+ */
+ if (!ccid->int_pipe || ccid->is_suspended)
+ goto out;
+
+ ret = usb_autopm_get_interface(ccid->intf);
+ if (ret < 0) {
+ pr_debug("fail to get autopm with %d\n", ret);
+ goto out;
+ }
+ ret = usb_submit_urb(ccid->inturb, GFP_KERNEL);
+ if (ret < 0)
+ pr_err("fail to submit int urb with %d\n", ret);
+ usb_autopm_put_interface(ccid->intf);
+
+out:
+ pr_debug("returning %d", ret);
+ return ret;
+}
+
+static int ccid_bridge_get_event(struct ccid_bridge *ccid)
+{
+ int ret = 0;
+
+ /*
+ * The first event returned after the device resume
+ * will be RESUME event. This event is set by
+ * the resume.
+ */
+ if (ccid->cur_event.event)
+ goto out;
+
+ ccid->event_result = -EINPROGRESS;
+
+ ret = ccid_bridge_submit_inturb(ccid);
+ if (ret < 0)
+ goto out;
+
+ /*
+ * Wait for the notification on interrupt endpoint
+ * or remote wakeup event from the resume. The
+ * int urb completion handler and resume callback
+ * take care of setting the current event.
+ */
+ mutex_unlock(&ccid->event_mutex);
+ ret = wait_event_interruptible(ccid->event_wq,
+ (ccid->event_result != -EINPROGRESS));
+ mutex_lock(&ccid->event_mutex);
+
+ if (ret == -ERESTARTSYS) /* interrupted */
+ usb_kill_urb(ccid->inturb);
+ else
+ ret = ccid->event_result;
+out:
+ pr_debug("returning %d", ret);
+ return ret;
+}
+
+static int ccid_bridge_open(struct inode *ip, struct file *fp)
+{
+ struct ccid_bridge *ccid = container_of(ip->i_cdev,
+ struct ccid_bridge, cdev);
+ int ret;
+
+ pr_debug("called");
+
+ mutex_lock(&ccid->open_mutex);
+ if (ccid->opened) {
+ ret = -EBUSY;
+ goto out;
+ }
+ mutex_unlock(&ccid->open_mutex);
+
+ ret = wait_event_interruptible_timeout(ccid->open_wq,
+ ccid->intf != NULL, msecs_to_jiffies(
+ CCID_BRIDGE_OPEN_TIMEOUT));
+
+ mutex_lock(&ccid->open_mutex);
+
+ if (ret != -ERESTARTSYS && ccid->intf) {
+ fp->private_data = ccid;
+ ccid->opened = true;
+ ret = 0;
+ } else if (!ret) { /* timed out */
+ ret = -ENODEV;
+ }
+out:
+ mutex_unlock(&ccid->open_mutex);
+ pr_debug("returning %d", ret);
+ return ret;
+}
+
+static ssize_t ccid_bridge_write(struct file *fp, const char __user *ubuf,
+ size_t count, loff_t *pos)
+{
+ struct ccid_bridge *ccid = fp->private_data;
+ int ret;
+ char *kbuf;
+
+ pr_debug("called with %d", count);
+
+ if (!ccid->intf) {
+ pr_debug("intf is not active");
+ return -ENODEV;
+ }
+
+ mutex_lock(&ccid->write_mutex);
+
+ if (!count || count > CCID_BRIDGE_MSG_SZ) {
+ pr_err("invalid count");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ kbuf = kmalloc(count, GFP_KERNEL);
+ if (!kbuf) {
+ pr_err("fail to allocate memory");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = copy_from_user(kbuf, ubuf, count);
+ if (ret) {
+ pr_err("fail to copy user buf");
+ ret = -EFAULT;
+ goto free_kbuf;
+ }
+
+ ret = usb_autopm_get_interface(ccid->intf);
+ if (ret) {
+ pr_err("fail to get autopm with %d", ret);
+ goto free_kbuf;
+ }
+
+ ccid->write_result = 0;
+
+ usb_fill_bulk_urb(ccid->writeurb, ccid->udev, ccid->out_pipe,
+ kbuf, count, ccid_bridge_out_cb, ccid);
+ ret = usb_submit_urb(ccid->writeurb, GFP_KERNEL);
+ if (ret < 0) {
+ pr_err("urb submit fail with %d", ret);
+ goto put_pm;
+ }
+
+ ret = wait_event_interruptible_timeout(ccid->write_wq,
+ ccid->write_result != 0,
+ msecs_to_jiffies(CCID_BRIDGE_MSG_TIMEOUT));
+ if (!ret || ret == -ERESTARTSYS) { /* timedout or interrupted */
+ usb_kill_urb(ccid->writeurb);
+ if (!ret)
+ ret = -ETIMEDOUT;
+ } else {
+ ret = ccid->write_result;
+ }
+
+ pr_debug("returning %d", ret);
+
+put_pm:
+ if (ret != -ENODEV)
+ usb_autopm_put_interface(ccid->intf);
+free_kbuf:
+ kfree(kbuf);
+out:
+ mutex_unlock(&ccid->write_mutex);
+ return ret;
+
+}
+
+static ssize_t ccid_bridge_read(struct file *fp, char __user *ubuf,
+ size_t count, loff_t *pos)
+{
+ struct ccid_bridge *ccid = fp->private_data;
+ int ret;
+ char *kbuf;
+
+ pr_debug("called with %d", count);
+ if (!ccid->intf) {
+ pr_debug("intf is not active");
+ return -ENODEV;
+ }
+
+ mutex_lock(&ccid->read_mutex);
+
+ if (!count || count > CCID_BRIDGE_MSG_SZ) {
+ pr_err("invalid count");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ kbuf = kmalloc(count, GFP_KERNEL);
+ if (!kbuf) {
+ pr_err("fail to allocate memory");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = usb_autopm_get_interface(ccid->intf);
+ if (ret) {
+ pr_err("fail to get autopm with %d", ret);
+ goto free_kbuf;
+ }
+
+ ccid->read_result = 0;
+
+ usb_fill_bulk_urb(ccid->readurb, ccid->udev, ccid->in_pipe,
+ kbuf, count, ccid_bridge_in_cb, ccid);
+ ret = usb_submit_urb(ccid->readurb, GFP_KERNEL);
+ if (ret < 0) {
+ pr_err("urb submit fail with %d", ret);
+ if (ret != -ENODEV)
+ usb_autopm_put_interface(ccid->intf);
+ goto free_kbuf;
+ }
+
+
+ ret = wait_event_interruptible_timeout(ccid->read_wq,
+ ccid->read_result != 0,
+ msecs_to_jiffies(CCID_BRIDGE_MSG_TIMEOUT));
+ if (!ret || ret == -ERESTARTSYS) { /* timedout or interrupted */
+ usb_kill_urb(ccid->readurb);
+ if (!ret)
+ ret = -ETIMEDOUT;
+ } else {
+ ret = ccid->read_result;
+ }
+
+
+ if (ret > 0) {
+ if (copy_to_user(ubuf, kbuf, ret))
+ ret = -EFAULT;
+ }
+
+ usb_autopm_put_interface(ccid->intf);
+ pr_debug("returning %d", ret);
+
+free_kbuf:
+ kfree(kbuf);
+out:
+ mutex_unlock(&ccid->read_mutex);
+ return ret;
+}
+
+static long
+ccid_bridge_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
+{
+ struct ccid_bridge *ccid = fp->private_data;
+ char *buf;
+ struct usb_ccid_data data;
+ struct usb_ccid_abort abort;
+ struct usb_descriptor_header *header;
+ int ret;
+ struct usb_device *udev = ccid->udev;
+ __u8 intf = ccid->intf->cur_altsetting->desc.bInterfaceNumber;
+ __u8 breq = 0;
+
+ if (!ccid->intf) {
+ pr_debug("intf is not active");
+ return -ENODEV;
+ }
+
+ mutex_lock(&ccid->event_mutex);
+ switch (cmd) {
+ case USB_CCID_GET_CLASS_DESC:
+ pr_debug("GET_CLASS_DESC ioctl called");
+ ret = copy_from_user(&data, (void __user *)arg, sizeof(data));
+ if (ret) {
+ ret = -EFAULT;
+ break;
+ }
+ ret = __usb_get_extra_descriptor(udev->rawdescriptors[0],
+ le16_to_cpu(udev->config[0].desc.wTotalLength),
+ CCID_CLASS_DECRIPTOR_TYPE, (void **) &buf);
+ if (ret) {
+ ret = -ENOENT;
+ break;
+ }
+ header = (struct usb_descriptor_header *) buf;
+ if (data.length != header->bLength) {
+ ret = -EINVAL;
+ break;
+ }
+ ret = copy_to_user((void __user *)data.data, buf, data.length);
+ if (ret)
+ ret = -EFAULT;
+ break;
+ case USB_CCID_GET_CLOCK_FREQUENCIES:
+ pr_debug("GET_CLOCK_FREQUENCIES ioctl called");
+ breq = CCID_GET_CLK_FREQ_REQ;
+ /* fall through */
+ case USB_CCID_GET_DATA_RATES:
+ if (!breq) {
+ pr_debug("GET_DATA_RATES ioctl called");
+ breq = CCID_GET_DATA_RATES;
+ }
+ ret = copy_from_user(&data, (void __user *)arg, sizeof(data));
+ if (ret) {
+ ret = -EFAULT;
+ break;
+ }
+ buf = kmalloc(data.length, GFP_KERNEL);
+ if (!buf) {
+ ret = -ENOMEM;
+ break;
+ }
+ ret = usb_autopm_get_interface(ccid->intf);
+ if (ret < 0) {
+ pr_debug("fail to get autopm with %d", ret);
+ break;
+ }
+ ret = usb_control_msg(ccid->udev,
+ usb_rcvctrlpipe(ccid->udev, 0),
+ breq, (USB_DIR_IN | USB_TYPE_CLASS |
+ USB_RECIP_INTERFACE), 0, intf, buf,
+ data.length, CCID_CONTROL_TIMEOUT);
+ usb_autopm_put_interface(ccid->intf);
+ if (ret == data.length) {
+ ret = copy_to_user((void __user *)data.data, buf,
+ data.length);
+ if (ret)
+ ret = -EFAULT;
+ } else {
+ if (ret > 0)
+ ret = -EPIPE;
+ }
+ kfree(buf);
+ break;
+ case USB_CCID_ABORT:
+ pr_debug("ABORT ioctl called");
+ breq = CCID_ABORT_REQ;
+ ret = copy_from_user(&abort, (void __user *)arg, sizeof(abort));
+ if (ret) {
+ ret = -EFAULT;
+ break;
+ }
+ ret = usb_autopm_get_interface(ccid->intf);
+ if (ret < 0) {
+ pr_debug("fail to get autopm with %d", ret);
+ break;
+ }
+ ret = usb_control_msg(ccid->udev,
+ usb_sndctrlpipe(ccid->udev, 0),
+ breq, (USB_DIR_OUT | USB_TYPE_CLASS |
+ USB_RECIP_INTERFACE),
+ (abort.seq << 8) | abort.slot, intf, NULL,
+ 0, CCID_CONTROL_TIMEOUT);
+ if (ret < 0)
+ pr_err("abort request failed with err %d\n", ret);
+ usb_autopm_put_interface(ccid->intf);
+ break;
+ case USB_CCID_GET_EVENT:
+ pr_debug("GET_EVENT ioctl called");
+ if (!ccid->events_supported) {
+ ret = -ENOENT;
+ break;
+ }
+ ret = ccid_bridge_get_event(ccid);
+ if (ret == 0) {
+ ret = copy_to_user((void __user *)arg, &ccid->cur_event,
+ sizeof(ccid->cur_event));
+ if (ret)
+ ret = -EFAULT;
+ }
+ ccid->cur_event.event = 0;
+ break;
+ default:
+ pr_err("UNKNOWN ioctl called");
+ ret = -EINVAL;
+ break;
+ }
+
+ mutex_unlock(&ccid->event_mutex);
+ pr_debug("returning %d", ret);
+ return ret;
+}
+
+static int ccid_bridge_release(struct inode *ip, struct file *fp)
+{
+ struct ccid_bridge *ccid = fp->private_data;
+
+ pr_debug("called");
+
+ usb_kill_urb(ccid->writeurb);
+ usb_kill_urb(ccid->readurb);
+ if (ccid->int_pipe)
+ usb_kill_urb(ccid->inturb);
+
+ ccid->event_result = -EIO;
+ wake_up(&ccid->event_wq);
+
+ mutex_lock(&ccid->open_mutex);
+ ccid->opened = false;
+ mutex_unlock(&ccid->open_mutex);
+ return 0;
+}
+
+static const struct file_operations ccid_bridge_fops = {
+ .owner = THIS_MODULE,
+ .open = ccid_bridge_open,
+ .write = ccid_bridge_write,
+ .read = ccid_bridge_read,
+ .unlocked_ioctl = ccid_bridge_ioctl,
+ .release = ccid_bridge_release,
+};
+
+static int ccid_bridge_suspend(struct usb_interface *intf, pm_message_t message)
+{
+ struct ccid_bridge *ccid = usb_get_intfdata(intf);
+ int ret = 0;
+
+ pr_debug("called");
+
+ if (!ccid->opened)
+ goto out;
+
+ mutex_lock(&ccid->event_mutex);
+ if (ccid->int_pipe) {
+ usb_kill_urb(ccid->inturb);
+ if (ccid->event_result != -ENOENT) {
+ ret = -EBUSY;
+ goto rel_mutex;
+ }
+ }
+
+ ccid->is_suspended = true;
+rel_mutex:
+ mutex_unlock(&ccid->event_mutex);
+out:
+ pr_debug("returning %d", ret);
+ return ret;
+}
+
+static int ccid_bridge_resume(struct usb_interface *intf)
+{
+ struct ccid_bridge *ccid = usb_get_intfdata(intf);
+ int ret;
+
+ pr_debug("called");
+
+ if (!ccid->opened)
+ goto out;
+
+ mutex_lock(&ccid->event_mutex);
+
+ ccid->is_suspended = false;
+
+ if (device_can_wakeup(&ccid->udev->dev)) {
+ ccid->event_result = 0;
+ ccid->cur_event.event = USB_CCID_RESUME_EVENT;
+ wake_up(&ccid->event_wq);
+ } else if (ccid->int_pipe) {
+ ccid->event_result = -EINPROGRESS;
+ ret = usb_submit_urb(ccid->inturb, GFP_KERNEL);
+ if (ret < 0)
+ pr_debug("fail to submit inturb with %d\n", ret);
+ }
+
+ mutex_unlock(&ccid->event_mutex);
+out:
+ return 0;
+}
+
+static int
+ccid_bridge_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+ struct ccid_bridge *ccid = __ccid_bridge_dev;
+ struct usb_host_interface *intf_desc;
+ struct usb_endpoint_descriptor *ep_desc;
+ struct usb_host_endpoint *ep;
+ __u8 epin_addr = 0, epout_addr = 0, epint_addr = 0;
+ int i, ret;
+
+ intf_desc = intf->cur_altsetting;
+
+ if (intf_desc->desc.bNumEndpoints > 3)
+ return -ENODEV;
+
+ for (i = 0; i < intf_desc->desc.bNumEndpoints; i++) {
+ ep_desc = &intf_desc->endpoint[i].desc;
+
+ if (usb_endpoint_is_bulk_in(ep_desc))
+ epin_addr = ep_desc->bEndpointAddress;
+ else if (usb_endpoint_is_bulk_out(ep_desc))
+ epout_addr = ep_desc->bEndpointAddress;
+ else if (usb_endpoint_is_int_in(ep_desc))
+ epint_addr = ep_desc->bEndpointAddress;
+ else
+ return -ENODEV;
+ }
+
+ if (!epin_addr || !epout_addr)
+ return -ENODEV;
+
+ ccid->udev = usb_get_dev(interface_to_usbdev(intf));
+ ccid->in_pipe = usb_rcvbulkpipe(ccid->udev, epin_addr);
+ ccid->out_pipe = usb_sndbulkpipe(ccid->udev, epout_addr);
+ if (epint_addr)
+ ccid->int_pipe = usb_rcvbulkpipe(ccid->udev, epint_addr);
+
+ ccid->writeurb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!ccid->writeurb) {
+ pr_err("fail to allocate write urb");
+ ret = -ENOMEM;
+ goto put_udev;
+ }
+ ccid->readurb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!ccid->readurb) {
+ pr_err("fail to allocate read urb");
+ ret = -ENOMEM;
+ goto free_writeurb;
+ }
+
+ if (ccid->int_pipe) {
+ pr_debug("interrupt endpoint is present");
+ ep = usb_pipe_endpoint(ccid->udev, ccid->int_pipe);
+ ccid->inturb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!ccid->inturb) {
+ pr_err("fail to allocate int urb");
+ ret = -ENOMEM;
+ goto free_readurb;
+ }
+ ccid->intbuf = kmalloc(usb_endpoint_maxp(&ep->desc),
+ GFP_KERNEL);
+ if (!ccid->intbuf) {
+ pr_err("fail to allocated int buf");
+ ret = -ENOMEM;
+ goto free_inturb;
+ }
+ usb_fill_int_urb(ccid->inturb, ccid->udev,
+ usb_rcvintpipe(ccid->udev, epint_addr),
+ ccid->intbuf, usb_endpoint_maxp(&ep->desc),
+ ccid_bridge_int_cb, ccid,
+ ep->desc.bInterval);
+ }
+
+ if (ccid->int_pipe || device_can_wakeup(&ccid->udev->dev)) {
+ pr_debug("event support is present");
+ ccid->events_supported = true;
+ }
+
+ usb_set_intfdata(intf, ccid);
+
+ mutex_lock(&ccid->open_mutex);
+ ccid->intf = intf;
+ wake_up(&ccid->open_wq);
+ mutex_unlock(&ccid->open_mutex);
+
+ pr_info("success");
+ return 0;
+
+free_inturb:
+ if (ccid->int_pipe)
+ usb_free_urb(ccid->inturb);
+free_readurb:
+ usb_free_urb(ccid->readurb);
+free_writeurb:
+ usb_free_urb(ccid->writeurb);
+put_udev:
+ usb_put_dev(ccid->udev);
+ return ret;
+}
+
+static void ccid_bridge_disconnect(struct usb_interface *intf)
+{
+ struct ccid_bridge *ccid = usb_get_intfdata(intf);
+
+ pr_debug("called");
+
+ usb_kill_urb(ccid->writeurb);
+ usb_kill_urb(ccid->readurb);
+ if (ccid->int_pipe)
+ usb_kill_urb(ccid->inturb);
+
+ ccid->event_result = -ENODEV;
+ wake_up(&ccid->event_wq);
+
+ /*
+ * This would synchronize any ongoing read/write/ioctl.
+ * After acquiring the mutex, we can safely set
+ * intf to NULL.
+ */
+ mutex_lock(&ccid->open_mutex);
+ mutex_lock(&ccid->write_mutex);
+ mutex_lock(&ccid->read_mutex);
+ mutex_lock(&ccid->event_mutex);
+
+ usb_free_urb(ccid->writeurb);
+ usb_free_urb(ccid->readurb);
+ if (ccid->int_pipe) {
+ usb_free_urb(ccid->inturb);
+ kfree(ccid->intbuf);
+ ccid->int_pipe = 0;
+ }
+
+ ccid->intf = NULL;
+
+ mutex_unlock(&ccid->event_mutex);
+ mutex_unlock(&ccid->read_mutex);
+ mutex_unlock(&ccid->write_mutex);
+ mutex_unlock(&ccid->open_mutex);
+
+}
+
+static const struct usb_device_id ccid_bridge_ids[] = {
+ { USB_INTERFACE_INFO(USB_CLASS_CSCID, 0, 0) },
+
+ {} /* terminating entry */
+};
+MODULE_DEVICE_TABLE(usb, ccid_bridge_ids);
+
+static struct usb_driver ccid_bridge_driver = {
+ .name = "ccid_bridge",
+ .probe = ccid_bridge_probe,
+ .disconnect = ccid_bridge_disconnect,
+ .suspend = ccid_bridge_suspend,
+ .resume = ccid_bridge_resume,
+ .id_table = ccid_bridge_ids,
+ .supports_autosuspend = 1,
+};
+
+static int __init ccid_bridge_init(void)
+{
+ int ret;
+ struct ccid_bridge *ccid;
+
+ ccid = kzalloc(sizeof(*ccid), GFP_KERNEL);
+ if (!ccid) {
+ pr_err("Fail to allocate ccid");
+ ret = -ENOMEM;
+ goto out;
+ }
+ __ccid_bridge_dev = ccid;
+
+ mutex_init(&ccid->open_mutex);
+ mutex_init(&ccid->write_mutex);
+ mutex_init(&ccid->read_mutex);
+ mutex_init(&ccid->event_mutex);
+
+ init_waitqueue_head(&ccid->open_wq);
+ init_waitqueue_head(&ccid->write_wq);
+ init_waitqueue_head(&ccid->read_wq);
+ init_waitqueue_head(&ccid->event_wq);
+
+ ret = usb_register(&ccid_bridge_driver);
+ if (ret < 0) {
+ pr_err("Fail to register ccid usb driver with %d", ret);
+ goto free_ccid;
+ }
+
+ ret = alloc_chrdev_region(&ccid->chrdev, 0, 1, "ccid_bridge");
+ if (ret < 0) {
+ pr_err("Fail to allocate ccid char dev region with %d", ret);
+ goto unreg_driver;
+ }
+ ccid->class = class_create(THIS_MODULE, "ccid_bridge");
+ if (IS_ERR(ccid->class)) {
+ ret = PTR_ERR(ccid->class);
+ pr_err("Fail to create ccid class with %d", ret);
+ goto unreg_chrdev;
+ }
+ cdev_init(&ccid->cdev, &ccid_bridge_fops);
+ ccid->cdev.owner = THIS_MODULE;
+
+ ret = cdev_add(&ccid->cdev, ccid->chrdev, 1);
+ if (ret < 0) {
+ pr_err("Fail to add ccid cdev with %d", ret);
+ goto destroy_class;
+ }
+ ccid->device = device_create(ccid->class,
+ NULL, ccid->chrdev, NULL,
+ "ccid_bridge");
+ if (IS_ERR(ccid->device)) {
+ ret = PTR_ERR(ccid->device);
+ pr_err("Fail to create ccid device with %d", ret);
+ goto del_cdev;
+ }
+
+ pr_info("success");
+
+ return 0;
+
+del_cdev:
+ cdev_del(&ccid->cdev);
+destroy_class:
+ class_destroy(ccid->class);
+unreg_chrdev:
+ unregister_chrdev_region(ccid->chrdev, 1);
+unreg_driver:
+ usb_deregister(&ccid_bridge_driver);
+free_ccid:
+ mutex_destroy(&ccid->open_mutex);
+ mutex_destroy(&ccid->write_mutex);
+ mutex_destroy(&ccid->read_mutex);
+ mutex_destroy(&ccid->event_mutex);
+ kfree(ccid);
+ __ccid_bridge_dev = NULL;
+out:
+ return ret;
+}
+
+static void __exit ccid_bridge_exit(void)
+{
+ struct ccid_bridge *ccid = __ccid_bridge_dev;
+
+ pr_debug("called");
+ device_destroy(ccid->class, ccid->chrdev);
+ cdev_del(&ccid->cdev);
+ class_destroy(ccid->class);
+ unregister_chrdev_region(ccid->chrdev, 1);
+
+ usb_deregister(&ccid_bridge_driver);
+
+ mutex_destroy(&ccid->open_mutex);
+ mutex_destroy(&ccid->write_mutex);
+ mutex_destroy(&ccid->read_mutex);
+ mutex_destroy(&ccid->event_mutex);
+
+ kfree(ccid);
+ __ccid_bridge_dev = NULL;
+}
+
+module_init(ccid_bridge_init);
+module_exit(ccid_bridge_exit);
+
+MODULE_DESCRIPTION("USB CCID bridge driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d97d548..827ac9d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3159,7 +3159,8 @@
for (i = 0; i < GET_DESCRIPTOR_TRIES; (++i, msleep(100))) {
if (USE_NEW_SCHEME(retry_counter) &&
!(hcd->driver->flags & HCD_USB3) &&
- !(hcd->driver->flags & HCD_OLD_ENUM)) {
+ !((hcd->driver->flags & HCD_RT_OLD_ENUM) &&
+ !hdev->parent)) {
struct usb_device_descriptor *buf;
int r = 0;
@@ -3261,7 +3262,8 @@
msleep(10);
if (USE_NEW_SCHEME(retry_counter) &&
!(hcd->driver->flags & HCD_USB3) &&
- !(hcd->driver->flags & HCD_OLD_ENUM))
+ !((hcd->driver->flags & HCD_RT_OLD_ENUM) &&
+ !hdev->parent))
break;
}
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 1be2550..4e84b94 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -631,6 +631,7 @@
u8 epnum;
struct dwc3_trb *trb;
+ struct dwc3_trb *ztrb;
dma_addr_t trb_dma;
unsigned direction:1;
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index ad3a3a9..7439c45 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -294,6 +294,15 @@
if (((dep->busy_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
dep->busy_slot++;
+
+ if (req->request.zero && req->ztrb) {
+ dep->busy_slot++;
+ req->ztrb = NULL;
+ if (((dep->busy_slot & DWC3_TRB_MASK) ==
+ DWC3_TRB_NUM - 1) &&
+ usb_endpoint_xfer_isoc(dep->endpoint.desc))
+ dep->busy_slot++;
+ }
}
list_del(&req->list);
req->trb = NULL;
@@ -864,6 +873,7 @@
req->trb_dma = dwc3_trb_dma_offset(dep, trb);
}
+update_trb:
trb->size = DWC3_TRB_SIZE_LENGTH(length);
trb->bpl = lower_32_bits(dma);
trb->bph = upper_32_bits(dma);
@@ -898,15 +908,31 @@
} else {
if (chain)
trb->ctrl |= DWC3_TRB_CTRL_CHN;
-
- if (last)
- trb->ctrl |= DWC3_TRB_CTRL_LST;
}
if (usb_endpoint_xfer_bulk(dep->endpoint.desc) && dep->stream_capable)
trb->ctrl |= DWC3_TRB_CTRL_SID_SOFN(req->request.stream_id);
trb->ctrl |= DWC3_TRB_CTRL_HWO;
+
+ if (req->request.zero && length &&
+ (length % usb_endpoint_maxp(dep->endpoint.desc) == 0)) {
+ trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
+ dep->free_slot++;
+
+ /* Skip the LINK-TRB on ISOC */
+ if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
+ usb_endpoint_xfer_isoc(dep->endpoint.desc))
+ dep->free_slot++;
+
+ req->ztrb = trb;
+ length = 0;
+
+ goto update_trb;
+ }
+
+ if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) && last)
+ trb->ctrl |= DWC3_TRB_CTRL_LST;
}
/*
@@ -1007,12 +1033,25 @@
}
dbg_queue(dep->number, &req->request, 0);
} else {
+ struct dwc3_request *req1;
+ int maxpkt_size = usb_endpoint_maxp(dep->endpoint.desc);
+
dma = req->request.dma;
length = req->request.length;
trbs_left--;
- if (!trbs_left)
+ if (req->request.zero && length &&
+ (length % maxpkt_size == 0))
+ trbs_left--;
+
+ if (!trbs_left) {
last_one = 1;
+ } else if (dep->direction && (trbs_left <= 1)) {
+ req1 = next_request(&req->list);
+ if (req1->request.zero && req1->request.length
+ && (req1->request.length % maxpkt_size == 0))
+ last_one = 1;
+ }
/* Is this the last request? */
if (list_is_last(&req->list, &dep->request_list))
@@ -2052,6 +2091,8 @@
s_pkt = 1;
}
+ if (req->ztrb)
+ trb = req->ztrb;
/*
* We assume here we will always receive the entire data block
* which we should receive. Meaning, if we program RX to
diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c
index 6d7dd3d..88ebd80 100644
--- a/drivers/usb/gadget/f_mtp.c
+++ b/drivers/usb/gadget/f_mtp.c
@@ -899,7 +899,10 @@
dev->rx_done || dev->state != STATE_BUSY);
if (dev->state == STATE_CANCELED
|| dev->state == STATE_OFFLINE) {
- r = -ECANCELED;
+ if (dev->state == STATE_OFFLINE)
+ r = -EIO;
+ else
+ r = -ECANCELED;
if (!dev->rx_done)
usb_ep_dequeue(dev->ep_out, read_req);
break;
diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c
index e8c9667..883c5fa 100644
--- a/drivers/usb/gadget/f_uac1.c
+++ b/drivers/usb/gadget/f_uac1.c
@@ -1,7 +1,7 @@
/*
* f_audio.c -- USB Audio class function driver
*
- * Copyright (c) 2012, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
* Copyright (C) 2008 Bryan Wu <cooloney@kernel.org>
* Copyright (C) 2008 Analog Devices, Inc
*
@@ -438,8 +438,8 @@
{
if (audio_buf) {
kfree(audio_buf->buf);
- kfree(audio_buf);
audio_buf->buf = NULL;
+ kfree(audio_buf);
audio_buf = NULL;
}
}
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index 299f620c..95b6fbc7 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -689,18 +689,20 @@
}
static int gs_alloc_requests(struct usb_ep *ep, struct list_head *head,
- int num, int size, void (*fn)(struct usb_ep *, struct usb_request *),
+ int queue_size, int req_size,
+ void (*fn)(struct usb_ep *, struct usb_request *),
int *allocated)
{
int i;
struct usb_request *req;
+ int n = allocated ? queue_size - *allocated : queue_size;
/* Pre-allocate up to QUEUE_SIZE transfers, but if we can't
* do quite that many this time, don't fail ... we just won't
* be as speedy as we might otherwise be.
*/
- for (i = 0; i < num; i++) {
- req = gs_alloc_req(ep, size, GFP_ATOMIC);
+ for (i = 0; i < n; i++) {
+ req = gs_alloc_req(ep, req_size, GFP_ATOMIC);
if (!req)
return list_empty(head) ? -ENOMEM : 0;
req->complete = fn;
@@ -941,22 +943,6 @@
port->port_num, tty, file);
wake_up_interruptible(&port->close_wait);
-
- /*
- * Freeing the previously queued requests as they are
- * allocated again as a part of gs_open()
- */
- if (port->port_usb) {
- spin_unlock_irq(&port->port_lock);
- usb_ep_fifo_flush(gser->out);
- usb_ep_fifo_flush(gser->in);
- spin_lock_irq(&port->port_lock);
- gs_free_requests(gser->out, &port->read_queue, NULL);
- gs_free_requests(gser->out, &port->read_pool, NULL);
- gs_free_requests(gser->in, &port->write_pool, NULL);
- }
- port->read_allocated = port->read_started =
- port->write_allocated = port->write_started = 0;
exit:
spin_unlock_irq(&port->port_lock);
}
diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c
index 5f20ad1..a89ac06 100644
--- a/drivers/usb/host/ehci-msm-hsic.c
+++ b/drivers/usb/host/ehci-msm-hsic.c
@@ -1,6 +1,6 @@
/* ehci-msm-hsic.c - HSUSB Host Controller Driver Implementation
*
- * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
*
* Partly derived from ehci-fsl.c and ehci-hcd.c
* Copyright (c) 2000-2004 by David Brownell
@@ -1486,7 +1486,7 @@
* generic hardware linkage
*/
.irq = msm_hsic_irq,
- .flags = HCD_USB2 | HCD_MEMORY | HCD_OLD_ENUM,
+ .flags = HCD_USB2 | HCD_MEMORY | HCD_RT_OLD_ENUM,
.reset = ehci_hsic_reset,
.start = ehci_run,
@@ -2263,6 +2263,9 @@
iounmap(hcd->regs);
usb_put_hcd(hcd);
+ if (pdev->dev.of_node)
+ pdev->dev.platform_data = NULL;
+
return 0;
}
diff --git a/drivers/video/msm/mdss/dsi_host_v2.c b/drivers/video/msm/mdss/dsi_host_v2.c
index 25ee3e4..53b6fc6 100644
--- a/drivers/video/msm/mdss/dsi_host_v2.c
+++ b/drivers/video/msm/mdss/dsi_host_v2.c
@@ -959,11 +959,17 @@
msm_dsi_clk_ctrl(&ctrl->panel_data, 1);
+ if (0 == (req->flags & CMD_REQ_LP_MODE))
+ dsi_set_tx_power_mode(0);
+
if (req->flags & CMD_REQ_RX)
msm_dsi_cmdlist_rx(ctrl, req);
else
msm_dsi_cmdlist_tx(ctrl, req);
+ if (0 == (req->flags & CMD_REQ_LP_MODE))
+ dsi_set_tx_power_mode(1);
+
msm_dsi_clk_ctrl(&ctrl->panel_data, 0);
mutex_unlock(&ctrl->cmd_mutex);
diff --git a/drivers/video/msm/mdss/mdp3.h b/drivers/video/msm/mdss/mdp3.h
index 28997ec..f1f0455 100644
--- a/drivers/video/msm/mdss/mdp3.h
+++ b/drivers/video/msm/mdss/mdp3.h
@@ -26,6 +26,7 @@
#include "mdss_fb.h"
#define MDP_VSYNC_CLK_RATE 19200000
+#define KOFF_TIMEOUT msecs_to_jiffies(84)
enum {
MDP3_CLK_AHB,
diff --git a/drivers/video/msm/mdss/mdp3_ctrl.c b/drivers/video/msm/mdss/mdp3_ctrl.c
index a6fc20d..b204493 100644
--- a/drivers/video/msm/mdss/mdp3_ctrl.c
+++ b/drivers/video/msm/mdss/mdp3_ctrl.c
@@ -28,7 +28,10 @@
#define MDP_CORE_CLK_RATE 100000000
#define VSYNC_EXPIRE_TICK 4
-static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd);
+static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd,
+ struct mdp_overlay *req,
+ int image_size,
+ int *pipe_ndx);
static int mdp3_overlay_unset(struct msm_fb_data_type *mfd, int ndx);
static int mdp3_histogram_stop(struct mdp3_session_data *session,
u32 block);
@@ -91,6 +94,36 @@
return bufq->count;
}
+void mdp3_ctrl_notifier_register(struct mdp3_session_data *ses,
+ struct notifier_block *notifier)
+{
+ blocking_notifier_chain_register(&ses->notifier_head, notifier);
+}
+
+void mdp3_ctrl_notifier_unregister(struct mdp3_session_data *ses,
+ struct notifier_block *notifier)
+{
+ blocking_notifier_chain_unregister(&ses->notifier_head, notifier);
+}
+
+int mdp3_ctrl_notify(struct mdp3_session_data *ses, int event)
+{
+ return blocking_notifier_call_chain(&ses->notifier_head, event, ses);
+}
+
+static void mdp3_dispatch_dma_done(struct work_struct *work)
+{
+ struct mdp3_session_data *session;
+
+ pr_debug("%s\n", __func__);
+ session = container_of(work, struct mdp3_session_data,
+ dma_done_work);
+ if (!session)
+ return;
+
+ mdp3_ctrl_notify(session, MDP_NOTIFY_FRAME_DONE);
+}
+
static void mdp3_dispatch_clk_off(struct work_struct *work)
{
struct mdp3_session_data *session;
@@ -121,6 +154,12 @@
sysfs_notify_dirent(session->vsync_event_sd);
}
+void dma_done_notify_handler(void *arg)
+{
+ struct mdp3_session_data *session = (struct mdp3_session_data *)arg;
+ schedule_work(&session->dma_done_work);
+}
+
void vsync_count_down(void *arg)
{
struct mdp3_session_data *session = (struct mdp3_session_data *)arg;
@@ -140,8 +179,8 @@
static int mdp3_ctrl_vsync_enable(struct msm_fb_data_type *mfd, int enable)
{
struct mdp3_session_data *mdp3_session;
- struct mdp3_vsync_notification vsync_client;
- struct mdp3_vsync_notification *arg = NULL;
+ struct mdp3_notification vsync_client;
+ struct mdp3_notification *arg = NULL;
pr_debug("mdp3_ctrl_vsync_enable =%d\n", enable);
mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
@@ -178,7 +217,8 @@
* active or when dsi clocks are currently off
*/
if (enable && mdp3_session->status == 1
- && mdp3_session->vsync_before_commit) {
+ && (mdp3_session->vsync_before_commit ||
+ !mdp3_session->intf->active)) {
mod_timer(&mdp3_session->vsync_timer,
jiffies + msecs_to_jiffies(mdp3_session->vsync_period));
} else if (enable && !mdp3_session->clk_on) {
@@ -194,7 +234,8 @@
void mdp3_vsync_timer_func(unsigned long arg)
{
struct mdp3_session_data *session = (struct mdp3_session_data *)arg;
- if (session->status == 1 && session->vsync_before_commit) {
+ if (session->status == 1 && (session->vsync_before_commit ||
+ !session->intf->active)) {
pr_debug("mdp3_vsync_timer_func trigger\n");
vsync_notify_handler(session);
mod_timer(&session->vsync_timer,
@@ -366,10 +407,10 @@
return type;
}
-static int mdp3_ctrl_get_source_format(struct msm_fb_data_type *mfd)
+static int mdp3_ctrl_get_source_format(u32 imgType)
{
int format;
- switch (mfd->fb_imgType) {
+ switch (imgType) {
case MDP_RGB_565:
format = MDP3_DMA_IBUF_FORMAT_RGB565;
break;
@@ -464,6 +505,7 @@
int frame_rate = mfd->panel_info->mipi.frame_rate;
int vbp, vfp, vspw;
int vtotal, vporch;
+ struct mdp3_notification dma_done_callback;
vbp = panel_info->lcdc.v_back_porch;
vfp = panel_info->lcdc.v_front_porch;
@@ -474,7 +516,7 @@
fix = &fbi->fix;
var = &fbi->var;
- sourceConfig.format = mdp3_ctrl_get_source_format(mfd);
+ sourceConfig.format = mdp3_ctrl_get_source_format(mfd->fb_imgType);
sourceConfig.width = panel_info->xres;
sourceConfig.height = panel_info->yres;
sourceConfig.x = 0;
@@ -499,6 +541,13 @@
rc = dma->dma_config(dma, &sourceConfig, &outputConfig);
else
rc = -EINVAL;
+
+ if (outputConfig.out_sel == MDP3_DMA_OUTPUT_SEL_DSI_CMD) {
+ dma_done_callback.handler = dma_done_notify_handler;
+ dma_done_callback.arg = mfd->mdp.private1;
+ dma->dma_done_notifier(dma, &dma_done_callback);
+ }
+
return rc;
}
@@ -527,6 +576,8 @@
}
mdp3_batfet_ctrl(true);
+ mdp3_ctrl_notifier_register(mdp3_session,
+ &mdp3_session->mfd->mdp_sync_pt_data.notifier);
rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
if (rc) {
@@ -658,6 +709,8 @@
if (rc)
pr_err("fail to dettach MDP DMA SMMU\n");
+ mdp3_ctrl_notifier_unregister(mdp3_session,
+ &mdp3_session->mfd->mdp_sync_pt_data.notifier);
mdp3_batfet_ctrl(false);
mdp3_session->vsync_enabled = 0;
atomic_set(&mdp3_session->vsync_countdown, 0);
@@ -677,7 +730,7 @@
struct mdp3_session_data *mdp3_session;
struct mdp3_dma *mdp3_dma;
struct mdss_panel_data *panel;
- struct mdp3_vsync_notification vsync_client;
+ struct mdp3_notification vsync_client;
pr_debug("mdp3_ctrl_reset_cmd\n");
mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
@@ -727,7 +780,7 @@
struct mdp3_session_data *mdp3_session;
struct mdp3_dma *mdp3_dma;
struct mdss_panel_data *panel;
- struct mdp3_vsync_notification vsync_client;
+ struct mdp3_notification vsync_client;
pr_debug("mdp3_ctrl_reset\n");
mdp3_session = (struct mdp3_session_data *)mfd->mdp.private1;
@@ -835,14 +888,15 @@
{
int rc = 0;
struct mdp3_session_data *mdp3_session = mfd->mdp.private1;
- struct fb_var_screeninfo *var;
+ struct mdp3_dma *dma = mdp3_session->dma;
struct fb_fix_screeninfo *fix;
struct fb_info *fbi = mfd->fbi;
int stride;
+ int format;
fix = &fbi->fix;
- var = &fbi->var;
- stride = req->src.width * var->bits_per_pixel/8;
+ stride = req->src.width * ppp_bpp(req->src.format);
+ format = mdp3_ctrl_get_source_format(req->src.format);
mutex_lock(&mdp3_session->lock);
@@ -851,9 +905,18 @@
mdp3_session->overlay = *req;
if (req->id == MSMFB_NEW_REQUEST) {
- if (fix->line_length != stride)
- mdp3_session->dma->config_stride(
- mdp3_session->dma, stride);
+ if (dma->source_config.stride != stride ||
+ dma->source_config.width != req->src.width ||
+ dma->source_config.height != req->src.height ||
+ dma->source_config.format != format) {
+ dma->source_config.width = req->src.width;
+ dma->source_config.height = req->src.height,
+ dma->source_config.format = format;
+ dma->source_config.stride = stride;
+ mdp3_clk_enable(1, 0);
+ mdp3_session->dma->dma_config_source(dma);
+ mdp3_clk_enable(0, 0);
+ }
mdp3_session->overlay.id = 1;
req->id = 1;
}
@@ -869,13 +932,22 @@
struct mdp3_session_data *mdp3_session = mfd->mdp.private1;
struct fb_info *fbi = mfd->fbi;
struct fb_fix_screeninfo *fix;
+ struct mdss_panel_info *panel_info = mfd->panel_info;
+ int format;
fix = &fbi->fix;
+ format = mdp3_ctrl_get_source_format(mfd->fb_imgType);
mutex_lock(&mdp3_session->lock);
if (mdp3_session->overlay.id == ndx && ndx == 1) {
- mdp3_session->dma->config_stride(mdp3_session->dma,
- fix->line_length);
+ struct mdp3_dma *dma = mdp3_session->dma;
+ dma->source_config.width = panel_info->xres,
+ dma->source_config.height = panel_info->yres,
+ dma->source_config.format = format;
+ dma->source_config.stride = fix->line_length;
+ mdp3_clk_enable(1, 0);
+ mdp3_session->dma->dma_config_source(dma);
+ mdp3_clk_enable(0, 0);
mdp3_session->overlay.id = MSMFB_NEW_REQUEST;
mdp3_bufq_deinit(&mdp3_session->bufq_in);
} else {
@@ -969,13 +1041,27 @@
return -EPERM;
}
+ mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_BEGIN);
data = mdp3_bufq_pop(&mdp3_session->bufq_in);
if (data) {
mdp3_ctrl_reset_countdown(mdp3_session, mfd);
mdp3_ctrl_clk_enable(mfd, 1);
- mdp3_session->dma->update(mdp3_session->dma,
+ rc = mdp3_session->dma->update(mdp3_session->dma,
(void *)data->addr,
mdp3_session->intf);
+ /* This is for the previous frame */
+ if (rc < 0) {
+ mdp3_ctrl_notify(mdp3_session,
+ MDP_NOTIFY_FRAME_TIMEOUT);
+ } else {
+ if (mdp3_ctrl_get_intf_type(mfd) ==
+ MDP3_DMA_OUTPUT_SEL_DSI_VIDEO) {
+ mdp3_ctrl_notify(mdp3_session,
+ MDP_NOTIFY_FRAME_DONE);
+ }
+ }
+
+ mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_FLUSHED);
mdp3_bufq_push(&mdp3_session->bufq_out, data);
}
@@ -998,16 +1084,20 @@
mdss_fb_update_notify_update(mfd);
- return rc;
+ return 0;
}
-static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
+static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd,
+ struct mdp_overlay *req,
+ int image_size,
+ int *pipe_ndx)
{
struct fb_info *fbi;
struct mdp3_session_data *mdp3_session;
u32 offset;
int bpp;
struct mdss_panel_info *panel_info = mfd->panel_info;
+ int rc;
pr_debug("mdp3_ctrl_pan_display\n");
if (!mfd || !mfd->mdp.private1)
@@ -1044,10 +1134,23 @@
if (mfd->fbi->screen_base) {
mdp3_ctrl_reset_countdown(mdp3_session, mfd);
+ mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_BEGIN);
mdp3_ctrl_clk_enable(mfd, 1);
- mdp3_session->dma->update(mdp3_session->dma,
- (void *)mfd->iova + offset,
+ rc = mdp3_session->dma->update(mdp3_session->dma,
+ (void *)(mfd->iova + offset),
mdp3_session->intf);
+ /* This is for the previous frame */
+ if (rc < 0) {
+ mdp3_ctrl_notify(mdp3_session,
+ MDP_NOTIFY_FRAME_TIMEOUT);
+ } else {
+ if (mdp3_ctrl_get_intf_type(mfd) ==
+ MDP3_DMA_OUTPUT_SEL_DSI_VIDEO) {
+ mdp3_ctrl_notify(mdp3_session,
+ MDP_NOTIFY_FRAME_DONE);
+ }
+ }
+ mdp3_ctrl_notify(mdp3_session, MDP_NOTIFY_FRAME_FLUSHED);
} else {
pr_debug("mdp3_ctrl_pan_display no memory, stop interface");
mdp3_clk_enable(1, 0);
@@ -1539,7 +1642,8 @@
req = &mdp3_session->req_overlay;
- if (!mdp3_session->status && cmd != MSMFB_METADATA_GET) {
+ if (!mdp3_session->status && cmd != MSMFB_METADATA_GET &&
+ cmd != MSMFB_HISTOGRAM_STOP) {
pr_err("mdp3_ctrl_ioctl_handler, display off!\n");
return -EPERM;
}
@@ -1658,6 +1762,7 @@
memset(mdp3_session, 0, sizeof(struct mdp3_session_data));
mutex_init(&mdp3_session->lock);
INIT_WORK(&mdp3_session->clk_off_work, mdp3_dispatch_clk_off);
+ INIT_WORK(&mdp3_session->dma_done_work, mdp3_dispatch_dma_done);
atomic_set(&mdp3_session->vsync_countdown, 0);
mutex_init(&mdp3_session->histo_lock);
mdp3_session->dma = mdp3_get_dma_pipe(MDP3_DMA_CAP_ALL);
@@ -1693,6 +1798,7 @@
mdp3_bufq_init(&mdp3_session->bufq_out);
mdp3_session->histo_status = 0;
mdp3_session->lut_sel = 0;
+ BLOCKING_INIT_NOTIFIER_HEAD(&mdp3_session->notifier_head);
init_timer(&mdp3_session->vsync_timer);
mdp3_session->vsync_timer.function = mdp3_vsync_timer_func;
@@ -1721,8 +1827,11 @@
kobject_uevent(&dev->kobj, KOBJ_ADD);
pr_debug("vsync kobject_uevent(KOBJ_ADD)\n");
- if (mdp3_get_cont_spash_en())
+ if (mdp3_get_cont_spash_en()) {
mdp3_session->clk_on = 1;
+ mdp3_ctrl_notifier_register(mdp3_session,
+ &mdp3_session->mfd->mdp_sync_pt_data.notifier);
+ }
if (splash_mismatch) {
pr_err("splash memory mismatch, stop splash\n");
diff --git a/drivers/video/msm/mdss/mdp3_ctrl.h b/drivers/video/msm/mdss/mdp3_ctrl.h
index f2484ef..cfad1d3 100644
--- a/drivers/video/msm/mdss/mdp3_ctrl.h
+++ b/drivers/video/msm/mdss/mdp3_ctrl.h
@@ -49,6 +49,7 @@
struct mdp3_buffer_queue bufq_in;
struct mdp3_buffer_queue bufq_out;
struct work_struct clk_off_work;
+ struct work_struct dma_done_work;
int histo_status;
struct mutex histo_lock;
int lut_sel;
@@ -56,6 +57,7 @@
bool vsync_before_commit;
bool first_commit;
int clk_on;
+ struct blocking_notifier_head notifier_head;
int vsync_enabled;
atomic_t vsync_countdown; /* Used to count down */
diff --git a/drivers/video/msm/mdss/mdp3_dma.c b/drivers/video/msm/mdss/mdp3_dma.c
index ae7598f..36d5cf1 100644
--- a/drivers/video/msm/mdss/mdp3_dma.c
+++ b/drivers/video/msm/mdss/mdp3_dma.c
@@ -27,7 +27,7 @@
static void mdp3_vsync_intr_handler(int type, void *arg)
{
struct mdp3_dma *dma = (struct mdp3_dma *)arg;
- struct mdp3_vsync_notification vsync_client;
+ struct mdp3_notification vsync_client;
unsigned int wait_for_next_vs;
pr_debug("mdp3_vsync_intr_handler\n");
@@ -49,10 +49,16 @@
static void mdp3_dma_done_intr_handler(int type, void *arg)
{
struct mdp3_dma *dma = (struct mdp3_dma *)arg;
+ struct mdp3_notification dma_client;
pr_debug("mdp3_dma_done_intr_handler\n");
+ spin_lock(&dma->dma_lock);
+ dma_client = dma->dma_notifier_client;
complete(&dma->dma_comp);
+ spin_unlock(&dma->dma_lock);
mdp3_irq_disable_nosync(type);
+ if (dma_client.handler)
+ dma_client.handler(dma_client.arg);
}
static void mdp3_hist_done_intr_handler(int type, void *arg)
@@ -195,7 +201,7 @@
}
static void mdp3_dma_vsync_enable(struct mdp3_dma *dma,
- struct mdp3_vsync_notification *vsync_client)
+ struct mdp3_notification *vsync_client)
{
unsigned long flag;
int updated = 0;
@@ -226,6 +232,21 @@
}
}
+static void mdp3_dma_done_notifier(struct mdp3_dma *dma,
+ struct mdp3_notification *dma_client)
+{
+ unsigned long flag;
+
+ spin_lock_irqsave(&dma->dma_lock, flag);
+ if (dma_client) {
+ dma->dma_notifier_client = *dma_client;
+ } else {
+ dma->dma_notifier_client.handler = NULL;
+ dma->dma_notifier_client.arg = NULL;
+ }
+ spin_unlock_irqrestore(&dma->dma_lock, flag);
+}
+
static void mdp3_dma_clk_auto_gating(struct mdp3_dma *dma, int enable)
{
u32 cgc;
@@ -274,23 +295,6 @@
return 0;
}
-static void mdp3_dma_stride_config(struct mdp3_dma *dma, int stride)
-{
- struct mdp3_dma_source *source_config;
- u32 dma_stride_offset;
-
- if (dma->dma_sel == MDP3_DMA_P)
- dma_stride_offset = MDP3_REG_DMA_P_IBUF_Y_STRIDE;
- else
- dma_stride_offset = MDP3_REG_DMA_S_IBUF_Y_STRIDE;
-
- source_config = &dma->source_config;
- source_config->stride = stride;
- pr_debug("%s: Update the fb stride for DMA to %d", __func__,
- (u32)source_config->stride);
- MDP3_REG_WRITE(dma_stride_offset, source_config->stride);
-}
-
static int mdp3_dmap_config(struct mdp3_dma *dma,
struct mdp3_dma_source *source_config,
struct mdp3_dma_output_config *output_config)
@@ -327,6 +331,22 @@
return 0;
}
+static void mdp3_dmap_config_source(struct mdp3_dma *dma)
+{
+ struct mdp3_dma_source *source_config = &dma->source_config;
+ u32 dma_p_cfg_reg, dma_p_size;
+
+ dma_p_cfg_reg = MDP3_REG_READ(MDP3_REG_DMA_P_CONFIG);
+ dma_p_cfg_reg &= ~MDP3_DMA_IBUF_FORMAT_MASK;
+ dma_p_cfg_reg |= source_config->format << 25;
+
+ dma_p_size = source_config->width | (source_config->height << 16);
+
+ MDP3_REG_WRITE(MDP3_REG_DMA_P_CONFIG, dma_p_cfg_reg);
+ MDP3_REG_WRITE(MDP3_REG_DMA_P_SIZE, dma_p_size);
+ MDP3_REG_WRITE(MDP3_REG_DMA_P_IBUF_Y_STRIDE, source_config->stride);
+}
+
static int mdp3_dmas_config(struct mdp3_dma *dma,
struct mdp3_dma_source *source_config,
struct mdp3_dma_output_config *output_config)
@@ -362,6 +382,22 @@
return 0;
}
+static void mdp3_dmas_config_source(struct mdp3_dma *dma)
+{
+ struct mdp3_dma_source *source_config = &dma->source_config;
+ u32 dma_s_cfg_reg, dma_s_size;
+
+ dma_s_cfg_reg = MDP3_REG_READ(MDP3_REG_DMA_S_CONFIG);
+ dma_s_cfg_reg &= ~MDP3_DMA_IBUF_FORMAT_MASK;
+ dma_s_cfg_reg |= source_config->format << 25;
+
+ dma_s_size = source_config->width | (source_config->height << 16);
+
+ MDP3_REG_WRITE(MDP3_REG_DMA_S_CONFIG, dma_s_cfg_reg);
+ MDP3_REG_WRITE(MDP3_REG_DMA_S_SIZE, dma_s_size);
+ MDP3_REG_WRITE(MDP3_REG_DMA_S_IBUF_Y_STRIDE, source_config->stride);
+}
+
static int mdp3_dmap_cursor_config(struct mdp3_dma *dma,
struct mdp3_dma_cursor *cursor)
{
@@ -552,13 +588,20 @@
{
unsigned long flag;
int cb_type = MDP3_DMA_CALLBACK_TYPE_VSYNC;
+ int rc = 0;
pr_debug("mdp3_dmap_update\n");
if (dma->output_config.out_sel == MDP3_DMA_OUTPUT_SEL_DSI_CMD) {
cb_type = MDP3_DMA_CALLBACK_TYPE_DMA_DONE;
- if (intf->active)
- wait_for_completion_killable(&dma->dma_comp);
+ if (intf->active) {
+ rc = wait_for_completion_timeout(&dma->dma_comp,
+ KOFF_TIMEOUT);
+ if (rc <= 0) {
+ WARN(1, "cmd kickoff timed out (%d)\n", rc);
+ rc = -1;
+ }
+ }
}
spin_lock_irqsave(&dma->dma_lock, flag);
MDP3_REG_WRITE(MDP3_REG_DMA_P_IBUF_ADDR, (u32)buf);
@@ -581,10 +624,14 @@
mdp3_dma_callback_enable(dma, cb_type);
pr_debug("mdp3_dmap_update wait for vsync_comp in\n");
- if (dma->output_config.out_sel == MDP3_DMA_OUTPUT_SEL_DSI_VIDEO)
- wait_for_completion_killable(&dma->vsync_comp);
+ if (dma->output_config.out_sel == MDP3_DMA_OUTPUT_SEL_DSI_VIDEO) {
+ rc = wait_for_completion_timeout(&dma->vsync_comp,
+ KOFF_TIMEOUT);
+ if (rc <= 0)
+ rc = -1;
+ }
pr_debug("mdp3_dmap_update wait for vsync_comp out\n");
- return 0;
+ return rc;
}
static int mdp3_dmas_update(struct mdp3_dma *dma, void *buf,
@@ -869,6 +916,7 @@
switch (dma->dma_sel) {
case MDP3_DMA_P:
dma->dma_config = mdp3_dmap_config;
+ dma->dma_config_source = mdp3_dmap_config_source;
dma->config_cursor = mdp3_dmap_cursor_config;
dma->config_ccs = mdp3_dmap_ccs_config;
dma->config_histo = mdp3_dmap_histo_config;
@@ -878,12 +926,13 @@
dma->get_histo = mdp3_dmap_histo_get;
dma->histo_op = mdp3_dmap_histo_op;
dma->vsync_enable = mdp3_dma_vsync_enable;
+ dma->dma_done_notifier = mdp3_dma_done_notifier;
dma->start = mdp3_dma_start;
dma->stop = mdp3_dma_stop;
- dma->config_stride = mdp3_dma_stride_config;
break;
case MDP3_DMA_S:
dma->dma_config = mdp3_dmas_config;
+ dma->dma_config_source = mdp3_dmas_config_source;
dma->config_cursor = NULL;
dma->config_ccs = NULL;
dma->config_histo = NULL;
@@ -895,7 +944,6 @@
dma->vsync_enable = mdp3_dma_vsync_enable;
dma->start = mdp3_dma_start;
dma->stop = mdp3_dma_stop;
- dma->config_stride = mdp3_dma_stride_config;
break;
case MDP3_DMA_E:
default:
diff --git a/drivers/video/msm/mdss/mdp3_dma.h b/drivers/video/msm/mdss/mdp3_dma.h
index 6ad4c79..207168f 100644
--- a/drivers/video/msm/mdss/mdp3_dma.h
+++ b/drivers/video/msm/mdss/mdp3_dma.h
@@ -14,6 +14,7 @@
#ifndef MDP3_DMA_H
#define MDP3_DMA_H
+#include <linux/notifier.h>
#include <linux/sched.h>
#define MDP_HISTOGRAM_BL_SCALE_MAX 1024
@@ -227,7 +228,7 @@
u32 extra[2];
};
-struct mdp3_vsync_notification {
+struct mdp3_notification {
void (*handler)(void *arg);
void *arg;
};
@@ -245,7 +246,8 @@
struct completion vsync_comp;
struct completion dma_comp;
struct completion histo_comp;
- struct mdp3_vsync_notification vsync_client;
+ struct mdp3_notification vsync_client;
+ struct mdp3_notification dma_notifier_client;
struct mdp3_dma_output_config output_config;
struct mdp3_dma_source source_config;
@@ -262,6 +264,8 @@
struct mdp3_dma_source *source_config,
struct mdp3_dma_output_config *output_config);
+ void (*dma_config_source)(struct mdp3_dma *dma);
+
int (*start)(struct mdp3_dma *dma, struct mdp3_intf *intf);
int (*stop)(struct mdp3_dma *dma, struct mdp3_intf *intf);
@@ -288,10 +292,11 @@
int (*histo_op)(struct mdp3_dma *dma, u32 op);
- void (*config_stride)(struct mdp3_dma *dma, int stride);
-
void (*vsync_enable)(struct mdp3_dma *dma,
- struct mdp3_vsync_notification *vsync_client);
+ struct mdp3_notification *vsync_client);
+
+ void (*dma_done_notifier)(struct mdp3_dma *dma,
+ struct mdp3_notification *dma_client);
};
struct mdp3_video_intf_cfg {
diff --git a/drivers/video/msm/mdss/mdp3_hwio.h b/drivers/video/msm/mdss/mdp3_hwio.h
index b457c10..5205b42 100644
--- a/drivers/video/msm/mdss/mdp3_hwio.h
+++ b/drivers/video/msm/mdss/mdp3_hwio.h
@@ -118,6 +118,9 @@
#define MDP3_REG_DMA_S_IBUF_Y_STRIDE 0xA000C
#define MDP3_REG_DMA_S_OUT_XY 0xA0010
+/*DMA MASK*/
+#define MDP3_DMA_IBUF_FORMAT_MASK 0x06000000
+
/*MISR*/
#define MDP3_REG_MODE_CLK 0x000D0000
#define MDP3_REG_MISR_RESET_CLK 0x000D0004
diff --git a/drivers/video/msm/mdss/mdp3_ppp.c b/drivers/video/msm/mdss/mdp3_ppp.c
index d778af8..71cbbe4 100644
--- a/drivers/video/msm/mdss/mdp3_ppp.c
+++ b/drivers/video/msm/mdss/mdp3_ppp.c
@@ -283,7 +283,7 @@
spin_unlock_irqrestore(&ppp_stat->ppp_lock, flag);
if (wait) {
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&ppp_stat->ppp_comp, 5 * HZ);
if (!ret)
pr_err("%s: Timed out waiting for the MDP.\n",
@@ -1099,7 +1099,7 @@
while (req_q->count >= MDP3_PPP_MAX_LIST_REQ) {
ppp_stat->wait_for_pop = true;
mutex_unlock(&ppp_stat->req_mutex);
- rc = wait_for_completion_interruptible_timeout(
+ rc = wait_for_completion_timeout(
&ppp_stat->pop_q_comp, 5 * HZ);
if (rc == 0) {
/* This will only occur if there is serious problem */
diff --git a/drivers/video/msm/mdss/mdss_dsi.h b/drivers/video/msm/mdss/mdss_dsi.h
index 855ec6c..b89a935 100644
--- a/drivers/video/msm/mdss/mdss_dsi.h
+++ b/drivers/video/msm/mdss/mdss_dsi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -330,7 +330,8 @@
void mdss_dsi_phy_enable(struct mdss_dsi_ctrl_pdata *ctrl, int on);
void mdss_dsi_phy_init(struct mdss_panel_data *pdata);
void mdss_dsi_phy_sw_reset(unsigned char *ctrl_base);
-void mdss_dsi_cmd_test_pattern(struct mdss_panel_data *pdata);
+void mdss_dsi_cmd_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl);
+void mdss_dsi_video_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_panel_pwm_cfg(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_ctrl_init(struct mdss_dsi_ctrl_pdata *ctrl);
diff --git a/drivers/video/msm/mdss/mdss_dsi_cmd.h b/drivers/video/msm/mdss/mdss_dsi_cmd.h
index c480756..f806e78 100644
--- a/drivers/video/msm/mdss/mdss_dsi_cmd.h
+++ b/drivers/video/msm/mdss/mdss_dsi_cmd.h
@@ -98,6 +98,7 @@
#define CMD_REQ_COMMIT 0x0002
#define CMD_CLK_CTRL 0x0004
#define CMD_REQ_NO_MAX_PKT_SIZE 0x0008
+#define CMD_REQ_LP_MODE 0x0010
struct dcs_cmd_req {
struct dsi_cmd_desc *cmds;
diff --git a/drivers/video/msm/mdss/mdss_dsi_host.c b/drivers/video/msm/mdss/mdss_dsi_host.c
index 65e6214..bd156fc 100644
--- a/drivers/video/msm/mdss/mdss_dsi_host.c
+++ b/drivers/video/msm/mdss/mdss_dsi_host.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -200,28 +200,34 @@
spin_unlock(&ctrl->irq_lock);
}
-void mdss_dsi_cmd_test_pattern(struct mdss_panel_data *pdata)
+void mdss_dsi_video_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl)
{
- struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
int i;
- if (pdata == NULL) {
- pr_err("%s: Invalid input data\n", __func__);
- return;
- }
-
- ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
- panel_data);
-
- MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x015c, 0x201);
- MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x016c, 0xff0000); /* red */
+ MIPI_OUTP((ctrl->ctrl_base) + 0x015c, 0x021);
+ MIPI_OUTP((ctrl->ctrl_base) + 0x0164, 0xff0000); /* red */
i = 0;
while (i++ < 50) {
- MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x0184, 0x1);
+ MIPI_OUTP((ctrl->ctrl_base) + 0x0180, 0x1);
/* Add sleep to get ~50 fps frame rate*/
msleep(20);
}
- MIPI_OUTP((ctrl_pdata->ctrl_base) + 0x015c, 0x0);
+ MIPI_OUTP((ctrl->ctrl_base) + 0x015c, 0x0);
+}
+
+void mdss_dsi_cmd_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl)
+{
+ int i;
+
+ MIPI_OUTP((ctrl->ctrl_base) + 0x015c, 0x201);
+ MIPI_OUTP((ctrl->ctrl_base) + 0x016c, 0xff0000); /* red */
+ i = 0;
+ while (i++ < 50) {
+ MIPI_OUTP((ctrl->ctrl_base) + 0x0184, 0x1);
+ /* Add sleep to get ~50 fps frame rate*/
+ msleep(20);
+ }
+ MIPI_OUTP((ctrl->ctrl_base) + 0x015c, 0x0);
}
void mdss_dsi_host_init(struct mipi_panel_info *pinfo,
diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c
index 3c7d17c..60e2cf9 100644
--- a/drivers/video/msm/mdss/mdss_dsi_panel.c
+++ b/drivers/video/msm/mdss/mdss_dsi_panel.c
@@ -118,6 +118,11 @@
cmdreq.cmds = pcmds->cmds;
cmdreq.cmds_cnt = pcmds->cmd_cnt;
cmdreq.flags = CMD_REQ_COMMIT;
+
+ /*Panel ON/Off commands should be sent in DSI Low Power Mode*/
+ if (pcmds->link_state == DSI_LP_MODE)
+ cmdreq.flags |= CMD_REQ_LP_MODE;
+
cmdreq.rlen = 0;
cmdreq.cb = NULL;
@@ -767,6 +772,8 @@
ctrl_pdata->bklt_ctrl = BL_DCS_CMD;
}
}
+ rc = of_property_read_u32(np, "qcom,mdss-brightness-max-level", &tmp);
+ pinfo->brightness_max = (!rc ? tmp : MDSS_MAX_BL_BRIGHTNESS);
rc = of_property_read_u32(np, "qcom,mdss-dsi-bl-min-level", &tmp);
pinfo->bl_min = (!rc ? tmp : 0);
rc = of_property_read_u32(np, "qcom,mdss-dsi-bl-max-level", &tmp);
diff --git a/drivers/video/msm/mdss/mdss_edp.c b/drivers/video/msm/mdss/mdss_edp.c
index 6dbca10..95c746e 100644
--- a/drivers/video/msm/mdss/mdss_edp.c
+++ b/drivers/video/msm/mdss/mdss_edp.c
@@ -697,10 +697,15 @@
static int mdss_edp_device_register(struct mdss_edp_drv_pdata *edp_drv)
{
int ret;
+ u32 tmp;
mdss_edp_edid2pinfo(edp_drv);
edp_drv->panel_data.panel_info.bl_min = 1;
edp_drv->panel_data.panel_info.bl_max = 255;
+ ret = of_property_read_u32(edp_drv->pdev->dev.of_node,
+ "qcom,mdss-brightness-max-level", &tmp);
+ edp_drv->panel_data.panel_info.brightness_max =
+ (!ret ? tmp : MDSS_MAX_BL_BRIGHTNESS);
edp_drv->panel_data.event_handler = mdss_edp_event_handler;
edp_drv->panel_data.set_backlight = mdss_edp_set_backlight;
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index 54e3bc8..08cdcef 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -123,18 +123,22 @@
if (notify == NOTIFY_UPDATE_START) {
INIT_COMPLETION(mfd->update.comp);
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&mfd->update.comp, 4 * HZ);
to_user = (unsigned int)mfd->update.value;
+ if (mfd->update.type == NOTIFY_TYPE_SUSPEND) {
+ to_user = (unsigned int)mfd->update.type;
+ ret = 1;
+ }
} else if (notify == NOTIFY_UPDATE_STOP) {
INIT_COMPLETION(mfd->no_update.comp);
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&mfd->no_update.comp, 4 * HZ);
to_user = (unsigned int)mfd->no_update.value;
} else {
if (mfd->panel_power_on) {
INIT_COMPLETION(mfd->power_off_comp);
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&mfd->power_off_comp, 1 * HZ);
}
}
@@ -146,6 +150,47 @@
return ret;
}
+static int mdss_fb_splash_thread(void *data)
+{
+ struct msm_fb_data_type *mfd = data;
+ int ret = -EINVAL;
+ struct fb_info *fbi = NULL;
+ int ov_index[2];
+
+ if (!mfd || !mfd->fbi || !mfd->mdp.splash_fnc) {
+ pr_err("Invalid input parameter\n");
+ goto end;
+ }
+
+ fbi = mfd->fbi;
+
+ ret = mdss_fb_open(fbi, current->tgid);
+ if (ret) {
+ pr_err("fb_open failed\n");
+ goto end;
+ }
+
+ mfd->bl_updated = true;
+ mdss_fb_set_backlight(mfd, mfd->panel_info->bl_max >> 1);
+
+ ret = mfd->mdp.splash_fnc(mfd, ov_index, MDP_CREATE_SPLASH_OV);
+ if (ret) {
+ pr_err("Splash image failed\n");
+ goto splash_err;
+ }
+
+ do {
+ schedule_timeout_interruptible(SPLASH_THREAD_WAIT_TIMEOUT * HZ);
+ } while (!kthread_should_stop());
+
+ mfd->mdp.splash_fnc(mfd, ov_index, MDP_REMOVE_SPLASH_OV);
+
+splash_err:
+ mdss_fb_release(fbi, current->tgid);
+end:
+ return ret;
+}
+
static int lcd_backlight_registered;
static void mdss_fb_set_bl_brightness(struct led_classdev *led_cdev,
@@ -154,13 +199,13 @@
struct msm_fb_data_type *mfd = dev_get_drvdata(led_cdev->dev->parent);
int bl_lvl;
- if (value > MDSS_MAX_BL_BRIGHTNESS)
- value = MDSS_MAX_BL_BRIGHTNESS;
+ if (value > mfd->panel_info->brightness_max)
+ value = mfd->panel_info->brightness_max;
/* This maps android backlight level 0 to 255 into
driver backlight level 0 to bl_max with rounding */
MDSS_BRIGHT_TO_BL(bl_lvl, value, mfd->panel_info->bl_max,
- MDSS_MAX_BL_BRIGHTNESS);
+ mfd->panel_info->brightness_max);
if (!bl_lvl && value)
bl_lvl = 1;
@@ -374,6 +419,9 @@
/* android supports only one lcd-backlight/lcd for now */
if (!lcd_backlight_registered) {
+
+ backlight_led.brightness = mfd->panel_info->brightness_max;
+ backlight_led.max_brightness = mfd->panel_info->brightness_max;
if (led_classdev_register(&pdev->dev, &backlight_led))
pr_err("led_classdev_register failed\n");
else
@@ -403,6 +451,16 @@
else
mfd->mdp_sync_pt_data.threshold = 2;
+ if (mfd->index == 0) {
+ mfd->splash_thread = kthread_run(mdss_fb_splash_thread, mfd,
+ "mdss_fb_splash");
+ if (IS_ERR(mfd->splash_thread)) {
+ pr_err("unable to start splash thread %d\n",
+ mfd->index);
+ mfd->splash_thread = NULL;
+ }
+ }
+
return rc;
}
@@ -1188,6 +1246,12 @@
pinfo->ref_cnt++;
mfd->ref_cnt++;
+ /* Stop the splash thread once userspace open the fb node */
+ if (mfd->splash_thread && mfd->ref_cnt > 1) {
+ kthread_stop(mfd->splash_thread);
+ mfd->splash_thread = NULL;
+ }
+
return 0;
blank_error:
@@ -1565,7 +1629,7 @@
(var->yoffset / info->fix.ypanstep) * info->fix.ypanstep;
if (mfd->mdp.dma_fnc)
- mfd->mdp.dma_fnc(mfd);
+ mfd->mdp.dma_fnc(mfd, NULL, 0, NULL);
else
pr_warn("dma function not set for panel type=%d\n",
mfd->panel.type);
diff --git a/drivers/video/msm/mdss/mdss_fb.h b/drivers/video/msm/mdss/mdss_fb.h
index e245dd3..e796fc6 100644
--- a/drivers/video/msm/mdss/mdss_fb.h
+++ b/drivers/video/msm/mdss/mdss_fb.h
@@ -33,6 +33,8 @@
#define WAIT_DISP_OP_TIMEOUT ((WAIT_FENCE_FIRST_TIMEOUT + \
WAIT_FENCE_FINAL_TIMEOUT) * MDP_MAX_FENCE_FD)
+#define SPLASH_THREAD_WAIT_TIMEOUT 3
+
#ifndef MAX
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
@@ -67,6 +69,11 @@
MDP_NOTIFY_FRAME_TIMEOUT,
};
+enum mdp_splash_event {
+ MDP_CREATE_SPLASH_OV = 0,
+ MDP_REMOVE_SPLASH_OV,
+};
+
struct disp_info_type_suspend {
int op_enable;
int panel_power_on;
@@ -110,7 +117,8 @@
int (*kickoff_fnc)(struct msm_fb_data_type *mfd,
struct mdp_display_commit *data);
int (*ioctl_handler)(struct msm_fb_data_type *mfd, u32 cmd, void *arg);
- void (*dma_fnc)(struct msm_fb_data_type *mfd);
+ void (*dma_fnc)(struct msm_fb_data_type *mfd, struct mdp_overlay *req,
+ int image_len, int *pipe_ndx);
int (*cursor_update)(struct msm_fb_data_type *mfd,
struct fb_cursor *cursor);
int (*lut_update)(struct msm_fb_data_type *mfd, struct fb_cmap *cmap);
@@ -119,6 +127,7 @@
int (*update_ad_input)(struct msm_fb_data_type *mfd);
int (*panel_register_done)(struct mdss_panel_data *pdata);
u32 (*fb_stride)(u32 fb_index, u32 xres, int bpp);
+ int (*splash_fnc) (struct msm_fb_data_type *mfd, int *index, int req);
struct msm_sync_pt_data *(*get_sync_fnc)(struct msm_fb_data_type *mfd,
const struct mdp_buf_sync *buf_sync);
void *private1;
@@ -201,6 +210,8 @@
wait_queue_head_t idle_wait_q;
bool shutdown_pending;
+ struct task_struct *splash_thread;
+
struct msm_fb_backup_type msm_fb_backup;
struct completion power_set_comp;
u32 is_power_setting;
diff --git a/drivers/video/msm/mdss/mdss_hdmi_cec.c b/drivers/video/msm/mdss/mdss_hdmi_cec.c
index 410f2b3..9d85070 100644
--- a/drivers/video/msm/mdss/mdss_hdmi_cec.c
+++ b/drivers/video/msm/mdss/mdss_hdmi_cec.c
@@ -366,7 +366,7 @@
DSS_REG_W(io, HDMI_CEC_CTRL, BIT(0) | BIT(1) |
((msg->frame_size & 0x1F) << 4) | BIT(9));
- if (!wait_for_completion_interruptible_timeout(
+ if (!wait_for_completion_timeout(
&cec_ctrl->cec_msg_wr_done, HZ)) {
DEV_ERR("%s: timedout", __func__);
hdmi_cec_dump_msg(cec_ctrl, msg);
diff --git a/drivers/video/msm/mdss/mdss_hdmi_hdcp.c b/drivers/video/msm/mdss/mdss_hdmi_hdcp.c
index 8ff9059..e56e9fa 100644
--- a/drivers/video/msm/mdss/mdss_hdmi_hdcp.c
+++ b/drivers/video/msm/mdss/mdss_hdmi_hdcp.c
@@ -520,7 +520,7 @@
/* Write R0' to HDCP registers and check to see if it is a match */
INIT_COMPLETION(hdcp_ctrl->r0_checked);
DSS_REG_W(io, HDMI_HDCP_RCVPORT_DATA2_0, (((u32)buf[1]) << 8) | buf[0]);
- timeout_count = wait_for_completion_interruptible_timeout(
+ timeout_count = wait_for_completion_timeout(
&hdcp_ctrl->r0_checked, HZ*2);
link0_status = DSS_REG_R(io, HDMI_HDCP_LINK0_STATUS);
is_match = link0_status & BIT(12);
diff --git a/drivers/video/msm/mdss/mdss_hdmi_tx.c b/drivers/video/msm/mdss/mdss_hdmi_tx.c
index b45a446..a29fb751 100644
--- a/drivers/video/msm/mdss/mdss_hdmi_tx.c
+++ b/drivers/video/msm/mdss/mdss_hdmi_tx.c
@@ -70,6 +70,24 @@
#define MSM_HDMI_AUDIO_CHANNEL_7 7
#define MSM_HDMI_AUDIO_CHANNEL_8 8
+#define NUM_MODES_AVI 20
+
+/* AVI Infoframe data byte 3, bit 7 (msb) represents ITC bit */
+#define SET_ITC_BIT(byte) (byte = (byte | BIT(7)))
+#define CLR_ITC_BIT(byte) (byte = (byte & ~BIT(7)))
+
+/*
+ * CN represents IT content type, if ITC bit in infoframe data byte 3
+ * is set, CN bits will represent content type as below:
+ * 0b00 Graphics
+ * 0b01 Photo
+ * 0b10 Cinema
+ * 0b11 Game
+*/
+#define CONFIG_CN_BITS(bits, byte) \
+ (byte = (byte & ~(BIT(4) | BIT(5))) |\
+ ((bits & (BIT(0) | BIT(1))) << 4))
+
enum msm_hdmi_supported_audio_sample_rates {
AUDIO_SAMPLE_RATE_32KHZ,
AUDIO_SAMPLE_RATE_44_1KHZ,
@@ -137,12 +155,6 @@
}
} /* hdmi_pm_name */
-static DEFINE_MUTEX(avi_iframe_lut_lock);
-#define NUM_MODES_AVI 20
-#define SET_ITC_BIT(byte) (byte | 0x80)
-#define CLR_ITC_BIT(byte) (byte & 0x7F)
-#define CONFIG_CN_BITS(bits, byte) ((byte & ~(0x03 << 4)) | (bits << 4))
-
static u8 hdmi_tx_avi_iframe_lut[][NUM_MODES_AVI] = {
{0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
@@ -210,55 +222,6 @@
{20480, 247500} } },
};
-/* To statically config ITC bit from sysfs attribute */
-static int hdmi_tx_config_itc_bit(int itc)
-{
- int ret = 0, loop = NUM_MODES_AVI;
-
- if (mutex_lock_interruptible(&avi_iframe_lut_lock)) {
- ret = -ERESTARTSYS;
- goto signal_intr;
- }
-
- do {
- --loop;
- if (itc == 0)
- hdmi_tx_avi_iframe_lut[2][loop] =
- CLR_ITC_BIT(hdmi_tx_avi_iframe_lut[2][loop]);
- if (itc == 1)
- hdmi_tx_avi_iframe_lut[2][loop] =
- SET_ITC_BIT(hdmi_tx_avi_iframe_lut[2][loop]);
- } while (loop);
-
- mutex_unlock(&avi_iframe_lut_lock);
-
-signal_intr:
- return ret;
-}
-
-/* To configure CN0_1 bits from sysfs attribute */
-static int hdmi_tx_config_cn_bits(int cns)
-{
- int ret = 0, loop = NUM_MODES_AVI;
-
- if (mutex_lock_interruptible(&avi_iframe_lut_lock)) {
- ret = -ERESTARTSYS;
- goto signal_intr;
- }
-
- do {
- --loop;
- hdmi_tx_avi_iframe_lut[4][loop] =
- CONFIG_CN_BITS(cns, hdmi_tx_avi_iframe_lut[4][loop]);
- } while (loop);
-
- mutex_unlock(&avi_iframe_lut_lock);
-
-signal_intr:
- return ret;
-}
-
-
static bool hdmi_tx_is_cea_format(int mode)
{
bool cea_fmt;
@@ -682,53 +645,80 @@
struct device_attribute *attr, const char *buf, size_t count)
{
ssize_t ret = strnlen(buf, PAGE_SIZE);
- int err = 0;
- int itc = 0, rc = 0;
+ u8 *avi_byte3 = hdmi_tx_avi_iframe_lut[2];
+ struct hdmi_tx_ctrl *hdmi_ctrl = NULL;
+ int loop = 0, itc = 0, rc = 0;
+
+ hdmi_ctrl = hdmi_tx_get_drvdata_from_sysfs_dev(dev);
+
+ if (!hdmi_ctrl) {
+ DEV_ERR("%s: invalid input\n", __func__);
+ return -EINVAL;
+ }
rc = kstrtoint(buf, 10, &itc);
if (rc) {
- DEV_ERR("%s: kstrtoint failed. rc=%d\n", __func__, rc);
+ DEV_ERR("%s: kstrtoint failed. rc =%d\n", __func__, rc);
return rc;
}
- if (itc == 0 || itc == 1) {
- if (hdmi_tx_config_itc_bit(itc))
- ret = err;
- else
- DEV_DBG("%s: '%d is configured'!\n", __func__, itc);
- } else {
- DEV_ERR("%s: unknown ITC '%d', should be either 0 or 1\n",
- __func__, itc);
+ if (itc < 0 || itc > 1) {
+ DEV_ERR("%s: Invalid ITC %d\n", __func__, itc);
+ return ret;
}
+ if (mutex_lock_interruptible(&hdmi_ctrl->lut_lock))
+ return -ERESTARTSYS;
+
+ for (loop = 0; loop < NUM_MODES_AVI; loop++) {
+ if (itc)
+ SET_ITC_BIT(avi_byte3[loop]);
+ else
+ CLR_ITC_BIT(avi_byte3[loop]);
+ }
+
+ mutex_unlock(&hdmi_ctrl->lut_lock);
+
return ret;
} /* hdmi_tx_sysfs_wta_avi_itc */
-static ssize_t hdmi_tx_sysfs_wta_avi_cn0_1(struct device *dev,
+static ssize_t hdmi_tx_sysfs_wta_avi_cn_bits(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
ssize_t ret = strnlen(buf, PAGE_SIZE);
- int err = 0;
- int cns = 0, rc = 0;
+ u8 *avi_byte5 = hdmi_tx_avi_iframe_lut[4];
+ struct hdmi_tx_ctrl *hdmi_ctrl = NULL;
+ int loop = 0, cn_bits = 0, rc = 0;
- rc = kstrtoint(buf, 10, &cns);
+ hdmi_ctrl = hdmi_tx_get_drvdata_from_sysfs_dev(dev);
+
+ if (!hdmi_ctrl) {
+ DEV_ERR("%s: invalid input\n", __func__);
+ return -EINVAL;
+ }
+
+ rc = kstrtoint(buf, 10, &cn_bits);
if (rc) {
DEV_ERR("%s: kstrtoint failed. rc=%d\n", __func__, rc);
return rc;
}
- if (cns == 0 || cns == 1 || cns == 2 || cns == 3) {
- if (hdmi_tx_config_cn_bits(cns))
- ret = err;
- else
- DEV_DBG("%s: '%d is configured'!\n", __func__, cns);
- } else {
- DEV_ERR("%s: unknown CN '%d' should be either 0 or 1, 2 ,3\n",
- __func__, cns);
+ /* As per CEA-861-E, CN is a positive number and can be max 3 */
+ if (cn_bits < 0 || cn_bits > 3) {
+ DEV_ERR("%s: Invalid CN %d\n", __func__, cn_bits);
+ return ret;
}
+ if (mutex_lock_interruptible(&hdmi_ctrl->lut_lock))
+ return -ERESTARTSYS;
+
+ for (loop = 0; loop < NUM_MODES_AVI; loop++)
+ CONFIG_CN_BITS(cn_bits, avi_byte5[loop]);
+
+ mutex_unlock(&hdmi_ctrl->lut_lock);
+
return ret;
-} /* hdmi_tx_sysfs_wta_avi_cn0_1 */
+} /* hdmi_tx_sysfs_wta_cn_bits */
static DEVICE_ATTR(connected, S_IRUGO, hdmi_tx_sysfs_rda_connected, NULL);
static DEVICE_ATTR(hpd, S_IRUGO | S_IWUSR, hdmi_tx_sysfs_rda_hpd,
@@ -739,7 +729,7 @@
hdmi_tx_sysfs_rda_product_description,
hdmi_tx_sysfs_wta_product_description);
static DEVICE_ATTR(avi_itc, S_IWUSR, NULL, hdmi_tx_sysfs_wta_avi_itc);
-static DEVICE_ATTR(avi_cn0_1, S_IWUSR, NULL, hdmi_tx_sysfs_wta_avi_cn0_1);
+static DEVICE_ATTR(avi_cn0_1, S_IWUSR, NULL, hdmi_tx_sysfs_wta_avi_cn_bits);
static struct attribute *hdmi_tx_fs_attrs[] = {
&dev_attr_connected.attr,
@@ -2546,7 +2536,7 @@
flush_work_sync(&hdmi_ctrl->power_off_work);
if (hdmi_ctrl->pdata.primary) {
- timeout = wait_for_completion_interruptible_timeout(
+ timeout = wait_for_completion_timeout(
&hdmi_ctrl->hpd_done, HZ);
if (!timeout) {
DEV_ERR("%s: cable connection hasn't happened yet\n",
@@ -2844,6 +2834,7 @@
switch_dev_unregister(&hdmi_ctrl->sdev);
if (hdmi_ctrl->workq)
destroy_workqueue(hdmi_ctrl->workq);
+ mutex_destroy(&hdmi_ctrl->lut_lock);
mutex_destroy(&hdmi_ctrl->mutex);
hdmi_tx_hw.ptr = NULL;
@@ -2872,6 +2863,7 @@
hdmi_setup_video_mode_lut();
mutex_init(&hdmi_ctrl->mutex);
+ mutex_init(&hdmi_ctrl->lut_lock);
hdmi_ctrl->workq = create_workqueue("hdmi_tx_workq");
if (!hdmi_ctrl->workq) {
DEV_ERR("%s: hdmi_tx_workq creation failed.\n", __func__);
@@ -2920,6 +2912,7 @@
fail_create_workq:
if (hdmi_ctrl->workq)
destroy_workqueue(hdmi_ctrl->workq);
+ mutex_destroy(&hdmi_ctrl->lut_lock);
mutex_destroy(&hdmi_ctrl->mutex);
fail_no_hdmi:
return rc;
@@ -3010,7 +3003,7 @@
u32 timeout;
hdmi_ctrl->panel_suspend = false;
- timeout = wait_for_completion_interruptible_timeout(
+ timeout = wait_for_completion_timeout(
&hdmi_ctrl->hpd_done, HZ/10);
if (!timeout & !hdmi_ctrl->hpd_state) {
DEV_INFO("%s: cable removed during suspend\n",
diff --git a/drivers/video/msm/mdss/mdss_hdmi_tx.h b/drivers/video/msm/mdss/mdss_hdmi_tx.h
index 66071e9..0787dee 100644
--- a/drivers/video/msm/mdss/mdss_hdmi_tx.h
+++ b/drivers/video/msm/mdss/mdss_hdmi_tx.h
@@ -54,6 +54,7 @@
struct hdmi_audio audio_data;
struct mutex mutex;
+ struct mutex lut_lock;
struct kobject *kobj;
struct switch_dev sdev;
struct switch_dev audio_sdev;
diff --git a/drivers/video/msm/mdss/mdss_hdmi_util.c b/drivers/video/msm/mdss/mdss_hdmi_util.c
index 711ec68..de422a4 100644
--- a/drivers/video/msm/mdss/mdss_hdmi_util.c
+++ b/drivers/video/msm/mdss/mdss_hdmi_util.c
@@ -296,7 +296,7 @@
INIT_COMPLETION(ddc_ctrl->ddc_sw_done);
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_CTRL, BIT(0) | BIT(20));
- time_out_count = wait_for_completion_interruptible_timeout(
+ time_out_count = wait_for_completion_timeout(
&ddc_ctrl->ddc_sw_done, HZ/2);
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_INT_CTRL, BIT(1));
if (!time_out_count) {
@@ -547,7 +547,7 @@
INIT_COMPLETION(ddc_ctrl->ddc_sw_done);
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_CTRL, BIT(0) | BIT(21));
- time_out_count = wait_for_completion_interruptible_timeout(
+ time_out_count = wait_for_completion_timeout(
&ddc_ctrl->ddc_sw_done, HZ/2);
reg_val = DSS_REG_R(ddc_ctrl->io, HDMI_DDC_INT_CTRL);
@@ -721,7 +721,7 @@
INIT_COMPLETION(ddc_ctrl->ddc_sw_done);
DSS_REG_W_ND(ddc_ctrl->io, HDMI_DDC_CTRL, BIT(0) | BIT(20));
- time_out_count = wait_for_completion_interruptible_timeout(
+ time_out_count = wait_for_completion_timeout(
&ddc_ctrl->ddc_sw_done, HZ/2);
reg_val = DSS_REG_R(ddc_ctrl->io, HDMI_DDC_INT_CTRL);
diff --git a/drivers/video/msm/mdss/mdss_mdp.c b/drivers/video/msm/mdss/mdss_mdp.c
index 3269eec..131744c 100644
--- a/drivers/video/msm/mdss/mdss_mdp.c
+++ b/drivers/video/msm/mdss/mdss_mdp.c
@@ -546,6 +546,8 @@
if (clk) {
pr_debug("clk=%d en=%d\n", clk_idx, enable);
if (enable) {
+ if (clk_idx == MDSS_CLK_MDP_VSYNC)
+ clk_set_rate(clk, 19200000);
ret = clk_prepare_enable(clk);
} else {
clk_disable_unprepare(clk);
@@ -2116,7 +2118,7 @@
int rc;
if (!mdss_res || !mdss_res->pan_cfg.init_done)
- rc = -EPROBE_DEFER;
+ return -EPROBE_DEFER;
if (mdss_res->pan_cfg.lk_cfg)
rc = 1;
else
diff --git a/drivers/video/msm/mdss/mdss_mdp.h b/drivers/video/msm/mdss/mdss_mdp.h
index fad6b0c..8918df8 100644
--- a/drivers/video/msm/mdss/mdss_mdp.h
+++ b/drivers/video/msm/mdss/mdss_mdp.h
@@ -274,7 +274,6 @@
u32 hist_cnt_sent;
u32 hist_cnt_time;
u32 frame_cnt;
- u32 is_kick_ready;
struct completion comp;
u32 data[HIST_V_SIZE];
struct mutex hist_mutex;
diff --git a/drivers/video/msm/mdss/mdss_mdp_hwio.h b/drivers/video/msm/mdss/mdss_mdp_hwio.h
index bcd3cf4..5d3e841 100644
--- a/drivers/video/msm/mdss/mdss_mdp_hwio.h
+++ b/drivers/video/msm/mdss/mdss_mdp_hwio.h
@@ -20,7 +20,6 @@
#define GC_LUT_SEGMENTS 16
#define ENHIST_LUT_ENTRIES 256
#define HIST_V_SIZE 256
-#define SIX_ZONE_LUT_ENTRIES 384
#define MDSS_MDP_HW_REV_100 0x10000000
#define MDSS_MDP_HW_REV_102 0x10020000
@@ -439,6 +438,7 @@
#define MDSS_MDP_REG_DSPP_HIST_CTL_BASE 0x210
#define MDSS_MDP_REG_DSPP_HIST_LUT_BASE 0x230
#define MDSS_MDP_REG_DSPP_PA_BASE 0x238
+#define MDSS_MDP_REG_DSPP_SIX_ZONE_BASE 0x248
#define MDSS_MDP_REG_DSPP_GAMUT_BASE 0x2DC
#define MDSS_MDP_REG_DSPP_GC_BASE 0x2B0
diff --git a/drivers/video/msm/mdss/mdss_mdp_intf_video.c b/drivers/video/msm/mdss/mdss_mdp_intf_video.c
index bd1c3eb..f8c59d7 100644
--- a/drivers/video/msm/mdss/mdss_mdp_intf_video.c
+++ b/drivers/video/msm/mdss/mdss_mdp_intf_video.c
@@ -62,6 +62,7 @@
atomic_t vsync_ref;
spinlock_t vsync_lock;
+ struct mutex vsync_mtx;
struct list_head vsync_handlers;
};
@@ -216,19 +217,23 @@
{
struct mdss_mdp_video_ctx *ctx = ctl->priv_data;
+ mutex_lock(&ctx->vsync_mtx);
if (atomic_inc_return(&ctx->vsync_ref) == 1)
mdss_mdp_irq_enable(MDSS_MDP_IRQ_INTF_VSYNC, ctl->intf_num);
else if (clear)
mdss_mdp_irq_clear(ctl->mdata, MDSS_MDP_IRQ_INTF_VSYNC,
ctl->intf_num);
+ mutex_unlock(&ctx->vsync_mtx);
}
static inline void video_vsync_irq_disable(struct mdss_mdp_ctl *ctl)
{
struct mdss_mdp_video_ctx *ctx = ctl->priv_data;
+ mutex_lock(&ctx->vsync_mtx);
if (atomic_dec_return(&ctx->vsync_ref) == 0)
mdss_mdp_irq_disable(MDSS_MDP_IRQ_INTF_VSYNC, ctl->intf_num);
+ mutex_unlock(&ctx->vsync_mtx);
}
static int mdss_mdp_video_add_vsync_handler(struct mdss_mdp_ctl *ctl,
@@ -684,6 +689,7 @@
ctx->intf_type = ctl->intf_type;
init_completion(&ctx->vsync_comp);
spin_lock_init(&ctx->vsync_lock);
+ mutex_init(&ctx->vsync_mtx);
atomic_set(&ctx->vsync_ref, 0);
mdss_mdp_set_intr_callback(MDSS_MDP_IRQ_INTF_VSYNC, ctl->intf_num,
diff --git a/drivers/video/msm/mdss/mdss_mdp_overlay.c b/drivers/video/msm/mdss/mdss_mdp_overlay.c
index 4c89064..572af1c 100644
--- a/drivers/video/msm/mdss/mdss_mdp_overlay.c
+++ b/drivers/video/msm/mdss/mdss_mdp_overlay.c
@@ -34,6 +34,8 @@
#include "mdss_mdp.h"
#include "mdss_mdp_rotator.h"
+#include "splash.h"
+
#define VSYNC_PERIOD 16
#define BORDERFILL_NDX 0x0BF000BF
#define CHECK_BOUNDS(offset, size, max_size) \
@@ -44,6 +46,8 @@
#define MEM_PROTECT_SD_CTRL 0xF
+#define INVALID_PIPE_INDEX 0xFFFF
+
struct sd_ctrl_req {
unsigned int enable;
} __attribute__ ((__packed__));
@@ -1375,18 +1379,18 @@
static int mdss_mdp_overlay_get_fb_pipe(struct msm_fb_data_type *mfd,
struct mdss_mdp_pipe **ppipe,
- int mixer_mux)
+ int mixer_mux,
+ struct mdp_overlay *req_ov)
{
struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
struct mdss_mdp_pipe *pipe;
+ int ret;
pipe = mdss_mdp_mixer_stage_pipe(mdp5_data->ctl, mixer_mux,
MDSS_MDP_STAGE_BASE);
+
if (pipe == NULL) {
- struct mdp_overlay req;
- struct fb_info *fbi = mfd->fbi;
struct mdss_mdp_mixer *mixer;
- int ret, bpp;
mixer = mdss_mdp_mixer_get(mdp5_data->ctl,
MDSS_MDP_MIXER_MUX_LEFT);
@@ -1395,49 +1399,73 @@
return -ENODEV;
}
- memset(&req, 0, sizeof(req));
+ if (req_ov == NULL) {
+ struct mdp_overlay req;
+ struct fb_info *fbi = mfd->fbi;
+ int bpp;
- bpp = fbi->var.bits_per_pixel / 8;
- req.id = MSMFB_NEW_REQUEST;
- req.src.format = mfd->fb_imgType;
- req.src.height = fbi->var.yres;
- req.src.width = fbi->fix.line_length / bpp;
- if (mixer_mux == MDSS_MDP_MIXER_MUX_RIGHT) {
- if (req.src.width <= mixer->width) {
- pr_warn("right fb pipe not needed\n");
- return -EINVAL;
+ memset(&req, 0, sizeof(req));
+
+ bpp = fbi->var.bits_per_pixel / 8;
+ req.id = MSMFB_NEW_REQUEST;
+ req.src.format = mfd->fb_imgType;
+ req.src.height = fbi->var.yres;
+ req.src.width = fbi->fix.line_length / bpp;
+ if (mixer_mux == MDSS_MDP_MIXER_MUX_RIGHT) {
+ if (req.src.width <= mixer->width) {
+ pr_warn("right fb pipe not needed\n");
+ return -EINVAL;
+ }
+
+ req.flags |= MDSS_MDP_RIGHT_MIXER;
+ req.src_rect.x = mixer->width;
+ req.src_rect.w = fbi->var.xres - mixer->width;
+ } else {
+ req.src_rect.x = 0;
+ req.src_rect.w = MIN(fbi->var.xres,
+ mixer->width);
}
- req.flags |= MDSS_MDP_RIGHT_MIXER;
- req.src_rect.x = mixer->width;
- req.src_rect.w = fbi->var.xres - mixer->width;
+ req.src_rect.y = 0;
+ req.src_rect.h = req.src.height;
+ req.dst_rect.x = 0;
+ req.dst_rect.y = 0;
+ req.dst_rect.w = req.src_rect.w;
+ req.dst_rect.h = req.src_rect.h;
+ req.z_order = MDSS_MDP_STAGE_BASE;
+
+ pr_debug("allocating base pipe mux=%d\n", mixer_mux);
+
+ ret = mdss_mdp_overlay_pipe_setup(mfd, &req, &pipe);
+ if (ret)
+ return ret;
} else {
- req.src_rect.x = 0;
- req.src_rect.w = MIN(fbi->var.xres, mixer->width);
+ if (mixer_mux == MDSS_MDP_MIXER_MUX_RIGHT) {
+ req_ov->id = MSMFB_NEW_REQUEST;
+ req_ov->flags |= MDSS_MDP_RIGHT_MIXER;
+ req_ov->src_rect.w = MIN(mixer->width,
+ req_ov->src_rect.w >> 1);
+ req_ov->dst_rect.w = req_ov->src_rect.w;
+ req_ov->src_rect.x = req_ov->src_rect.w;
+ req_ov->dst_rect.x = 0;
+ }
+
+ ret = mdss_mdp_overlay_pipe_setup(mfd, req_ov, &pipe);
+ if (ret)
+ return ret;
}
-
- req.src_rect.y = 0;
- req.src_rect.h = req.src.height;
- req.dst_rect.x = 0;
- req.dst_rect.y = 0;
- req.dst_rect.w = req.src_rect.w;
- req.dst_rect.h = req.src_rect.h;
- req.z_order = MDSS_MDP_STAGE_BASE;
-
- pr_debug("allocating base pipe mux=%d\n", mixer_mux);
-
- ret = mdss_mdp_overlay_pipe_setup(mfd, &req, &pipe);
- if (ret)
- return ret;
-
- pr_debug("ctl=%d pnum=%d\n", mdp5_data->ctl->num, pipe->num);
}
+ pr_debug("ctl=%d pnum=%d\n", mdp5_data->ctl->num, pipe->num);
+
*ppipe = pipe;
return 0;
}
-static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd)
+static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd,
+ struct mdp_overlay *req,
+ int image_size,
+ int *pipe_ndx)
{
struct mdss_mdp_data *buf;
struct mdss_mdp_pipe *pipe;
@@ -1485,8 +1513,8 @@
goto pan_display_error;
}
-
- ret = mdss_mdp_overlay_get_fb_pipe(mfd, &pipe, MDSS_MDP_MIXER_MUX_LEFT);
+ ret = mdss_mdp_overlay_get_fb_pipe(mfd, &pipe,
+ MDSS_MDP_MIXER_MUX_LEFT, req);
if (ret) {
pr_err("unable to allocate base pipe\n");
goto pan_display_error;
@@ -1496,12 +1524,14 @@
pr_err("unable to map base pipe\n");
goto pan_display_error;
}
+ if (pipe_ndx)
+ pipe_ndx[0] = pipe->ndx;
buf = &pipe->back_buf;
if (is_mdss_iommu_attached()) {
if (!mfd->iova) {
pr_err("mfd iova is zero\n");
- goto pan_display_error;
+ goto attach_err;
}
buf->p[0].addr = mfd->iova;
} else {
@@ -1509,22 +1539,28 @@
}
buf->p[0].addr += offset;
- buf->p[0].len = fbi->fix.smem_len - offset;
+ if (image_size)
+ buf->p[0].len = image_size;
+ else
+ buf->p[0].len = fbi->fix.smem_len - offset;
buf->num_planes = 1;
pipe->has_buf = 1;
mdss_mdp_pipe_unmap(pipe);
if (fbi->var.xres > MAX_MIXER_WIDTH || mfd->split_display) {
ret = mdss_mdp_overlay_get_fb_pipe(mfd, &pipe,
- MDSS_MDP_MIXER_MUX_RIGHT);
+ MDSS_MDP_MIXER_MUX_RIGHT, req);
if (ret) {
pr_err("unable to allocate right base pipe\n");
- goto pan_display_error;
+ goto attach_err;
}
if (mdss_mdp_pipe_map(pipe)) {
pr_err("unable to map right base pipe\n");
- goto pan_display_error;
+ goto attach_err;
}
+ if (pipe_ndx)
+ pipe_ndx[1] = pipe->ndx;
+
pipe->back_buf = *buf;
pipe->has_buf = 1;
mdss_mdp_pipe_unmap(pipe);
@@ -1537,6 +1573,12 @@
return;
+attach_err:
+ mutex_unlock(&mdp5_data->ov_lock);
+ mdss_mdp_overlay_unset(mfd, pipe->ndx);
+ if (pipe_ndx)
+ pipe_ndx[0] = INVALID_PIPE_INDEX;
+ return;
pan_display_error:
mutex_unlock(&mdp5_data->ov_lock);
}
@@ -2604,6 +2646,63 @@
return rc;
}
+static int mdss_mdp_overlay_splash_image(struct msm_fb_data_type *mfd,
+ int *pipe_ndx, int splash_event)
+{
+ struct mdp_overlay req;
+ int rc = 0;
+ struct fb_info *fbi = NULL;
+ int image_len = 0;
+
+ if (!mfd || !mfd->fbi || !mfd->fbi->screen_base || !pipe_ndx) {
+ pr_err("Invalid input parameter\n");
+ return -EINVAL;
+ }
+
+ fbi = mfd->fbi;
+ image_len = SPLASH_IMAGE_WIDTH * SPLASH_IMAGE_HEIGHT * SPLASH_IMAGE_BPP;
+
+ if (SPLASH_IMAGE_WIDTH > fbi->var.xres ||
+ SPLASH_IMAGE_HEIGHT > fbi->var.yres ||
+ SPLASH_IMAGE_BPP > fbi->var.bits_per_pixel / 8 ||
+ image_len > fbi->fix.smem_len) {
+ pr_err("Invalid splash parameter configuration\n");
+ return -EINVAL;
+ }
+
+ if (splash_event == MDP_CREATE_SPLASH_OV) {
+ pipe_ndx[0] = INVALID_PIPE_INDEX;
+ pipe_ndx[1] = INVALID_PIPE_INDEX;
+
+ memset(&req, 0, sizeof(struct mdp_overlay));
+ req.src.width = req.dst_rect.w = req.src_rect.w =
+ SPLASH_IMAGE_WIDTH;
+ req.src.height = req.dst_rect.h = req.src_rect.h =
+ SPLASH_IMAGE_HEIGHT;
+ req.src.format = SPLASH_IMAGE_FORMAT;
+ req.id = MSMFB_NEW_REQUEST;
+ req.z_order = MDSS_MDP_STAGE_0;
+ req.is_fg = 1;
+ req.alpha = 0xff;
+ req.transp_mask = MDP_TRANSP_NOP;
+ req.dst_rect.x =
+ (fbi->var.xres >> 1) - (SPLASH_IMAGE_WIDTH >> 1);
+ req.dst_rect.y =
+ (fbi->var.yres >> 1) - (SPLASH_IMAGE_HEIGHT >> 1);
+
+ memcpy(fbi->screen_base, splash_bgr888_image, image_len);
+ mdss_mdp_overlay_pan_display(mfd, &req, image_len, pipe_ndx);
+
+ } else if (splash_event == MDP_REMOVE_SPLASH_OV) {
+ if (pipe_ndx[0] != INVALID_PIPE_INDEX)
+ mdss_mdp_overlay_unset(mfd, pipe_ndx[0]);
+ if (pipe_ndx[1] != INVALID_PIPE_INDEX)
+ mdss_mdp_overlay_unset(mfd, pipe_ndx[1]);
+ }
+
+ return rc;
+}
+
int mdss_mdp_overlay_init(struct msm_fb_data_type *mfd)
{
struct device *dev = mfd->fbi->dev;
@@ -2621,6 +2720,7 @@
mdp5_interface->panel_register_done = mdss_panel_register_done;
mdp5_interface->kickoff_fnc = mdss_mdp_overlay_kickoff;
mdp5_interface->get_sync_fnc = mdss_mdp_rotator_sync_pt_get;
+ mdp5_interface->splash_fnc = mdss_mdp_overlay_splash_image;
mdp5_data = kmalloc(sizeof(struct mdss_overlay_private), GFP_KERNEL);
if (!mdp5_data) {
diff --git a/drivers/video/msm/mdss/mdss_mdp_pp.c b/drivers/video/msm/mdss/mdss_mdp_pp.c
index 555974b..87f0779 100644
--- a/drivers/video/msm/mdss/mdss_mdp_pp.c
+++ b/drivers/video/msm/mdss/mdss_mdp_pp.c
@@ -174,6 +174,8 @@
GAMUT_T5_SIZE + GAMUT_T6_SIZE + GAMUT_T7_SIZE)
#define MDSS_MDP_PA_SIZE 0xC
+#define MDSS_MDP_SIX_ZONE_SIZE 0xC
+#define MDSS_MDP_MEM_COL_SIZE 0x3C
#define MDSS_MDP_GC_SIZE 0x28
#define MDSS_MDP_PCC_SIZE 0xB8
#define MDSS_MDP_GAMUT_SIZE 0x5C
@@ -293,8 +295,8 @@
u32 enhist_lut[MDSS_BLOCK_DISP_NUM][ENHIST_LUT_ENTRIES];
struct mdp_pa_cfg pa_disp_cfg[MDSS_BLOCK_DISP_NUM];
struct mdp_pa_v2_data pa_v2_disp_cfg[MDSS_BLOCK_DISP_NUM];
- u32 six_zone_lut_curve_p0[MDSS_BLOCK_DISP_NUM][SIX_ZONE_LUT_ENTRIES];
- u32 six_zone_lut_curve_p1[MDSS_BLOCK_DISP_NUM][SIX_ZONE_LUT_ENTRIES];
+ u32 six_zone_lut_curve_p0[MDSS_BLOCK_DISP_NUM][MDP_SIX_ZONE_LUT_SIZE];
+ u32 six_zone_lut_curve_p1[MDSS_BLOCK_DISP_NUM][MDP_SIX_ZONE_LUT_SIZE];
struct mdp_pcc_cfg_data pcc_disp_cfg[MDSS_BLOCK_DISP_NUM];
struct mdp_igc_lut_data igc_disp_cfg[MDSS_BLOCK_DISP_NUM];
struct mdp_pgc_lut_data argc_disp_cfg[MDSS_BLOCK_DISP_NUM];
@@ -643,7 +645,7 @@
data, addr);
/* Remove Index Update */
- for (i = 1; i < SIX_ZONE_LUT_ENTRIES; i++) {
+ for (i = 1; i < MDP_SIX_ZONE_LUT_SIZE; i++) {
addr += 4;
writel_relaxed(pa_v2_config->six_zone_curve_p1[i],
addr);
@@ -1089,7 +1091,7 @@
/*program pixel extn values for the SSPP*/
mdss_mdp_pipe_program_pixel_extn(pipe);
- } else {
+ } else if (pipe->type == MDSS_MDP_PIPE_TYPE_VIG) {
writel_relaxed(phasex_step, pipe->base +
MDSS_MDP_REG_SCALE_PHASE_STEP_X);
writel_relaxed(phasey_step, pipe->base +
@@ -1098,6 +1100,11 @@
MDSS_MDP_REG_SCALE_INIT_PHASE_X);
writel_relaxed(init_phasey, pipe->base +
MDSS_MDP_REG_SCALE_INIT_PHASE_Y);
+ } else {
+ writel_relaxed(phasex_step, pipe->base +
+ MDSS_MDP_REG_SCALE_PHASE_STEP_X);
+ writel_relaxed(phasey_step, pipe->base +
+ MDSS_MDP_REG_SCALE_PHASE_STEP_Y);
}
writel_relaxed(scale_config, pipe->base +
@@ -1302,10 +1309,7 @@
mutex_lock(&hist_info->hist_mutex);
spin_lock_irqsave(&hist_info->hist_lock, flag);
col_state = hist_info->col_state;
- if (hist_info->is_kick_ready &&
- ((col_state == HIST_IDLE) ||
- ((false == hist_info->read_request) &&
- col_state == HIST_READY))) {
+ if (col_state == HIST_IDLE) {
/* Kick off collection */
writel_relaxed(1, base + kick_base);
hist_info->col_state = HIST_START;
@@ -1512,6 +1516,9 @@
pp_sts_set_split_bits(&pp_sts->pgc_sts, pgc_config->flags);
}
+ pp_dspp_opmode_config(ctl, dspp_num, pp_sts, mdata->mdp_rev, &opmode);
+
+flush_exit:
if (ad_hw) {
mutex_lock(&ad->lock);
ad_flags = ad->reg_sts;
@@ -1526,8 +1533,6 @@
mutex_unlock(&ad->lock);
}
- pp_dspp_opmode_config(ctl, dspp_num, pp_sts, mdata->mdp_rev, &opmode);
-flush_exit:
writel_relaxed(opmode, base + MDSS_MDP_REG_DSPP_OP_MODE);
ctl->flush_bits |= BIT(13 + dspp_num);
wmb();
@@ -1940,10 +1945,13 @@
/* Six zone LUT and thresh data */
if (pa_v2_config->flags & MDP_PP_PA_SIX_ZONE_ENABLE) {
+ if (pa_v2_config->six_zone_len != MDP_SIX_ZONE_LUT_SIZE)
+ return -EINVAL;
+
data = (3 << 25);
writel_relaxed(data, addr);
- for (i = 0; i < SIX_ZONE_LUT_ENTRIES; i++) {
+ for (i = 0; i < MDP_SIX_ZONE_LUT_SIZE; i++) {
addr += 4;
mdss_pp_res->six_zone_lut_curve_p1[disp_num][i] =
readl_relaxed(addr);
@@ -1954,13 +1962,13 @@
if (copy_to_user(pa_v2_config->six_zone_curve_p0,
&mdss_pp_res->six_zone_lut_curve_p0[disp_num][0],
- SIX_ZONE_LUT_ENTRIES * sizeof(u32))) {
+ pa_v2_config->six_zone_len * sizeof(u32))) {
return -EFAULT;
}
if (copy_to_user(pa_v2_config->six_zone_curve_p1,
&mdss_pp_res->six_zone_lut_curve_p1[disp_num][0],
- SIX_ZONE_LUT_ENTRIES * sizeof(u32))) {
+ pa_v2_config->six_zone_len * sizeof(u32))) {
return -EFAULT;
}
@@ -2005,14 +2013,17 @@
static int pp_copy_pa_six_zone_lut(struct mdp_pa_v2_cfg_data *pa_v2_config,
u32 disp_num)
{
+ if (pa_v2_config->pa_v2_data.six_zone_len != MDP_SIX_ZONE_LUT_SIZE)
+ return -EINVAL;
+
if (copy_from_user(&mdss_pp_res->six_zone_lut_curve_p0[disp_num][0],
pa_v2_config->pa_v2_data.six_zone_curve_p0,
- SIX_ZONE_LUT_ENTRIES * sizeof(u32))) {
+ pa_v2_config->pa_v2_data.six_zone_len * sizeof(u32))) {
return -EFAULT;
}
if (copy_from_user(&mdss_pp_res->six_zone_lut_curve_p1[disp_num][0],
pa_v2_config->pa_v2_data.six_zone_curve_p1,
- SIX_ZONE_LUT_ENTRIES * sizeof(u32))) {
+ pa_v2_config->pa_v2_data.six_zone_len * sizeof(u32))) {
return -EFAULT;
}
@@ -2881,11 +2892,10 @@
hist_info->hist_cnt_sent = 0;
hist_info->hist_cnt_time = 0;
spin_lock_irqsave(&hist_info->hist_lock, flag);
- hist_info->read_request = false;
+ hist_info->read_request = 0;
hist_info->col_state = HIST_RESET;
hist_info->col_en = true;
spin_unlock_irqrestore(&hist_info->hist_lock, flag);
- hist_info->is_kick_ready = true;
mdss_mdp_hist_intr_req(&mdata->hist_intr, 3 << shift_bit, true);
writel_relaxed(req->frame_cnt, ctl_base + 8);
/* Kick out reset start */
@@ -3006,7 +3016,6 @@
hist_info->col_en = false;
hist_info->col_state = HIST_UNKNOWN;
spin_unlock_irqrestore(&hist_info->hist_lock, flag);
- hist_info->is_kick_ready = false;
mdss_mdp_hist_intr_req(&mdata->hist_intr, done_bit, false);
writel_relaxed(BIT(1), ctl_base);/* cancel */
ret = 0;
@@ -3256,7 +3265,6 @@
spin_lock_irqsave(&hist_info->hist_lock, flag);
/* wait for hist done if cache has no data */
if (hist_info->col_state != HIST_READY) {
- hist_info->read_request = true;
spin_unlock_irqrestore(&hist_info->hist_lock, flag);
timeout = HIST_WAIT_TIMEOUT(hist_info->frame_cnt);
mutex_unlock(&hist_info->hist_mutex);
@@ -3296,9 +3304,11 @@
}
if (hist_info->col_state != HIST_READY) {
ret = -ENODATA;
+ spin_lock_irqsave(&hist_info->hist_lock, flag);
+ hist_info->col_state = HIST_READY;
+ spin_unlock_irqrestore(&hist_info->hist_lock, flag);
pr_debug("%s: state is not ready: %d",
__func__, hist_info->col_state);
- goto hist_collect_exit;
}
} else {
spin_unlock_irqrestore(&hist_info->hist_lock, flag);
@@ -3311,9 +3321,7 @@
sum = pp_hist_read(v_base, hist_info);
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false);
spin_lock_irqsave(&hist_info->hist_lock, flag);
- if (!expect_sum || sum == expect_sum)
- hist_info->read_request = false;
- else
+ if (expect_sum && sum != expect_sum)
ret = -ENODATA;
hist_info->col_state = HIST_IDLE;
}
@@ -3325,8 +3333,9 @@
int mdss_mdp_hist_collect(struct mdp_histogram_data *hist)
{
- int i, j, off, ret = 0;
+ int i, j, off, ret = 0, temp_ret = 0;
struct pp_hist_col_info *hist_info;
+ struct pp_hist_col_info *hists[MDSS_MDP_INTF_MAX_LAYERMIXER];
u32 dspp_num, disp_num;
char __iomem *ctl_base;
u32 hist_cnt, mixer_id[MDSS_MDP_INTF_MAX_LAYERMIXER];
@@ -3337,6 +3346,7 @@
u32 exp_sum = 0;
struct mdss_mdp_pipe *pipe;
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
+ unsigned long flag;
if ((PP_BLOCK(hist->block) < MDP_LOGICAL_BLOCK_DISP_0) ||
(PP_BLOCK(hist->block) >= MDP_BLOCK_MAX))
@@ -3357,20 +3367,41 @@
ret = -EPERM;
goto hist_collect_exit;
}
+
if (PP_LOCAT(hist->block) == MDSS_PP_DSPP_CFG) {
- hist_info = &mdss_pp_res->dspp_hist[disp_num];
for (i = 0; i < hist_cnt; i++) {
dspp_num = mixer_id[i];
- hist_info = &mdss_pp_res->dspp_hist[dspp_num];
+ hists[i] = &mdss_pp_res->dspp_hist[dspp_num];
+ }
+ for (i = 0; i < hist_cnt; i++) {
+ spin_lock_irqsave(&hists[i]->hist_lock, flag);
+ /* mark that collect is ready to handle completions */
+ hists[i]->read_request = 1;
+ spin_unlock_irqrestore(&hists[i]->hist_lock, flag);
+ }
+ for (i = 0; i < hist_cnt; i++) {
+ dspp_num = mixer_id[i];
ctl_base = mdss_mdp_get_dspp_addr_off(dspp_num) +
MDSS_MDP_REG_DSPP_HIST_CTL_BASE;
exp_sum = (mdata->mixer_intf[dspp_num].width *
mdata->mixer_intf[dspp_num].height);
- ret = pp_hist_collect(hist, hist_info, ctl_base,
- exp_sum);
if (ret)
- goto hist_collect_exit;
+ temp_ret = ret;
+ ret = pp_hist_collect(hist, hists[i], ctl_base,
+ exp_sum);
}
+ for (i = 0; i < hist_cnt; i++) {
+ /* reset read requests and re-intialize completions */
+ spin_lock_irqsave(&hists[i]->hist_lock, flag);
+ hists[i]->read_request = 0;
+ INIT_COMPLETION(hists[i]->comp);
+ spin_unlock_irqrestore(&hists[i]->hist_lock, flag);
+ }
+ if (ret || temp_ret) {
+ ret = ret ? ret : temp_ret;
+ goto hist_collect_exit;
+ }
+
if (hist->bin_cnt != HIST_V_SIZE) {
pr_err("User not expecting size %d output",
HIST_V_SIZE);
@@ -3386,19 +3417,19 @@
}
memset(hist_concat, 0, HIST_V_SIZE * sizeof(u32));
for (i = 0; i < hist_cnt; i++) {
- dspp_num = mixer_id[i];
- hist_info = &mdss_pp_res->dspp_hist[dspp_num];
- mutex_lock(&hist_info->hist_mutex);
+ mutex_lock(&hists[i]->hist_mutex);
for (j = 0; j < HIST_V_SIZE; j++)
- hist_concat[j] += hist_info->data[j];
- mutex_unlock(&hist_info->hist_mutex);
+ hist_concat[j] += hists[i]->data[j];
+ mutex_unlock(&hists[i]->hist_mutex);
}
hist_data_addr = hist_concat;
} else {
- hist_data_addr = hist_info->data;
+ hist_data_addr = hists[0]->data;
}
- hist_info = &mdss_pp_res->dspp_hist[disp_num];
- hist_info->hist_cnt_sent++;
+
+ for (i = 0; i < hist_cnt; i++)
+ hists[i]->hist_cnt_sent++;
+
} else if (PP_LOCAT(hist->block) == MDSS_PP_SSPP_CFG) {
hist_cnt = MDSS_PP_ARG_MASK & hist->block;
@@ -3434,14 +3465,50 @@
continue;
}
hist_info = &pipe->pp_res.hist;
+ spin_lock_irqsave(&hist_info->hist_lock, flag);
+ hist_info->read_request = 1;
+ spin_unlock_irqrestore(&hist_info->hist_lock, flag);
+ }
+ for (i = pipe_num; i < MDSS_PP_ARG_NUM; i++) {
+ if (!PP_ARG(i, hist->block))
+ continue;
+ pipe_cnt++;
+ pipe = mdss_mdp_pipe_get(mdata, BIT(i));
+ if (IS_ERR_OR_NULL(pipe) ||
+ pipe->num > MDSS_MDP_SSPP_VIG2) {
+ pr_warn("Invalid Hist pipe (%d)", i);
+ continue;
+ }
+ hist_info = &pipe->pp_res.hist;
ctl_base = pipe->base +
MDSS_MDP_REG_VIG_HIST_CTL_BASE;
+ if (ret)
+ temp_ret = ret;
ret = pp_hist_collect(hist, hist_info, ctl_base,
exp_sum);
mdss_mdp_pipe_unmap(pipe);
- if (ret)
- goto hist_collect_exit;
}
+ for (i = pipe_num; i < MDSS_PP_ARG_NUM; i++) {
+ if (!PP_ARG(i, hist->block))
+ continue;
+ pipe_cnt++;
+ pipe = mdss_mdp_pipe_get(mdata, BIT(i));
+ if (IS_ERR_OR_NULL(pipe) ||
+ pipe->num > MDSS_MDP_SSPP_VIG2) {
+ pr_warn("Invalid Hist pipe (%d)", i);
+ continue;
+ }
+ hist_info = &pipe->pp_res.hist;
+ spin_lock_irqsave(&hist_info->hist_lock, flag);
+ hist_info->read_request = 0;
+ INIT_COMPLETION(hist_info->comp);
+ spin_unlock_irqrestore(&hist_info->hist_lock, flag);
+ }
+ if (ret || temp_ret) {
+ ret = ret ? ret : temp_ret;
+ goto hist_collect_exit;
+ }
+
if (pipe_cnt != 0 &&
(hist->bin_cnt != (HIST_V_SIZE * pipe_cnt))) {
pr_err("User not expecting size %d output",
@@ -3539,8 +3606,10 @@
spin_lock(&hist_info->hist_lock);
hist_info->col_state = HIST_READY;
spin_unlock(&hist_info->hist_lock);
- if (hist_info->read_request)
+ if (hist_info->read_request == 1) {
complete(&hist_info->comp);
+ hist_info->read_request++;
+ }
}
/* Histogram Reset Done Interrupt */
if ((isr_blk & 0x2) &&
@@ -3708,7 +3777,6 @@
struct mdss_ad_init_cfg *init_cfg)
{
struct mdss_ad_info *ad;
- struct mdss_mdp_ctl *ctl;
struct msm_fb_data_type *bl_mfd;
int lin_ret = -1, inv_ret = -1, ret = 0;
u32 ratio_temp, shift = 0, last_ops;
@@ -3736,10 +3804,12 @@
if (init_cfg->params.init.bl_lin_len == AD_BL_LIN_LEN) {
lin_ret = copy_from_user(&ad->bl_lin,
init_cfg->params.init.bl_lin,
- AD_BL_LIN_LEN * sizeof(uint32_t));
+ init_cfg->params.init.bl_lin_len *
+ sizeof(uint32_t));
inv_ret = copy_from_user(&ad->bl_lin_inv,
init_cfg->params.init.bl_lin_inv,
- AD_BL_LIN_LEN * sizeof(uint32_t));
+ init_cfg->params.init.bl_lin_len *
+ sizeof(uint32_t));
if (lin_ret || inv_ret)
ret = -ENOMEM;
ratio_temp = mfd->panel_info->bl_max / AD_BL_LIN_LEN;
@@ -3748,13 +3818,14 @@
shift++;
}
ad->bl_bright_shift = shift;
- } else if (init_cfg->params.init.bl_lin_len) {
+ } else {
ret = -EINVAL;
}
- if (!lin_ret && !inv_ret)
+ if (ret) {
+ ad->state &= ~PP_AD_STATE_BL_LIN;
+ goto ad_config_exit;
+ } else
ad->state |= PP_AD_STATE_BL_LIN;
- else
- ad->state &= !PP_AD_STATE_BL_LIN;
ad->sts |= PP_AD_STS_DIRTY_INIT;
} else if (init_cfg->ops & MDP_PP_AD_CFG) {
@@ -3796,8 +3867,8 @@
ad->mfd = mfd;
ad->bl_mfd = bl_mfd;
}
+ad_config_exit:
mutex_unlock(&ad->lock);
- ctl = mfd_to_ctl(mfd);
return ret;
}
@@ -3869,7 +3940,7 @@
mutex_unlock(&ad->lock);
mutex_lock(&mfd->bl_lock);
MDSS_BRIGHT_TO_BL(bl, bl, mfd->panel_info->bl_max,
- MDSS_MAX_BL_BRIGHTNESS);
+ mfd->panel_info->brightness_max);
mdss_fb_set_backlight(mfd, bl);
mutex_unlock(&mfd->bl_lock);
mutex_lock(&ad->lock);
@@ -3891,7 +3962,7 @@
mutex_unlock(&ad->lock);
}
if (wait) {
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&ad->comp, HIST_WAIT_TIMEOUT(1));
if (ret == 0)
ret = -ETIMEDOUT;
@@ -4351,8 +4422,7 @@
MDSS_MDP_REG_AD_BL_OUT);
if (ad->state & PP_AD_STATE_BL_LIN) {
bl = bl >> ad->bl_bright_shift;
- bl = min_t(u32, bl,
- MDSS_MAX_BL_BRIGHTNESS);
+ bl = min_t(u32, bl, (AD_BL_LIN_LEN-1));
bl = ad->bl_lin_inv[bl];
bl = bl << ad->bl_bright_shift;
}
@@ -4515,6 +4585,14 @@
} else if ((ptr == base + MDSS_MDP_REG_DSPP_DITHER_DEPTH)) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
+ /* Six zone and mem color */
+ } else if (mdss_res->mdp_rev >= MDSS_MDP_HW_REV_103 &&
+ (ptr >= base + MDSS_MDP_REG_DSPP_SIX_ZONE_BASE) &&
+ (ptr <= base + MDSS_MDP_REG_DSPP_SIX_ZONE_BASE +
+ MDSS_MDP_SIX_ZONE_SIZE +
+ MDSS_MDP_MEM_COL_SIZE)) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
}
}
@@ -4531,7 +4609,10 @@
pipe = mdss_res->vig_pipes + counter;
base = pipe->base;
- if (ptr == base + MDSS_MDP_REG_SSPP_SRC_FORMAT) {
+ if (ptr == base + MDSS_MDP_REG_VIG_OP_MODE) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
+ } else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_FORMAT) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
} else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_CONSTANT_COLOR) {
@@ -4540,6 +4621,9 @@
} else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_UNPACK_PATTERN) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
+ } else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_OP_MODE) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
} else if ((ptr == base + MDSS_MDP_REG_VIG_QSEED2_SHARP)) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
@@ -4549,6 +4633,13 @@
MDSS_MDP_PA_SIZE)) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
+ /* Mem color range */
+ } else if (mdss_res->mdp_rev >= MDSS_MDP_HW_REV_103 &&
+ (ptr >= base + MDSS_MDP_REG_VIG_MEM_COL_BASE) &&
+ (ptr <= base + MDSS_MDP_REG_VIG_MEM_COL_BASE +
+ MDSS_MDP_MEM_COL_SIZE)) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
/* IGC range */
} else if ((ptr >= base + MDSS_MDP_REG_IGC_VIG_BASE) &&
(ptr <= base + MDSS_MDP_REG_IGC_VIG_BASE +
@@ -4580,6 +4671,9 @@
} else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_UNPACK_PATTERN) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
+ } else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_OP_MODE) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
/* IGC range */
} else if ((ptr >= base + MDSS_MDP_REG_IGC_RGB_BASE) &&
(ptr <= base + MDSS_MDP_REG_IGC_RGB_BASE +
@@ -4611,6 +4705,9 @@
} else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_UNPACK_PATTERN) {
ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
break;
+ } else if (ptr == base + MDSS_MDP_REG_SSPP_SRC_OP_MODE) {
+ ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE;
+ break;
/* IGC range */
} else if ((ptr >= base + MDSS_MDP_REG_IGC_DMA_BASE) &&
(ptr <= base + MDSS_MDP_REG_IGC_DMA_BASE +
diff --git a/drivers/video/msm/mdss/mdss_mdp_rotator.c b/drivers/video/msm/mdss/mdss_mdp_rotator.c
index e2e41bb..883a728 100644
--- a/drivers/video/msm/mdss/mdss_mdp_rotator.c
+++ b/drivers/video/msm/mdss/mdss_mdp_rotator.c
@@ -202,7 +202,7 @@
struct mdss_mdp_data *dst_data)
{
struct mdss_mdp_pipe *rot_pipe = NULL;
- struct mdss_mdp_ctl *ctl;
+ struct mdss_mdp_ctl *orig_ctl, *rot_ctl;
int ret;
if (!rot || !rot->ref_cnt)
@@ -218,20 +218,20 @@
pr_debug("queue rotator pnum=%d\n", rot_pipe->num);
- ctl = rot_pipe->mixer->ctl;
- if (ctl->shared_lock)
- mutex_lock(ctl->shared_lock);
+ orig_ctl = rot_pipe->mixer->ctl;
+ if (orig_ctl->shared_lock)
+ mutex_lock(orig_ctl->shared_lock);
- ctl = mdss_mdp_ctl_mixer_switch(ctl,
+ rot_ctl = mdss_mdp_ctl_mixer_switch(orig_ctl,
MDSS_MDP_WB_CTL_TYPE_BLOCK);
- if (!ctl) {
+ if (!rot_ctl) {
ret = -EINVAL;
goto error;
} else {
- rot->pipe->mixer = ctl->mixer_left;
+ rot->pipe->mixer = rot_ctl->mixer_left;
}
- if (rot->params_changed || ctl->mdata->mixer_switched) {
+ if (rot->params_changed || rot_ctl->mdata->mixer_switched) {
rot->params_changed = 0;
rot_pipe->flags = rot->flags;
rot_pipe->src_fmt = mdss_mdp_get_format_params(rot->format);
@@ -257,12 +257,12 @@
goto error;
}
- ret = mdss_mdp_rotator_kickoff(ctl, rot, dst_data);
+ ret = mdss_mdp_rotator_kickoff(rot_ctl, rot, dst_data);
return ret;
error:
- if (ctl->shared_lock)
- mutex_unlock(ctl->shared_lock);
+ if (orig_ctl->shared_lock)
+ mutex_unlock(orig_ctl->shared_lock);
return ret;
}
diff --git a/drivers/video/msm/mdss/mdss_panel.h b/drivers/video/msm/mdss/mdss_panel.h
index 65275db..a42ff1e 100644
--- a/drivers/video/msm/mdss/mdss_panel.h
+++ b/drivers/video/msm/mdss/mdss_panel.h
@@ -272,6 +272,7 @@
u32 type;
u32 wait_cycle;
u32 pdest;
+ u32 brightness_max;
u32 bl_max;
u32 bl_min;
u32 fb_num;
diff --git a/drivers/video/msm/mdss/mdss_qpic.c b/drivers/video/msm/mdss/mdss_qpic.c
index fa6bd3d..54b837a 100644
--- a/drivers/video/msm/mdss/mdss_qpic.c
+++ b/drivers/video/msm/mdss/mdss_qpic.c
@@ -368,7 +368,7 @@
phys_addr += block_len;
len -= block_len;
}
- ret = wait_for_completion_interruptible_timeout(
+ ret = wait_for_completion_timeout(
&qpic_res->qpic_endpt.completion,
msecs_to_jiffies(100 * 4));
if (ret <= 0)
diff --git a/drivers/video/msm/mdss/mhl_sii8334.c b/drivers/video/msm/mdss/mhl_sii8334.c
index ab01566..1f728e0 100644
--- a/drivers/video/msm/mdss/mhl_sii8334.c
+++ b/drivers/video/msm/mdss/mhl_sii8334.c
@@ -364,7 +364,7 @@
* after toggling reset line and enabling disc
* tx can take a while to generate intr
*/
- timeout = wait_for_completion_interruptible_timeout
+ timeout = wait_for_completion_timeout
(&mhl_ctrl->rgnd_done, HZ * 3);
if (!timeout) {
/*
@@ -1274,7 +1274,7 @@
INIT_COMPLETION(mhl_ctrl->msc_cmd_done);
MHL_SII_REG_NAME_WR(REG_CBUS_PRI_START, start_bit);
- timeout = wait_for_completion_interruptible_timeout
+ timeout = wait_for_completion_timeout
(&mhl_ctrl->msc_cmd_done, msecs_to_jiffies(T_ABORT_NEXT));
if (!timeout) {
pr_err("%s: cbus_command_send timed out!\n", __func__);
diff --git a/drivers/video/msm/mdss/splash.h b/drivers/video/msm/mdss/splash.h
new file mode 100644
index 0000000..dc8a473
--- /dev/null
+++ b/drivers/video/msm/mdss/splash.h
@@ -0,0 +1,5279 @@
+/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#ifndef __SPLASH_H_
+#define __SPLASH_H_
+
+#define SPLASH_IMAGE_WIDTH 113
+#define SPLASH_IMAGE_HEIGHT 124
+#define SPLASH_IMAGE_FORMAT MDP_BGR_888
+#define SPLASH_IMAGE_BPP 3
+
+char splash_bgr888_image[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10,
+ 0x29, 0x19, 0x31, 0x31,
+ 0x29, 0x31, 0x31, 0x29, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x31, 0x31,
+ 0x29, 0x4a, 0x52, 0x4a, 0x6b, 0x5a, 0x73, 0x4a, 0x52, 0x4a, 0x10, 0x29,
+ 0x19, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x31, 0x31, 0x29, 0x6b, 0x5a, 0x73, 0x6b, 0x7b, 0x73, 0x6b, 0x5a,
+ 0x4a, 0x31, 0x31, 0x29,
+ 0x3a, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x6b, 0x5a, 0x4a, 0x6b, 0x5a,
+ 0x73, 0x3a, 0x31, 0x4a,
+ 0x31, 0x31, 0x29, 0x10, 0x29, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x3a, 0x31,
+ 0x4a, 0x31, 0x31, 0x29,
+ 0x10, 0x29, 0x19, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x21, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x08,
+ 0x10, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x08, 0x08, 0x10,
+ 0x08, 0x08, 0x10, 0x10,
+ 0x29, 0x19, 0x10, 0x29, 0x19, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10,
+ 0x4a, 0x52, 0x4a, 0x08,
+ 0x08, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x08,
+ 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x29, 0x19, 0x4a, 0x52, 0x4a, 0x3a, 0x31, 0x4a,
+ 0x08, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x4a, 0x52, 0x4a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0x9c, 0xa5, 0x94, 0x9c, 0x7b, 0x94, 0x08, 0x08, 0x10, 0x08,
+ 0x08, 0x10, 0x10, 0x29,
+ 0x19, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x10, 0x21, 0x00,
+ 0x08, 0x08, 0x10, 0x6b, 0x7b, 0x73, 0x9c, 0x7b, 0x94, 0x9c, 0xa5, 0x94,
+ 0xce, 0xad, 0xad, 0xa5,
+ 0xb5, 0xb5, 0x31, 0x31, 0x29, 0x08, 0x08, 0x10, 0x10, 0x29, 0x19, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0xa5, 0x9c, 0xad, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0x9c,
+ 0x7b, 0x94, 0x10, 0x29,
+ 0x19, 0x3a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x9c, 0x7b, 0x94, 0x9c, 0xa5, 0x94, 0xa5, 0xb5, 0xb5,
+ 0xa5, 0xb5, 0xb5, 0xce,
+ 0xde, 0xce, 0xc5, 0xad, 0xd6, 0x9c, 0xa5, 0x94, 0x3a, 0x10, 0x21, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x9c, 0x7b, 0x94, 0xce, 0xad, 0xad, 0xce, 0xe6, 0xef, 0xce,
+ 0xe6, 0xef, 0xe6, 0xde,
+ 0xde, 0xa5, 0x9c, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6b, 0x5a, 0x73, 0xce, 0xde, 0xce, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xde, 0xce, 0x6b,
+ 0x7b, 0x73, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x29, 0x19, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0x9c,
+ 0xa5, 0x94, 0xce, 0xde,
+ 0xce, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0xce, 0xde, 0xce, 0xff, 0xf7, 0xff,
+ 0xff, 0xf7, 0xff, 0x9c,
+ 0xa5, 0x94, 0x00, 0x00, 0x00, 0x31, 0x31, 0x29, 0xef, 0xf7, 0xe6, 0xff,
+ 0xf7, 0xff, 0xef, 0xde,
+ 0xef, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0xff, 0xf7, 0xff, 0x10,
+ 0x29, 0x19, 0x08, 0x08,
+ 0x10, 0x4a, 0x52, 0x4a, 0xce, 0xad, 0xad, 0xff, 0xff, 0xff, 0x4a, 0x52,
+ 0x4a, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0xce, 0xad, 0xad,
+ 0xef, 0xf7, 0xff, 0xce,
+ 0xde, 0xce, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x9c, 0x7b, 0x94, 0x31,
+ 0x31, 0x29, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0x4a, 0x52, 0x4a, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x5a, 0x73, 0xef,
+ 0xf7, 0xe6, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x6b, 0x7b, 0x73, 0x08, 0x08, 0x10, 0xff, 0xff,
+ 0xff, 0x6b, 0x7b, 0x73,
+ 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x4a, 0x52, 0x4a, 0x08, 0x08, 0x10,
+ 0xce, 0xde, 0xce, 0xff,
+ 0xff, 0xff, 0x10, 0x29, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31,
+ 0x31, 0x29, 0x4a, 0x52,
+ 0x4a, 0xa5, 0xb5, 0xb5, 0xff, 0xff, 0xff, 0x9c, 0x7b, 0x94, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0xe6, 0xde,
+ 0xde, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x31, 0x31, 0x29, 0x08, 0x08,
+ 0x10, 0xff, 0xff, 0xff,
+ 0x4a, 0x52, 0x4a, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x9c,
+ 0x7b, 0x94, 0xff, 0xff, 0xff, 0x3a, 0x10, 0x21, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x08, 0x08, 0x10, 0x6b, 0x5a, 0x73, 0xff, 0xff, 0xff, 0xa5, 0xb5,
+ 0xb5, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x4a, 0x52,
+ 0x4a, 0xef, 0xf7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xe6, 0xde, 0xde, 0x08, 0x31, 0x5a, 0x10, 0x7b, 0x9c, 0x10, 0x7b, 0x9c,
+ 0x10, 0x7b, 0x9c, 0x10,
+ 0x52, 0x7b, 0x31, 0x31, 0x29, 0xef, 0xf7, 0xff, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xa5, 0x94, 0xff, 0xff,
+ 0xff, 0xa5, 0x9c, 0xad,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x21, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x08, 0x08, 0x10, 0xff, 0xf7, 0xff, 0x4a, 0x52, 0x4a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x31, 0x5a, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xd6, 0x00, 0xbd, 0xef,
+ 0x00, 0xbd, 0xef, 0x00,
+ 0x9c, 0xd6, 0x08, 0xa5, 0xad, 0x08, 0xad, 0xd6, 0x10, 0xce, 0xce, 0x6b,
+ 0x7b, 0x9c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0x6b, 0x5a, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0xce, 0xde, 0xce, 0xff, 0xf7,
+ 0xff, 0x10, 0x29, 0x19,
+ 0x10, 0x5a, 0x9c, 0x00, 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xd6, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xd6, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd,
+ 0xef, 0x08, 0xa5, 0xad, 0x08, 0x31, 0x5a, 0x10, 0x29, 0x19, 0xff, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xe6, 0xde, 0xde, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x5a,
+ 0x73, 0xef, 0xf7, 0xe6,
+ 0x19, 0x7b, 0xbd, 0x19, 0x7b, 0xbd, 0x08, 0xad, 0xd6, 0x00, 0xbd, 0xef,
+ 0x10, 0xc5, 0xef, 0x00,
+ 0xbd, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x3a, 0xde, 0xef, 0x19,
+ 0xbd, 0xf7, 0x3a, 0xde,
+ 0xef, 0x3a, 0xde, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad,
+ 0xd6, 0x19, 0x94, 0xce,
+ 0xa5, 0xb5, 0xb5, 0x4a, 0x5a, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10,
+ 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xd6,
+ 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x10, 0xc5, 0xef, 0x10, 0xe6, 0xef, 0x19,
+ 0xbd, 0xf7, 0x3a, 0xde,
+ 0xef, 0x3a, 0xde, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xe6, 0xef, 0x10, 0xe6,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x10, 0xe6, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xd6, 0x08, 0x31, 0x3a,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10,
+ 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6,
+ 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x10,
+ 0xc5, 0xef, 0x6b, 0xe6,
+ 0xef, 0x3a, 0xde, 0xef, 0x10, 0xe6, 0xef, 0x10, 0xe6, 0xef, 0x10, 0xc5,
+ 0xef, 0x10, 0xe6, 0xef,
+ 0x10, 0xc5, 0xef, 0x10, 0xe6, 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7,
+ 0x19, 0x7b, 0xbd, 0x00,
+ 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x31, 0x5a, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6,
+ 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xef, 0x10, 0xc5, 0xef, 0x10,
+ 0xc5, 0xef, 0x10, 0xe6,
+ 0xef, 0x3a, 0xde, 0xef, 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xe6,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x10, 0xe6, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0x84, 0xbd, 0x10, 0x7b, 0x9c,
+ 0x00, 0xbd, 0xef, 0x10,
+ 0x73, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x52, 0x7b, 0x19, 0x7b, 0xbd, 0x00, 0x9c, 0xd6,
+ 0x19, 0x94, 0xce, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x10,
+ 0xe6, 0xef, 0x19, 0xbd,
+ 0xf7, 0x6b, 0xe6, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xe6, 0xef, 0x10, 0xe6,
+ 0xef, 0x10, 0xe6, 0xef,
+ 0x10, 0xc5, 0xef, 0x00, 0x9c, 0xd6, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6,
+ 0x19, 0x94, 0xce, 0x00,
+ 0x9c, 0xd6, 0x10, 0x52, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x31, 0x5a,
+ 0x08, 0xa5, 0xad, 0x08,
+ 0xad, 0xef, 0x00, 0xbd, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x10,
+ 0xc5, 0xef, 0x10, 0xc5,
+ 0xef, 0x10, 0xe6, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xe6, 0xef, 0x10, 0xc5,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x19, 0xbd, 0xf7, 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce,
+ 0x08, 0xad, 0xd6, 0x00,
+ 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x08, 0x31, 0x3a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x31, 0x31, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x31, 0x3a, 0x10,
+ 0x52, 0x7b, 0x10, 0x7b, 0x9c, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x10, 0xc5,
+ 0xef, 0x3a, 0xde, 0xef, 0x10, 0xe6, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xe6,
+ 0xef, 0x08, 0xad, 0xd6,
+ 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x00, 0x9c, 0xd6, 0x19, 0x94, 0xce,
+ 0x00, 0x9c, 0xd6, 0x00,
+ 0x9c, 0xd6, 0x19, 0x7b, 0xbd, 0x19, 0x7b, 0xbd, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10, 0x9c, 0x7b, 0x73, 0x6b, 0x5a, 0x73, 0x10, 0x29,
+ 0x19, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x73, 0xa5, 0xad, 0x10, 0x52, 0x7b, 0x10, 0x52, 0x7b, 0x00,
+ 0x84, 0xbd, 0x08, 0xa5,
+ 0xad, 0x08, 0xad, 0xd6, 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x10, 0x73,
+ 0x7b, 0x10, 0x5a, 0x9c,
+ 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6, 0x00, 0x9c, 0xd6, 0x00, 0x9c, 0xd6,
+ 0x00, 0x9c, 0xd6, 0x00,
+ 0x84, 0xbd, 0x3a, 0xa5, 0xce, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0x6b,
+ 0x5a, 0x73, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0x6b, 0x7b,
+ 0x9c, 0x9c, 0x7b, 0x73,
+ 0x31, 0x31, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x31, 0x31, 0x29, 0xc5, 0xad, 0xd6, 0x52, 0xa5, 0xa5, 0x10,
+ 0x5a, 0x9c, 0x10, 0x7b,
+ 0x9c, 0x19, 0x94, 0xce, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xd6, 0x19, 0x94,
+ 0xce, 0x00, 0x9c, 0xd6,
+ 0x00, 0x9c, 0xd6, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce,
+ 0x00, 0x84, 0xbd, 0x19,
+ 0x7b, 0xbd, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xce, 0xde, 0xce, 0xa5,
+ 0xb5, 0xb5, 0xa5, 0xb5,
+ 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21,
+ 0x00, 0x6b, 0x7b, 0x73,
+ 0x9c, 0x7b, 0x94, 0x6b, 0x7b, 0x73, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x4a, 0x52, 0x4a, 0xa5, 0xd6, 0xad, 0xc5,
+ 0xad, 0xd6, 0x4a, 0x7b,
+ 0x9c, 0x10, 0x5a, 0x9c, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6, 0x00, 0x84,
+ 0xbd, 0x00, 0x9c, 0xd6,
+ 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd,
+ 0x19, 0x7b, 0xbd, 0x73,
+ 0xa5, 0xad, 0xa5, 0xb5, 0xb5, 0xc5, 0xad, 0xd6, 0xa5, 0xb5, 0xb5, 0xe6,
+ 0xde, 0xde, 0xce, 0xde,
+ 0xce, 0xce, 0xad, 0xad, 0x10, 0x29, 0x19, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x4a, 0x52, 0x4a, 0x6b, 0x7b, 0x73, 0x31, 0x31, 0x29, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x31, 0x4a, 0xce,
+ 0xad, 0xad, 0xce, 0xde,
+ 0xce, 0xa5, 0xb5, 0xb5, 0x73, 0xa5, 0xad, 0x10, 0x73, 0x7b, 0x10, 0x5a,
+ 0x9c, 0x10, 0x7b, 0x9c,
+ 0x10, 0x5a, 0xbd, 0x10, 0x7b, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c,
+ 0x19, 0x7b, 0xbd, 0xa5,
+ 0xb5, 0xb5, 0xa5, 0xb5, 0xb5, 0xc5, 0xad, 0xd6, 0xa5, 0xd6, 0xad, 0xef,
+ 0xde, 0xef, 0xef, 0xf7,
+ 0xe6, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x9c, 0xad, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0xe6, 0xde,
+ 0xde, 0xc5, 0xad, 0xd6, 0xa5, 0xb5, 0xb5, 0xce, 0xad, 0xad, 0x9c, 0xad,
+ 0xce, 0x52, 0xa5, 0xa5,
+ 0x10, 0x5a, 0x9c, 0x10, 0x7b, 0x9c, 0x10, 0x5a, 0x9c, 0x52, 0xa5, 0xa5,
+ 0x73, 0xa5, 0xad, 0xc5,
+ 0xad, 0xd6, 0xa5, 0xb5, 0xb5, 0xce, 0xde, 0xce, 0xce, 0xde, 0xce, 0xef,
+ 0xde, 0xef, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7,
+ 0xe6, 0x08, 0x08, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xef, 0xf7,
+ 0xe6, 0xef, 0xf7, 0xe6, 0xce, 0xde, 0xce, 0xce, 0xde, 0xce, 0xa5, 0xb5,
+ 0xb5, 0xce, 0xde, 0xce,
+ 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xa5, 0xb5, 0xb5, 0xce, 0xde, 0xce,
+ 0xce, 0xad, 0xad, 0xc5,
+ 0xad, 0xd6, 0xa5, 0xd6, 0xad, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xe6,
+ 0xde, 0xde, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xa5, 0xb5, 0xb5, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x21, 0x00, 0x00,
+ 0x00, 0x00, 0x9c, 0xa5,
+ 0x94, 0xff, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xc5, 0xad,
+ 0xd6, 0xa5, 0xb5, 0xb5,
+ 0xce, 0xad, 0xad, 0xc5, 0xad, 0xd6, 0xa5, 0xb5, 0xb5, 0xce, 0xad, 0xad,
+ 0xc5, 0xad, 0xd6, 0xa5,
+ 0xd6, 0xad, 0xc5, 0xad, 0xd6, 0xce, 0xde, 0xce, 0xef, 0xde, 0xef, 0xef,
+ 0xf7, 0xe6, 0xff, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x31, 0x31, 0x29, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x08,
+ 0x08, 0x10, 0x10, 0x29,
+ 0x19, 0xef, 0xde, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xc5, 0xad, 0xd6, 0xa5, 0xd6, 0xad, 0xa5, 0xb5, 0xb5, 0xce, 0xde, 0xce,
+ 0xa5, 0xb5, 0xb5, 0xce,
+ 0xde, 0xce, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xef, 0xf7, 0xe6, 0xef,
+ 0xf7, 0xff, 0xff, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde,
+ 0x08, 0x08, 0x10, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x21,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0xe6, 0xde, 0xde, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xe6, 0xde, 0xde, 0xce, 0xad, 0xad, 0xc5, 0xad, 0xd6,
+ 0xa5, 0xb5, 0xb5, 0xce,
+ 0xad, 0xad, 0xce, 0xde, 0xce, 0xce, 0xe6, 0xef, 0xff, 0xf7, 0xff, 0xff,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x4a, 0x52, 0x4a, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xe6,
+ 0xe6, 0xde, 0xde, 0xef,
+ 0xf7, 0xe6, 0xce, 0xe6, 0xef, 0xff, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xa5, 0x9c, 0xad, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08,
+ 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0xce, 0xde, 0xce, 0xef, 0xde,
+ 0xef, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef,
+ 0xf7, 0xff, 0x31, 0x31,
+ 0x29, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0xce, 0xad,
+ 0xad, 0xef, 0xf7, 0xe6,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xef,
+ 0xde, 0xef, 0xef, 0xf7,
+ 0xe6, 0x9c, 0xa5, 0x94, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31,
+ 0x29, 0xa5, 0xb5, 0xb5,
+ 0xce, 0xde, 0xce, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xe6, 0xef, 0xde, 0xef, 0xef,
+ 0xf7, 0xe6, 0xe6, 0xde,
+ 0xde, 0xce, 0xe6, 0xef, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xe6,
+ 0xef, 0xf7, 0xe6, 0xef,
+ 0xde, 0xef, 0xce, 0xe6, 0xef, 0xe6, 0xde, 0xde, 0xe6, 0xde, 0xde, 0xce,
+ 0xde, 0xce, 0xce, 0xde,
+ 0xce, 0xe6, 0xde, 0xde, 0xce, 0xad, 0xad, 0x08, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x10, 0x21, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x6b, 0x5a, 0x4a,
+ 0x73, 0xa5, 0xad, 0xce, 0xad, 0xad, 0xc5, 0xad, 0xd6, 0xe6, 0xde, 0xde,
+ 0xe6, 0xde, 0xde, 0xff,
+ 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef,
+ 0xde, 0xef, 0xce, 0xde,
+ 0xce, 0xef, 0xde, 0xef, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xde, 0xef,
+ 0xce, 0xde, 0xce, 0xc5,
+ 0xad, 0xd6, 0xce, 0xde, 0xce, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xa5,
+ 0xb5, 0xb5, 0xc5, 0xad,
+ 0xd6, 0xa5, 0xb5, 0xb5, 0xc5, 0xad, 0xd6, 0xef, 0xf7, 0xff, 0x4a, 0x52,
+ 0x4a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x10, 0x29, 0x19,
+ 0x6b, 0x5a, 0x73, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xce, 0xde, 0xce,
+ 0xef, 0xf7, 0xe6, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xef, 0xde, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xe6, 0xde, 0xde, 0xce, 0xde, 0xce, 0xc5,
+ 0xad, 0xd6, 0xce, 0xde,
+ 0xce, 0xce, 0xad, 0xad, 0xce, 0xde, 0xce, 0xa5, 0xb5, 0xb5, 0xce, 0xde,
+ 0xce, 0xff, 0xf7, 0xff,
+ 0x31, 0x31, 0x29, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a, 0x52, 0x4a,
+ 0x31, 0x31, 0x29, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0xa5, 0x9c, 0xad, 0xce, 0xde, 0xce, 0xce, 0xe6, 0xef,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xce, 0xe6, 0xef, 0xe6, 0xde, 0xde, 0xce, 0xde, 0xce, 0xc5, 0xad,
+ 0xd6, 0xce, 0xad, 0xad,
+ 0xe6, 0xde, 0xde, 0xff, 0xf7, 0xff, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x31, 0x31, 0x29, 0x3a, 0x10, 0x21, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x31, 0x31,
+ 0x29, 0x00, 0x00, 0x00,
+ 0x10, 0x21, 0x00, 0x6b, 0x5a, 0x73, 0xce, 0xde, 0xce, 0xff, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xce, 0xde, 0xce,
+ 0xce, 0xde, 0xce, 0x9c, 0xad, 0xce, 0xef, 0xf7, 0xe6, 0xa5, 0x9c, 0xad,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x3a, 0x31, 0x4a, 0x10,
+ 0x29, 0x19, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52,
+ 0x4a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0xe6, 0xde, 0xde, 0xef, 0xf7, 0xe6,
+ 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xf7, 0xff,
+ 0xef, 0xf7, 0xff, 0xef, 0xde, 0xef, 0xce, 0xe6, 0xad, 0xc5, 0xad, 0xd6,
+ 0xff, 0xff, 0xff, 0x10,
+ 0x29, 0x19, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x31, 0x31,
+ 0x29, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29,
+ 0x19, 0x08, 0x08, 0x10,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x5a, 0x73, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xde, 0xef,
+ 0xce, 0xde, 0xce, 0xce,
+ 0xde, 0xce, 0xce, 0xad, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+ 0x21, 0x00, 0x08, 0x08,
+ 0x10, 0x08, 0x08, 0x10, 0x4a, 0x52, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x4a, 0x52, 0x4a,
+ 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0xf7, 0xe6,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xde, 0xef, 0xce, 0xde, 0xce, 0xef, 0xf7, 0xff, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x3a, 0x10,
+ 0x21, 0x31, 0x31, 0x29, 0x31, 0x31, 0x29, 0x08, 0x08, 0x10, 0x10, 0x29,
+ 0x19, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x29, 0x19,
+ 0x3a, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x7b, 0x94,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0x4a,
+ 0x52, 0x4a, 0x00, 0x00,
+ 0x00, 0x10, 0x29, 0x19, 0x4a, 0x52, 0x4a, 0x31, 0x31, 0x29, 0x08, 0x08,
+ 0x10, 0x3a, 0x31, 0x4a,
+ 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x4a, 0x52, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xce, 0xde,
+ 0xce, 0x3a, 0x10, 0x21, 0x10, 0x29, 0x19, 0x3a, 0x31, 0x4a, 0x3a, 0x10,
+ 0x21, 0x10, 0x21, 0x00,
+ 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x3a, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x9c, 0x7b, 0x94, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xe6, 0xef, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0x3a, 0x10, 0x21, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x29,
+ 0x08, 0x08, 0x10, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x31, 0x31, 0x29, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xe6, 0xde, 0xde,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4a, 0x52,
+ 0x4a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x31,
+ 0x31, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x29, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe6, 0xde, 0xde, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xe6, 0xde, 0xde, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xf7, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0x9c, 0x7b, 0x94,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x10, 0x29, 0x19, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x29, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xce,
+ 0xe6, 0xef, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xa5, 0xb5, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x3a, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x31, 0x31, 0x29, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf7, 0xff, 0xef,
+ 0xf7, 0xe6, 0xe6, 0xde, 0xde, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xce, 0xde, 0xce, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x29, 0x19, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x31,
+ 0x31, 0x29, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0xce, 0xad, 0xad, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xde, 0xef, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x29, 0x19, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x21, 0x00, 0x3a, 0x31, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce,
+ 0xe6, 0xef, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0xff, 0xce, 0xe6, 0xef, 0xe6, 0xde, 0xde, 0xef,
+ 0xf7, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x3a,
+ 0x31, 0x4a, 0x08, 0x08,
+ 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x4a, 0x52, 0x4a, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde, 0xe6,
+ 0xde, 0xde, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x4a, 0x52,
+ 0x4a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x21, 0x4a, 0x52, 0x4a, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce,
+ 0xe6, 0xef, 0xe6, 0xde,
+ 0xde, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x10, 0x29, 0x19, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x3a, 0x31, 0x4a, 0x6b,
+ 0x7b, 0x73, 0x08, 0x00,
+ 0x00, 0x10, 0x29, 0x19, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xe6, 0xde,
+ 0xde, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x29, 0x19, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10,
+ 0x29, 0x19, 0x6b, 0x5a,
+ 0x73, 0x08, 0x00, 0x00, 0x10, 0x29, 0x19, 0xff, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xe6, 0xde, 0xde, 0xe6, 0xde, 0xde, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x31, 0x31, 0x29, 0x08, 0x00, 0x00, 0x31, 0x31, 0x29, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xff, 0xe6, 0xde, 0xde, 0xef, 0xf7, 0xe6, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xe6, 0xde, 0xde, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x29, 0x19, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x31, 0x4a, 0x31, 0x31,
+ 0x29, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde, 0xce, 0xe6,
+ 0xef, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff, 0xff, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5,
+ 0xb5, 0xb5, 0x00, 0x00,
+ 0x00, 0x10, 0x21, 0x00, 0x3a, 0x31, 0x4a, 0x10, 0x29, 0x19, 0x3a, 0x08,
+ 0x00, 0x08, 0x08, 0x10,
+ 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x31, 0x31, 0x29, 0x10, 0x29, 0x19,
+ 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x10,
+ 0x7b, 0x9c, 0x10, 0xc5,
+ 0xef, 0x10, 0xc5, 0xef, 0x10, 0x7b, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x4a, 0x52, 0x4a,
+ 0xef, 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xde,
+ 0xde, 0xef, 0xf7, 0xe6,
+ 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x6b, 0x5a,
+ 0x4a, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x3a, 0x10, 0x21, 0x6b,
+ 0x5a, 0x73, 0x10, 0x29, 0x19, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19,
+ 0x94, 0xce, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad,
+ 0xd6, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x4a, 0x5a, 0x73, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xe6, 0xde, 0xde,
+ 0xef, 0xde, 0xef, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xe6, 0xef, 0xce,
+ 0xe6, 0xef, 0xce, 0xe6,
+ 0xef, 0x08, 0x10, 0x42, 0x10, 0x29, 0x19, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x31, 0x31, 0x29, 0x4a, 0x52, 0x4a, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19,
+ 0x7b, 0xbd, 0x00, 0x9c,
+ 0xd6, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0x9c, 0xd6, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x4a, 0x52, 0x4a,
+ 0xef, 0xde, 0xef, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff,
+ 0xe6, 0xde, 0xde, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0x08, 0xad, 0xd6, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x08, 0x08, 0x10, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x31, 0x31, 0x29, 0x10, 0x29, 0x19, 0x3a,
+ 0x10, 0x21, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x84,
+ 0xbd, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0x7b, 0xbd, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x31,
+ 0x31, 0x29, 0xe6, 0xde, 0xde, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xce, 0xe6, 0xef, 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xe6, 0xef, 0x08,
+ 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x10, 0xe6, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xe6, 0xef, 0x08, 0x08,
+ 0x10, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x29, 0x19, 0x10, 0x29, 0x19, 0x00,
+ 0x00, 0x00, 0x00, 0x84,
+ 0xbd, 0x10, 0xe6, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x19, 0x7b,
+ 0xbd, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x10, 0xc5, 0xef,
+ 0x10, 0x5a, 0x9c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x29, 0x19, 0xce, 0xde, 0xce, 0xff,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xde, 0xde, 0xef, 0xde, 0xef,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xce,
+ 0xe6, 0xef, 0x00, 0x9c,
+ 0xd6, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad,
+ 0xd6, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x08, 0x31,
+ 0x3a, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x10, 0xc5, 0xef, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x84,
+ 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x00, 0xbd, 0xef,
+ 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x00,
+ 0xbd, 0xef, 0x08, 0x31, 0x3a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x9c, 0xa5,
+ 0x94, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xce, 0xe6,
+ 0xef, 0x08, 0xad, 0xd6, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0x94, 0xce,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x19, 0x94, 0xce, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x84, 0xbd, 0x00,
+ 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x00, 0x84, 0xbd, 0x19,
+ 0x94, 0xce, 0x00, 0x84,
+ 0xbd, 0x08, 0xad, 0xd6, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x4a, 0x52, 0x4a, 0xff, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xef, 0xde,
+ 0xef, 0x9c, 0xde, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0x84, 0xbd, 0x08, 0x31, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x10, 0x5a, 0x9c, 0x08, 0xad, 0xd6, 0x00, 0xbd, 0xef, 0x10, 0xc5,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x19,
+ 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19,
+ 0x7b, 0xbd, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31,
+ 0x29, 0xce, 0xe6, 0xef,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xce, 0xe6,
+ 0xef, 0xce, 0xad, 0xad, 0x9c, 0xad, 0xce, 0x19, 0x94, 0xce, 0x08, 0xad,
+ 0xef, 0x00, 0xbd, 0xef,
+ 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x10, 0x5a, 0x9c, 0x08, 0x08, 0x10,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x08,
+ 0x10, 0x10, 0x73, 0x7b, 0x00, 0x9c, 0xd6, 0x00, 0xbd, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0xbd, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0xbd, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x10, 0xce,
+ 0xce, 0x08, 0x31, 0x3a, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x08, 0x10, 0xce, 0xde, 0xce, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xc5, 0xad, 0xd6, 0xce, 0xde, 0xce, 0x9c, 0xad, 0xce, 0x08, 0xad,
+ 0xd6, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x00, 0x9c, 0xd6, 0x19, 0x7b, 0xbd,
+ 0x10, 0x7b, 0x9c, 0x08,
+ 0x31, 0x5a, 0x08, 0x31, 0x3a, 0x08, 0x08, 0x10, 0x08, 0x31, 0x3a, 0x08,
+ 0x31, 0x3a, 0x10, 0x5a,
+ 0x9c, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x00, 0xbd,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x19, 0x7b, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7, 0x19, 0x94, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x7b, 0x94,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xa5, 0xb5, 0xb5, 0xce, 0xde, 0xce, 0x9c, 0xad,
+ 0xce, 0x19, 0x94, 0xce,
+ 0x08, 0xad, 0xd6, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x00, 0x9c, 0xd6,
+ 0x00, 0x9c, 0xd6, 0x00,
+ 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x19,
+ 0x7b, 0xbd, 0x00, 0x84,
+ 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xd6, 0x08,
+ 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xef, 0x10, 0x52,
+ 0x7b, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6b,
+ 0x7b, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7,
+ 0xe6, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xce, 0xad, 0xad, 0xce, 0xde,
+ 0xce, 0xa5, 0xb5, 0xb5,
+ 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef,
+ 0x19, 0x94, 0xce, 0x00,
+ 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00,
+ 0x84, 0xbd, 0x00, 0x84,
+ 0xbd, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x10, 0xc5, 0xef, 0x19,
+ 0x94, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x7b, 0xbd, 0x19,
+ 0x94, 0xce, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x08,
+ 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xd6,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xde, 0xce, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xce, 0xde,
+ 0xce, 0xc5, 0xad, 0xd6,
+ 0xa5, 0xb5, 0xb5, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xd6,
+ 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x00, 0x9c, 0xd6, 0x00, 0x9c, 0xd6, 0x00,
+ 0x9c, 0xd6, 0x00, 0x9c,
+ 0xd6, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x84, 0xbd, 0x00, 0x9c,
+ 0xd6, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xef,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0x7b, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x5a, 0x73, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xce, 0xde, 0xce,
+ 0xa5, 0xb5, 0xb5, 0x9c, 0xad, 0xce, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6,
+ 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x19,
+ 0x94, 0xce, 0x08, 0xad,
+ 0xef, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad,
+ 0xef, 0x00, 0xbd, 0xef,
+ 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x10, 0x7b, 0xe6, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x00, 0xbd,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x08,
+ 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08,
+ 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x10, 0xe6, 0xef, 0x00, 0xbd, 0xef, 0x08, 0x31, 0x3a,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a,
+ 0x52, 0x4a, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xf7, 0xff,
+ 0xe6, 0xde, 0xde, 0xc5, 0xad, 0xd6, 0x29, 0x5a, 0x4a, 0x00, 0x84, 0xbd,
+ 0x19, 0x94, 0xce, 0x08,
+ 0xad, 0xd6, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x19, 0x94, 0xce, 0x08, 0xad, 0xd6, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x08, 0xad, 0xd6, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x9c, 0xa5,
+ 0x94, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7,
+ 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xff, 0xf7, 0xff,
+ 0xef, 0xf7, 0xff, 0xce, 0xde, 0xce, 0x4a, 0x52, 0x4a, 0x08, 0x31, 0x5a,
+ 0x00, 0x84, 0xbd, 0x00,
+ 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x08, 0xad,
+ 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0xbd, 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xd6, 0x19, 0x94,
+ 0xce, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x10,
+ 0xc5, 0xef, 0x10, 0x5a, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x9c, 0x7b,
+ 0x94, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4a, 0x52, 0x4a, 0x08, 0x00, 0x00,
+ 0x08, 0x31, 0x5a, 0x00,
+ 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xef, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x94,
+ 0xce, 0x00, 0x9c, 0xd6,
+ 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x10, 0x73, 0x7b, 0xe6,
+ 0xde, 0xde, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0x31, 0x31, 0x29, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10,
+ 0x52, 0x7b, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x08, 0xad, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x84, 0xbd,
+ 0x00, 0x9c, 0xd6, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xd6, 0x10, 0xc5, 0xef, 0x19,
+ 0x94, 0xce, 0x9c, 0xad,
+ 0xce, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xff, 0xef, 0xde, 0xef, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x52, 0x7b, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08,
+ 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x08,
+ 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x00, 0xbd, 0xf7,
+ 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x84, 0xbd,
+ 0x00, 0x84, 0xbd, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x08, 0xad,
+ 0xd6, 0x10, 0x7b, 0x9c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff,
+ 0xff, 0xef, 0xf7, 0xff,
+ 0xff, 0xff, 0xff, 0x9c, 0xa5, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x52, 0x7b, 0x00, 0x84, 0xbd, 0x08,
+ 0xad, 0xd6, 0x00, 0xbd,
+ 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0x94, 0xce, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00,
+ 0xbd, 0xef, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xd6, 0x00, 0x84, 0xbd, 0x10, 0x52, 0x7b, 0xef, 0xf7,
+ 0xe6, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xff, 0xff, 0xf7, 0xff, 0xef, 0xf7, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xf7, 0xff,
+ 0xce, 0xde, 0xce, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x52, 0x7b, 0x00,
+ 0x84, 0xbd, 0x19, 0x94,
+ 0xce, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x00, 0x9c, 0xd6, 0x19, 0x7b, 0xbd,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x19, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xef, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xd6, 0x10, 0x52,
+ 0x7b, 0x3a, 0x31, 0x4a,
+ 0xef, 0xf7, 0xe6, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6,
+ 0xff, 0xff, 0xff, 0xef,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xef, 0xf7, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xce, 0xde, 0xce,
+ 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x10,
+ 0x52, 0x7b, 0x00, 0x84,
+ 0xbd, 0x00, 0x9c, 0xd6, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x00, 0xbd, 0xf7,
+ 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xef, 0x19, 0x94, 0xce, 0x19, 0x94, 0xce, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x19, 0x7b, 0xbd, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xef,
+ 0x10, 0xc5, 0xef, 0x00,
+ 0xbd, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x00, 0x9c,
+ 0xd6, 0x10, 0x7b, 0x9c,
+ 0x08, 0x31, 0x5a, 0x00, 0x00, 0x00, 0x4a, 0x5a, 0x73, 0xce, 0xde, 0xce,
+ 0xef, 0xf7, 0xe6, 0xff,
+ 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xef, 0xf7,
+ 0xe6, 0xef, 0xf7, 0xff, 0xef, 0xf7, 0xe6, 0xa5, 0xb5, 0xb5, 0x6b, 0x5a,
+ 0x73, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x31, 0x3a, 0x10, 0x52,
+ 0x7b, 0x19, 0x7b, 0xbd, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x10, 0xc5,
+ 0xef, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x19, 0x7b, 0xbd, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6,
+ 0x19, 0x94, 0xce, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xf7, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x00, 0xbd,
+ 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x19,
+ 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xd6, 0x19, 0x94, 0xce,
+ 0x00, 0x84, 0xbd, 0x10, 0x52, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x08, 0x10, 0x10, 0x29, 0x19, 0x31, 0x31, 0x29, 0x31,
+ 0x31, 0x29, 0x08, 0x08,
+ 0x10, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x31,
+ 0x3a, 0x10, 0x52, 0x7b, 0x00, 0x84, 0xbd, 0x00, 0x9c, 0xd6, 0x08, 0xad,
+ 0xef, 0x10, 0xc5, 0xef,
+ 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad,
+ 0xef, 0x00, 0x84, 0xbd,
+ 0x19, 0x94, 0xce, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0xbd,
+ 0x19, 0x94, 0xce, 0x00,
+ 0x9c, 0xd6, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xef, 0x08, 0xad, 0xd6, 0x08,
+ 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x00, 0x9c, 0xd6, 0x10, 0x5a, 0x9c, 0x10, 0x52, 0x7b, 0x08, 0x31, 0x3a,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x00, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x31, 0x5a, 0x10, 0x5a, 0x9c, 0x00, 0x84, 0xbd, 0x19, 0x94,
+ 0xce, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7,
+ 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd, 0xf7, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x10,
+ 0xc5, 0xef, 0x00, 0xbd,
+ 0xef, 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x19, 0x94, 0xce, 0x00, 0x9c,
+ 0xd6, 0x00, 0x84, 0xbd,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x7b, 0x9c, 0x00,
+ 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x19,
+ 0x94, 0xce, 0x00, 0x9c,
+ 0xd6, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x08, 0xad, 0xd6, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xd6,
+ 0x08, 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef,
+ 0x10, 0xc5, 0xef, 0x08,
+ 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x00, 0xbd, 0xf7, 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x10, 0xc5, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd,
+ 0xf7, 0x08, 0xad, 0xd6,
+ 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x10, 0x7b, 0x9c, 0x10, 0x52, 0x7b,
+ 0x08, 0x31, 0x5a, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x3a, 0x10, 0x52, 0x7b, 0x00, 0x84,
+ 0xbd, 0x00, 0x84, 0xbd,
+ 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x10, 0xc5, 0xef,
+ 0x00, 0xbd, 0xf7, 0x10,
+ 0xc5, 0xef, 0x08, 0xad, 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xf7, 0x08, 0xad,
+ 0xef, 0x19, 0x94, 0xce, 0x08, 0xad, 0xd6, 0x00, 0x9c, 0xd6, 0x00, 0x9c,
+ 0xd6, 0x10, 0x5a, 0x9c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10,
+ 0x5a, 0x9c, 0x00, 0x84,
+ 0xbd, 0x19, 0x7b, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x19, 0x94,
+ 0xce, 0x00, 0x84, 0xbd,
+ 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef,
+ 0x19, 0x94, 0xce, 0x08,
+ 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xef, 0x19,
+ 0xbd, 0xf7, 0x00, 0xbd,
+ 0xef, 0x19, 0xbd, 0xf7, 0x08, 0xad, 0xef, 0x00, 0xbd, 0xf7, 0x10, 0xc5,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xef, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x10, 0x5a, 0x9c,
+ 0x10, 0x52, 0x7b, 0x08,
+ 0x31, 0x3a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x5a, 0x10, 0x52,
+ 0x7b, 0x00, 0x84, 0xbd,
+ 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x08, 0xad, 0xd6, 0x08, 0xad, 0xef,
+ 0x19, 0xbd, 0xf7, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x00,
+ 0xbd, 0xef, 0x08, 0xad,
+ 0xef, 0x19, 0x94, 0xce, 0x08, 0xad, 0xef, 0x00, 0x84, 0xbd, 0x00, 0x84,
+ 0xbd, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x10, 0x73, 0x7b, 0x10, 0x5a, 0x9c, 0x10, 0x7b,
+ 0x9c, 0x10, 0x5a, 0xbd,
+ 0x00, 0x84, 0xbd, 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd,
+ 0x00, 0x84, 0xbd, 0x00,
+ 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x08,
+ 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xd6, 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x10, 0x5a, 0x9c,
+ 0x10, 0x52, 0x7b, 0x10,
+ 0x52, 0x7b, 0x08, 0x31, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x21, 0x00, 0x08,
+ 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31,
+ 0x3a, 0x10, 0x52, 0x7b,
+ 0x10, 0x5a, 0x9c, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x08, 0xad, 0xef,
+ 0x08, 0xad, 0xd6, 0x08,
+ 0xad, 0xef, 0x08, 0xad, 0xef, 0x10, 0xc5, 0xef, 0x08, 0xad, 0xef, 0x08,
+ 0xad, 0xef, 0x19, 0x94,
+ 0xce, 0x00, 0x9c, 0xd6, 0x00, 0x84, 0xbd, 0x19, 0x7b, 0xbd, 0x10, 0x5a,
+ 0x9c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x10, 0x5a, 0x9c, 0x10, 0x52, 0x7b, 0x10, 0x5a, 0x9c,
+ 0x10, 0x5a, 0x9c, 0x10,
+ 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x00,
+ 0x84, 0xbd, 0x19, 0x94,
+ 0xce, 0x00, 0x9c, 0xd6, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x08, 0xad,
+ 0xef, 0x08, 0xad, 0xd6,
+ 0x19, 0x94, 0xce, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x10, 0x5a, 0x9c,
+ 0x10, 0x52, 0x7b, 0x10,
+ 0x52, 0x7b, 0x08, 0x31, 0x5a, 0x08, 0x08, 0x10, 0x08, 0x08, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x31, 0x3a,
+ 0x08, 0x31, 0x5a, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x19, 0x7b, 0xbd,
+ 0x00, 0x84, 0xbd, 0x00,
+ 0x9c, 0xd6, 0x08, 0xad, 0xd6, 0x19, 0x94, 0xce, 0x00, 0x9c, 0xd6, 0x19,
+ 0x94, 0xce, 0x00, 0x9c,
+ 0xd6, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x10, 0x5a,
+ 0x9c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x52, 0x7b, 0x10, 0x52, 0x7b, 0x10, 0x5a, 0x9c, 0x10,
+ 0x5a, 0x9c, 0x10, 0x5a,
+ 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x7b, 0x9c, 0x00, 0x84, 0xbd, 0x19, 0x7b,
+ 0xbd, 0x00, 0x84, 0xbd,
+ 0x19, 0x7b, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x10, 0x5a, 0x9c,
+ 0x10, 0x52, 0x7b, 0x10,
+ 0x52, 0x7b, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x5a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x08, 0x31, 0x5a, 0x10, 0x5a, 0x9c, 0x10, 0x7b, 0x9c,
+ 0x00, 0x84, 0xbd, 0x00,
+ 0x84, 0xbd, 0x19, 0x7b, 0xbd, 0x00, 0x84, 0xbd, 0x00, 0x84, 0xbd, 0x00,
+ 0x84, 0xbd, 0x00, 0x84,
+ 0xbd, 0x19, 0x7b, 0xbd, 0x10, 0x7b, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x52,
+ 0x7b, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x31, 0x5a, 0x10, 0x52, 0x7b, 0x10, 0x52, 0x7b, 0x10, 0x5a,
+ 0x9c, 0x10, 0x73, 0x7b,
+ 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x52, 0x7b,
+ 0x10, 0x52, 0x7b, 0x10,
+ 0x52, 0x7b, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x3a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x5a,
+ 0x10, 0x52, 0x7b, 0x10,
+ 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x7b, 0x9c, 0x10, 0x5a, 0x9c, 0x00,
+ 0x84, 0xbd, 0x00, 0x84,
+ 0xbd, 0x10, 0x7b, 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x08, 0x31,
+ 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31,
+ 0x5a, 0x10, 0x52, 0x7b,
+ 0x08, 0x31, 0x5a, 0x10, 0x52, 0x7b, 0x10, 0x52, 0x7b, 0x08, 0x31, 0x5a,
+ 0x10, 0x52, 0x7b, 0x08,
+ 0x31, 0x5a, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x3a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x31, 0x5a, 0x08,
+ 0x31, 0x5a, 0x10, 0x52, 0x7b, 0x10, 0x5a, 0x9c, 0x10, 0x5a, 0x9c, 0x10,
+ 0x5a, 0x9c, 0x10, 0x5a,
+ 0x9c, 0x10, 0x5a, 0x9c, 0x10, 0x52, 0x7b, 0x10, 0x52, 0x7b, 0x08, 0x31,
+ 0x5a, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x5a,
+ 0x08, 0x31, 0x5a, 0x08,
+ 0x31, 0x5a, 0x08, 0x31, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x31, 0x3a, 0x08, 0x31, 0x5a, 0x08,
+ 0x31, 0x5a, 0x10, 0x52,
+ 0x7b, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x5a, 0x08, 0x31, 0x3a, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+};
+
+#endif
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index aca1790..d0b8f98 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -109,10 +109,10 @@
if (ext4_handle_valid(handle)) {
err = jbd2_journal_dirty_metadata(handle, bh);
- if (err) {
- /* Errors can only happen if there is a bug */
- handle->h_err = err;
- __ext4_journal_stop(where, line, handle);
+ /* Errors can only happen if there is a bug */
+ if (WARN_ON_ONCE(err)) {
+ ext4_journal_abort_handle(where, line, __func__, bh,
+ handle, err);
}
} else {
if (inode)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e1fb1d5..48609bc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4105,6 +4105,7 @@
ext4_commit_super(sb, 1);
jbd2_journal_clear_err(journal);
+ jbd2_journal_update_sb_errno(journal);
}
}
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index e88748e..6c27436 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1267,6 +1267,8 @@
s_min_extra_isize) {
tried_min_extra_isize++;
new_extra_isize = s_min_extra_isize;
+ kfree(is); is = NULL;
+ kfree(bs); bs = NULL;
goto retry;
}
error = -1;
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 1afb701..9956ac6 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1340,7 +1340,7 @@
* Update a journal's errno. Write updated superblock to disk waiting for IO
* to complete.
*/
-static void jbd2_journal_update_sb_errno(journal_t *journal)
+void jbd2_journal_update_sb_errno(journal_t *journal)
{
journal_superblock_t *sb = journal->j_superblock;
@@ -1352,6 +1352,7 @@
jbd2_write_superblock(journal, WRITE_SYNC);
}
+EXPORT_SYMBOL(jbd2_journal_update_sb_errno);
/*
* Read the superblock for a given journal, performing initial
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 912c30a..2ed66ef 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1091,6 +1091,7 @@
extern int jbd2_journal_recover (journal_t *journal);
extern int jbd2_journal_wipe (journal_t *, int);
extern int jbd2_journal_skip_recovery (journal_t *);
+extern void jbd2_journal_update_sb_errno(journal_t *);
extern void jbd2_journal_update_sb_log_tail (journal_t *, tid_t,
unsigned long, int);
extern void __jbd2_journal_abort_hard (journal_t *);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 43aebb5..1740576 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -352,6 +352,9 @@
#define MMC_QUIRK_INAND_DATA_TIMEOUT (1<<8) /* For incorrect data timeout */
/* To avoid eMMC device getting broken permanently due to HPI feature */
#define MMC_QUIRK_BROKEN_HPI (1 << 11)
+ /* Skip data-timeout advertised by card */
+#define MMC_QUIRK_BROKEN_DATA_TIMEOUT (1<<12)
+
unsigned int erase_size; /* erase size in sectors */
unsigned int erase_shift; /* if erase unit is power 2 */
diff --git a/include/linux/msm_mdp.h b/include/linux/msm_mdp.h
index 0791545..121a00c 100644
--- a/include/linux/msm_mdp.h
+++ b/include/linux/msm_mdp.h
@@ -422,7 +422,7 @@
uint32_t val_region;
};
-#define MDP_SIX_ZONE_TABLE_NUM 384
+#define MDP_SIX_ZONE_LUT_SIZE 384
struct mdp_pa_v2_data {
/* Mask bits for PA features */
@@ -431,12 +431,13 @@
uint32_t global_sat_adj;
uint32_t global_val_adj;
uint32_t global_cont_adj;
- uint32_t *six_zone_curve_p0;
- uint32_t *six_zone_curve_p1;
- uint32_t six_zone_thresh;
struct mdp_pa_mem_col_cfg skin_cfg;
struct mdp_pa_mem_col_cfg sky_cfg;
struct mdp_pa_mem_col_cfg fol_cfg;
+ uint32_t six_zone_len;
+ uint32_t six_zone_thresh;
+ uint32_t *six_zone_curve_p0;
+ uint32_t *six_zone_curve_p1;
};
struct mdp_igc_lut_data {
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index ddbb6a9..289754e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -254,8 +254,9 @@
exclude_host : 1, /* don't count in host */
exclude_guest : 1, /* don't count in guest */
+ constraint_duplicate : 1,
- __reserved_1 : 43;
+ __reserved_1 : 42;
union {
__u32 wakeup_events; /* wakeup every n events */
@@ -740,6 +741,8 @@
int * __percpu pmu_disable_count;
struct perf_cpu_context * __percpu pmu_cpu_context;
int task_ctx_nr;
+ u32 events_across_hotplug:1,
+ reserved:31;
/*
* Fully disable/enable this PMU, can be used to protect from the PMI
diff --git a/include/linux/qpnp/power-on.h b/include/linux/qpnp/power-on.h
index 772bf62..ae4e731 100644
--- a/include/linux/qpnp/power-on.h
+++ b/include/linux/qpnp/power-on.h
@@ -52,6 +52,7 @@
int qpnp_pon_system_pwr_off(enum pon_power_off_type type);
int qpnp_pon_is_warm_reset(void);
int qpnp_pon_trigger_config(enum pon_trigger_source pon_src, bool enable);
+int qpnp_pon_wd_config(bool enable);
#else
static int qpnp_pon_system_pwr_off(enum pon_power_off_type type)
{
@@ -63,6 +64,10 @@
{
return -ENODEV;
}
+int qpnp_pon_wd_config(bool enable)
+{
+ return -ENODEV;
+}
#endif
#endif
diff --git a/include/linux/qpnp/qpnp-adc.h b/include/linux/qpnp/qpnp-adc.h
index 6e711c2..e6dcc3b 100644
--- a/include/linux/qpnp/qpnp-adc.h
+++ b/include/linux/qpnp/qpnp-adc.h
@@ -220,6 +220,8 @@
* btm parameters.
* %SCALE_QRD_SKUAA_BATT_THERM: Conversion to temperature(decidegC) based on
* btm parametersi for SKUAA.
+ * %SCALE_QRD_SKUG_BATT_THERM: Conversion to temperature(decidegC) based on
+ * btm parametersi for SKUG.
* %SCALE_NONE: Do not use this scaling type.
*/
enum qpnp_adc_scale_fn_type {
@@ -231,6 +233,7 @@
SCALE_THERM_150K_PULLUP,
SCALE_QRD_BATT_THERM,
SCALE_QRD_SKUAA_BATT_THERM,
+ SCALE_QRD_SKUG_BATT_THERM = 9,
SCALE_NONE,
};
@@ -1135,6 +1138,23 @@
const struct qpnp_vadc_chan_properties *chan_prop,
struct qpnp_vadc_result *chan_rslt);
/**
+ * qpnp_adc_scale_qrd_skug_batt_therm() - Scales the pre-calibrated digital output
+ * of an ADC to the ADC reference and compensates for the
+ * gain and offset. Returns the temperature in decidegC.
+ * @dev: Structure device for qpnp vadc
+ * @adc_code: pre-calibrated digital ouput of the ADC.
+ * @adc_prop: adc properties of the pm8xxx adc such as bit resolution,
+ * reference voltage.
+ * @chan_prop: individual channel properties to compensate the i/p scaling,
+ * slope and offset.
+ * @chan_rslt: physical result to be stored.
+ */
+int32_t qpnp_adc_scale_qrd_skug_batt_therm(struct qpnp_vadc_chip *dev,
+ int32_t adc_code,
+ const struct qpnp_adc_properties *adc_prop,
+ const struct qpnp_vadc_chan_properties *chan_prop,
+ struct qpnp_vadc_result *chan_rslt);
+/**
* qpnp_adc_scale_batt_id() - Scales the pre-calibrated digital output
* of an ADC to the ADC reference and compensates for the
* gain and offset.
@@ -1388,6 +1408,12 @@
const struct qpnp_vadc_chan_properties *chan_prop,
struct qpnp_vadc_result *chan_rslt)
{ return -ENXIO; }
+static inline int32_t qpnp_adc_scale_qrd_skug_batt_therm(
+ struct qpnp_vadc_chip *vadc, int32_t adc_code,
+ const struct qpnp_adc_properties *adc_prop,
+ const struct qpnp_vadc_chan_properties *chan_prop,
+ struct qpnp_vadc_result *chan_rslt)
+{ return -ENXIO; }
static inline int32_t qpnp_adc_scale_batt_id(struct qpnp_vadc_chip *vadc,
int32_t adc_code,
const struct qpnp_adc_properties *adc_prop,
diff --git a/include/linux/regulator/cpr-regulator.h b/include/linux/regulator/cpr-regulator.h
index 624860e..3b23d17 100644
--- a/include/linux/regulator/cpr-regulator.h
+++ b/include/linux/regulator/cpr-regulator.h
@@ -16,26 +16,57 @@
#include <linux/regulator/machine.h>
-#define CPR_REGULATOR_DRIVER_NAME "qti,cpr-regulator"
+#define CPR_REGULATOR_DRIVER_NAME "qcom,cpr-regulator"
#define CPR_PVS_EFUSE_BITS_MAX 5
#define CPR_PVS_EFUSE_BINS_MAX (1 << CPR_PVS_EFUSE_BITS_MAX)
/**
+ * enum cpr_fuse_corner_enum - CPR fuse corner enum values
+ * %CPR_FUSE_CORNER_SVS: Lowest voltage for APC
+ * %CPR_FUSE_CORNER_NORMAL: Normal mode voltage
+ * %CPR_FUSE_CORNER_TURBO: Turbo mode voltage
+ * %CPR_FUSE_CORNER_SUPER_TURBO: Super Turbo mode voltage
+ *
+ */
+enum cpr_fuse_corner_enum {
+ CPR_FUSE_CORNER_SVS = 1,
+ CPR_FUSE_CORNER_NORMAL,
+ CPR_FUSE_CORNER_TURBO,
+ CPR_FUSE_CORNER_MAX,
+};
+
+/**
* enum cpr_corner_enum - CPR corner enum values
- * %CPR_CORNER_SVS: Lowest voltage for APC
- * %CPR_CORNER_NORMAL: Normal mode voltage
- * %CPR_CORNER_TURBO: Turbo mode voltage
- * %CPR_CORNER_SUPER_TURBO: Super Turbo mode voltage
+ * %CPR_CORNER_1: Lowest voltage for APC
+ * %CPR_CORNER_2: Second lowest voltage for APC
+ * %CPR_CORNER_3: Third lowest voltage for APC
+ * %CPR_CORNER_4: Forth lowest voltage for APC
+ * %CPR_CORNER_5: Fifth lowest voltage for APC
+ * %CPR_CORNER_6: Sixth lowest voltage for APC
+ * %CPR_CORNER_7: Seventh lowest voltage for APC
+ * %CPR_CORNER_8: Eighth lowest voltage for APC
+ * %CPR_CORNER_9: Ninth lowest voltage for APC
+ * %CPR_CORNER_10: Tenth lowest voltage for APC
+ * %CPR_CORNER_11: Eleventh lowest voltage for APC
+ * %CPR_CORNER_12: Twelfth lowest voltage for APC
*
* These should be used in regulator_set_voltage() for CPR
* regulator as if they had units of uV.
*/
enum cpr_corner_enum {
- CPR_CORNER_SVS = 1,
- CPR_CORNER_NORMAL,
- CPR_CORNER_TURBO,
- CPR_CORNER_MAX,
+ CPR_CORNER_1 = 1,
+ CPR_CORNER_2,
+ CPR_CORNER_3,
+ CPR_CORNER_4,
+ CPR_CORNER_5,
+ CPR_CORNER_6,
+ CPR_CORNER_7,
+ CPR_CORNER_8,
+ CPR_CORNER_9,
+ CPR_CORNER_10,
+ CPR_CORNER_11,
+ CPR_CORNER_12,
};
/**
diff --git a/include/linux/sensors.h b/include/linux/sensors.h
index 3520034..96d2aa6 100644
--- a/include/linux/sensors.h
+++ b/include/linux/sensors.h
@@ -47,9 +47,37 @@
#define SENSOR_TYPE_STEP_COUNTER 19
#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR 20
+/**
+ * struct sensors_classdev - hold the sensor general parameters and APIs
+ * @dev: The device to register.
+ * @node: The list for the all the sensor drivers.
+ * @name: Name of this sensor.
+ * @vendor: The vendor of the hardware part.
+ * @handle: The handle that identifies this sensors.
+ * @type: The sensor type.
+ * @max_range: The maximum range of this sensor's value in SI units.
+ * @resolution: The smallest difference between two values reported by
+ * this sensor.
+ * @sensor_power: The rough estimate of this sensor's power consumption
+ * in mA.
+ * @min_delay: This value depends on the trigger mode:
+ * continuous: minimum period allowed in microseconds
+ * on-change : 0
+ * one-shot :-1
+ * special : 0, unless otherwise noted
+ * @fifo_reserved_event_count: The number of events reserved for this sensor
+ * in the batch mode FIFO.
+ * @fifo_max_event_count: The maximum number of events of this sensor
+ * that could be batched.
+ * @enabled: Store the sensor driver enable status.
+ * @delay_msec: Store the sensor driver delay value. The data unit is
+ * millisecond.
+ * @sensors_enable: The handle for enable and disable sensor.
+ * @sensors_poll_delay: The handle for set the sensor polling delay time.
+ */
struct sensors_classdev {
struct device *dev;
- struct list_head node;
+ struct list_head node;
const char *name;
const char *vendor;
int version;
@@ -61,6 +89,13 @@
int min_delay;
int fifo_reserved_event_count;
int fifo_max_event_count;
+ unsigned int enabled;
+ unsigned int delay_msec;
+ /* enable and disable the sensor handle*/
+ int (*sensors_enable)(struct sensors_classdev *sensors_cdev,
+ unsigned int enabled);
+ int (*sensors_poll_delay)(struct sensors_classdev *sensors_cdev,
+ unsigned int delay_msec);
};
extern int sensors_classdev_register(struct device *parent,
diff --git a/include/linux/slimbus/slimbus.h b/include/linux/slimbus/slimbus.h
index c940091..67f4d8c 100644
--- a/include/linux/slimbus/slimbus.h
+++ b/include/linux/slimbus/slimbus.h
@@ -586,6 +586,9 @@
* @device_down: This callback is called when device reports absent, or the
* bus goes down. Device will report present when bus is up and
* device_up callback will be called again when that happens
+ * @reset_device: This callback is called after framer is booted.
+ * Driver should do the needful to reset the device,
+ * so that device acquires sync and be operational.
* @driver: Slimbus device drivers should initialize name and owner field of
* this structure
* @id_table: List of slimbus devices supported by this driver
@@ -600,6 +603,8 @@
int (*device_up)(struct slim_device *sldev);
int (*device_down)
(struct slim_device *sldev);
+ int (*reset_device)
+ (struct slim_device *sldev);
struct device_driver driver;
const struct slim_device_id *id_table;
@@ -1036,6 +1041,16 @@
void slim_report_absent(struct slim_device *sbdev);
/*
+ * slim_framer_booted: This function is called by controller after the active
+ * framer has booted (using Bus Reset sequence, or after it has shutdown and has
+ * come back up). Components, devices on the bus may be in undefined state,
+ * and this function triggers their drivers to do the needful
+ * to bring them back in Reset state so that they can acquire sync, report
+ * present and be operational again.
+ */
+void slim_framer_booted(struct slim_controller *ctrl);
+
+/*
* slim_msg_response: Deliver Message response received from a device to the
* framework.
* @ctrl: Controller handle
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 087d163..fe4d6da 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -1,4 +1,5 @@
header-y += audio.h
+header-y += ccid_bridge.h
header-y += cdc.h
header-y += ch9.h
header-y += ch11.h
diff --git a/include/linux/usb/ccid_bridge.h b/include/linux/usb/ccid_bridge.h
new file mode 100644
index 0000000..1d1b895
--- /dev/null
+++ b/include/linux/usb/ccid_bridge.h
@@ -0,0 +1,64 @@
+#ifndef __UAPI_USB_CCID_BRIDGE_H
+#define __UAPI_USB_CCID_BRIDGE_H
+
+#include <linux/ioctl.h>
+
+/**
+ * struct usb_ccid_data - Used to receive the CCID class descriptor,
+ * clock rates and data rates supported by the device.
+ * @length: The length of the buffer.
+ * @data: The buffer as it is returned by the device for GET_DESCRIPTOR,
+ * GET_CLOCK_FREQUENCIES and GET_DATA_RATES requests.
+ */
+struct usb_ccid_data {
+ uint8_t length;
+ void *data;
+};
+
+/**
+ * struct usb_ccid_abort - Used to abort an already sent command.
+ * @seq: The sequence number of the command.
+ * @slot: The slot of the IC, on which the command is sent.
+ */
+struct usb_ccid_abort {
+ uint8_t seq;
+ uint8_t slot;
+};
+
+#define USB_CCID_NOTIFY_SLOT_CHANGE_EVENT 1
+#define USB_CCID_HARDWARE_ERROR_EVENT 2
+#define USB_CCID_RESUME_EVENT 3
+/**
+ * struct usb_ccid_event - Used to receive notify slot change or hardware
+ * error event.
+ * @notify: If the event is USB_CCID_NOTIFY_SLOT_CHANGE_EVENT, slot_icc_state
+ * has the information about the current slots state.
+ * @error: If the event is USB_CCID_HARDWARE_ERROR_EVENT, error has
+ * information about the hardware error condition.
+ */
+struct usb_ccid_event {
+ uint8_t event;
+ union {
+ struct {
+ uint8_t slot_icc_state;
+ } notify;
+
+ struct {
+ uint8_t slot;
+ uint8_t seq;
+ uint8_t error_code;
+ } error;
+ } u;
+};
+
+#define USB_CCID_GET_CLASS_DESC _IOWR('C', 0, struct usb_ccid_data)
+
+#define USB_CCID_GET_CLOCK_FREQUENCIES _IOWR('C', 1, struct usb_ccid_data)
+
+#define USB_CCID_GET_DATA_RATES _IOWR('C', 2, struct usb_ccid_data)
+
+#define USB_CCID_ABORT _IOW('C', 3, struct usb_ccid_abort)
+
+#define USB_CCID_GET_EVENT _IOR('C', 4, struct usb_ccid_event)
+
+#endif /* __UAPI_USB_CCID_BRIDGE_H */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 4fb20f6..f9dec0b 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -212,7 +212,8 @@
#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
#define HCD_LOCAL_MEM 0x0002 /* HC needs local memory */
#define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
-#define HCD_OLD_ENUM 0x0008 /* HC supports short enumeration */
+#define HCD_RT_OLD_ENUM 0x0008 /* HC supports short enumeration
+ on root port */
#define HCD_USB11 0x0010 /* USB 1.1 */
#define HCD_USB2 0x0020 /* USB 2.0 */
#define HCD_USB3 0x0040 /* USB 3.0 */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index bfafe00..51ca67d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1906,6 +1906,8 @@
#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MIN_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 36)
#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MAX_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 37)
+#define V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR \
+ (V4L2_CID_MPEG_MSM_VIDC_BASE + 38)
/* Camera class control IDs */
#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 7675a5c..500421f 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -136,6 +136,12 @@
extern __init void vm_area_add_early(struct vm_struct *vm);
extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
extern __init int vm_area_check_early(struct vm_struct *vm);
+#ifdef CONFIG_ENABLE_VMALLOC_SAVING
+extern void mark_vmalloc_reserved_area(void *addr, unsigned long size);
+#else
+static inline void mark_vmalloc_reserved_area(void *addr, unsigned long size)
+{ };
+#endif
#ifdef CONFIG_SMP
# ifdef CONFIG_MMU
diff --git a/include/linux/wcnss_wlan.h b/include/linux/wcnss_wlan.h
index 39357e0..9241b93 100644
--- a/include/linux/wcnss_wlan.h
+++ b/include/linux/wcnss_wlan.h
@@ -86,7 +86,11 @@
{
}
#endif
-
+int wcnss_set_wlan_unsafe_channel(
+ u16 *unsafe_ch_list, u16 ch_count);
+int wcnss_get_wlan_unsafe_channel(
+ u16 *unsafe_ch_list, u16 buffer_size,
+ u16 *ch_count);
#define wcnss_wlan_get_drvdata(dev) dev_get_drvdata(dev)
#define wcnss_wlan_set_drvdata(dev, data) dev_set_drvdata((dev), (data))
/* WLAN driver uses these names */
diff --git a/include/media/msm_cam_sensor.h b/include/media/msm_cam_sensor.h
index a01dd9a..38d3aab 100644
--- a/include/media/msm_cam_sensor.h
+++ b/include/media/msm_cam_sensor.h
@@ -482,6 +482,7 @@
int8_t sign_dir;
int16_t dest_step_pos;
int32_t num_steps;
+ uint16_t curr_lens_pos;
struct damping_params_t *ringing_params;
};
diff --git a/include/media/msmb_generic_buf_mgr.h b/include/media/msmb_generic_buf_mgr.h
index efcb425..237380f 100644
--- a/include/media/msmb_generic_buf_mgr.h
+++ b/include/media/msmb_generic_buf_mgr.h
@@ -20,4 +20,10 @@
#define VIDIOC_MSM_BUF_MNGR_BUF_DONE \
_IOWR('V', BASE_VIDIOC_PRIVATE + 35, struct msm_buf_mngr_info)
+#define VIDIOC_MSM_BUF_MNGR_INIT \
+ _IOWR('V', BASE_VIDIOC_PRIVATE + 36, struct msm_buf_mngr_info)
+
+#define VIDIOC_MSM_BUF_MNGR_DEINIT \
+ _IOWR('V', BASE_VIDIOC_PRIVATE + 37, struct msm_buf_mngr_info)
+
#endif
diff --git a/include/media/msmb_isp.h b/include/media/msmb_isp.h
index 568a3fa..3ba0abe 100644
--- a/include/media/msmb_isp.h
+++ b/include/media/msmb_isp.h
@@ -228,6 +228,7 @@
VFE_READ_DMI_32BIT,
VFE_READ_DMI_64BIT,
GET_SOC_HW_VER,
+ GET_MAX_CLK_RATE,
};
struct msm_vfe_cfg_cmd2 {
diff --git a/include/media/radio-iris.h b/include/media/radio-iris.h
index d28a8c0..a69f3f1 100644
--- a/include/media/radio-iris.h
+++ b/include/media/radio-iris.h
@@ -32,6 +32,50 @@
#include <linux/mutex.h>
#include <linux/atomic.h>
#include "radio-iris-commands.h"
+const unsigned char MIN_TX_TONE_VAL = 0x00;
+const unsigned char MAX_TX_TONE_VAL = 0x07;
+const unsigned char MIN_HARD_MUTE_VAL = 0x00;
+const unsigned char MAX_HARD_MUTE_VAL = 0x03;
+const unsigned char MIN_SRCH_MODE = 0x00;
+const unsigned char MAX_SRCH_MODE = 0x01;
+const unsigned char MIN_SCAN_DWELL = 0x00;
+const unsigned char MAX_SCAN_DWELL = 0x0F;
+const unsigned char MIN_SIG_TH = 0x00;
+const unsigned char MAX_SIG_TH = 0x03;
+const unsigned char MIN_PTY = 0X00;
+const unsigned char MAX_PTY = 0x1F;
+const unsigned short MIN_PI = 0x0000;
+const unsigned short MAX_PI = 0xFFFF;
+const unsigned char MIN_SRCH_STATIONS_CNT = 0x00;
+const unsigned char MAX_SRCH_STATIONS_CNT = 0x14;
+const unsigned char MIN_CHAN_SPACING = 0x00;
+const unsigned char MAX_CHAN_SPACING = 0x02;
+const unsigned char MIN_EMPHASIS = 0x00;
+const unsigned char MAX_EMPHASIS = 0x01;
+const unsigned char MIN_RDS_STD = 0x00;
+const unsigned char MAX_RDS_STD = 0x02;
+const unsigned char MIN_ANTENNA_VAL = 0x00;
+const unsigned char MAX_ANTENNA_VAL = 0x01;
+const unsigned char MIN_TX_PS_REPEAT_CNT = 0x01;
+const unsigned char MAX_TX_PS_REPEAT_CNT = 0x0F;
+const unsigned char MIN_SOFT_MUTE = 0x00;
+const unsigned char MAX_SOFT_MUTE = 0x01;
+const unsigned char MIN_PEEK_ACCESS_LEN = 0x01;
+const unsigned char MAX_PEEK_ACCESS_LEN = 0xF9;
+const unsigned char MIN_RESET_CNTR = 0x00;
+const unsigned char MAX_RESET_CNTR = 0x01;
+const unsigned char MIN_HLSI = 0x00;
+const unsigned char MAX_HLSI = 0x02;
+const unsigned char MIN_NOTCH_FILTER = 0x00;
+const unsigned char MAX_NOTCH_FILTER = 0x02;
+const unsigned char MIN_INTF_DET_OUT_LW_TH = 0x00;
+const unsigned char MAX_INTF_DET_OUT_LW_TH = 0xFF;
+const unsigned char MIN_INTF_DET_OUT_HG_TH = 0x00;
+const unsigned char MAX_INTF_DET_OUT_HG_TH = 0xFF;
+const signed char MIN_SINR_TH = -128;
+const signed char MAX_SINR_TH = 127;
+const unsigned char MIN_SINR_SAMPLES = 0x01;
+const unsigned char MAX_SINR_SAMPLES = 0xFF;
/* ---- HCI Packet structures ---- */
#define RADIO_HCI_COMMAND_HDR_SIZE sizeof(struct radio_hci_command_hdr)
@@ -630,6 +674,7 @@
FM_TURNING_OFF,
FM_RECV_TURNING_ON,
FM_TRANS_TURNING_ON,
+ FM_MAX_NO_STATES,
};
enum emphasis_type {
@@ -828,4 +873,209 @@
int hci_fm_do_calibration(__u8 *arg, struct radio_hci_dev *hdev);
int hci_fm_do_calibration(__u8 *arg, struct radio_hci_dev *hdev);
+static inline int is_valid_tone(int tone)
+{
+ if ((tone >= MIN_TX_TONE_VAL) &&
+ (tone <= MAX_TX_TONE_VAL))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_hard_mute(int hard_mute)
+{
+ if ((hard_mute >= MIN_HARD_MUTE_VAL) &&
+ (hard_mute <= MAX_HARD_MUTE_VAL))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_srch_mode(int srch_mode)
+{
+ if ((srch_mode >= MIN_SRCH_MODE) &&
+ (srch_mode <= MAX_SRCH_MODE))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_scan_dwell_prd(int scan_dwell_prd)
+{
+ if ((scan_dwell_prd >= MIN_SCAN_DWELL) &&
+ (scan_dwell_prd <= MAX_SCAN_DWELL))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_sig_th(int sig_th)
+{
+ if ((sig_th >= MIN_SIG_TH) &&
+ (sig_th <= MAX_SIG_TH))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_pty(int pty)
+{
+ if ((pty >= MIN_PTY) &&
+ (pty <= MAX_PTY))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_pi(int pi)
+{
+ if ((pi >= MIN_PI) &&
+ (pi <= MAX_PI))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_srch_station_cnt(int cnt)
+{
+ if ((cnt >= MIN_SRCH_STATIONS_CNT) &&
+ (cnt <= MAX_SRCH_STATIONS_CNT))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_chan_spacing(int spacing)
+{
+ if ((spacing >= MIN_CHAN_SPACING) &&
+ (spacing <= MAX_CHAN_SPACING))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_emphasis(int emphasis)
+{
+ if ((emphasis >= MIN_EMPHASIS) &&
+ (emphasis <= MAX_EMPHASIS))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_rds_std(int rds_std)
+{
+ if ((rds_std >= MIN_RDS_STD) &&
+ (rds_std <= MAX_RDS_STD))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_antenna(int antenna_type)
+{
+ if ((antenna_type >= MIN_ANTENNA_VAL) &&
+ (antenna_type <= MAX_ANTENNA_VAL))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_ps_repeat_cnt(int cnt)
+{
+ if ((cnt >= MIN_TX_PS_REPEAT_CNT) &&
+ (cnt <= MAX_TX_PS_REPEAT_CNT))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_soft_mute(int soft_mute)
+{
+ if ((soft_mute >= MIN_SOFT_MUTE) &&
+ (soft_mute <= MAX_SOFT_MUTE))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_peek_len(int len)
+{
+ if ((len >= MIN_PEEK_ACCESS_LEN) &&
+ (len <= MAX_PEEK_ACCESS_LEN))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_reset_cntr(int cntr)
+{
+ if ((cntr >= MIN_RESET_CNTR) &&
+ (cntr <= MAX_RESET_CNTR))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_hlsi(int hlsi)
+{
+ if ((hlsi >= MIN_HLSI) &&
+ (hlsi <= MAX_HLSI))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_notch_filter(int filter)
+{
+ if ((filter >= MIN_NOTCH_FILTER) &&
+ (filter <= MAX_NOTCH_FILTER))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_intf_det_low_th(int th)
+{
+ if ((th >= MIN_INTF_DET_OUT_LW_TH) &&
+ (th <= MAX_INTF_DET_OUT_LW_TH))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_intf_det_hgh_th(int th)
+{
+ if ((th >= MIN_INTF_DET_OUT_HG_TH) &&
+ (th <= MAX_INTF_DET_OUT_HG_TH))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_sinr_th(int th)
+{
+ if ((th >= MIN_SINR_TH) &&
+ (th <= MAX_SINR_TH))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_sinr_samples(int samples_cnt)
+{
+ if ((samples_cnt >= MIN_SINR_SAMPLES) &&
+ (samples_cnt <= MAX_SINR_SAMPLES))
+ return 1;
+ else
+ return 0;
+}
+
+static inline int is_valid_fm_state(int state)
+{
+ if ((state >= 0) && (state < FM_MAX_NO_STATES))
+ return 1;
+ else
+ return 0;
+}
#endif /* __RADIO_HCI_CORE_H */
diff --git a/kernel/events/core.c b/kernel/events/core.c
index aafa4c1..7dd822b 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1194,6 +1194,28 @@
return 0;
}
+#ifdef CONFIG_SMP
+static void perf_retry_remove(struct perf_event *event)
+{
+ int up_ret;
+ /*
+ * CPU was offline. Bring it online so we can
+ * gracefully exit a perf context.
+ */
+ up_ret = cpu_up(event->cpu);
+ if (!up_ret)
+ /* Try the remove call once again. */
+ cpu_function_call(event->cpu, __perf_remove_from_context,
+ event);
+ else
+ pr_err("Failed to bring up CPU: %d, ret: %d\n",
+ event->cpu, up_ret);
+}
+#else
+static void perf_retry_remove(struct perf_event *event)
+{
+}
+#endif
/*
* Remove the event from a task's (or a CPU's) list of events.
@@ -1208,19 +1230,22 @@
* When called from perf_event_exit_task, it's OK because the
* context has been detached from its task.
*/
-static void perf_remove_from_context(struct perf_event *event)
+static void __ref perf_remove_from_context(struct perf_event *event)
{
struct perf_event_context *ctx = event->ctx;
struct task_struct *task = ctx->task;
+ int ret;
lockdep_assert_held(&ctx->mutex);
if (!task) {
/*
- * Per cpu events are removed via an smp call and
- * the removal is always successful.
+ * Per cpu events are removed via an smp call
*/
- cpu_function_call(event->cpu, __perf_remove_from_context, event);
+ ret = cpu_function_call(event->cpu, __perf_remove_from_context,
+ event);
+ if (ret == -ENXIO)
+ perf_retry_remove(event);
return;
}
@@ -2934,6 +2959,14 @@
struct perf_event *event = file->private_data;
struct task_struct *owner;
+ /*
+ * Event can be in state OFF because of a constraint check.
+ * Change to ACTIVE so that it gets cleaned up correctly.
+ */
+ if ((event->state == PERF_EVENT_STATE_OFF) &&
+ event->attr.constraint_duplicate)
+ event->state = PERF_EVENT_STATE_ACTIVE;
+
file->private_data = NULL;
rcu_read_lock();
@@ -5171,6 +5204,7 @@
.read = perf_swevent_read,
.event_idx = perf_swevent_event_idx,
+ .events_across_hotplug = 1,
};
#ifdef CONFIG_EVENT_TRACING
@@ -5265,6 +5299,7 @@
.read = perf_swevent_read,
.event_idx = perf_swevent_event_idx,
+ .events_across_hotplug = 1,
};
static inline void perf_tp_register(void)
@@ -5492,6 +5527,7 @@
.read = cpu_clock_event_read,
.event_idx = perf_swevent_event_idx,
+ .events_across_hotplug = 1,
};
/*
@@ -5572,6 +5608,7 @@
.read = task_clock_event_read,
.event_idx = perf_swevent_event_idx,
+ .events_across_hotplug = 1,
};
static void perf_pmu_nop_void(struct pmu *pmu)
@@ -7029,11 +7066,20 @@
idx = srcu_read_lock(&pmus_srcu);
list_for_each_entry_rcu(pmu, &pmus, entry) {
- ctx = &per_cpu_ptr(pmu->pmu_cpu_context, cpu)->ctx;
+ /*
+ * If keeping events across hotplugging is supported, do not
+ * remove the event list, but keep it alive across CPU hotplug.
+ * The context is exited via an fd close path when userspace
+ * is done and the target CPU is online.
+ */
+ if (!pmu->events_across_hotplug) {
+ ctx = &per_cpu_ptr(pmu->pmu_cpu_context, cpu)->ctx;
- mutex_lock(&ctx->mutex);
- smp_call_function_single(cpu, __perf_event_exit_context, ctx, 1);
- mutex_unlock(&ctx->mutex);
+ mutex_lock(&ctx->mutex);
+ smp_call_function_single(cpu, __perf_event_exit_context,
+ ctx, 1);
+ mutex_unlock(&ctx->mutex);
+ }
}
srcu_read_unlock(&pmus_srcu, idx);
}
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index bb38c4d..98e6903 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -635,6 +635,7 @@
.read = hw_breakpoint_pmu_read,
.event_idx = hw_breakpoint_event_idx,
+ .events_across_hotplug = 1,
};
int __init init_hw_breakpoint(void)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index e174693..2e074aa 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -184,36 +184,6 @@
return ret;
}
-#ifdef ENABLE_VMALLOC_SAVING
-int is_vmalloc_addr(const void *x)
-{
- struct rb_node *n;
- struct vmap_area *va;
- int ret = 0;
-
- spin_lock(&vmap_area_lock);
-
- for (n = rb_first(vmap_area_root); n; rb_next(n)) {
- va = rb_entry(n, struct vmap_area, rb_node);
- if (x >= va->va_start && x < va->va_end) {
- ret = 1;
- break;
- }
- }
-
- spin_unlock(&vmap_area_lock);
- return ret;
-}
-#else
-int is_vmalloc_addr(const void *x)
-{
- unsigned long addr = (unsigned long)x;
-
- return addr >= VMALLOC_START && addr < VMALLOC_END;
-}
-#endif
-EXPORT_SYMBOL(is_vmalloc_addr);
-
int is_vmalloc_or_module_addr(const void *x)
{
/*
@@ -302,6 +272,47 @@
static unsigned long vmap_area_pcpu_hole;
+#ifdef CONFIG_ENABLE_VMALLOC_SAVING
+#define POSSIBLE_VMALLOC_START PAGE_OFFSET
+
+#define VMALLOC_BITMAP_SIZE ((VMALLOC_END - PAGE_OFFSET) >> \
+ PAGE_SHIFT)
+#define VMALLOC_TO_BIT(addr) ((addr - PAGE_OFFSET) >> PAGE_SHIFT)
+#define BIT_TO_VMALLOC(i) (PAGE_OFFSET + i * PAGE_SIZE)
+
+DECLARE_BITMAP(possible_areas, VMALLOC_BITMAP_SIZE);
+
+void mark_vmalloc_reserved_area(void *x, unsigned long size)
+{
+ unsigned long addr = (unsigned long)x;
+
+ bitmap_set(possible_areas, VMALLOC_TO_BIT(addr), size >> PAGE_SHIFT);
+}
+
+int is_vmalloc_addr(const void *x)
+{
+ unsigned long addr = (unsigned long)x;
+
+ if (addr < POSSIBLE_VMALLOC_START || addr >= VMALLOC_END)
+ return 0;
+
+ if (test_bit(VMALLOC_TO_BIT(addr), possible_areas))
+ return 0;
+
+ return 1;
+}
+#else
+int is_vmalloc_addr(const void *x)
+{
+ unsigned long addr = (unsigned long)x;
+
+ return addr >= VMALLOC_START && addr < VMALLOC_END;
+}
+#endif
+EXPORT_SYMBOL(is_vmalloc_addr);
+
+
+
static struct vmap_area *__find_vmap_area(unsigned long addr)
{
struct rb_node *n = vmap_area_root.rb_node;
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index fd7a3f6..cfaaf13 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -271,6 +271,11 @@
local_bh_disable();
addend = xt_write_recseq_begin();
private = table->private;
+ /*
+ * Ensure we load private-> members after we've fetched the base
+ * pointer.
+ */
+ smp_read_barrier_depends();
table_base = private->entries[smp_processor_id()];
e = get_entry(table_base, private->hook_entry[hook]);
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 24e556e..ed1468a 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -327,6 +327,11 @@
addend = xt_write_recseq_begin();
private = table->private;
cpu = smp_processor_id();
+ /*
+ * Ensure we load private-> members after we've fetched the base
+ * pointer.
+ */
+ smp_read_barrier_depends();
table_base = private->entries[cpu];
jumpstack = (struct ipt_entry **)private->jumpstack[cpu];
stackptr = per_cpu_ptr(private->stackptr, cpu);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b2b0e99..74a286c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -485,14 +485,12 @@
!tp->urg_data ||
before(tp->urg_seq, tp->copied_seq) ||
!before(tp->urg_seq, tp->rcv_nxt)) {
- struct sk_buff *skb;
answ = tp->rcv_nxt - tp->copied_seq;
- /* Subtract 1, if FIN is in queue. */
- skb = skb_peek_tail(&sk->sk_receive_queue);
- if (answ && skb)
- answ -= tcp_hdr(skb)->fin;
+ /* Subtract 1, if FIN was received */
+ if (answ && sock_flag(sk, SOCK_DONE))
+ answ--;
} else
answ = tp->urg_seq - tp->copied_seq;
release_sock(sk);
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index e641f8f..c30a20c 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -349,6 +349,11 @@
local_bh_disable();
addend = xt_write_recseq_begin();
private = table->private;
+ /*
+ * Ensure we load private-> members after we've fetched the base
+ * pointer.
+ */
+ smp_read_barrier_depends();
cpu = smp_processor_id();
table_base = private->entries[cpu];
jumpstack = (struct ip6t_entry **)private->jumpstack[cpu];
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 8d987c3..5888e00 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -832,8 +832,13 @@
return NULL;
}
- table->private = newinfo;
newinfo->initial_entries = private->initial_entries;
+ /*
+ * Ensure contents of newinfo are visible before assigning to
+ * private.
+ */
+ smp_wmb();
+ table->private = newinfo;
/*
* Even though table entries have now been swapped, other CPU's
diff --git a/sound/soc/codecs/msm8x10-wcd.c b/sound/soc/codecs/msm8x10-wcd.c
index 1962ff0..bbebc5d 100644
--- a/sound/soc/codecs/msm8x10-wcd.c
+++ b/sound/soc/codecs/msm8x10-wcd.c
@@ -50,6 +50,8 @@
#define BITS_PER_REG 8
#define MSM8X10_WCD_TX_PORT_NUMBER 4
+#define DAPM_MICBIAS_EXTERNAL_STANDALONE "MIC BIAS External Standalone"
+
#define MSM8X10_WCD_I2S_MASTER_MODE_MASK 0x08
#define MSM8X10_DINO_CODEC_BASE_ADDR 0xFE043000
#define MSM8X10_DINO_CODEC_REG_SIZE 0x200
@@ -1635,6 +1637,8 @@
/* Always pull up TxFe for TX2 to Micbias */
snd_soc_update_bits(codec, micb_int_reg, 0x04, 0x04);
+ snd_soc_update_bits(codec, MSM8X10_WCD_A_MICB_1_CTL,
+ 0x80, 0x80);
break;
case SND_SOC_DAPM_POST_PMU:
usleep_range(20000, 20100);
@@ -1642,6 +1646,8 @@
wcd9xxx_resmgr_notifier_call(&msm8x10_wcd->resmgr, e_post_on);
break;
case SND_SOC_DAPM_POST_PMD:
+ snd_soc_update_bits(codec, MSM8X10_WCD_A_MICB_1_CTL,
+ 0x80, 0x00);
/* Let MBHC module know so micbias switch to be off */
wcd9xxx_resmgr_notifier_call(&msm8x10_wcd->resmgr, e_post_off);
@@ -2300,7 +2306,8 @@
SND_SOC_DAPM_OUTPUT("EAR"),
SND_SOC_DAPM_PGA_E("EAR PA", MSM8X10_WCD_A_RX_EAR_EN, 4, 0, NULL, 0,
- msm8x10_wcd_codec_enable_ear_pa, SND_SOC_DAPM_POST_PMU),
+ msm8x10_wcd_codec_enable_ear_pa,
+ SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER("DAC1", MSM8X10_WCD_A_RX_EAR_EN, 6, 0, dac1_switch,
ARRAY_SIZE(dac1_switch)),
@@ -2458,6 +2465,11 @@
MSM8X10_WCD_A_MICB_1_CTL, 7, 0,
msm8x10_wcd_codec_enable_micbias, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_MICBIAS_E(DAPM_MICBIAS_EXTERNAL_STANDALONE,
+ MSM8X10_WCD_A_MICB_1_CTL,
+ 7, 0, msm8x10_wcd_codec_enable_micbias,
+ SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
+ SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_ADC_E("ADC1", NULL, MSM8X10_WCD_A_TX_1_EN, 7, 0,
msm8x10_wcd_codec_enable_adc, SND_SOC_DAPM_PRE_PMU |
@@ -2709,6 +2721,30 @@
return ret;
}
+static int msm8x10_wcd_enable_mbhc_micbias(struct snd_soc_codec *codec,
+ bool enable)
+{
+ int rc;
+
+ if (enable)
+ rc = snd_soc_dapm_force_enable_pin(&codec->dapm,
+ DAPM_MICBIAS_EXTERNAL_STANDALONE);
+ else
+ rc = snd_soc_dapm_disable_pin(&codec->dapm,
+ DAPM_MICBIAS_EXTERNAL_STANDALONE);
+ snd_soc_dapm_sync(&codec->dapm);
+
+ snd_soc_update_bits(codec, WCD9XXX_A_MICB_1_CTL,
+ 0x80, enable ? 0x80 : 0x00);
+ if (rc)
+ pr_debug("%s: Failed to force %s micbias", __func__,
+ enable ? "enable" : "disable");
+ else
+ pr_debug("%s: Trying force %s micbias", __func__,
+ enable ? "enable" : "disable");
+ return rc;
+}
+
static void msm8x10_wcd_micb_internal(struct snd_soc_codec *codec, bool on)
{
snd_soc_update_bits(codec, MSM8X10_WCD_A_MICB_1_INT_RBIAS,
@@ -3191,7 +3227,8 @@
ret = wcd9xxx_mbhc_init(&msm8x10_wcd_priv->mbhc,
&msm8x10_wcd_priv->resmgr,
- codec, NULL, &mbhc_cb, &cdc_intr_ids,
+ codec, msm8x10_wcd_enable_mbhc_micbias,
+ &mbhc_cb, &cdc_intr_ids,
HELICON_MCLK_CLK_9P6MHZ, true);
if (ret) {
dev_err(msm8x10_wcd->dev, "%s: Failed to initialize mbhc\n",
diff --git a/sound/soc/codecs/wcd9306.c b/sound/soc/codecs/wcd9306.c
index 4912cf04a..1dc78ff 100644
--- a/sound/soc/codecs/wcd9306.c
+++ b/sound/soc/codecs/wcd9306.c
@@ -514,31 +514,41 @@
struct snd_ctl_elem_value *ucontrol)
{
u8 ear_pa_gain;
+ int rc = 0;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
ear_pa_gain = snd_soc_read(codec, TAPAN_A_RX_EAR_GAIN);
-
ear_pa_gain = ear_pa_gain >> 5;
- if (ear_pa_gain == 0x00) {
- ucontrol->value.integer.value[0] = 0;
- } else if (ear_pa_gain == 0x04) {
- ucontrol->value.integer.value[0] = 1;
- } else {
+ switch (ear_pa_gain) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ ucontrol->value.integer.value[0] = ear_pa_gain;
+ break;
+ case 7:
+ ucontrol->value.integer.value[0] = (ear_pa_gain - 1);
+ break;
+ default:
+ rc = -EINVAL;
pr_err("%s: ERROR: Unsupported Ear Gain = 0x%x\n",
- __func__, ear_pa_gain);
- return -EINVAL;
+ __func__, ear_pa_gain);
+ break;
}
dev_dbg(codec->dev, "%s: ear_pa_gain = 0x%x\n", __func__, ear_pa_gain);
- return 0;
+ return rc;
}
static int tapan_pa_gain_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
u8 ear_pa_gain;
+ int rc = 0;
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
dev_dbg(codec->dev, "%s: ucontrol->value.integer.value[0] = %ld\n",
@@ -546,17 +556,24 @@
switch (ucontrol->value.integer.value[0]) {
case 0:
- ear_pa_gain = 0x00;
- break;
case 1:
- ear_pa_gain = 0x80;
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ ear_pa_gain = ucontrol->value.integer.value[0];
+ break;
+ case 6:
+ ear_pa_gain = 0x07;
break;
default:
- return -EINVAL;
+ rc = -EINVAL;
+ break;
}
-
- snd_soc_update_bits(codec, TAPAN_A_RX_EAR_GAIN, 0xE0, ear_pa_gain);
- return 0;
+ if (!rc)
+ snd_soc_update_bits(codec, TAPAN_A_RX_EAR_GAIN,
+ 0xE0, ear_pa_gain << 5);
+ return rc;
}
static int tapan_get_iir_enable_audio_mixer(
@@ -1017,9 +1034,13 @@
return 0;
}
-static const char * const tapan_ear_pa_gain_text[] = {"POS_6_DB", "POS_2_DB"};
+static const char * const tapan_ear_pa_gain_text[] = {"POS_6_DB", "POS_4P5_DB",
+ "POS_3_DB", "POS_1P5_DB",
+ "POS_0_DB", "NEG_2P5_DB",
+ "NEG_12_DB"};
static const struct soc_enum tapan_ear_pa_gain_enum[] = {
- SOC_ENUM_SINGLE_EXT(2, tapan_ear_pa_gain_text),
+ SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(tapan_ear_pa_gain_text),
+ tapan_ear_pa_gain_text),
};
static const char *const tapan_anc_func_text[] = {"OFF", "ON"};
@@ -1867,9 +1888,10 @@
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- if (w->reg == TAPAN_A_TX_3_EN)
+ if (w->reg == TAPAN_A_TX_3_EN ||
+ w->reg == TAPAN_A_TX_1_EN)
wcd9xxx_resmgr_notifier_call(&tapan->resmgr,
- WCD9XXX_EVENT_PRE_TX_3_ON);
+ WCD9XXX_EVENT_PRE_TX_1_3_ON);
snd_soc_update_bits(codec, adc_reg, 1 << init_bit_shift,
1 << init_bit_shift);
break;
@@ -1879,9 +1901,10 @@
break;
case SND_SOC_DAPM_POST_PMD:
- if (w->reg == TAPAN_A_TX_3_EN)
+ if (w->reg == TAPAN_A_TX_3_EN ||
+ w->reg == TAPAN_A_TX_1_EN)
wcd9xxx_resmgr_notifier_call(&tapan->resmgr,
- WCD9XXX_EVENT_POST_TX_3_OFF);
+ WCD9XXX_EVENT_POST_TX_1_3_OFF);
break;
}
return 0;
diff --git a/sound/soc/codecs/wcd9xxx-mbhc.c b/sound/soc/codecs/wcd9xxx-mbhc.c
index 14218d8..32ca0c6 100644
--- a/sound/soc/codecs/wcd9xxx-mbhc.c
+++ b/sound/soc/codecs/wcd9xxx-mbhc.c
@@ -98,7 +98,7 @@
* Invalid voltage range for the detection
* of plug type with current source
*/
-#define WCD9XXX_CS_MEAS_INVALD_RANGE_LOW_MV 110
+#define WCD9XXX_CS_MEAS_INVALD_RANGE_LOW_MV 160
#define WCD9XXX_CS_MEAS_INVALD_RANGE_HIGH_MV 265
/*
@@ -121,7 +121,7 @@
#define WCD9XXX_V_CS_HS_MAX 500
#define WCD9XXX_V_CS_NO_MIC 5
#define WCD9XXX_MB_MEAS_DELTA_MAX_MV 80
-#define WCD9XXX_CS_MEAS_DELTA_MAX_MV 10
+#define WCD9XXX_CS_MEAS_DELTA_MAX_MV 12
static int impedance_detect_en;
module_param(impedance_detect_en, int,
@@ -1352,7 +1352,6 @@
vdce = __wcd9xxx_codec_sta_dce_v(mbhc, true, d->dce,
dce_z, (u32)mb_mv);
-
d->_vdces = vdce;
if (d->_vdces < no_mic)
d->_type = PLUG_TYPE_HEADPHONE;
@@ -1386,14 +1385,6 @@
}
}
- if (event_state & (1 << MBHC_EVENT_PA_HPHL)) {
- pr_debug("%s: HPHL PA was ON\n", __func__);
- } else if (ch != sz && ch > 0) {
- pr_debug("%s: Invalid, inconsistent HPHL\n", __func__);
- type = PLUG_TYPE_INVALID;
- goto exit;
- }
-
delta_thr = ((highhph_cnt == sz) || highhph) ?
WCD9XXX_MB_MEAS_DELTA_MAX_MV :
WCD9XXX_CS_MEAS_DELTA_MAX_MV;
@@ -1445,6 +1436,30 @@
}
}
+ if (type == PLUG_TYPE_HEADSET && dgnd && !dgnd->mic_bias) {
+ /* if plug type is Headphone report as GND_MIC_SWAP */
+ if (dgnd->_type == PLUG_TYPE_HEADPHONE) {
+ pr_debug("%s: GND_MIC_SWAP\n", __func__);
+ type = PLUG_TYPE_GND_MIC_SWAP;
+ /*
+ * if type is GND_MIC_SWAP we should not check
+ * HPHL status hence goto exit
+ */
+ goto exit;
+ } else if (dgnd->_type != PLUG_TYPE_HEADSET && !dmicbias) {
+ pr_debug("%s: Invalid, inconsistent types\n", __func__);
+ type = PLUG_TYPE_INVALID;
+ }
+ }
+
+ if (event_state & (1 << MBHC_EVENT_PA_HPHL)) {
+ pr_debug("%s: HPHL PA was ON\n", __func__);
+ } else if (ch != sz && ch > 0) {
+ pr_debug("%s: Invalid, inconsistent HPHL..\n", __func__);
+ type = PLUG_TYPE_INVALID;
+ goto exit;
+ }
+
if (!(event_state & (1UL << MBHC_EVENT_PA_HPHL))) {
if (((type == PLUG_TYPE_HEADSET ||
type == PLUG_TYPE_HEADPHONE) && ch != sz)) {
@@ -1453,17 +1468,12 @@
type = PLUG_TYPE_INVALID;
}
}
- if (type == PLUG_TYPE_HEADSET && dgnd && !dgnd->mic_bias) {
- if ((dgnd->_vdces + WCD9XXX_CS_GM_SWAP_THRES_MIN_MV <
- minv) &&
- (dgnd->_vdces + WCD9XXX_CS_GM_SWAP_THRES_MAX_MV >
- maxv))
- type = PLUG_TYPE_GND_MIC_SWAP;
- else if (dgnd->_type != PLUG_TYPE_HEADSET && !dmicbias) {
- pr_debug("%s: Invalid, inconsistent types\n", __func__);
- type = PLUG_TYPE_INVALID;
- }
- }
+
+ if (type == PLUG_TYPE_HEADSET &&
+ (mbhc->mbhc_cfg->micbias_enable_flags &
+ (1 << MBHC_MICBIAS_ENABLE_REGULAR_HEADSET)))
+ mbhc->micbias_enable = true;
+
exit:
pr_debug("%s: Plug type %d detected\n", __func__, type);
return type;
@@ -2034,7 +2044,8 @@
/* if PA is already on, switch micbias source to VDDIO */
if (mbhc->event_state &
- (1 << MBHC_EVENT_PA_HPHL | 1 << MBHC_EVENT_PA_HPHR))
+ (1 << MBHC_EVENT_PA_HPHL | 1 << MBHC_EVENT_PA_HPHR |
+ 1 << MBHC_EVENT_PRE_TX_1_3_ON))
__wcd9xxx_switch_micbias(mbhc, 1, false, false);
wcd9xxx_start_hs_polling(mbhc);
} else if (plug_type == PLUG_TYPE_HIGH_HPH) {
@@ -4265,6 +4276,14 @@
if (!mbhc->polling_active)
wcd9xxx_enable_mbhc_txfe(mbhc, false);
}
+ if (mbhc->micbias_enable && mbhc->polling_active &&
+ !(snd_soc_read(mbhc->codec, mbhc->mbhc_bias_regs.ctl_reg)
+ & 0x80)) {
+ pr_debug("%s:Micbias turned off by recording, set up again",
+ __func__);
+ snd_soc_update_bits(codec, mbhc->mbhc_bias_regs.ctl_reg,
+ 0x80, 0x80);
+ }
break;
/* PA usage change */
case WCD9XXX_EVENT_PRE_HPHL_PA_ON:
@@ -4285,7 +4304,7 @@
hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
if (!(mbhc->event_state &
(1 << MBHC_EVENT_PA_HPHL | 1 << MBHC_EVENT_PA_HPHR |
- 1 << MBHC_EVENT_PRE_TX_3_ON)))
+ 1 << MBHC_EVENT_PRE_TX_1_3_ON)))
wcd9xxx_switch_micbias(mbhc, 0);
break;
case WCD9XXX_EVENT_POST_HPHR_PA_OFF:
@@ -4297,7 +4316,7 @@
hphrocp_off_report(mbhc, SND_JACK_OC_HPHL);
if (!(mbhc->event_state &
(1 << MBHC_EVENT_PA_HPHL | 1 << MBHC_EVENT_PA_HPHR |
- 1 << MBHC_EVENT_PRE_TX_3_ON)))
+ 1 << MBHC_EVENT_PRE_TX_1_3_ON)))
wcd9xxx_switch_micbias(mbhc, 0);
break;
/* Clock usage change */
@@ -4379,23 +4398,23 @@
case WCD9XXX_EVENT_POST_BG_MBHC_ON:
/* Not used for now */
break;
- case WCD9XXX_EVENT_PRE_TX_3_ON:
+ case WCD9XXX_EVENT_PRE_TX_1_3_ON:
/*
* if polling is ON, mbhc micbias not enabled
* switch micbias source to VDDIO
*/
- set_bit(MBHC_EVENT_PRE_TX_3_ON, &mbhc->event_state);
+ set_bit(MBHC_EVENT_PRE_TX_1_3_ON, &mbhc->event_state);
if (!(snd_soc_read(codec, mbhc->mbhc_bias_regs.ctl_reg)
& 0x80) &&
mbhc->polling_active && !mbhc->mbhc_micbias_switched)
wcd9xxx_switch_micbias(mbhc, 1);
break;
- case WCD9XXX_EVENT_POST_TX_3_OFF:
+ case WCD9XXX_EVENT_POST_TX_1_3_OFF:
/*
* Switch back to micbias if HPH PA or TX3 path
* is disabled
*/
- clear_bit(MBHC_EVENT_PRE_TX_3_ON, &mbhc->event_state);
+ clear_bit(MBHC_EVENT_PRE_TX_1_3_ON, &mbhc->event_state);
if (mbhc->polling_active && mbhc->mbhc_micbias_switched &&
!(mbhc->event_state & (1 << MBHC_EVENT_PA_HPHL |
1 << MBHC_EVENT_PA_HPHR)))
diff --git a/sound/soc/codecs/wcd9xxx-mbhc.h b/sound/soc/codecs/wcd9xxx-mbhc.h
index 98f73fc..b5031a6 100644
--- a/sound/soc/codecs/wcd9xxx-mbhc.h
+++ b/sound/soc/codecs/wcd9xxx-mbhc.h
@@ -123,8 +123,8 @@
enum wcd9xxx_mbhc_event_state {
MBHC_EVENT_PA_HPHL,
MBHC_EVENT_PA_HPHR,
- MBHC_EVENT_PRE_TX_3_ON,
- MBHC_EVENT_POST_TX_3_OFF,
+ MBHC_EVENT_PRE_TX_1_3_ON,
+ MBHC_EVENT_POST_TX_1_3_OFF,
};
struct wcd9xxx_mbhc_general_cfg {
diff --git a/sound/soc/codecs/wcd9xxx-resmgr.c b/sound/soc/codecs/wcd9xxx-resmgr.c
index e56b182..4843b51 100644
--- a/sound/soc/codecs/wcd9xxx-resmgr.c
+++ b/sound/soc/codecs/wcd9xxx-resmgr.c
@@ -92,8 +92,8 @@
"WCD9XXX_EVENT_POST_RESUME",
- "WCD9XXX_EVENT_PRE_TX_3_ON",
- "WCD9XXX_EVENT_POST_TX_3_OFF",
+ "WCD9XXX_EVENT_PRE_TX_1_3_ON",
+ "WCD9XXX_EVENT_POST_TX_1_3_OFF",
"WCD9XXX_EVENT_LAST",
};
diff --git a/sound/soc/codecs/wcd9xxx-resmgr.h b/sound/soc/codecs/wcd9xxx-resmgr.h
index 9f383b6..29896fc 100644
--- a/sound/soc/codecs/wcd9xxx-resmgr.h
+++ b/sound/soc/codecs/wcd9xxx-resmgr.h
@@ -105,8 +105,8 @@
WCD9XXX_EVENT_POST_RESUME,
- WCD9XXX_EVENT_PRE_TX_3_ON,
- WCD9XXX_EVENT_POST_TX_3_OFF,
+ WCD9XXX_EVENT_PRE_TX_1_3_ON,
+ WCD9XXX_EVENT_POST_TX_1_3_OFF,
WCD9XXX_EVENT_LAST,
};
diff --git a/sound/soc/msm/msm8974.c b/sound/soc/msm/msm8974.c
index 69a6671..4c3a72e 100644
--- a/sound/soc/msm/msm8974.c
+++ b/sound/soc/msm/msm8974.c
@@ -2203,6 +2203,22 @@
.codec_name = "snd-soc-dummy",
},
{
+ .name = "Voice2",
+ .stream_name = "Voice2",
+ .cpu_dai_name = "Voice2",
+ .platform_name = "msm-pcm-voice",
+ .dynamic = 1,
+ .trigger = {SND_SOC_DPCM_TRIGGER_POST,
+ SND_SOC_DPCM_TRIGGER_POST},
+ .no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
+ .ignore_suspend = 1,
+ /* this dainlink has playback support */
+ .ignore_pmdown_time = 1,
+ .codec_dai_name = "snd-soc-dummy-dai",
+ .codec_name = "snd-soc-dummy",
+ .be_id = MSM_FRONTEND_DAI_VOICE2,
+ },
+ {
.name = "INT_HFP_BT Hostless",
.stream_name = "INT_HFP_BT Hostless",
.cpu_dai_name = "INT_HFP_BT_HOSTLESS",
diff --git a/sound/soc/msm/msm8x10.c b/sound/soc/msm/msm8x10.c
index c1ba26a..caf81fc 100644
--- a/sound/soc/msm/msm8x10.c
+++ b/sound/soc/msm/msm8x10.c
@@ -99,6 +99,8 @@
.insert_detect = true,
.swap_gnd_mic = NULL,
.use_int_rbias = false,
+ .micbias_enable_flags = 1 << MBHC_MICBIAS_ENABLE_THRESHOLD_HEADSET |
+ 1 << MBHC_MICBIAS_ENABLE_REGULAR_HEADSET,
.cs_enable_flags = (1 << MBHC_CS_ENABLE_POLLING |
1 << MBHC_CS_ENABLE_INSERTION |
1 << MBHC_CS_ENABLE_REMOVAL),
@@ -607,21 +609,21 @@
btn_high = wcd9xxx_mbhc_cal_btn_det_mp(btn_cfg,
MBHC_BTN_DET_V_BTN_HIGH);
btn_low[0] = -50;
- btn_high[0] = 10;
- btn_low[1] = 11;
- btn_high[1] = 52;
- btn_low[2] = 53;
- btn_high[2] = 94;
- btn_low[3] = 95;
- btn_high[3] = 133;
- btn_low[4] = 134;
- btn_high[4] = 171;
- btn_low[5] = 172;
- btn_high[5] = 208;
- btn_low[6] = 209;
- btn_high[6] = 244;
- btn_low[7] = 245;
- btn_high[7] = 330;
+ btn_high[0] = 20;
+ btn_low[1] = 21;
+ btn_high[1] = 61;
+ btn_low[2] = 62;
+ btn_high[2] = 104;
+ btn_low[3] = 105;
+ btn_high[3] = 148;
+ btn_low[4] = 149;
+ btn_high[4] = 189;
+ btn_low[5] = 190;
+ btn_high[5] = 228;
+ btn_low[6] = 229;
+ btn_high[6] = 269;
+ btn_low[7] = 270;
+ btn_high[7] = 500;
n_ready = wcd9xxx_mbhc_cal_btn_det_mp(btn_cfg, MBHC_BTN_DET_N_READY);
n_ready[0] = 80;
n_ready[1] = 68;
diff --git a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
index 7935100..5f512ae 100644
--- a/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -66,6 +66,8 @@
int32_t stream_opened[2];
uint32_t initial_samples_drop;
uint32_t trailing_samples_drop;
+ uint32_t gapless_transition;
+ bool use_dsp_gapless_mode;
};
struct msm_compr_pdata {
@@ -73,6 +75,7 @@
struct snd_compr_stream *cstream[MSM_FRONTEND_DAI_MAX];
uint32_t volume[MSM_FRONTEND_DAI_MAX][2]; /* For both L & R */
struct msm_compr_audio_effects *audio_effects[MSM_FRONTEND_DAI_MAX];
+ bool use_dsp_gapless_mode;
};
struct msm_compr_audio {
@@ -174,7 +177,7 @@
pr_debug("%s: bytes_received = %d copied_total = %d\n",
__func__, prtd->bytes_received, prtd->copied_total);
- if (prtd->first_buffer)
+ if (prtd->first_buffer && prtd->gapless_state.use_dsp_gapless_mode)
q6asm_send_meta_data(prtd->audio_client,
prtd->gapless_state.initial_samples_drop,
prtd->gapless_state.trailing_samples_drop);
@@ -448,7 +451,8 @@
pr_debug("%s\n", __func__);
ret = q6asm_stream_open_write_v2(ac,
prtd->codec, bits_per_sample,
- ac->stream_id, true/*gapless*/);
+ ac->stream_id,
+ prtd->gapless_state.use_dsp_gapless_mode);
if (ret < 0) {
pr_err("%s: Session out open failed\n", __func__);
return -ENOMEM;
@@ -556,6 +560,13 @@
prtd->first_buffer = 1;
prtd->partial_drain_delay = 0;
memset(&prtd->gapless_state, 0, sizeof(struct msm_compr_gapless_state));
+ /*
+ * Update the use_dsp_gapless_mode from gapless struture with the value
+ * part of platform data.
+ */
+ prtd->gapless_state.use_dsp_gapless_mode = pdata->use_dsp_gapless_mode;
+
+ pr_debug("%s: gapless mode %d", __func__, pdata->use_dsp_gapless_mode);
spin_lock_init(&prtd->lock);
@@ -801,21 +812,10 @@
__func__, rc);
break;
case SNDRV_PCM_TRIGGER_STOP:
- pr_debug("%s: SNDRV_PCM_TRIGGER_STOP\n", __func__);
spin_lock_irqsave(&prtd->lock, flags);
-
+ pr_debug("%s: SNDRV_PCM_TRIGGER_STOP transition %d\n", __func__,
+ prtd->gapless_state.gapless_transition);
stream_id = ac->stream_id;
- if (prtd->gapless_state.set_next_stream_id &&
- prtd->first_buffer) {
- /*
- * Stream just switched for gapless, no buffers sent.
- * So seek needs to be applied to previous stream
- */
- pr_debug("Seek previous stream as next stream hasn't started\n");
- stream_id = stream_id^1;
- ac->stream_id = stream_id;
- prtd->first_buffer = 0;
- }
atomic_set(&prtd->start, 0);
if (atomic_read(&prtd->eos)) {
pr_debug("%s: interrupt eos wait queues", __func__);
@@ -833,22 +833,27 @@
prtd->last_buffer = 0;
pr_debug("issue CMD_FLUSH\n");
prtd->cmd_ack = 0;
- spin_unlock_irqrestore(&prtd->lock, flags);
- rc = q6asm_stream_cmd(prtd->audio_client, CMD_FLUSH, stream_id);
- if (rc < 0) {
- pr_err("%s: flush cmd failed rc=%d\n",
- __func__, rc);
- return rc;
- }
- rc = wait_event_timeout(prtd->flush_wait,
+ if (!prtd->gapless_state.gapless_transition) {
+ spin_unlock_irqrestore(&prtd->lock, flags);
+ rc = q6asm_stream_cmd(
+ prtd->audio_client, CMD_FLUSH, stream_id);
+ if (rc < 0) {
+ pr_err("%s: flush cmd failed rc=%d\n",
+ __func__, rc);
+ return rc;
+ }
+ rc = wait_event_timeout(prtd->flush_wait,
prtd->cmd_ack, 1 * HZ);
- if (!rc) {
- rc = -ETIMEDOUT;
- pr_err("Flush cmd timeout\n");
- } else
- rc = 0; /* prtd->cmd_status == OK? 0 : -EPERM */
-
- spin_lock_irqsave(&prtd->lock, flags);
+ if (!rc) {
+ rc = -ETIMEDOUT;
+ pr_err("Flush cmd timeout\n");
+ } else {
+ rc = 0; /* prtd->cmd_status == OK? 0 : -EPERM*/
+ }
+ spin_lock_irqsave(&prtd->lock, flags);
+ } else {
+ prtd->first_buffer = 0;
+ }
/* FIXME. only reset if flush was successful */
prtd->byte_offset = 0;
prtd->copied_total = 0;
@@ -858,17 +863,27 @@
spin_unlock_irqrestore(&prtd->lock, flags);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- pr_debug("SNDRV_PCM_TRIGGER_PAUSE_PUSH\n");
- q6asm_cmd_nowait(prtd->audio_client, CMD_PAUSE);
- atomic_set(&prtd->start, 0);
+ pr_debug("SNDRV_PCM_TRIGGER_PAUSE_PUSH transition %d\n",
+ prtd->gapless_state.gapless_transition);
+ if (!prtd->gapless_state.gapless_transition) {
+ q6asm_cmd_nowait(prtd->audio_client, CMD_PAUSE);
+ atomic_set(&prtd->start, 0);
+ }
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- pr_debug("SNDRV_PCM_TRIGGER_PAUSE_RELEASE\n");
- atomic_set(&prtd->start, 1);
- q6asm_run_nowait(prtd->audio_client, 0, 0, 0);
+ pr_debug("SNDRV_PCM_TRIGGER_PAUSE_RELEASE transition %d\n",
+ prtd->gapless_state.gapless_transition);
+ if (!prtd->gapless_state.gapless_transition) {
+ atomic_set(&prtd->start, 1);
+ q6asm_run_nowait(prtd->audio_client, 0, 0, 0);
+ }
break;
case SND_COMPR_TRIGGER_PARTIAL_DRAIN:
pr_debug("%s: SND_COMPR_TRIGGER_PARTIAL_DRAIN\n", __func__);
+ if (!prtd->gapless_state.use_dsp_gapless_mode) {
+ pr_debug("%s: set partial drain as drain\n", __func__);
+ cmd = SND_COMPR_TRIGGER_DRAIN;
+ }
case SND_COMPR_TRIGGER_DRAIN:
pr_debug("%s: SNDRV_COMPRESS_DRAIN\n", __func__);
/* Make sure all the data is sent to DSP before sending EOS */
@@ -915,6 +930,7 @@
if ((cmd == SND_COMPR_TRIGGER_PARTIAL_DRAIN) &&
(prtd->gapless_state.set_next_stream_id)) {
/* wait for the last buffer to be returned */
+
if (prtd->last_buffer) {
pr_debug("%s: last buffer drain\n", __func__);
rc = msm_compr_drain_buffer(prtd, &flags);
@@ -926,7 +942,6 @@
/* send EOS */
prtd->cmd_ack = 0;
- atomic_set(&prtd->eos, 1);
q6asm_cmd_nowait(prtd->audio_client, CMD_EOS);
pr_info("PARTIAL DRAIN, do not wait for EOS ack\n");
@@ -970,6 +985,7 @@
prtd->app_pointer = 0;
prtd->first_buffer = 1;
prtd->last_buffer = 0;
+ prtd->gapless_state.gapless_transition = 1;
/*
Don't reset these as these vars map to
total_bytes_transferred and total_bytes_available
@@ -1013,7 +1029,7 @@
rc = -EINTR;
/*FIXME : what if a flush comes while PC is here */
- if (rc == 0 && (cmd == SND_COMPR_TRIGGER_PARTIAL_DRAIN)) {
+ if (rc == 0) {
/*
* Failed to open second stream in DSP for gapless
* so prepare the current stream in session for gapless playback
@@ -1049,6 +1065,11 @@
prtd->cmd_interrupt = 0;
break;
case SND_COMPR_TRIGGER_NEXT_TRACK:
+ if (!prtd->gapless_state.use_dsp_gapless_mode) {
+ pr_debug("%s: ignore trigger next track\n", __func__);
+ rc = 0;
+ break;
+ }
pr_debug("%s: SND_COMPR_TRIGGER_NEXT_TRACK\n", __func__);
spin_lock_irqsave(&prtd->lock, flags);
rc = 0;
@@ -1060,9 +1081,9 @@
}
spin_unlock_irqrestore(&prtd->lock, flags);
rc = q6asm_stream_open_write_v2(prtd->audio_client,
- prtd->codec, 16,
- stream_id,
- true /*gapless*/);
+ prtd->codec, 16,
+ stream_id,
+ prtd->gapless_state.use_dsp_gapless_mode);
if (rc < 0) {
pr_err("%s: Session out open failed for gapless\n",
__func__);
@@ -1226,7 +1247,8 @@
* since the available bytes fits fragment_size, copy the data right away
*/
spin_lock_irqsave(&prtd->lock, flags);
-
+ if (prtd->gapless_state.gapless_transition)
+ prtd->gapless_state.gapless_transition = 0;
prtd->bytes_received += count;
if (atomic_read(&prtd->start)) {
if (atomic_read(&prtd->xrun)) {
@@ -1315,7 +1337,6 @@
prtd = cstream->runtime->private_data;
if (!prtd && !prtd->audio_client)
return -EINVAL;
-
ac = prtd->audio_client;
if (metadata->key == SNDRV_COMPRESS_ENCODER_PADDING) {
pr_debug("%s, got encoder padding %u", __func__, metadata->value[0]);
@@ -1471,6 +1492,13 @@
pdata->cstream[i] = NULL;
}
+ /*
+ * use_dsp_gapless_mode part of platform data(pdata) is updated from HAL
+ * through a mixer control before compress driver is opened. The mixer
+ * control is used to decide if dsp gapless mode needs to be enabled.
+ * Gapless is disabled by default.
+ */
+ pdata->use_dsp_gapless_mode = false;
return 0;
}
@@ -1580,7 +1608,7 @@
fe_audio_effects_config_control[0].name = mixer_str;
fe_audio_effects_config_control[0].private_value = rtd->dai_link->be_id;
- pr_debug("Registering new mixer ctl %s", mixer_str);
+ pr_debug("Registering new mixer ctl %s\n", mixer_str);
snd_soc_add_platform_controls(rtd->platform,
fe_audio_effects_config_control,
ARRAY_SIZE(fe_audio_effects_config_control));
@@ -1588,6 +1616,38 @@
return 0;
}
+static int msm_compr_gapless_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol);
+ struct msm_compr_pdata *pdata = (struct msm_compr_pdata *)
+ snd_soc_platform_get_drvdata(platform);
+ pdata->use_dsp_gapless_mode = ucontrol->value.integer.value[0];
+ pr_debug("%s: value: %ld\n", __func__,
+ ucontrol->value.integer.value[0]);
+
+ return 0;
+}
+
+static int msm_compr_gapless_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_platform *platform = snd_kcontrol_chip(kcontrol);
+ struct msm_compr_pdata *pdata =
+ snd_soc_platform_get_drvdata(platform);
+ pr_debug("%s:gapless mode %d\n", __func__, pdata->use_dsp_gapless_mode);
+ ucontrol->value.integer.value[0] = pdata->use_dsp_gapless_mode;
+
+ return 0;
+}
+
+static const struct snd_kcontrol_new msm_compr_gapless_controls[] = {
+ SOC_SINGLE_EXT("Compress Gapless Playback",
+ 0, 0, 1, 0,
+ msm_compr_gapless_get,
+ msm_compr_gapless_put),
+};
+
static int msm_compr_new(struct snd_soc_pcm_runtime *rtd)
{
int rc;
@@ -1618,7 +1678,10 @@
static struct snd_soc_platform_driver msm_soc_platform = {
.probe = msm_compr_probe,
.compr_ops = &msm_compr_ops,
- .pcm_new = msm_compr_new,
+ .pcm_new = msm_compr_new,
+ .controls = msm_compr_gapless_controls,
+ .num_controls = ARRAY_SIZE(msm_compr_gapless_controls),
+
};
static __devinit int msm_compr_dev_probe(struct platform_device *pdev)
diff --git a/sound/soc/msm/qdsp6v2/msm-lsm-client.c b/sound/soc/msm/qdsp6v2/msm-lsm-client.c
index 3f57078..ff82299 100644
--- a/sound/soc/msm/qdsp6v2/msm-lsm-client.c
+++ b/sound/soc/msm/qdsp6v2/msm-lsm-client.c
@@ -170,6 +170,9 @@
*/
rc = -EFAULT;
} else {
+ if (!access_ok(VERIFY_READ, user,
+ sizeof(struct snd_lsm_event_status)))
+ rc = -EFAULT;
if (user->payload_size <
event_status->payload_size) {
pr_debug("%s: provided %dbytes isn't enough, needs %dbytes\n",
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
index 3ddc3e0..32eaebf 100644
--- a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
@@ -188,6 +188,7 @@
} else {
pr_debug("%s: reclaim flushed buf in_count %x\n",
__func__, atomic_read(&prtd->in_count));
+ prtd->pcm_irq_pos += prtd->pcm_count;
atomic_inc(&prtd->in_count);
if (atomic_read(&prtd->in_count) == prtd->periods) {
pr_info("%s: reclaimed all bufs\n", __func__);
diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c
index 24f5f3b..e60cd26 100644
--- a/sound/soc/msm/qdsp6v2/q6asm.c
+++ b/sound/soc/msm/qdsp6v2/q6asm.c
@@ -335,15 +335,12 @@
static int q6asm_session_alloc(struct audio_client *ac)
{
int n;
- mutex_lock(&session_lock);
for (n = 1; n <= SESSION_MAX; n++) {
if (!session[n]) {
session[n] = ac;
- mutex_unlock(&session_lock);
return n;
}
}
- mutex_unlock(&session_lock);
return -ENOMEM;
}
@@ -351,9 +348,7 @@
{
pr_debug("%s: sessionid[%d]\n", __func__, ac->session);
rtac_remove_popp_from_adm_devices(ac->session);
- mutex_lock(&session_lock);
session[ac->session] = 0;
- mutex_unlock(&session_lock);
ac->session = 0;
ac->perf_mode = LEGACY_PCM_MODE;
ac->fptr_cache_ops = NULL;
@@ -724,6 +719,9 @@
struct audio_port_data *port;
if (!ac || !ac->session)
return;
+
+ mutex_lock(&session_lock);
+
pr_debug("%s: Session id %d\n", __func__, ac->session);
if (ac->io_mode & SYNC_IO_MODE) {
for (loopcnt = 0; loopcnt <= OUT; loopcnt++) {
@@ -748,6 +746,8 @@
/*done:*/
kfree(ac);
ac = NULL;
+ mutex_unlock(&session_lock);
+
return;
}
@@ -804,9 +804,13 @@
ac = kzalloc(sizeof(struct audio_client), GFP_KERNEL);
if (!ac)
return NULL;
+
+ mutex_lock(&session_lock);
n = q6asm_session_alloc(ac);
- if (n <= 0)
+ if (n <= 0) {
+ mutex_unlock(&session_lock);
goto fail_session;
+ }
ac->session = n;
ac->cb = cb;
ac->priv = priv;
@@ -820,7 +824,8 @@
if (ac->apr == NULL) {
pr_err("%s Registration with APR failed\n", __func__);
- goto fail;
+ mutex_unlock(&session_lock);
+ goto fail;
}
ac->apr2 = apr_register("ADSP", "ASM", \
(apr_fn)q6asm_callback,\
@@ -829,14 +834,17 @@
if (ac->apr2 == NULL) {
pr_err("%s Registration with APR-2 failed\n", __func__);
- goto fail;
+ mutex_unlock(&session_lock);
+ goto fail;
}
rtac_set_asm_handle(n, ac->apr);
pr_debug("%s Registering the common port with APR\n", __func__);
ac->mmap_apr = q6asm_mmap_apr_reg();
- if (ac->mmap_apr == NULL)
+ if (ac->mmap_apr == NULL) {
+ mutex_unlock(&session_lock);
goto fail;
+ }
init_waitqueue_head(&ac->cmd_wait);
init_waitqueue_head(&ac->time_wait);
@@ -856,6 +864,8 @@
pr_debug("%s: session[%d]\n", __func__, ac->session);
+ mutex_unlock(&session_lock);
+
return ac;
fail:
q6asm_audio_client_free(ac);
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index b9af9b6..0970a83 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -95,7 +95,7 @@
else
stream = SNDRV_PCM_STREAM_CAPTURE;
- mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
+ mutex_lock(&fe->card->dpcm_mutex);
if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
ret = platform->driver->compr_ops->open(cstream);
@@ -154,7 +154,7 @@
codec_dai->active++;
fe->codec->active++;
- mutex_unlock(&fe->card->mutex);
+ mutex_unlock(&fe->card->dpcm_mutex);
return 0;
@@ -166,7 +166,7 @@
platform->driver->compr_ops->free(cstream);
out:
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
- mutex_unlock(&fe->card->mutex);
+ mutex_unlock(&fe->card->dpcm_mutex);
return ret;
}
@@ -273,8 +273,7 @@
else
stream = SNDRV_PCM_STREAM_CAPTURE;
- mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
-
+ mutex_lock(&fe->card->dpcm_mutex);
if (cstream->direction == SND_COMPRESS_PLAYBACK) {
cpu_dai->playback_active--;
codec_dai->playback_active--;
@@ -323,7 +322,7 @@
platform->driver->compr_ops->free(cstream);
//cpu_dai->runtime = NULL;
- mutex_unlock(&fe->card->mutex);
+ mutex_unlock(&fe->card->dpcm_mutex);
return 0;
}
@@ -393,8 +392,7 @@
stream = SNDRV_PCM_STREAM_CAPTURE;
- mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
-
+ mutex_lock(&fe->card->dpcm_mutex);
if (platform->driver->compr_ops && platform->driver->compr_ops->trigger) {
ret = platform->driver->compr_ops->trigger(cstream, cmd);
if (ret < 0)
@@ -422,7 +420,7 @@
out:
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
- mutex_unlock(&fe->card->mutex);
+ mutex_unlock(&fe->card->dpcm_mutex);
return ret;
}
@@ -489,8 +487,7 @@
if (hw_params == NULL)
return -ENOMEM;
- mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
-
+ mutex_lock(&fe->card->dpcm_mutex);
/* first we call set_params for the platform driver
* this should configure the soc side
* if the machine has compressed ops then we call that as well
@@ -535,7 +532,7 @@
out:
fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
- mutex_unlock(&fe->card->mutex);
+ mutex_unlock(&fe->card->dpcm_mutex);
return ret;
}
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 63bbbdd..2f9e319 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1904,16 +1904,12 @@
}
if (found) {
- if (widget->platform) {
- soc_dpcm_runtime_update(widget);
- } else {
- dapm_mark_dirty(widget, "mux change");
- dapm_power_widgets(widget->dapm,
- SND_SOC_DAPM_STREAM_NOP);
- }
+ dapm_mark_dirty(widget, "mux change");
+ dapm_power_widgets(widget->dapm,
+ SND_SOC_DAPM_STREAM_NOP);
}
- return 0;
+ return found;
}
int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
@@ -1925,6 +1921,8 @@
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
ret = soc_dapm_mux_update_power(widget, kcontrol, change, mux, e);
mutex_unlock(&card->dapm_mutex);
+ if (ret > 0)
+ soc_dpcm_runtime_update(widget);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);
@@ -1953,16 +1951,11 @@
}
if (found) {
- if (widget->platform) {
- soc_dpcm_runtime_update(widget);
- } else {
dapm_mark_dirty(widget, "mixer update");
dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
- }
-
}
- return 0;
+ return found;
}
int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
@@ -1973,6 +1966,8 @@
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
ret = soc_dapm_mixer_update_power(widget, kcontrol, connect);
mutex_unlock(&card->dapm_mutex);
+ if (ret > 0)
+ soc_dpcm_runtime_update(widget);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power);
@@ -3100,9 +3095,11 @@
{
struct snd_soc_dapm_context *pdapm = &rtd->platform->dapm;
struct snd_soc_dapm_context *cdapm = &rtd->codec->dapm;
+ struct snd_soc_card *card = rtd->card;
dev_dbg(rtd->dev, "rtd stream %d event %d\n", stream, event);
+ mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
widget_stream_event(pdapm, rtd->cpu_dai->playback_aif, event);
widget_stream_event(cdapm, rtd->codec_dai->playback_aif, event);
@@ -3110,6 +3107,7 @@
widget_stream_event(pdapm, rtd->cpu_dai->capture_aif, event);
widget_stream_event(cdapm, rtd->codec_dai->capture_aif, event);
}
+ mutex_unlock(&card->dapm_mutex);
/* do we need to notify any clients that DAPM stream is complete */
if (pdapm->stream_event)
@@ -3133,14 +3131,14 @@
int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
const char *stream, int event)
{
+ struct snd_soc_card *card = rtd->card;
struct snd_soc_codec *codec = rtd->codec;
if (stream == NULL)
return 0;
-
- mutex_lock(&codec->mutex);
+ mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
soc_dapm_stream_event(&codec->dapm, stream, event);
- mutex_unlock(&codec->mutex);
+ mutex_unlock(&card->dapm_mutex);
return 0;
}
diff --git a/sound/usb/card.c b/sound/usb/card.c
index f453dbd..d419e2f 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -205,11 +205,24 @@
struct usb_device *dev = chip->dev;
struct usb_host_interface *host_iface;
struct usb_interface_descriptor *altsd;
+ struct usb_interface *usb_iface;
void *control_header;
int i, protocol;
+ usb_iface = usb_ifnum_to_if(dev, ctrlif);
+ if (!usb_iface) {
+ snd_printk(KERN_ERR "%d:%u : does not exist\n",
+ dev->devnum, ctrlif);
+ return -EINVAL;
+ }
+
/* find audiocontrol interface */
- host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0];
+ host_iface = &usb_iface->altsetting[0];
+ if (!host_iface) {
+ snd_printk(KERN_ERR "Audio Control interface is not available.");
+ return -EINVAL;
+ }
+
control_header = snd_usb_find_csint_desc(host_iface->extra,
host_iface->extralen,
NULL, UAC_HEADER);
@@ -248,8 +261,7 @@
case UAC_VERSION_2: {
struct usb_interface_assoc_descriptor *assoc =
- usb_ifnum_to_if(dev, ctrlif)->intf_assoc;
-
+ usb_iface->intf_assoc;
if (!assoc) {
snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n");
return -EINVAL;
@@ -723,6 +735,11 @@
}
usbaudiosdev = kzalloc(sizeof(*usbaudiosdev), GFP_KERNEL);
+ if (!usbaudiosdev) {
+ pr_err("Usb audio device memory allocation failed.\n");
+ return -ENOMEM;
+ }
+
usbaudiosdev->name = "usb_audio";
err = switch_dev_register(usbaudiosdev);