Commit 702bf92
committed
iio: adc: at91-sama5d2_adc: lock around oversampling and sample freq
In case of temperature sensor being available changes of oversampling
ratio and sample frequency may be done (before/after reading the
temperature) to improve the accuracy of the read temperature.
As .read_raw()/.write_raw() could be called asynchronously from user space
or other in kernel drivers concurrency on oversampling ratio and sample
frequency existed before. Thus, to avoid concurrency on reading/updating
oversampling ratio and sample frequency the st->lock was
acquired/released accordingly.
Fixes: 27e1771 ("iio:adc:at91_adc8xx: introduce new atmel adc driver")
Fixes: 6794e23 ("iio: adc: at91-sama5d2_adc: add support for oversampling resolution")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>1 parent 0f73cc6 commit 702bf92
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
| 1603 | + | |
1603 | 1604 | | |
1604 | 1605 | | |
1605 | 1606 | | |
1606 | | - | |
| 1607 | + | |
1607 | 1608 | | |
1608 | 1609 | | |
1609 | 1610 | | |
| |||
1659 | 1660 | | |
1660 | 1661 | | |
1661 | 1662 | | |
| 1663 | + | |
1662 | 1664 | | |
| 1665 | + | |
1663 | 1666 | | |
1664 | 1667 | | |
1665 | 1668 | | |
| 1669 | + | |
1666 | 1670 | | |
| 1671 | + | |
1667 | 1672 | | |
1668 | 1673 | | |
1669 | 1674 | | |
| |||
1676 | 1681 | | |
1677 | 1682 | | |
1678 | 1683 | | |
1679 | | - | |
| 1684 | + | |
1680 | 1685 | | |
1681 | 1686 | | |
1682 | 1687 | | |
| |||
1685 | 1690 | | |
1686 | 1691 | | |
1687 | 1692 | | |
| 1693 | + | |
1688 | 1694 | | |
1689 | | - | |
| 1695 | + | |
1690 | 1696 | | |
1691 | 1697 | | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
1695 | 1701 | | |
1696 | 1702 | | |
1697 | 1703 | | |
1698 | 1704 | | |
1699 | 1705 | | |
| 1706 | + | |
1700 | 1707 | | |
| 1708 | + | |
1701 | 1709 | | |
1702 | 1710 | | |
1703 | 1711 | | |
| |||
0 commit comments