2 * Copyright (C) 2012 Invensense, Inc.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/module.h>
15 #include <linux/slab.h>
16 #include <linux/i2c.h>
17 #include <linux/err.h>
18 #include <linux/delay.h>
19 #include <linux/sysfs.h>
20 #include <linux/jiffies.h>
21 #include <linux/irq.h>
22 #include <linux/interrupt.h>
23 #include <linux/kfifo.h>
24 #include <linux/spinlock.h>
25 #include <linux/iio/iio.h>
26 #include <linux/i2c-mux.h>
27 #include <linux/acpi.h>
28 #include "inv_mpu_iio.h"
31 * this is the gyro scale translated from dynamic range plus/minus
32 * {250, 500, 1000, 2000} to rad/s
34 static const int gyro_scale_6050
[] = {133090, 266181, 532362, 1064724};
37 * this is the accel scale translated from dynamic range plus/minus
38 * {2, 4, 8, 16} to m/s^2
40 static const int accel_scale
[] = {598, 1196, 2392, 4785};
42 static const struct inv_mpu6050_reg_map reg_set_6050
= {
43 .sample_rate_div
= INV_MPU6050_REG_SAMPLE_RATE_DIV
,
44 .lpf
= INV_MPU6050_REG_CONFIG
,
45 .user_ctrl
= INV_MPU6050_REG_USER_CTRL
,
46 .fifo_en
= INV_MPU6050_REG_FIFO_EN
,
47 .gyro_config
= INV_MPU6050_REG_GYRO_CONFIG
,
48 .accl_config
= INV_MPU6050_REG_ACCEL_CONFIG
,
49 .fifo_count_h
= INV_MPU6050_REG_FIFO_COUNT_H
,
50 .fifo_r_w
= INV_MPU6050_REG_FIFO_R_W
,
51 .raw_gyro
= INV_MPU6050_REG_RAW_GYRO
,
52 .raw_accl
= INV_MPU6050_REG_RAW_ACCEL
,
53 .temperature
= INV_MPU6050_REG_TEMPERATURE
,
54 .int_enable
= INV_MPU6050_REG_INT_ENABLE
,
55 .pwr_mgmt_1
= INV_MPU6050_REG_PWR_MGMT_1
,
56 .pwr_mgmt_2
= INV_MPU6050_REG_PWR_MGMT_2
,
57 .int_pin_cfg
= INV_MPU6050_REG_INT_PIN_CFG
,
60 static const struct inv_mpu6050_chip_config chip_config_6050
= {
61 .fsr
= INV_MPU6050_FSR_2000DPS
,
62 .lpf
= INV_MPU6050_FILTER_20HZ
,
63 .fifo_rate
= INV_MPU6050_INIT_FIFO_RATE
,
64 .gyro_fifo_enable
= false,
65 .accl_fifo_enable
= false,
66 .accl_fs
= INV_MPU6050_FS_02G
,
69 static const struct inv_mpu6050_hw hw_info
[INV_NUM_PARTS
] = {
74 .config
= &chip_config_6050
,
78 int inv_mpu6050_switch_engine(struct inv_mpu6050_state
*st
, bool en
, u32 mask
)
80 unsigned int d
, mgmt_1
;
83 * switch clock needs to be careful. Only when gyro is on, can
84 * clock source be switched to gyro. Otherwise, it must be set to
87 if (mask
== INV_MPU6050_BIT_PWR_GYRO_STBY
) {
88 result
= regmap_read(st
->map
, st
->reg
->pwr_mgmt_1
, &mgmt_1
);
92 mgmt_1
&= ~INV_MPU6050_BIT_CLK_MASK
;
95 if ((mask
== INV_MPU6050_BIT_PWR_GYRO_STBY
) && (!en
)) {
97 * turning off gyro requires switch to internal clock first.
98 * Then turn off gyro engine
100 mgmt_1
|= INV_CLK_INTERNAL
;
101 result
= regmap_write(st
->map
, st
->reg
->pwr_mgmt_1
, mgmt_1
);
106 result
= regmap_read(st
->map
, st
->reg
->pwr_mgmt_2
, &d
);
113 result
= regmap_write(st
->map
, st
->reg
->pwr_mgmt_2
, d
);
118 /* Wait for output stabilize */
119 msleep(INV_MPU6050_TEMP_UP_TIME
);
120 if (mask
== INV_MPU6050_BIT_PWR_GYRO_STBY
) {
121 /* switch internal clock to PLL */
122 mgmt_1
|= INV_CLK_PLL
;
123 result
= regmap_write(st
->map
,
124 st
->reg
->pwr_mgmt_1
, mgmt_1
);
133 int inv_mpu6050_set_power_itg(struct inv_mpu6050_state
*st
, bool power_on
)
138 /* Already under indio-dev->mlock mutex */
139 if (!st
->powerup_count
)
140 result
= regmap_write(st
->map
, st
->reg
->pwr_mgmt_1
, 0);
145 if (!st
->powerup_count
)
146 result
= regmap_write(st
->map
, st
->reg
->pwr_mgmt_1
,
147 INV_MPU6050_BIT_SLEEP
);
154 msleep(INV_MPU6050_REG_UP_TIME
);
158 EXPORT_SYMBOL_GPL(inv_mpu6050_set_power_itg
);
161 * inv_mpu6050_init_config() - Initialize hardware, disable FIFO.
163 * Initial configuration:
167 * Clock source: Gyro PLL
169 static int inv_mpu6050_init_config(struct iio_dev
*indio_dev
)
173 struct inv_mpu6050_state
*st
= iio_priv(indio_dev
);
175 result
= inv_mpu6050_set_power_itg(st
, true);
178 d
= (INV_MPU6050_FSR_2000DPS
<< INV_MPU6050_GYRO_CONFIG_FSR_SHIFT
);
179 result
= regmap_write(st
->map
, st
->reg
->gyro_config
, d
);
183 d
= INV_MPU6050_FILTER_20HZ
;
184 result
= regmap_write(st
->map
, st
->reg
->lpf
, d
);
188 d
= INV_MPU6050_ONE_K_HZ
/ INV_MPU6050_INIT_FIFO_RATE
- 1;
189 result
= regmap_write(st
->map
, st
->reg
->sample_rate_div
, d
);
193 d
= (INV_MPU6050_FS_02G
<< INV_MPU6050_ACCL_CONFIG_FSR_SHIFT
);
194 result
= regmap_write(st
->map
, st
->reg
->accl_config
, d
);
198 memcpy(&st
->chip_config
, hw_info
[st
->chip_type
].config
,
199 sizeof(struct inv_mpu6050_chip_config
));
200 result
= inv_mpu6050_set_power_itg(st
, false);
205 static int inv_mpu6050_sensor_show(struct inv_mpu6050_state
*st
, int reg
,
211 ind
= (axis
- IIO_MOD_X
) * 2;
212 result
= regmap_bulk_read(st
->map
, reg
+ ind
, (u8
*)&d
, 2);
215 *val
= (short)be16_to_cpup(&d
);
221 inv_mpu6050_read_raw(struct iio_dev
*indio_dev
,
222 struct iio_chan_spec
const *chan
,
223 int *val
, int *val2
, long mask
)
225 struct inv_mpu6050_state
*st
= iio_priv(indio_dev
);
228 case IIO_CHAN_INFO_RAW
:
234 mutex_lock(&indio_dev
->mlock
);
235 if (!st
->chip_config
.enable
) {
236 result
= inv_mpu6050_set_power_itg(st
, true);
240 /* when enable is on, power is already on */
241 switch (chan
->type
) {
243 if (!st
->chip_config
.gyro_fifo_enable
||
244 !st
->chip_config
.enable
) {
245 result
= inv_mpu6050_switch_engine(st
, true,
246 INV_MPU6050_BIT_PWR_GYRO_STBY
);
250 ret
= inv_mpu6050_sensor_show(st
, st
->reg
->raw_gyro
,
251 chan
->channel2
, val
);
252 if (!st
->chip_config
.gyro_fifo_enable
||
253 !st
->chip_config
.enable
) {
254 result
= inv_mpu6050_switch_engine(st
, false,
255 INV_MPU6050_BIT_PWR_GYRO_STBY
);
261 if (!st
->chip_config
.accl_fifo_enable
||
262 !st
->chip_config
.enable
) {
263 result
= inv_mpu6050_switch_engine(st
, true,
264 INV_MPU6050_BIT_PWR_ACCL_STBY
);
268 ret
= inv_mpu6050_sensor_show(st
, st
->reg
->raw_accl
,
269 chan
->channel2
, val
);
270 if (!st
->chip_config
.accl_fifo_enable
||
271 !st
->chip_config
.enable
) {
272 result
= inv_mpu6050_switch_engine(st
, false,
273 INV_MPU6050_BIT_PWR_ACCL_STBY
);
279 /* wait for stablization */
280 msleep(INV_MPU6050_SENSOR_UP_TIME
);
281 ret
= inv_mpu6050_sensor_show(st
, st
->reg
->temperature
,
289 if (!st
->chip_config
.enable
)
290 result
|= inv_mpu6050_set_power_itg(st
, false);
291 mutex_unlock(&indio_dev
->mlock
);
297 case IIO_CHAN_INFO_SCALE
:
298 switch (chan
->type
) {
301 *val2
= gyro_scale_6050
[st
->chip_config
.fsr
];
303 return IIO_VAL_INT_PLUS_NANO
;
306 *val2
= accel_scale
[st
->chip_config
.accl_fs
];
308 return IIO_VAL_INT_PLUS_MICRO
;
311 *val2
= INV_MPU6050_TEMP_SCALE
;
313 return IIO_VAL_INT_PLUS_MICRO
;
317 case IIO_CHAN_INFO_OFFSET
:
318 switch (chan
->type
) {
320 *val
= INV_MPU6050_TEMP_OFFSET
;
331 static int inv_mpu6050_write_gyro_scale(struct inv_mpu6050_state
*st
, int val
)
336 for (i
= 0; i
< ARRAY_SIZE(gyro_scale_6050
); ++i
) {
337 if (gyro_scale_6050
[i
] == val
) {
338 d
= (i
<< INV_MPU6050_GYRO_CONFIG_FSR_SHIFT
);
339 result
= regmap_write(st
->map
, st
->reg
->gyro_config
, d
);
343 st
->chip_config
.fsr
= i
;
351 static int inv_write_raw_get_fmt(struct iio_dev
*indio_dev
,
352 struct iio_chan_spec
const *chan
, long mask
)
355 case IIO_CHAN_INFO_SCALE
:
356 switch (chan
->type
) {
358 return IIO_VAL_INT_PLUS_NANO
;
360 return IIO_VAL_INT_PLUS_MICRO
;
363 return IIO_VAL_INT_PLUS_MICRO
;
369 static int inv_mpu6050_write_accel_scale(struct inv_mpu6050_state
*st
, int val
)
374 for (i
= 0; i
< ARRAY_SIZE(accel_scale
); ++i
) {
375 if (accel_scale
[i
] == val
) {
376 d
= (i
<< INV_MPU6050_ACCL_CONFIG_FSR_SHIFT
);
377 result
= regmap_write(st
->map
, st
->reg
->accl_config
, d
);
381 st
->chip_config
.accl_fs
= i
;
389 static int inv_mpu6050_write_raw(struct iio_dev
*indio_dev
,
390 struct iio_chan_spec
const *chan
,
391 int val
, int val2
, long mask
)
393 struct inv_mpu6050_state
*st
= iio_priv(indio_dev
);
396 mutex_lock(&indio_dev
->mlock
);
398 * we should only update scale when the chip is disabled, i.e.
401 if (st
->chip_config
.enable
) {
403 goto error_write_raw
;
405 result
= inv_mpu6050_set_power_itg(st
, true);
407 goto error_write_raw
;
410 case IIO_CHAN_INFO_SCALE
:
411 switch (chan
->type
) {
413 result
= inv_mpu6050_write_gyro_scale(st
, val2
);
416 result
= inv_mpu6050_write_accel_scale(st
, val2
);
429 result
|= inv_mpu6050_set_power_itg(st
, false);
430 mutex_unlock(&indio_dev
->mlock
);
436 * inv_mpu6050_set_lpf() - set low pass filer based on fifo rate.
438 * Based on the Nyquist principle, the sampling rate must
439 * exceed twice of the bandwidth of the signal, or there
440 * would be alising. This function basically search for the
441 * correct low pass parameters based on the fifo rate, e.g,
442 * sampling frequency.
444 static int inv_mpu6050_set_lpf(struct inv_mpu6050_state
*st
, int rate
)
446 const int hz
[] = {188, 98, 42, 20, 10, 5};
447 const int d
[] = {INV_MPU6050_FILTER_188HZ
, INV_MPU6050_FILTER_98HZ
,
448 INV_MPU6050_FILTER_42HZ
, INV_MPU6050_FILTER_20HZ
,
449 INV_MPU6050_FILTER_10HZ
, INV_MPU6050_FILTER_5HZ
};
455 while ((h
< hz
[i
]) && (i
< ARRAY_SIZE(d
) - 1))
458 result
= regmap_write(st
->map
, st
->reg
->lpf
, data
);
461 st
->chip_config
.lpf
= data
;
467 * inv_mpu6050_fifo_rate_store() - Set fifo rate.
470 inv_mpu6050_fifo_rate_store(struct device
*dev
, struct device_attribute
*attr
,
471 const char *buf
, size_t count
)
476 struct iio_dev
*indio_dev
= dev_to_iio_dev(dev
);
477 struct inv_mpu6050_state
*st
= iio_priv(indio_dev
);
479 if (kstrtoint(buf
, 10, &fifo_rate
))
481 if (fifo_rate
< INV_MPU6050_MIN_FIFO_RATE
||
482 fifo_rate
> INV_MPU6050_MAX_FIFO_RATE
)
484 if (fifo_rate
== st
->chip_config
.fifo_rate
)
487 mutex_lock(&indio_dev
->mlock
);
488 if (st
->chip_config
.enable
) {
492 result
= inv_mpu6050_set_power_itg(st
, true);
496 d
= INV_MPU6050_ONE_K_HZ
/ fifo_rate
- 1;
497 result
= regmap_write(st
->map
, st
->reg
->sample_rate_div
, d
);
500 st
->chip_config
.fifo_rate
= fifo_rate
;
502 result
= inv_mpu6050_set_lpf(st
, fifo_rate
);
507 result
|= inv_mpu6050_set_power_itg(st
, false);
508 mutex_unlock(&indio_dev
->mlock
);
516 * inv_fifo_rate_show() - Get the current sampling rate.
519 inv_fifo_rate_show(struct device
*dev
, struct device_attribute
*attr
,
522 struct inv_mpu6050_state
*st
= iio_priv(dev_to_iio_dev(dev
));
524 return sprintf(buf
, "%d\n", st
->chip_config
.fifo_rate
);
528 * inv_attr_show() - calling this function will show current
531 static ssize_t
inv_attr_show(struct device
*dev
, struct device_attribute
*attr
,
534 struct inv_mpu6050_state
*st
= iio_priv(dev_to_iio_dev(dev
));
535 struct iio_dev_attr
*this_attr
= to_iio_dev_attr(attr
);
538 switch (this_attr
->address
) {
540 * In MPU6050, the two matrix are the same because gyro and accel
541 * are integrated in one chip
543 case ATTR_GYRO_MATRIX
:
544 case ATTR_ACCL_MATRIX
:
545 m
= st
->plat_data
.orientation
;
547 return sprintf(buf
, "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
548 m
[0], m
[1], m
[2], m
[3], m
[4], m
[5], m
[6], m
[7], m
[8]);
555 * inv_mpu6050_validate_trigger() - validate_trigger callback for invensense
557 * @indio_dev: The IIO device
558 * @trig: The new trigger
560 * Returns: 0 if the 'trig' matches the trigger registered by the MPU6050
561 * device, -EINVAL otherwise.
563 static int inv_mpu6050_validate_trigger(struct iio_dev
*indio_dev
,
564 struct iio_trigger
*trig
)
566 struct inv_mpu6050_state
*st
= iio_priv(indio_dev
);
568 if (st
->trig
!= trig
)
574 #define INV_MPU6050_CHAN(_type, _channel2, _index) \
578 .channel2 = _channel2, \
579 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
580 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
581 .scan_index = _index, \
587 .endianness = IIO_BE, \
591 static const struct iio_chan_spec inv_mpu_channels
[] = {
592 IIO_CHAN_SOFT_TIMESTAMP(INV_MPU6050_SCAN_TIMESTAMP
),
594 * Note that temperature should only be via polled reading only,
595 * not the final scan elements output.
599 .info_mask_separate
= BIT(IIO_CHAN_INFO_RAW
)
600 | BIT(IIO_CHAN_INFO_OFFSET
)
601 | BIT(IIO_CHAN_INFO_SCALE
),
604 INV_MPU6050_CHAN(IIO_ANGL_VEL
, IIO_MOD_X
, INV_MPU6050_SCAN_GYRO_X
),
605 INV_MPU6050_CHAN(IIO_ANGL_VEL
, IIO_MOD_Y
, INV_MPU6050_SCAN_GYRO_Y
),
606 INV_MPU6050_CHAN(IIO_ANGL_VEL
, IIO_MOD_Z
, INV_MPU6050_SCAN_GYRO_Z
),
608 INV_MPU6050_CHAN(IIO_ACCEL
, IIO_MOD_X
, INV_MPU6050_SCAN_ACCL_X
),
609 INV_MPU6050_CHAN(IIO_ACCEL
, IIO_MOD_Y
, INV_MPU6050_SCAN_ACCL_Y
),
610 INV_MPU6050_CHAN(IIO_ACCEL
, IIO_MOD_Z
, INV_MPU6050_SCAN_ACCL_Z
),
613 /* constant IIO attribute */
614 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("10 20 50 100 200 500");
615 static IIO_CONST_ATTR(in_anglvel_scale_available
,
616 "0.000133090 0.000266181 0.000532362 0.001064724");
617 static IIO_CONST_ATTR(in_accel_scale_available
,
618 "0.000598 0.001196 0.002392 0.004785");
619 static IIO_DEV_ATTR_SAMP_FREQ(S_IRUGO
| S_IWUSR
, inv_fifo_rate_show
,
620 inv_mpu6050_fifo_rate_store
);
621 static IIO_DEVICE_ATTR(in_gyro_matrix
, S_IRUGO
, inv_attr_show
, NULL
,
623 static IIO_DEVICE_ATTR(in_accel_matrix
, S_IRUGO
, inv_attr_show
, NULL
,
626 static struct attribute
*inv_attributes
[] = {
627 &iio_dev_attr_in_gyro_matrix
.dev_attr
.attr
,
628 &iio_dev_attr_in_accel_matrix
.dev_attr
.attr
,
629 &iio_dev_attr_sampling_frequency
.dev_attr
.attr
,
630 &iio_const_attr_sampling_frequency_available
.dev_attr
.attr
,
631 &iio_const_attr_in_accel_scale_available
.dev_attr
.attr
,
632 &iio_const_attr_in_anglvel_scale_available
.dev_attr
.attr
,
636 static const struct attribute_group inv_attribute_group
= {
637 .attrs
= inv_attributes
640 static const struct iio_info mpu_info
= {
641 .driver_module
= THIS_MODULE
,
642 .read_raw
= &inv_mpu6050_read_raw
,
643 .write_raw
= &inv_mpu6050_write_raw
,
644 .write_raw_get_fmt
= &inv_write_raw_get_fmt
,
645 .attrs
= &inv_attribute_group
,
646 .validate_trigger
= inv_mpu6050_validate_trigger
,
650 * inv_check_and_setup_chip() - check and setup chip.
652 static int inv_check_and_setup_chip(struct inv_mpu6050_state
*st
)
656 st
->chip_type
= INV_MPU6050
;
657 st
->hw
= &hw_info
[st
->chip_type
];
658 st
->reg
= hw_info
[st
->chip_type
].reg
;
660 /* reset to make sure previous state are not there */
661 result
= regmap_write(st
->map
, st
->reg
->pwr_mgmt_1
,
662 INV_MPU6050_BIT_H_RESET
);
665 msleep(INV_MPU6050_POWER_UP_TIME
);
667 * toggle power state. After reset, the sleep bit could be on
668 * or off depending on the OTP settings. Toggling power would
669 * make it in a definite state as well as making the hardware
670 * state align with the software state
672 result
= inv_mpu6050_set_power_itg(st
, false);
675 result
= inv_mpu6050_set_power_itg(st
, true);
679 result
= inv_mpu6050_switch_engine(st
, false,
680 INV_MPU6050_BIT_PWR_ACCL_STBY
);
683 result
= inv_mpu6050_switch_engine(st
, false,
684 INV_MPU6050_BIT_PWR_GYRO_STBY
);
691 int inv_mpu_core_probe(struct regmap
*regmap
, int irq
, const char *name
,
692 int (*inv_mpu_bus_setup
)(struct iio_dev
*))
694 struct inv_mpu6050_state
*st
;
695 struct iio_dev
*indio_dev
;
696 struct inv_mpu6050_platform_data
*pdata
;
697 struct device
*dev
= regmap_get_device(regmap
);
700 indio_dev
= devm_iio_device_alloc(dev
, sizeof(*st
));
704 st
= iio_priv(indio_dev
);
705 st
->powerup_count
= 0;
708 pdata
= dev_get_platdata(dev
);
710 st
->plat_data
= *pdata
;
711 /* power is turned on inside check chip type*/
712 result
= inv_check_and_setup_chip(st
);
716 if (inv_mpu_bus_setup
)
717 inv_mpu_bus_setup(indio_dev
);
719 result
= inv_mpu6050_init_config(indio_dev
);
721 dev_err(dev
, "Could not initialize device.\n");
725 dev_set_drvdata(dev
, indio_dev
);
726 indio_dev
->dev
.parent
= dev
;
727 /* name will be NULL when enumerated via ACPI */
729 indio_dev
->name
= name
;
731 indio_dev
->name
= dev_name(dev
);
732 indio_dev
->channels
= inv_mpu_channels
;
733 indio_dev
->num_channels
= ARRAY_SIZE(inv_mpu_channels
);
735 indio_dev
->info
= &mpu_info
;
736 indio_dev
->modes
= INDIO_BUFFER_TRIGGERED
;
738 result
= iio_triggered_buffer_setup(indio_dev
,
739 inv_mpu6050_irq_handler
,
740 inv_mpu6050_read_fifo
,
743 dev_err(dev
, "configure buffer fail %d\n", result
);
746 result
= inv_mpu6050_probe_trigger(indio_dev
);
748 dev_err(dev
, "trigger probe fail %d\n", result
);
752 INIT_KFIFO(st
->timestamps
);
753 spin_lock_init(&st
->time_stamp_lock
);
754 result
= iio_device_register(indio_dev
);
756 dev_err(dev
, "IIO register fail %d\n", result
);
757 goto out_remove_trigger
;
763 inv_mpu6050_remove_trigger(st
);
765 iio_triggered_buffer_cleanup(indio_dev
);
768 EXPORT_SYMBOL_GPL(inv_mpu_core_probe
);
770 int inv_mpu_core_remove(struct device
*dev
)
772 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
774 iio_device_unregister(indio_dev
);
775 inv_mpu6050_remove_trigger(iio_priv(indio_dev
));
776 iio_triggered_buffer_cleanup(indio_dev
);
780 EXPORT_SYMBOL_GPL(inv_mpu_core_remove
);
782 #ifdef CONFIG_PM_SLEEP
784 static int inv_mpu_resume(struct device
*dev
)
786 return inv_mpu6050_set_power_itg(iio_priv(dev_get_drvdata(dev
)), true);
789 static int inv_mpu_suspend(struct device
*dev
)
791 return inv_mpu6050_set_power_itg(iio_priv(dev_get_drvdata(dev
)), false);
793 #endif /* CONFIG_PM_SLEEP */
795 SIMPLE_DEV_PM_OPS(inv_mpu_pmops
, inv_mpu_suspend
, inv_mpu_resume
);
796 EXPORT_SYMBOL_GPL(inv_mpu_pmops
);
798 MODULE_AUTHOR("Invensense Corporation");
799 MODULE_DESCRIPTION("Invensense device MPU6050 driver");
800 MODULE_LICENSE("GPL");