| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for ITE Tech Inc. IT8712F/IT8512F CIR |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 Juan Jesús García de Soria <skandalfo@gmail.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 8 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 9 | | - * License, or (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 12 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 14 | | - * General Public License for more details. |
|---|
| 15 | 6 | */ |
|---|
| 16 | 7 | |
|---|
| 17 | 8 | /* platform driver name to register */ |
|---|
| .. | .. |
|---|
| 155 | 146 | #define ITE_DEFAULT_CARRIER_FREQ 38000 |
|---|
| 156 | 147 | |
|---|
| 157 | 148 | /* convert bits to us */ |
|---|
| 158 | | -#define ITE_BITS_TO_NS(bits, sample_period) \ |
|---|
| 159 | | -((u32) ((bits) * ITE_BAUDRATE_DIVISOR * sample_period)) |
|---|
| 149 | +#define ITE_BITS_TO_US(bits, sample_period) \ |
|---|
| 150 | +((u32)((bits) * ITE_BAUDRATE_DIVISOR * (sample_period) / 1000)) |
|---|
| 160 | 151 | |
|---|
| 161 | 152 | /* |
|---|
| 162 | 153 | * n in RDCR produces a tolerance of +/- n * 6.25% around the center |
|---|